Skip to content

fix(extension-list): fill the empty task item checkbox label for accessibility - #8174

Open
bdbch wants to merge 4 commits into
mainfrom
fix/task-item-a11y-label
Open

fix(extension-list): fill the empty task item checkbox label for accessibility#8174
bdbch wants to merge 4 commits into
mainfrom
fix/task-item-a11y-label

Conversation

@bdbch

@bdbch bdbch commented Aug 10, 2026

Copy link
Copy Markdown
Member

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.

image

Checklist

  • I have added a changeset if necessary.
  • I have added tests if possible.
  • I have made sure to test my changes myself.

Responsibility

  • I have reviewed and understand these changes, and I take responsibility for this PR, even if an AI agent created it.

@bdbch
bdbch requested a review from a team as a code owner August 10, 2026 03:17
@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5e33433

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 74 packages
Name Type
@tiptap/extension-list Patch
@tiptap/extension-bullet-list Patch
@tiptap/extension-ordered-list Patch
@tiptap/starter-kit Patch
@tiptap/extension-list-item Patch
@tiptap/extension-list-keymap Patch
@tiptap/extension-task-item Patch
@tiptap/extension-task-list Patch
@tiptap/core Patch
@tiptap/extension-audio Patch
@tiptap/extension-blockquote Patch
@tiptap/extension-bold Patch
@tiptap/extension-bubble-menu Patch
@tiptap/extension-code-block-lowlight Patch
@tiptap/extension-code-block Patch
@tiptap/extension-code Patch
@tiptap/extension-collaboration-caret Patch
@tiptap/extension-collaboration Patch
@tiptap/extension-color Patch
@tiptap/extension-details Patch
@tiptap/extension-document Patch
@tiptap/extension-drag-handle-react Patch
@tiptap/extension-drag-handle-vue-2 Patch
@tiptap/extension-drag-handle-vue-3 Patch
@tiptap/extension-drag-handle Patch
@tiptap/extension-emoji Patch
@tiptap/extension-file-handler Patch
@tiptap/extension-find-and-replace Patch
@tiptap/extension-floating-menu Patch
@tiptap/extension-font-family Patch
@tiptap/extension-hard-break Patch
@tiptap/extension-heading Patch
@tiptap/extension-highlight Patch
@tiptap/extension-horizontal-rule Patch
@tiptap/extension-image Patch
@tiptap/extension-invisible-characters Patch
@tiptap/extension-italic Patch
@tiptap/extension-link Patch
@tiptap/extension-mathematics Patch
@tiptap/extension-mention Patch
@tiptap/extension-node-range Patch
@tiptap/extension-paragraph Patch
@tiptap/extension-ruby-text Patch
@tiptap/extension-strike Patch
@tiptap/extension-subscript Patch
@tiptap/extension-superscript Patch
@tiptap/extension-table-of-contents Patch
@tiptap/extension-table Patch
@tiptap/extension-text-align Patch
@tiptap/extension-text-style Patch
@tiptap/extension-text Patch
@tiptap/extension-twitch Patch
@tiptap/extension-typography Patch
@tiptap/extension-underline Patch
@tiptap/extension-unique-id Patch
@tiptap/extension-youtube Patch
@tiptap/extensions Patch
@tiptap/html Patch
@tiptap/markdown Patch
@tiptap/pm Patch
@tiptap/react Patch
@tiptap/static-renderer Patch
@tiptap/suggestion Patch
@tiptap/vue-2 Patch
@tiptap/vue-3 Patch
@tiptap/extension-character-count Patch
@tiptap/extension-dropcursor Patch
@tiptap/extension-focus Patch
@tiptap/extension-gapcursor Patch
@tiptap/extension-history Patch
@tiptap/extension-placeholder Patch
@tiptap/extension-table-cell Patch
@tiptap/extension-table-header Patch
@tiptap/extension-table-row Patch

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

@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit 5e33433
🔍 Latest deploy log https://app.netlify.com/projects/tiptap-embed/deploys/6a7955379ab95d00083ce595
😎 Deploy Preview https://deploy-preview-8174--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e07ef77-b8ac-4fc2-af51-6ed99395ab78

📥 Commits

Reviewing files that changed from the base of the PR and between 264060e and 5e33433.

📒 Files selected for processing (1)
  • demos/src/Nodes/TaskList/index.spec.ts

📝 Walkthrough

Summary

  • Added accessible checkbox labels to TaskItem.
  • Added support for custom labels and label updates.
  • Added tests for accessibility labels and HTML output.
  • Updated the task-list demo snapshot.
  • Added a patch changeset for @tiptap/extension-list.

This prevents accessibility tools from reporting empty task item labels.

Walkthrough

TaskItem now generates accessible checkbox labels from task content or a configured callback. The label text appears in visually hidden HTML, applies to aria-label, updates when node attributes change, and is covered by accessibility tests.

Changes

TaskItem accessibility labels

Layer / File(s) Summary
Label generation and static rendering
packages/extension-list/src/task-item/task-item.ts, packages/extension-list/__tests__/taskItem.spec.ts, demos/src/Nodes/TaskList/index.spec.ts, .changeset/2026-08-10-task-item-a11y-label.md
TaskItem generates default or configured checkbox labels. Static HTML includes visually hidden label text. Tests cover wrapping labels, custom labels, empty items, serialization, and updated demo output.
Node-view accessibility synchronization
packages/extension-list/src/task-item/task-item.ts, packages/extension-list/__tests__/taskItem.spec.ts
Node views apply the checkbox aria-label and update hidden label text when task-item attributes change. Tests cover custom labels and checked-state updates.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested labels: area: core, complexity: medium, impact: medium

Suggested reviewers: arnaugomez, alexvcasillas

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main accessibility fix for the empty TaskItem checkbox label.
Description check ✅ Passed The description includes the issue link, change summary, verification guidance, changeset confirmation, tests, and responsibility checklist.
Linked Issues check ✅ Passed The changes satisfy the TaskItem accessibility objective in [#6707] by populating the label and adding accessible checkbox labeling.
Out of Scope Changes check ✅ Passed All changes support the TaskItem accessibility fix in [#6707], including tests, demo expectations, and the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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 added area: core Core editor engine and ProseMirror integration complexity: medium Moderate change, possibly multiple files impact: medium Affects some users or workflows labels Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 win

Set aria-label in static HTML.

renderHTML creates an input without aria-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-label in 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

📥 Commits

Reviewing files that changed from the base of the PR and between eded5e4 and 8acffa4.

📒 Files selected for processing (3)
  • .changeset/2026-08-10-task-item-a11y-label.md
  • packages/extension-list/__tests__/taskItem.spec.ts
  • packages/extension-list/src/task-item/task-item.ts

Comment thread packages/extension-list/src/task-item/task-item.ts
Comment thread packages/extension-list/src/task-item/task-item.ts
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Core editor engine and ProseMirror integration complexity: medium Moderate change, possibly multiple files impact: medium Affects some users or workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a11y Improvements for Details and TaskItem

1 participant