New/RFC: Saved Filter List refactor - #7224
Open
Gykes wants to merge 2 commits into
Open
Conversation
Consolidate the per-filter actions in both the toolbar and the sidebar saved filter lists into a single overflow menu, and add a rename operation. Renaming edits the name in place in the list rather than in a modal. A modal is portalled to the document body, which the toolbar's saved filter dropdown reads as a click outside itself, so the dropdown would close behind it and the user would have to reopen it to carry on. Enter confirms, escape or blur abandons. Keeping that dropdown open takes some care, since it is asked to close by three separate mechanisms. Choosing an operation forwards a nested menu's select up through SelectableContext, and the operations menu is portalled to the document body so it also reads as a click outside; the dropdown is therefore controlled, and ignores a close while an operation is being started. It uses a callback from the menu rather than inspecting the event, because useRootClose evaluates containment in the capture phase, before React has run its handlers, so by the time the close arrives the clicked item may already be unmounted. Escape is the third: react- overlays' Dropdown listens for it on keydown and useRootClose on keyup, so the name input stops both and abandons the rename on keyup, while it is still mounted to do so. The filter is re-saved under its existing ID with the new name. Its stored find_filter, object_filter and ui_options are passed through untouched rather than round-tripped through ListFilterModel: a criterion type the current UI doesn't recognise becomes an UnsupportedCriterion, which neither reads itself in nor writes itself back, and saving replaces object_filter wholesale - so a round-trip would silently delete such a criterion. Legacy criteria like career_length and movies are affected. Names are trimmed, and a rename onto an existing name is rejected before saving rather than surfacing a raw uniqueness constraint error. As in SaveFilterDialog the comparison is case-insensitive, even though the unique index is not, to avoid a confusing "foo"/"Foo" pair. A rejected rename leaves the name in the editor rather than discarding it. The menu also allows an existing saved filter to be made the default for the view. The toolbar menu's own Set as default button has been removed, since having two controls with the same label in the one menu is confusing and it did something different - it set the default from the current filter rather than from a saved one. That remains available from the sidebar, which is present on every view that has the toolbar. OperationDropdown gains optional icon, id, title, size, toggle class and onClick props so that the per-filter menu can reuse it instead of duplicating it. All are defaulted, leaving existing callers unaffected. Two components that were being declared during a render are no longer: the dropdown's menu, and the toolbar's filter rows. Each was a new component type on every render, remounting its subtree and discarding an in-progress rename.
Also mention that saved filters are available in the filter sidebar, not just in the toolbar bookmark menu, and that the current filter is set as the default from the sidebar.
DogmaDragon
approved these changes
Sep 11, 2026
DogmaDragon
left a comment
Collaborator
There was a problem hiding this comment.
Documentation check passed.
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.
Description
This PR refactors the filter list dropdown to be slightly more in line with modern expectations. I made some changes from the original PR. I didn't like that when renaming it would open a new modal and then close the filter list. This would cause more mouse clicks and it was annoying so I kept it all in house and you can now change the name inside the same modal.
Related Issue
closes #4077
Testing
Tested in dev environment
Screenshots
Checklist
AI Usage Disclosure
Drafted with Claude Opus.
Additional Context
Supersedes: #4097.