🎨 Palette: Add contextual ARIA labels to generic list buttons#201
🎨 Palette: Add contextual ARIA labels to generic list buttons#201aicoder2009 wants to merge 1 commit into
Conversation
…ation component Co-authored-by: aicoder2009 <127642633+aicoder2009@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds ChangesContextual ARIA labels for citation buttons
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed due to a network error. 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/wiki/sortable-citation.tsx (1)
458-467: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd
aria-labelto the[clear]notes button.This generic
[clear]button is the remaining action button in the component without a contextualaria-label. Screen-reader users will only hear "clear" without context that it clears notes for this specific citation.<button onClick={() => { const label = citation.fields?.title || citation.formattedText?.slice(0, 60) || "this citation"; // eslint-disable-next-line no-alert if (confirm(`Clear notes for "${label}"?`)) onSaveNotes(citation.id, ""); }} className="text-wiki-link text-xs hover:underline focus-visible:outline-dotted focus-visible:outline-1 focus-visible:outline-wiki-text" + aria-label="Clear notes" > [clear] </button>As per path instructions, all clickable things that aren't buttons use the link pattern with contextual ARIA labels.
🤖 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 `@src/components/wiki/sortable-citation.tsx` around lines 458 - 467, The [clear] action button in sortable-citation.tsx is missing a contextual accessible name, so screen readers only announce a generic clear action. Update the button in the citation notes clear handler to include an aria-label that clearly states it clears notes for the specific citation, using the same label text already derived from citation.fields?.title or citation.formattedText so the context matches the confirm prompt.Source: Path instructions
🤖 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 `@src/components/wiki/sortable-citation.tsx`:
- Around line 458-467: The [clear] action button in sortable-citation.tsx is
missing a contextual accessible name, so screen readers only announce a generic
clear action. Update the button in the citation notes clear handler to include
an aria-label that clearly states it clears notes for the specific citation,
using the same label text already derived from citation.fields?.title or
citation.formattedText so the context matches the confirm prompt.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: cbae8d8b-167f-4cdc-96a3-643e85b2f533
📒 Files selected for processing (2)
.jules/palette.mdsrc/components/wiki/sortable-citation.tsx
💡 What: Added explicit
aria-labelattributes to generic action buttons (e.g., "[edit]", "[delete]", "[share]", "[copy]") in theSortableCitationcomponent. Furthermore, the[copy]and[copy in-text]buttons now feature dynamicaria-labels that correctly update to "Copied citation" when their visual state changes to "[copied!]".🎯 Why: In repeated lists like a list of citations, generic buttons that just say "[edit]" or "[delete]" lack context for screen reader users, making it unclear what they are editing or deleting. Additionally, dynamic buttons that visually indicate a success state without updating their underlying accessibility label provide an inconsistent experience.
📸 Before/After:
♿ Accessibility: Improves adherence to WCAG Success Criterion 4.1.2 Name, Role, Value by providing unambiguous, contextual names for interactive controls within repeated list items, ensuring screen reader users have the full context for their actions.
PR created automatically by Jules for task 17536907517488478448 started by @aicoder2009
Summary by CodeRabbit