Skip to content

Debug overlay/1 backend plumbing - #892

Open
c-lamoureux wants to merge 5 commits into
mainfrom
debug-overlay/1-backend-plumbing
Open

Debug overlay/1 backend plumbing#892
c-lamoureux wants to merge 5 commits into
mainfrom
debug-overlay/1-backend-plumbing

Conversation

@c-lamoureux

Copy link
Copy Markdown
Contributor

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…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
c-lamoureux force-pushed the debug-overlay/1-backend-plumbing branch from ff2afff to 8cd0437 Compare August 24, 2026 16:09
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.
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant