refac: pivot data store orchestration - #9538
Merged
Merged
Conversation
AdityaHegde
requested changes
Jun 10, 2026
AdityaHegde
left a comment
Collaborator
There was a problem hiding this comment.
Note that the pivot folder is growing. We should look into creating subfoders in a follow up. Claude's suggestion,
pivot/
data/
pivot-data-store.ts
pivot-data-config.ts
pivot-query-plan.ts
pivot-data-assembly.ts
pivot-queries.ts
pivot-table-transformations.ts
pivot-expansion.ts
pivot-infinite-scroll.ts
components/ # all 25 .svelte files + regular-table-style.css
table/ # presentation logic for the grid
pivot-column-definition.ts
pivot-column-width-utils.ts
pivot-cell-classes.ts
regular-table-utils.ts
selection/
pivot-click-selection.ts
pivot-row-selection.ts
pivot-selection-indices.ts
swapListener.ts
time-pill/
time-pill-store.ts
time-pill-utils.ts
pivot-utils.ts # stays at root: shared, imported widely
pivot-constants.ts
pivot-merge-filters.ts
types.ts
tests/ # already exists; co-locate specs here
| ); | ||
| let cellData = pivotSkeleton; | ||
| if (tableCellData !== null) { | ||
| if (tableCellData.isFetching) { |
Collaborator
There was a problem hiding this comment.
This is a behavioural change right? We will show a loading state while fetching data vs showing old data. Is it intended?
Member
Author
There was a problem hiding this comment.
Yes, this was unintended. Fixed now.
AdityaHegde
approved these changes
Jun 12, 2026
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.
Refactors the pivot data store internals to make the data flow easier to follow while preserving the existing
PivotDataStoreAPI.pivot-query-plan.tspivot-data-assembly.tspivot-data-store.tsby replacing inline paging/sort/cache/final-state logic with named helpersFlattened nested derived stores in pivot-data-store.ts with two moves:
derivedSwitchhelper (~15 lines). It's likederived, but the callback can return either a plain PivotDataState or another store; a returned store is subscribed and its values forwarded (with proper cleanup, same as the old.subscribe(set)trick). This is essentially RxJS'sswitchMapfor Svelte stores.createColumnAxesStage— column headers, builds the query plancreateRowAxesStage— row skeleton, global + column totalscreateCellDataStage— measure totals per row, cell data, column defscreateExpandedDataStage— expanded rows, final assemblyChecklist: