Skip to content

🎨 Palette: Add contextual ARIA labels to inline bracket buttons#196

Open
aicoder2009 wants to merge 1 commit into
mainfrom
palette-aria-labels-8311857828005278687
Open

🎨 Palette: Add contextual ARIA labels to inline bracket buttons#196
aicoder2009 wants to merge 1 commit into
mainfrom
palette-aria-labels-8311857828005278687

Conversation

@aicoder2009

@aicoder2009 aicoder2009 commented Jun 28, 2026

Copy link
Copy Markdown
Owner

💡 What

Added context-aware aria-label attributes to the generic, bracket-style inline action buttons (like [edit], [share], [delete], [remove], [cancel], [+ add...]) in the SortableCitation and ShareDialog components.

🎯 Why

These components use Wikipedia-style bracketed text links for actions. When these are repeated in a list of items (e.g., a long list of citations), screen readers only read the generic text like "edit" or "delete." This leaves users without visual context unable to determine which item is being edited or deleted. By adding dynamic ARIA labels (e.g., Edit citation Introduction to Algorithms), screen reader users now have full context.

📸 Before/After

No visual changes. This is an invisible accessibility improvement.

♿ Accessibility

  • Added aria-label={\Edit citation ${citation.title}`}` to generic action buttons within citation lists.
  • Added descriptive static labels (e.g., aria-label="Cancel sharing") to generic [cancel] buttons in modals.
  • Resolves WCAG 2.1 Success Criterion 2.4.4 (Link Purpose) and 4.1.2 (Name, Role, Value) by ensuring interactive elements have descriptive, programmatic names when their visible text is ambiguous out of context.

PR created automatically by Jules for task 8311857828005278687 started by @aicoder2009

Summary by CodeRabbit

  • New Features

    • Improved accessibility for inline action buttons and citation controls with clearer screen-reader labels.
    • Added more descriptive labels for cancel, edit, add, delete, share, and related actions so their context is easier to understand.
  • Bug Fixes

    • Updated button labels in sharing and citation areas to provide better context when navigating with assistive technology.

Added contextual `aria-label` attributes to repeated, generic inline
bracket-style action buttons (e.g., `[edit]`, `[delete]`, `[remove]`,
`[cancel]`) within lists to improve screen reader accessibility. Also
updated the Palette journal with this UX learning.

Co-authored-by: aicoder2009 <127642633+aicoder2009@users.noreply.github.com>
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
opencitation Ready Ready Preview, Comment Jun 28, 2026 11:51am

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds aria-label attributes to inline action buttons in sortable-citation.tsx (edit, share, delete, notes, quotes, and tag actions) using citation.fields?.title for context, and to the "Cancel" button in share-dialog.tsx. Documents the pattern in .jules/palette.md.

Changes

Accessibility aria-label additions

Layer / File(s) Summary
aria-label additions to citation and share-dialog buttons
src/components/wiki/sortable-citation.tsx, src/components/wiki/share-dialog.tsx, .jules/palette.md
Header, notes, quotes, and tag action buttons in sortable-citation.tsx gain contextual aria-label values incorporating citation.fields?.title; the share-dialog "Cancel" button gains a static aria-label="Cancel sharing"; the palette documents the new rule for repeated bracket-style inline buttons.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A bunny hops through buttons bright,
Adding labels left and right,
"Edit this!" and "Delete that!"
Screen readers cheer — imagine that!
🐇✨ Accessible at last!

🚥 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 clearly summarizes the main accessibility change by adding contextual ARIA labels to inline bracket buttons.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette-aria-labels-8311857828005278687

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.

@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)
src/components/wiki/sortable-citation.tsx (2)

523-523: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Quote removal label uses index only — consider adding citation title for consistency.

The remove quote button uses Remove quote ${i + 1}, which provides some context via index. However, every other contextual label in this component also includes the citation title (e.g., Edit quotes for ${citation.fields?.title || 'citation'}). For consistency with the established pattern and fuller context when navigating by button, consider:

- aria-label={`Remove quote ${i + 1}`}
+ aria-label={`Remove quote ${i + 1} from ${citation.fields?.title || 'citation'}`}
🤖 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` at line 523, The remove-quote
button label in sortable-citation should be updated for consistency with the
other contextual labels in this component. In the remove button’s aria-label,
include the citation title from citation.fields?.title with the existing quote
index so it matches the pattern used by labels like “Edit quotes for ...” and
gives better context when navigating by button.

648-648: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Static "Add tag" label lacks citation context compared to other dynamic labels.

This [add] button sits inside the inline tag-editing UI for a specific citation. While "Add tag" is descriptive, it omits the citation title that every other action in this component includes. For consistency with the pattern established throughout SortableCitation (and per the palette guidance to incorporate "the relevant entity's name or title"), consider:

- aria-label="Add tag"
+ aria-label={`Add tag to ${citation.fields?.title || 'citation'}`}
🤖 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` at line 648, The aria-label on the
add-tag control in SortableCitation is static and missing the citation context
used by the rest of the component. Update the inline tag-editing button’s label
so it includes the current citation’s title/name, matching the dynamic naming
pattern already used by other actions in SortableCitation and making the label
specific to the entity being edited.
🤖 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`:
- Line 523: The remove-quote button label in sortable-citation should be updated
for consistency with the other contextual labels in this component. In the
remove button’s aria-label, include the citation title from
citation.fields?.title with the existing quote index so it matches the pattern
used by labels like “Edit quotes for ...” and gives better context when
navigating by button.
- Line 648: The aria-label on the add-tag control in SortableCitation is static
and missing the citation context used by the rest of the component. Update the
inline tag-editing button’s label so it includes the current citation’s
title/name, matching the dynamic naming pattern already used by other actions in
SortableCitation and making the label specific to the entity being edited.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 163fe8ba-356e-4032-9c55-22728f5b1c24

📥 Commits

Reviewing files that changed from the base of the PR and between b69285b and 9bd1ff1.

📒 Files selected for processing (3)
  • .jules/palette.md
  • src/components/wiki/share-dialog.tsx
  • src/components/wiki/sortable-citation.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.

1 participant