Skip to content

Add aria-labels to icon-only buttons - #220

Closed
charlie12520 wants to merge 2 commits into
boundlessfi:mainfrom
charlie12520:codex/aria-label-icon-buttons
Closed

Add aria-labels to icon-only buttons#220
charlie12520 wants to merge 2 commits into
boundlessfi:mainfrom
charlie12520:codex/aria-label-icon-buttons

Conversation

@charlie12520

@charlie12520 charlie12520 commented May 26, 2026

Copy link
Copy Markdown

Fixes #216

Summary:

  • Add accessible names to icon-only buttons in the bounty detail, wallet, theme, sidebar, carousel, dialog/sheet, document upload, and related shared UI surfaces.
  • Keep tooltip text and aria-labels aligned for tooltip-backed icon controls touched by the change.
  • Leave visible-text buttons unchanged.

Validation:

  • pnpm install --frozen-lockfile
  • pnpm lint (passes with one existing warning in lib/server-graphql.ts)
  • next build (ran successfully from the repo pre-push hook; only Stellar env fallback warnings were reported)

Summary by CodeRabbit

Release Notes

  • Accessibility Improvements

    • Enhanced accessibility labeling for interactive buttons and controls throughout the application, including bounty management, wallet access, theme toggling, carousel navigation, dialogs, sidebars, and form components.
    • Improved support for screen readers and other assistive technologies across the platform.
  • Style

    • Code formatting and consistency improvements across UI components.

Review Change Stack

@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

@charlie12520 is attempting to deploy a commit to the Threadflow Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@charlie12520, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 43 minutes and 10 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4126c7f1-32ac-4593-af5e-01c75499eaa8

📥 Commits

Reviewing files that changed from the base of the PR and between 572966c and 8a25195.

📒 Files selected for processing (2)
  • components/mode-toggle.tsx
  • components/ui/sidebar.tsx
📝 Walkthrough

Walkthrough

This PR adds aria-label attributes to icon-only buttons across the application to improve screen reader accessibility. Changes include button labels in bounty detail, feature components, and UI library components, alongside formatting standardization and structural refactoring in sidebar and dialog/sheet primitives.

Changes

Accessibility improvements across application components

Layer / File(s) Summary
Bounty detail components accessibility
components/bounty-detail/bounty-detail-sidebar-cta.tsx, components/bounty-detail/model4-maintainer-dashboard.tsx
Mobile cancel buttons in sidebar CTA receive aria-label="Cancel bounty" in two separate branches; maintainer dashboard introduces dynamic variables for message and remove button labels, wiring them to both aria-label and tooltip content for consistency.
Application feature components accessibility
components/bounty/forms/milestone-builder.tsx, components/bounty/refund-status.tsx, components/compliance/document-upload.tsx, components/global-navbar.tsx, components/mode-toggle.tsx, components/wallet/wallet-sheet.tsx
Icon-only buttons across milestone builder, refund status, document upload, global navbar, mode toggle, and wallet sheet now include context-specific aria-label attributes; document upload button reformatted to multi-line JSX.
Carousel component accessibility and refactoring
components/ui/carousel.tsx
CarouselPrevious and CarouselNext buttons gain aria-label attributes ("Previous slide" / "Next slide"); imports and internal formatting standardized with semicolon-terminated statements and consistent callback/effect structure.
Dialog and Sheet UI components accessibility and refactoring
components/ui/dialog.tsx, components/ui/sheet.tsx
DialogContent close button receives aria-label="Close dialog" and explicit optional prop typing; both files converted to semicolon-terminated imports/exports, normalized return statements, and consistent prop-type annotations.
Sidebar component structural refactoring with accessibility
components/ui/sidebar.tsx
SidebarProvider now memoizes context and exposes toggleSidebar helper; SidebarTrigger adds aria-label and keyboard toggle integration; all subcomponents refactored to consistently thread className via cn(...), with standardized formatting and explicit dependency arrays.
StellarLink label consolidation
components/ui/stellar-link.tsx
Copy button tooltip text consolidated into memoized copyTooltipText derived from copy state; reused for both button aria-label and tooltip content to maintain consistency.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • boundlessfi/bounties#154: Directly related through the StellarLink component's refactoring of copy button tooltip text and aria-label handling to maintain consistency.

Suggested reviewers

  • Benjtalkshow
  • 0xdevcollins

Poem

🐰 Buttons now whisper their purpose clear,
No more mystery for those who hear,
Labels on icons, precise and true,
Accessibility blooming in every view.
A carousel slides, a sidebar glides—
Screen readers smile with grateful strides.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the primary change: adding aria-labels to icon-only buttons across the codebase for accessibility improvements.
Linked Issues check ✅ Passed The PR successfully implements all requirements from issue #216: aria-labels added to icon-only buttons across multiple components, tooltip text aligned with aria-labels, existing text-labeled buttons unchanged, and comprehensive coverage of identified problem areas.
Out of Scope Changes check ✅ Passed Minor code style changes (semicolons, quote formatting, JSX prop reformatting) introduced alongside aria-label additions appear to be incidental consistency improvements rather than out-of-scope functional changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
components/mode-toggle.tsx (1)

21-24: ⚡ Quick win

Consider removing the redundant sr-only span.

The button now has both aria-label="Toggle theme" (Line 21) and an sr-only span with the same text (Line 24). When aria-label is present, it takes precedence and the sr-only content is ignored by screen readers. The sr-only span is now redundant.

♻️ Proposed cleanup
-        <Button variant="outline" size="icon" aria-label="Toggle theme">
+        <Button variant="outline" size="icon" aria-label="Toggle theme">
           <Sun className="h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" />
           <Moon className="absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" />
-          <span className="sr-only">Toggle theme</span>
         </Button>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/mode-toggle.tsx` around lines 21 - 24, The Button already provides
an accessible name via aria-label="Toggle theme", so remove the redundant
visually-hidden label element: delete the <span className="sr-only">Toggle
theme</span> in the Mode Toggle component (where Button, Sun, and Moon are
rendered) and keep the aria-label on the Button to preserve accessibility.
components/ui/sidebar.tsx (1)

270-278: 💤 Low value

Minor casing inconsistency between aria-label and sr-only text.

The aria-label uses lowercase "sidebar" while the sr-only span uses uppercase "Sidebar". Consider aligning them for consistency.

Suggested alignment
-      aria-label="Toggle sidebar"
+      aria-label="Toggle Sidebar"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/ui/sidebar.tsx` around lines 270 - 278, Align the casing between
the aria-label and the screen-reader text: update the aria-label on the button
(currently aria-label="Toggle sidebar") or the sr-only span text (the <span
className="sr-only">Toggle Sidebar</span>) so both use the same casing (e.g.,
"Toggle Sidebar") to ensure consistency; the change should be made where the
onClick handler/toggleSidebar call and props are defined in the component so
both the aria-label and sr-only span match.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@components/mode-toggle.tsx`:
- Around line 21-24: The Button already provides an accessible name via
aria-label="Toggle theme", so remove the redundant visually-hidden label
element: delete the <span className="sr-only">Toggle theme</span> in the Mode
Toggle component (where Button, Sun, and Moon are rendered) and keep the
aria-label on the Button to preserve accessibility.

In `@components/ui/sidebar.tsx`:
- Around line 270-278: Align the casing between the aria-label and the
screen-reader text: update the aria-label on the button (currently
aria-label="Toggle sidebar") or the sr-only span text (the <span
className="sr-only">Toggle Sidebar</span>) so both use the same casing (e.g.,
"Toggle Sidebar") to ensure consistency; the change should be made where the
onClick handler/toggleSidebar call and props are defined in the component so
both the aria-label and sr-only span match.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2f26ec4e-3180-4f96-890e-d3cbb15b0b3c

📥 Commits

Reviewing files that changed from the base of the PR and between ede3b20 and 572966c.

📒 Files selected for processing (13)
  • components/bounty-detail/bounty-detail-sidebar-cta.tsx
  • components/bounty-detail/model4-maintainer-dashboard.tsx
  • components/bounty/forms/milestone-builder.tsx
  • components/bounty/refund-status.tsx
  • components/compliance/document-upload.tsx
  • components/global-navbar.tsx
  • components/mode-toggle.tsx
  • components/ui/carousel.tsx
  • components/ui/dialog.tsx
  • components/ui/sheet.tsx
  • components/ui/sidebar.tsx
  • components/ui/stellar-link.tsx
  • components/wallet/wallet-sheet.tsx

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.

Add aria-labels to all icon-only buttons across the app

2 participants