Sync staging: preserve server-grid filter state#180
Merged
VibhavSetlur merged 1 commit intoModelSEED:stagingfrom May 5, 2026
Merged
Sync staging: preserve server-grid filter state#180VibhavSetlur merged 1 commit intoModelSEED:stagingfrom
VibhavSetlur merged 1 commit intoModelSEED:stagingfrom
Conversation
… pages - DataControlHeader: also update grid's filterModel when onApplyFilterModel is provided, so GridHighlightText and filter badge reflect current state - PatricGenomesTable: fix multi-filter truncation logic to allow intentional clear (when incomingItems.length === 0) - PatricGenomesTable: wire onApplyFilterModel so toolbar receives full multi-filter model for server-side filtering
There was a problem hiding this comment.
Pull request overview
Syncs staging while carrying a remaining UI fix intended to preserve committed (multi-)filter state on server-backed MUI DataGrid pages when toolbar quick-filter/search updates occur, aligning behavior across tables.
Changes:
- Updates
DataControlHeaderto additionally sync the grid’s internalfilterModel(truncated to CE limits) after applying the full model viaonApplyFilterModelfor server pages. - Updates
PatricGenomesTableto accept toolbar-applied filter models and to refine truncation-vs-clear handling inonFilterModelChange.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| components/layout/DataControlHeader.tsx | After toolbar “Save” on server pages, applies the full filter model via callback and then sets a truncated grid-internal model so UI features (badge/highlight) stay in sync. |
| components/build-model/PatricGenomesTable.tsx | Adds a toolbar apply handler + adjusts filter change logic to preserve committed filters across truncation and handle clears, wiring onApplyFilterModel into DataControlHeader. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+191
to
+192
| // Only update committed refs if we're not clearing (incoming has items or was truncation) | ||
| if (incomingItems.length > 0 || incomingItems.length >= committedFilterItemsRef.current.length) { |
Comment on lines
+132
to
+145
| const handleToolbarApplyFilterModel = (model: GridFilterModel) => { | ||
| // Store the full multi-filter from the toolbar (bypasses grid truncation) | ||
| committedFilterItemsRef.current = model.items as GridFilterItem[]; | ||
| committedLogicOperatorRef.current = model.logicOperator; | ||
|
|
||
| // Also update the local filterModel so the UI stays in sync | ||
| setFilterModel({ | ||
| items: model.items, | ||
| logicOperator: model.logicOperator, | ||
| quickFilterValues: model.quickFilterValues ?? [], | ||
| quickFilterLogicOperator: model.quickFilterLogicOperator, | ||
| }); | ||
| setPaginationModel((prev) => ({ ...prev, page: 0 })); | ||
| }; |
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
VibhavSetlur:stagingintoModelSEED:staging18dcf9efix(ui): preserve grid state when using onApplyFilterModel for server pagesWhy
Scope
components/layout/DataControlHeader.tsxcomponents/build-model/PatricGenomesTable.tsxValidation
develop == staging == origin/develop == origin/stagingupstream/staging...origin/staging = 0 1Made with Cursor