feat(interaction): tell brushX format which handle it labels #172
main fromrefs/pull/172/head·opened A brushX format callback produces each keyboard handle's aria-valuetext, but it only received the value. When the values mark boundaries between items, such as the edges between bars in an overview chart, the same boundary means "from the next item" for the start handle and "through the previous item" for the end handle, so one of the two handles always announced the wrong item.
Pass a BrushXFormatContext naming the start or end handle as the second argument, following the value-plus-context convention of other formatters. Existing one-argument formatters are unaffected.
Summary by CodeRabbit#
- New Features
- Brush value formatters can now distinguish the start and end handles, enabling more specific accessible labels for each boundary.
- Documentation
- Clarified how to use the formatter context to label values at the brush boundaries.
- 1
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9012251e-40fb-45bc-99d9-c256425ac2eb
📥 Commits
Reviewing files that changed from the base of the PR and between e6a51a836e0bf9ea5288822a4247a995f43a768c and 2ca53e4228763289781ece69ee3c3eb5d83de885.
📒 Files selected for processing (7)
.changeset/brush-x-format-handle.mddocs/reference/focus-and-interaction.mddocs/reference/types.mdpackages/charts-core/docs/reference/focus-and-interaction.mdpackages/charts-core/docs/reference/types.mdpackages/charts-core/src/interaction-brush.test.tspackages/charts-core/src/interaction-brush.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
📝 Walkthrough
Walkthrough#
brushXformatting now receives context identifying the start or end handle. The handle’s formatted text is used for itsaria-valuetext. Tests and reference documentation cover the context and handle-specific labels.Changes#
BrushX handle formatting
Layer / File(s) Summary Handle context and accessibility text
packages/charts-core/src/interaction-brush.ts,packages/charts-core/src/interaction-brush.test.ts,packages/charts-core/docs/reference/focus-and-interaction.md,packages/charts-core/docs/reference/types.md,docs/reference/focus-and-interaction.md,docs/reference/types.md,.changeset/brush-x-format-handle.mdBrushXFormatContextidentifies thestartorendhandle.decorateHandlepasses that context toformatwhen settingaria-valuetext. A test checks both handle labels. The reference documentation and changeset describe the context.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature
Suggested reviewers:
tannerlinsleyMerge Risk: ⚪ Minimal · up to
2ca53The change lets brush formatters provide handle-specific accessibility text. No concrete merge-blocking issue was found; proceed with normal checks.
🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (5 skipped: 5 … 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 change: brushX format callbacks receive the handle they label. 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. Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (5 skipped: 5 unsupported.)
- Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 `@coderabbitai help` to get the list of available commands.tannerlinsley closed this
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: 2ca53e4228763289781ece69ee3c3eb5d83de885
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 12 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