Skip to content

fix(adapters): keep the overlay background correct after a zoom or panel reset under a cross-filter - #94

Merged
jvdd merged 3 commits into
mainfrom
fix/overlay-background
Sep 25, 2026
Merged

jvdd merged 3 commits into
mainfrom
fix/overlay-background

Conversation

@jvdd

@jvdd jvdd commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Two client bugs in the overlay background cache. Both exist on main in either cross-filter model. They were found in #93 and move here, so #93 can stay open as a reference for #80.

Bugs

  1. A filtered delta became the unfiltered background. On main, isUnfilteredBaseForFigure returned true for every figure with its own selection. But the engine filters a recomputed figure by every selection except its own. So a zoom on such a figure stored filtered data as its overlay background.
    • Repro: two figures on ts. Brush both. Zoom figure 0. Switch to overlay mode. The background of figure 0 shows only the rows that the brush of figure 1 keeps.
    • With a third figure that has no selection, main hides the bug by accident. The zoom marks the background of that figure stale, and the warm-up init then refreshes every background.
  2. A panel reset left an old background. A reset that clears a zoom and a selection together is a selection event with viewport keys. main marked the background stale only on viewport events.
    • Repro: zoom figure 0. Brush both figures. Reset the panel of figure 0. Switch to overlay mode. The background of figure 0 covers only the old zoomed range.

Changes

  • isUnfilteredBaseForFigure: a delta is unfiltered only when no other figure has a selection with predicates. requestHasActiveSelections had no other callers and is removed.
  • postDashboardUpdate: a figure whose viewport keys are in the event gets a stale background when its delta is filtered. Before, every figure without a selection got a stale background on a viewport event with selections.
  • A CHANGELOG entry and one Architecture.md sentence.

Tests

  • Two browser tests in TestResponseOrderBrowser, one per commit. Each fails without its fix and passes with it. Without the first fix, the background of figure 0 stays at x = (200, 250). Without the second fix, the wait for a full-range background times out.
  • make test: 2372 passed, 2 skipped. make test-browser: 303 passed, 9 skipped.

Not changed

A figure with its own selection still shows unfiltered data after a switch from update to overlay mode and back. main does the same when at least one figure has no selection. This PR adds the case where every figure has a selection, because the overlay warm-up now runs there too. #80 tracks it: option A+ refreshes the owners on the switch back.

Related: #80 (the trade-off and its options), #93 (open as a reference, not merged).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

ECharts datazoom events do not provide the viewport key needed to invalidate stale backgrounds.

Review effort: Lite
Findings: None

What changed in this PR

Fixes stale or filtered overlay backgrounds after cross-filtered zooms and panel resets.

Changes:

  • Corrects unfiltered-background detection.
  • Invalidates stale backgrounds when viewport keys change.
  • Adds regression tests and documentation updates.
File Summary
tests/​test_browser.py Adds regression tests for overlay behavior.
flexviz/​adapters/​js/​runtime/​state.js Updates background eligibility logic.
flexviz/​adapters/​js/​runtime/​delta.js Invalidates stale overlay backgrounds.
CHANGELOG.md Documents the fixes.
Architecture.md Clarifies overlay background behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codspeed

codspeed Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing fix/overlay-background (71e3195) with main (c3c01fc)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (71e3195) during the generation of this report, so c3c01fc was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@jvdd
jvdd merged commit 471c09b into main Sep 25, 2026
7 checks passed
@jvdd
jvdd deleted the fix/overlay-background branch September 25, 2026 13:42
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.

2 participants