Repository navigation
Conversation
Add an optional step(points, context) method to ChartFocusStrategy so a strategy can choose the next point for a navigation key. Strategies without step keep their navigation order. Ship focusGrid from @tanstack/charts/focus/grid for row-and-column movement in heatmaps, calendars, and matrices.
Single-row or single-column grids no longer reject pointers off the center line. End with no focus moves to the last cell, matching linear navigation. A focused cell that no longer exists restarts from the grid edge instead of jumping inside the row. Document the offset-label caveat and name the open key and modifier contract choices.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
🦋 Changeset detectedLatest commit: 030c131 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 |
|
Thanks @greglum, I checked the grid behavior at The sparse-grid checks passed against an independent row/column oracle, with more than 106,000 directional moves per browser. The mounted checks also passed for reversed x/y domains, LTR and RTL containers, resize preserving the focused datum, removing the focused cell, and cleanup, eight cases per browser. Removing This is source-bundle verification with installed dependencies, not a full-checkout CI run, packed-package check or screen-reader test. I have not accepted the proposed budget changes or resolved the draft's input-contract questions. One documentation detail to clarify: I could confirm the React Native fallback in |
|
Thanks @greglum, I was able to extend verification at the same The isolated checkout passes 2,231 DOM tests, all six additional framework test targets, TypeScript, the documentation contract, the catalog checks, and the seven-adapter package gate. The actual packed core export also passes the sparse-grid oracle and all eight mounted cases in each of Chromium, Firefox and WebKit, with no workspace source inputs. Disabling This still is not a full CI or release-package approval. The React Native packed consumer cannot access the shared dependency store from the isolated environment. The bundle check passes against this PR's own proposed budgets, which does not approve those budget increases. The draft and input-contract questions above remain open. |
|
Thanks @greglum, the local package blocker is resolved at this same head. The full package gate now passes in the credential-free sandbox: packed exports, declarations and runtime, bare React Native and Expo Metro consumers, all seven adapters, and the unified artifact. I prepared a separate dependency store rather than granting access to the shared store. The previously tested grid runtime is byte-identical in the final unified artifact across all 112 packed modules used by that fixture. The draft, input-contract discussion, proposed budget increases and required CI remain separate holds. Verified head: |
Draft, to settle a contract question before polishing.
Heatmap keyboard focus walks one flat list, and ArrowDown behaves like ArrowRight (
interaction.ts). We build a person-by-week capacity heatmap in a production app as an HTML table with one button per cell, partly for this reason. The friction is logged as API-FRICTION F-307.This draft adds an optional
step(points, { point, key, modifier })toChartFocusStrategy. It returns the next point, orundefinedto fall back tonavigation()order. It also adds an opt-infocusGridfrom@tanstack/charts/focus/grid:axisFocususes. A one-row or one-column strip still accepts pointers anywhere along it.Existing strategies behave exactly as before. Ordinary DOM charts grow about 41 B gzip for the dispatch. Static scene and SVG bundles do not change, and
focusGridalone is about 1.2 kB gzip.I did not let
navigation()return rows. That would change a return type that the renderer, the D3 host and React Native all consume, and it still could not express grid extremes or skipping missing cells.Open questions:
keyis the rawKeyboardEvent.key, so only the DOM host dispatchesstep. The D3 host and React Native callnavigation()only, so grid charts fall back to row-major linear order there; the docs say so. A host-neutral direction vocabulary ('right' | 'left' | 'up' | 'down' | 'rowStart' | 'rowEnd' | 'first' | 'last') would let every host dispatch it.modifieris one boolean for Control or Command. Would you prefer explicitctrlKeyandmetaKey?focusGridalso handle PageUp/PageDown, or logical Home/End for right-to-left layouts?Verification:
focusGridunit tests cover row and column moves, sparse skips, Home/End, edge clamping, single-row pointers and removed cells. The mounted ArrowDown test fails under linear order.package:checkfails locally at the React 18 packed-consumer step withERR_PNPM_PEER_DEP_ISSUES, andmainfails the same way here.Includes a minor changeset and friction entry F-307. That ID will need renumbering if another friction entry lands first.