Debug overlay/1 backend plumbing - #892
Open
c-lamoureux wants to merge 5 commits into
Open
Conversation
…al interaction controller Replaces the hooks-driven click/legend/popover interaction wiring with a functional controller layer (vegaChartController/), matching Phase 1's mount/resize controller pattern: - interactionConfig.ts / interactionHandlers.ts (renamed and generalized from utils/markClickUtils.ts, since its scope now covers legend/axis dispatch too, not just mark clicks) drive click/contextmenu/mouseover listener registration from a single plain-data config object instead of individually-threaded hook arguments. - attachVegaChartController.ts gains setSignal() for cheap live signal writes, and wires attachInteractionListeners() into the embed lifecycle. - useChartInteractions.tsx becomes the assembler that builds this config from useMarkOnClickDetails/useMarkMouseInputDetails/useAxisLabelOnClickDetails/ useLegend/usePopovers. - useLegend.tsx drops its useState — hiddenSeries becomes fully signal-driven via setSignal — fixing a confirmed inefficiency where every legend toggle forced a full view recreation. - utils/signalUtils.ts extracted as a dependency-free leaf module (no '../components' import) so the SSR-guarded controller module graph can't accidentally pull in browser-only component code via the '../utils' barrel. Regression-proven per planning/specs/chart/js-controller-interaction-runtime.json.
c-lamoureux
force-pushed
the
debug-overlay/1-backend-plumbing
branch
from
August 24, 2026 16:09
ff2afff to
8cd0437
Compare
Splits the embed/recreate flow into named phases (getOutgoingHiddenSeries, prepareSpecForEmbed, wireNewView), groups controller state into one object, unifies the two staleness checks into isStale(), and renames recreate() to embedView() since it also handles the first-ever mount. No behavior change.
Resolves the one real conflict in VegaChart.tsx: main independently guarded the expressionFunction registration for SSR (c166a6f), while this branch's controller refactor already moved that registration (and resizeView) out of VegaChart.tsx entirely into attachVegaChartController.ts. Takes this branch's side — main's inline fix is superseded, not something to merge alongside.
…tegory functions Also addresses SonarCloud findings: keeps JSON.stringify/parse (not structuredClone) for the spec clone with a comment on why, and simplifies getItemForAreaMark's guard to optional chaining.
|
|
🎨 Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-892 🎨 S2 Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-892-s2 📚 Docs -> https://opensource.adobe.com/react-spectrum-charts/PR-892-docs/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: