fix(dashboard): keep More filters reachable on cross-filter apply#41351
fix(dashboard): keep More filters reachable on cross-filter apply#41351sadpandajoe wants to merge 9 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #41351 +/- ##
==========================================
+ Coverage 65.03% 65.20% +0.16%
==========================================
Files 2744 2692 -52
Lines 153627 149631 -3996
Branches 35226 34676 -550
==========================================
- Hits 99915 97560 -2355
+ Misses 51805 50302 -1503
+ Partials 1907 1769 -138
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Fixes a dashboard filter-bar overflow regression where applying a cross-filter (which prepends a “chip” item) could cause the “More filters” trigger to disappear and strand overflowed filters by adding a one-shot requestAnimationFrame confirmation re-measure after item-set changes, plus a dedicated overflow-engine regression test suite.
Changes:
- Adds item-set-change detection and a versioned/cancellable rAF confirmation pass to prevent a transient “nothing overflows” measurement from latching.
- Adjusts dropdown-trigger mounting logic to stay present across the full confirmation window.
- Introduces
DropdownContainer.overflow.test.tsxto exercise real overflow recalculation behavior under jsdom via mocked geometry and deterministic rAF.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx | Adds rAF-based confirmation re-measurement and trigger-mounting guards to keep overflowed filters reachable. |
| superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.overflow.test.tsx | Adds regression tests covering cross-filter prepend, transient mis-measurement, fit→overflow, and re-entrant item-set changes. |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
f708027 to
1385377
Compare
|
🎪 Showtime deployed environment on GHA for 1385377 • Environment: http://18.236.196.225:8080 (admin/admin) |
|
🎪 Showtime deployed environment on GHA for f7c69b3 • Environment: http://35.92.37.38:8080 (admin/admin) |
|
🎪 Showtime deployed environment on GHA for 7829ad1 • Environment: http://34.220.51.51:8080 (admin/admin) |
|
Closing this one. The PR targeted a latch in the overflow recalculation: when the item set changes, the reset path zeroes the overflowed items, so the existing That path is real in the code, but for it to bite, The regression suite here doesn't close that gap either. Against master's component it fails only where it forces On that basis the added ref/rAF coordination isn't carrying its weight in a shared core component. Happy to revisit if a reproduction on master turns up. |
SUMMARY
When a horizontal filter bar has enough native filters to overflow into the "More filters" dropdown, applying a cross-filter (which prepends a chip to the bar) could make the overflowed native filters disappear from both the bar and the dropdown, while the "More filters" button itself also vanished, leaving the hidden filters unreachable. Clearing the cross-filter restored them. The failure depends on the number of configured filters, not screen resolution.
Root cause: on an item-set change
DropdownContainerresets its positional overflow index and re-measures; if that measurement catches a transient mid-reflow layout it can settle a "nothing overflows" verdict that never self-corrects (the recalculation effect's dependencies don't change again). Because the trigger's visibility is derived solely from the overflow count, that one bad verdict both strands the surplus filters in the clipped bar and removes the trigger to reach them.Fix: treat a post-item-change "nothing overflows" read as provisional and run a single
requestAnimationFrameconfirmation pass that re-measures once the browser has reflowed, keeping the trigger mounted across the confirmation window. The confirmation is armed on every item-set change (covering a fit→overflow transition, not only the already-overflowing case) and is versioned/cancelled so a superseded frame from a rapid second change cannot clobber the newer state. This extends the intent of #38193 (which guarded only the transient reset window) to the settled case, in the same overflow/button-visibility area as #28060.BEFORE/AFTER
Behavioral overflow bug, no visual redesign. Covered by automated tests rather than screenshots; see Testing Instructions.
TESTING INSTRUCTIONS
cd superset-frontend && npm run test -- DropdownContainer.overflowDropdownContainer.overflow.test.tsxdrives the real overflow recalculation (mocking only the container width and per-element geometry) and covers: clean re-measurement after a prepended chip, the transient-latch regression, the fit→overflow transition, over-correction (a genuine fit drops the trigger), and re-entrant item-set changes.ADDITIONAL INFORMATION