Add aria-label to copy page dropdown trigger#818
Add aria-label to copy page dropdown trigger#818MoonBrillante wants to merge 2 commits intoTanStack:mainfrom
Conversation
👷 Deploy request for tanstack pending review.Visit the deploys page to approve it
|
📝 WalkthroughWalkthroughAdded an Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/CopyPageDropdown.tsx (1)
314-314: Consider deriving the triggeraria-labelfrom thelabelprop for consistency.Nice accessibility improvement. To avoid wording drift when
labelis overridden, build this string fromlabelinstead of hardcoding"Copy page".♻️ Suggested tweak
- aria-label="More Copy page options" + aria-label={`More ${label} options`}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/CopyPageDropdown.tsx` at line 314, The aria-label on the dropdown trigger is hardcoded as "More Copy page options" which can drift from the component's label prop; update the trigger to derive its aria-label from the label prop (in the CopyPageDropdown component) by interpolating the label value (e.g., `${label} options` or `More ${label} options`) so overriding the label keeps the aria-label consistent; adjust any usages of the trigger element or prop names in CopyPageDropdown to use this computed string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/CopyPageDropdown.tsx`:
- Line 314: The aria-label on the dropdown trigger is hardcoded as "More Copy
page options" which can drift from the component's label prop; update the
trigger to derive its aria-label from the label prop (in the CopyPageDropdown
component) by interpolating the label value (e.g., `${label} options` or `More
${label} options`) so overriding the label keeps the aria-label consistent;
adjust any usages of the trigger element or prop names in CopyPageDropdown to
use this computed string.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 74c82027-7f12-4d1c-a0f2-96accf7a3a3e
📒 Files selected for processing (1)
src/components/CopyPageDropdown.tsx
|
Addressed — the dropdown |
Summary
Adds an
aria-labelto the icon-only dropdown trigger next to the "Copy page" button so screen readers announce it more clearly.Changes
aria-labelto the dropdown trigger buttonaria-labelfrom thelabelprop so it stays consistent when the label is overriddenNotes
I only changed this one component. I wasn't able to run the full local lint successfully because my local setup hit unrelated repository-wide issues, including a missing
content-collectionsmodule and a Node version mismatch.Related to #793
Summary by CodeRabbit