fix(extension-list): fill the empty task item checkbox label for accessibility - #8174
fix(extension-list): fill the empty task item checkbox label for accessibility#8174bdbch wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: 5e33433 The changes in this PR will be included in the next version bump. This PR includes changesets to release 74 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary
This prevents accessibility tools from reporting empty task item labels. WalkthroughTaskItem now generates accessible checkbox labels from task content or a configured callback. The label text appears in visually hidden HTML, applies to ChangesTaskItem accessibility labels
Estimated code review effort: 2 (Simple) | ~15 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/extension-list/src/task-item/task-item.ts (1)
133-142: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winSet
aria-labelin static HTML.
renderHTMLcreates an input withoutaria-label. The node view sets this attribute. Static HTML and editor HTML therefore have different accessibility behavior.Proposed fix
{ type: 'checkbox', checked: node.attrs.checked ? 'checked' : null, + 'aria-label': getCheckboxLabel(node, node.attrs.checked, this.options.a11y), },Also assert the static checkbox
aria-labelin the static HTML test.🤖 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 `@packages/extension-list/src/task-item/task-item.ts` around lines 133 - 142, Update the checkbox input attributes in renderHTML to include the same aria-label produced by getCheckboxLabel, preserving consistency with the node view and editor output. Extend the static HTML test to assert the checkbox includes this aria-label.
🤖 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.
Inline comments:
In `@packages/extension-list/src/task-item/task-item.ts`:
- Around line 53-57: Complete the JSDoc for the public checkboxLabel callback by
documenting the node and checked parameters, its returned string, and a runnable
usage example. Update the existing checkboxLabel documentation without changing
the callback signature or behavior.
- Around line 217-221: Update the updateA11Y callback in the task-item
initialization flow to pass currentNode.attrs.checked to getCheckboxLabel
instead of checkbox.checked, ensuring the initial label reflects the node’s
checked state. Add a unit test for an initially checked task that verifies both
the hidden checkbox text and its aria-label.
---
Outside diff comments:
In `@packages/extension-list/src/task-item/task-item.ts`:
- Around line 133-142: Update the checkbox input attributes in renderHTML to
include the same aria-label produced by getCheckboxLabel, preserving consistency
with the node view and editor output. Extend the static HTML test to assert the
checkbox includes this aria-label.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 080ea4fd-7082-4918-9b32-b519bff9a6c2
📒 Files selected for processing (3)
.changeset/2026-08-10-task-item-a11y-label.mdpackages/extension-list/__tests__/taskItem.spec.tspackages/extension-list/src/task-item/task-item.ts
Fixes
Changes and Review
This PR adds missing a11y
aria-*attributes to the task item node to improve the accessibility of task items. You can verify it yourself on the "Tasks" demo.Checklist
Responsibility