Skip to content

Conversation

@paulinewahle
Copy link
Contributor

@paulinewahle paulinewahle commented Sep 2, 2025

fix: #3665

Summary by CodeRabbit

  • New Features
    • Improved slider accessibility by linking helper text to the input via aria-describedby, enabling screen readers to announce helper information.
    • Maintains existing behavior and labels; no changes to public API or visuals.

Review:

  • Commits are atomic
  • Commits have the correct type for the changes made
  • Commits with breaking changes are marked as such

Browsers tested:

(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)

Windows:

  • Chrome
  • Edge
  • Firefox

Linux:

  • Chrome
  • Firefox

macOS:

  • Chrome
  • Firefox
  • Safari

Mobile:

  • Chrome on Android
  • iOS

@paulinewahle paulinewahle requested a review from Kiarokh September 2, 2025 14:14
@coderabbitai
Copy link

coderabbitai bot commented Sep 2, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Adds aria-describedby to the slider input, referencing helperTextId when helperText is present. No other behavior or public API changes; aria-labelledby and aria-controls remain unchanged.

Changes

Cohort / File(s) Summary
Slider A11y attributes
src/components/slider/slider.tsx
Adds aria-describedby linking the input to helper text via helperTextId; no changes to aria-controls or other attributes.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Add aria-describedby to link helper text [#3665]
Add aria-controls to reference helperTextId [#3665] aria-controls not added or modified.

Assessment against linked issues: Out-of-scope changes

Possibly related PRs

Suggested labels

maintenance

Suggested reviewers

  • LucyChyzhova
  • civing
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch slider-aria

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

github-actions bot commented Sep 2, 2025

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3667/

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 222e2fd and b221cc2.

📒 Files selected for processing (1)
  • src/components/slider/slider.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/wrap-multiple-jsx-elements-in-host-not-in-array.mdc)

When returning multiple JSX elements from the render method, never wrap them in an array literal. Instead, always wrap them in the special <Host> element. When there is already a single top-level element, it does not have to be wrapped in <Host>.

Files:

  • src/components/slider/slider.tsx

⚙️ CodeRabbit configuration file

**/*.tsx: Our .tsx files are typically using StencilJS, not React. When a developer wants to return multiple top-level JSX elements from the render method, they will sometimes wrap them in an array literal. In these cases, rather than recommending they add key properties to the elements, recommend removing the hardcoded array literal. Recommend wrapping the elements in StencilJS's special <Host> element.

Files:

  • src/components/slider/slider.tsx
**/*.{ts,tsx}

⚙️ CodeRabbit configuration file

**/*.{ts,tsx}: Imports from other files in the same module (lime-elements) must use relative paths. Using absolute paths for imports will cause the production build to fail.

Files:

  • src/components/slider/slider.tsx
**/*.{tsx,scss}

⚙️ CodeRabbit configuration file

**/*.{tsx,scss}: Almost all our components use shadow-DOM. Therefore, we have no need of BEM-style class names in our CSS.

Files:

  • src/components/slider/slider.tsx
src/components/**/*.tsx

⚙️ CodeRabbit configuration file

src/components/**/*.tsx: When contributors add new props to existing components in the lime-elements repository, they should always add documentation examples that demonstrate the new prop's usage and explain how it works. This helps with user adoption, feature discoverability, and maintains comprehensive documentation.

Files:

  • src/components/slider/slider.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Docs / Publish Docs
  • GitHub Check: Test
  • GitHub Check: Build
🔇 Additional comments (1)
src/components/slider/slider.tsx (1)

256-258: a11y: Conditional aria-describedby looks correct

Good: the input now references helper text only when present, preventing a dangling idref.

Comment on lines 256 to 261
aria-describedby={
this.helperText ? this.helperTextId : undefined
}
aria-labelledby={this.labelId}
aria-controls={this.helperTextId}
{...inputProps}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify cross-shadow ARIA: helperTextId must be on limel-helper-line host

If limel-helper-line assigns helperTextId to an element inside its own shadow root (instead of the host element), idref resolution from the input may fail across shadow boundaries. Ensure the id is on the limel-helper-line host (e.g., ) or another element in the same shadow tree as the input.

Run this script to confirm:


🏁 Script executed:

#!/bin/bash
# Locate the limel-helper-line component and verify where helperTextId is applied.
set -euo pipefail

echo "Searching for limel-helper-line implementation..."
files=$(fd -t f -g "src/**/helper-line*.tsx" || true)
if [ -z "${files}" ]; then
  echo "No helper-line component found under src/**."
  exit 1
fi

for f in $files; do
  echo "=== $f ==="
  rg -n -C2 "tag:\s*'limel-helper-line'" "$f" || true
  rg -n -C3 "helperTextId" "$f" || true
  rg -n -C3 "<Host\b.*id=" "$f" || true
  rg -n -C3 "id=\{.*helperTextId" "$f" || true
done

echo
echo "Expectation:"
echo "- helperTextId should be bound to the limel-helper-line host (e.g., <Host id={this.helperTextId} />)"
echo "  or another element that resides in the same shadow tree as the input."

Length of output: 301


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "Searching for limel-helper-line component in src/components..."
files=$(rg -l "tag:\\s*['\"]limel-helper-line['\"]" -g "src/components/**/*.tsx" || true)
if [ -z "$files" ]; then
  echo "limel-helper-line component not found under src/components."
  exit 1
fi

for f in $files; do
  echo "=== $f ==="
  rg -n -C2 "helperTextId" "$f" || true
  rg -n -C2 "<Host\b" "$f" || true
  rg -n -C2 "id=\{.*helperTextId" "$f" || true
done

Length of output: 1216


Move the helperTextId onto the host element of limel-helper-line
In src/components/helper-line/helper-line.tsx, remove the id={this.helperTextId} from the internal <span> (around line 94) and instead add id={this.helperTextId} to the <Host> (around line 65). This ensures the ID lives on the host element so aria-describedby can resolve across shadow boundaries.

🤖 Prompt for AI Agents
In src/components/slider/slider.tsx around lines 256 to 261 and in
src/components/helper-line/helper-line.tsx (Host around line 65, internal <span>
around line 94): move the id={this.helperTextId} off the internal span and onto
the component host element so aria-describedby can resolve across shadow DOM;
remove the id attribute from the internal span, add id={this.helperTextId} to
the <Host> element, ensure the helperTextId property is still generated and
available on the host, and run/update any tests that reference the old span id
or query inside the shadow root.

@Kiarokh Kiarokh merged commit 229698f into main Sep 3, 2025
12 checks passed
@Kiarokh Kiarokh deleted the slider-aria branch September 3, 2025 08:10
@lime-opensource
Copy link
Collaborator

🎉 This PR is included in version 38.23.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

slider: missing ARIA attributes for the helperText

4 participants