Skip to content

Conversation

liam-claude-code-action-bot[bot]
Copy link
Contributor

@liam-claude-code-action-bot liam-claude-code-action-bot bot commented Sep 11, 2025

Closes #3447

Summary

Enable useAriaPropsSupportedByRole biome rule for @liam-hq/app package

Implementation Details

Overview

The useAriaPropsSupportedByRole biome rule needs to be enabled for the @liam-hq/app package to improve accessibility by ensuring ARIA attributes are used correctly with appropriate HTML elements. After enabling this rule, lint errors have been detected that need to be fixed.

Steps to Enable the Rule

  1. Update frontend/apps/app/biome.jsonc with the following configuration:
{
  "extends": "//",
  "root": false,
  "linter": {
    "rules": {
      "a11y": {
        "useAriaPropsSupportedByRole": "error"
      }
    }
  }
}

This overrides the base configuration in frontend/internal-packages/configs/biome.jsonc where useAriaPropsSupportedByRole is set to "off".

  1. Run lint to see the errors:
cd frontend/apps/app && pnpm lint:biome

Lint Errors to Fix

After enabling the rule, useAriaPropsSupportedByRole errors appear in the following files:

  • components/SessionDetailPage/components/Chat/components/ChatInput/ChatInput.tsx
  • components/SessionDetailPage/components/Chat/components/ChatInput/components/MentionSuggestor/MentionSuggestor.tsx

These violations can lead to:

  • Poor screen reader compatibility in chat functionality
  • Accessibility issues for users with disabilities using the chat feature
  • Non-compliant ARIA attribute usage in interactive elements
  • Confusing navigation for assistive technologies in mention suggestions

Root Cause

The chat components contain ARIA attributes that are not supported by their HTML elements:

  • <textarea> element with aria-expanded attribute (not supported by textarea)
  • <button> element with aria-selected attribute (requires specific roles to be valid)

Required Fix Patterns

Fix 1: Handle Textarea Expandable State

// Before
<textarea aria-expanded={isExpanded} />

// After - Use proper container with role for expandable UI
<div role="combobox" aria-expanded={isExpanded}>
  <textarea />
</div>

// Or remove aria-expanded if not needed for popover state
<textarea />

Fix 2: Fix Button Selection State

// Before
<button aria-selected={isSelected}>

// After - Add appropriate role for selectable items
<button role="option" aria-selected={isSelected}>

// Or use different pattern for selection state
<button aria-pressed={isSelected} className={isSelected ? 'selected' : ''}>

Action Items

  • Enable the useAriaPropsSupportedByRole: "error" rule in frontend/apps/app/biome.jsonc
  • Run pnpm lint:biome to identify all ARIA attribute violations
  • Fix ARIA attribute usage in:
    • components/SessionDetailPage/components/Chat/components/ChatInput/ChatInput.tsx
    • components/SessionDetailPage/components/Chat/components/ChatInput/components/MentionSuggestor/MentionSuggestor.tsx
  • Choose appropriate fix method for each violation (proper roles, container patterns, or alternative approaches)
  • Run pnpm lint to verify all errors are resolved
  • Test chat functionality with screen readers to ensure accessibility improvements
  • Verify that mention suggestions and chat input remain fully functional

Testing

After implementing all fixes:

  1. All lint errors should be resolved
  2. Chat input and mention suggestion features should maintain full functionality
  3. Screen reader compatibility should be improved for chat interactions
  4. ARIA attributes should only be used on elements that support them
  5. Chat accessibility should be enhanced for users with disabilities

Related

Auto-generated

This PR was automatically generated by Claude Code Action.

Summary by CodeRabbit

  • Bug Fixes

    • Corrected ARIA semantics in Chat input: removed always-on combobox attributes and only reference the mention popover when it’s open, improving screen reader behavior.
    • Added proper roles to Mention Suggestor: listbox for the container and option for items for clearer navigation.
  • Chores

    • Enabled stricter accessibility linting to ensure ARIA properties are valid for their roles.

- Enable useAriaPropsSupportedByRole rule in biome.jsonc for @liam-hq/app package
- Fix ChatInput textarea ARIA attributes by removing unsupported role and attributes
- Add role="option" to MentionSuggestor buttons to support aria-selected
- Add role="listbox" to MentionSuggestor container for proper ARIA pattern
- Maintain accessibility while ensuring biome rule compliance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: FunamaYukina <FunamaYukina@users.noreply.github.com>
Copy link

changeset-bot bot commented Sep 11, 2025

⚠️ No Changeset found

Latest commit: b826391

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Sep 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
liam-app Ready Ready Preview Comment Sep 11, 2025 1:21pm
liam-assets Ready Ready Preview Sep 11, 2025 1:21pm
liam-storybook Ready Ready Preview Comment Sep 11, 2025 1:21pm
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
liam-docs Ignored Ignored Sep 11, 2025 1:21pm
liam-erd-sample Skipped Skipped Sep 11, 2025 1:21pm

Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Enabled the Biome a11y rule useAriaPropsSupportedByRole in the app package and adjusted chat components’ ARIA usage: removed incorrect combobox-related attributes from the textarea, made aria-controls conditional to the suggestor state, and added appropriate listbox/option roles to the mention suggestor.

Changes

Cohort / File(s) Summary of changes
A11y lint configuration
frontend/apps/app/biome.jsonc
Enabled linter.rules.a11y.useAriaPropsSupportedByRole: "error" alongside existing rules.
Chat input ARIA cleanup
frontend/apps/app/components/.../ChatInput/ChatInput.tsx
Removed role="combobox" and unsupported ARIA attrs (aria-expanded, aria-autocomplete, aria-haspopup); made aria-controls reference the mention popover only when open via mentionSuggestorId.
Mention suggestor ARIA roles
frontend/apps/app/components/.../MentionSuggestor/MentionSuggestor.tsx
Added role="listbox" to wrapper and role="option" to each suggestion item button.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant ChatInput as ChatInput (textarea)
  participant Mention as MentionSuggestor (popover)

  User->>ChatInput: Type / mention trigger
  ChatInput->>Mention: Open suggestor (state: open)
  Note over ChatInput,Mention: ChatInput sets aria-controls=<mentionSuggestorId> only when open
  Mention-->>User: Render options (role=listbox/option)

  User->>ChatInput: Continue typing / selection
  alt Suggestor closes
    ChatInput->>Mention: Close suggestor (state: closed)
    Note over ChatInput: aria-controls removed (undefined)
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Suggested labels

Review effort 2/5

Suggested reviewers

  • hoshinotsuyoshi
  • NoritakaIkeda

Pre-merge checks (5 passed)

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and concisely describes the primary change: enabling the useAriaPropsSupportedByRole Biome rule for the @liam-hq/app package and directly relates to the changes in frontend/apps/app/biome.jsonc and the ARIA fixes in chat components, so a reviewer scanning history will understand the main intent.
Linked Issues Check ✅ Passed The PR updates frontend/apps/app/biome.jsonc to enable useAriaPropsSupportedByRole and modifies the two flagged files (ChatInput.tsx and MentionSuggestor.tsx) to remove unsupported ARIA attributes and add appropriate roles (listbox/option), which satisfies the coding objectives described in linked issue #3447.
Out of Scope Changes Check ✅ Passed All modified files are within the @liam-hq/app package and directly relate to enabling the Biome accessibility rule and fixing the reported ARIA issues; there are no unrelated or out-of-scope changes evident in the provided summary.
Description Check ✅ Passed The description is detailed and includes a summary, implementation steps, root cause, required fix patterns, action items, testing guidance, and a close reference to #3447, so it contains the substantive information the repository template requests; however it does not use the exact template headings '## Issue' with a '- resolve:' line nor an explicit '## Why is this change needed?' heading that the template shows.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I tap my paws on keys so bright,
A listbox blooms in gentle light.
No combobox where none belongs—
Options sing accessible songs.
With tidy ARIA, I hop with glee,
A happier chat for you and me. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/issue-3447-20250911-1308

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

supabase bot commented Sep 11, 2025

Updates to Preview Branch (claude/issue-3447-20250911-1308) ↗︎

Deployments Status Updated
Database Thu, 11 Sep 2025 13:18:29 UTC
Services Thu, 11 Sep 2025 13:18:29 UTC
APIs Thu, 11 Sep 2025 13:18:29 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Thu, 11 Sep 2025 13:18:41 UTC
Migrations Thu, 11 Sep 2025 13:18:47 UTC
Seeding Thu, 11 Sep 2025 13:18:49 UTC
Edge Functions Thu, 11 Sep 2025 13:18:49 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables the useAriaPropsSupportedByRole biome rule for the @liam-hq/app package to improve accessibility by ensuring ARIA attributes are used correctly with appropriate HTML elements. The changes fix existing violations in chat components by adding proper roles and removing unsupported ARIA attributes.

  • Enable the useAriaPropsSupportedByRole accessibility rule in biome configuration
  • Fix ARIA attribute violations in chat input component by removing unsupported attributes from textarea
  • Fix mention suggestion component by adding proper listbox and option roles

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
frontend/apps/app/biome.jsonc Enables the useAriaPropsSupportedByRole accessibility rule
frontend/apps/app/components/SessionDetailPage/components/Chat/components/ChatInput/ChatInput.tsx Removes unsupported ARIA attributes from textarea element
frontend/apps/app/components/SessionDetailPage/components/Chat/components/ChatInput/components/MentionSuggestor/MentionSuggestor.tsx Adds proper listbox and option roles to support ARIA attributes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +195 to +197
aria-controls={
isMentionSuggestorOpen ? mentionSuggestorId : undefined
}
Copy link
Preview

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

The textarea element still needs proper ARIA attributes for combobox functionality. Consider wrapping the textarea in a div with role='combobox' and the appropriate ARIA attributes, or add role='combobox' to the textarea itself if supported by your target browsers.

Copilot uses AI. Check for mistakes.

@FunamaYukina
Copy link
Member

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Sep 12, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
frontend/apps/app/components/SessionDetailPage/components/Chat/components/ChatInput/components/MentionSuggestor/MentionSuggestor.tsx (2)

124-126: Effect doesn’t match its comment; never resets on query change

Dependency array is empty. Reset when query changes.

-  useEffect(() => {
-    setHighlightedIndex(0)
-  }, [])
+  useEffect(() => {
+    setHighlightedIndex(0)
+  }, [query])

128-141: Scroll-to-active doesn’t run when selection changes

The effect depends only on enabled. Include highlightedIndex so scrolling tracks navigation.

-  }, [enabled])
+  }, [enabled, highlightedIndex])
♻️ Duplicate comments (1)
frontend/apps/app/components/SessionDetailPage/components/Chat/components/ChatInput/ChatInput.tsx (1)

195-197: On prior suggestion about “combobox on textarea”

Ignoring the earlier recommendation to add combobox semantics to a textarea is correct here; textarea isn’t a valid combobox control. Your current approach is safer.

🧹 Nitpick comments (3)
frontend/apps/app/components/SessionDetailPage/components/Chat/components/ChatInput/components/MentionSuggestor/MentionSuggestor.tsx (3)

146-146: Name the listbox

Provide an accessible name so AT can announce the popup meaningfully.

-    <div ref={containerRef} className={styles.wrapper} id={id} role="listbox">
+    <div ref={containerRef} className={styles.wrapper} id={id} role="listbox" aria-label="Mention suggestions">

147-151: Avoid non-option content inside listbox

The empty-state message inside a listbox can confuse AT. Prefer rendering the message outside the listbox as a polite status.

-    <div ref={containerRef} className={styles.wrapper} id={id} role="listbox">
-      {matches.length === 0 ? (
-        <div className={styles.emptyMessage} aria-disabled="true">
-          {DEFAULT_NO_ITEMS_MESSAGE}
-        </div>
-      ) : (
-        matches.map(…)
-      )}
-    </div>
+    {matches.length === 0 ? (
+      <div className={styles.emptyMessage} role="status" aria-live="polite">
+        {DEFAULT_NO_ITEMS_MESSAGE}
+      </div>
+    ) : (
+      <div ref={containerRef} className={styles.wrapper} id={id} role="listbox" aria-label="Mention suggestions">
+        {matches.map(…)}
+      </div>
+    )}

117-121: Remove unnecessary event type cast

You only use e.key. Generalize the handler type and drop the cast.

-  useImperativeHandle(ref, () => ({
-    handleKeyDown(e) {
-      handleKeyDown(e as unknown as KeyboardEvent<HTMLInputElement>)
-    },
-  }))
+  useImperativeHandle(ref, () => ({
+    handleKeyDown(e: KeyboardEvent<HTMLElement>) {
+      handleKeyDown(e)
+    },
+  }))

And update the local handler signature:

-  const handleKeyDown = useCallback(
-    (e: KeyboardEvent<HTMLInputElement>) => {
+  const handleKeyDown = useCallback(
+    (e: KeyboardEvent<HTMLElement>) => {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0114447 and b826391.

📒 Files selected for processing (3)
  • frontend/apps/app/biome.jsonc (1 hunks)
  • frontend/apps/app/components/SessionDetailPage/components/Chat/components/ChatInput/ChatInput.tsx (1 hunks)
  • frontend/apps/app/components/SessionDetailPage/components/Chat/components/ChatInput/components/MentionSuggestor/MentionSuggestor.tsx (2 hunks)
⏰ 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: Supabase Preview
  • GitHub Check: Supabase Preview
  • GitHub Check: Supabase Preview
🔇 Additional comments (4)
frontend/apps/app/biome.jsonc (1)

8-11: LGTM — linter verification failed (command missing)

Enabling a11y.useAriaPropsSupportedByRole at the app package level looks good; running pnpm lint:biome failed ("Command "lint:biome" not found"), so I cannot confirm zero violations.

Run the package linter and paste the output to verify. Suggested actions:

  • Inspect frontend/apps/app/package.json for a lint script and run it.
  • cd frontend/apps/app && pnpm run lint
  • or from repo root: pnpm --filter ./frontend/apps/app run lint
frontend/apps/app/components/SessionDetailPage/components/Chat/components/ChatInput/components/MentionSuggestor/MentionSuggestor.tsx (1)

153-170: Incorrect — role="option" is allowed on ; keep the button.

ARIA-in-HTML's allowed roles table permits role="option" on the HTML

element (W3C/MDN). The suggested replacement with a non-button element is unnecessary; retain the button markup and preserve the pointer handlers (onMouseDown/onMouseEnter) to avoid focus loss.

Likely an incorrect or invalid review comment.

frontend/apps/app/components/SessionDetailPage/components/Chat/components/ChatInput/ChatInput.tsx (2)

195-197: Good: aria-controls only when popup is open

This removes invalid combobox bits from the textarea while preserving linkage to the popup.


195-199: Optional a11y: advertise popup type and autocomplete

Add aria-haspopup="listbox" and aria-autocomplete="list" to the textarea (valid on multiline textbox) to improve screen‑reader hints.

               data-error={error ? 'true' : undefined}
+              aria-haspopup="listbox"
+              aria-autocomplete="list"
               aria-controls={
                 isMentionSuggestorOpen ? mentionSuggestorId : undefined
               }

Verification: pnpm lint:biome is not available in this repo (command returned "Command 'lint:biome' not found"). Run your project's Biome linter (pnpm lint:biome or equivalent) and confirm these changes pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable useAriaPropsSupportedByRole biome rule for @liam-hq/app package
1 participant