✨ feat: add scoped refresh event with loading state to VirtualizedTable - #669
Merged
Conversation
- Add sendRefreshEvent(tableId?) to VirtualizedTable.Events: refetches the internal query and shows the loading skeleton while in flight; without a tableId it refreshes every mounted table (no-op on tables without fetchData) - Scope FilterEvent.RESET by a per-Filter resetScope (auto-generated via useId, injectable by prop) so resetting one table's filters no longer clears every filter dropdown on the page; unscoped resetEvent() keeps resetting all - Split VirtualizedTable events into per-scope folders (row, filters, refresh) with their own types and tests - Remove the 'civo' default theme on Filter so it inherits from the ancestor when undefined
futjesus
force-pushed
the
feat/virtualized-table-refresh-event
branch
from
July 27, 2026 14:29
58b50e3 to
07c9187
Compare
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.
Summary
Fixes two issues reported when using
VirtualizedTableacross micro-frontends:fetchData, background refetches only flip TanStack Query'sisFetching, which nothing consumed, so a refresh button produced no visual feedback.FilterEvent.RESETwas dispatched globally with no scope.Changes
New
sendRefreshEvent(tableId?)VirtualizedTable.Events.sendRefreshEvent(tableId?)refetches the table's internal query and shows the loading skeleton (and hides pagination) while in flight, same as the initial load.tableIdonly the matching table refreshes; without arguments every mounted table refreshes (for refresh buttons living outside a table).fetchData. Handles overlapping refreshes, fetch failures (skeleton clears, rows kept) and unmount mid-refresh. Background/polling refetches still never flash the skeleton.Scoped filter reset
resetEvent(scope?)now carries a scope; each<Filter>root gets aresetScope(auto-generated viauseId, injectable by prop) andVirtualizedTableinjects itstableId.sendResetFiltersEvent('table-a')now only clears table A's search, provider state and dropdowns.resetEvent()keeps the previous reset-everything behavior (note:CustomEventnormalizes an undefineddetailtonull, hence the nullish guard).Filter.ResetButtonno longer clears dropdowns in other<Filter>roots — that was the leak being fixed.Other
VirtualizedTableevents split into per-scope folders (events/row,events/filters,events/refresh) with their own types and tests.Filter'sthemeno longer defaults to'civo'; when undefined it inherits from the ancestor'sdata-theme.vite-tsconfig-pathswith Vite 8's nativeresolve.tsconfigPathsin the Storybook config (removes the deprecation warning and the dependency).Consumer usage
Requires the table to use
fetchData; each mounted table needs a uniqueid.Testing
fetchData, scoped/unscopedresetEvent,ResetButtonper-root scoping, and a two-table e2e forsendResetFiltersEvent.ManualRefreshStorybook story with an external refresh button.npm run cigreen: 502 tests, lint, types, prettier, build, Storybook build.