Scope filter-by-values top-K to exclude the filter being edited#9376
Merged
Conversation
Re-opening a filter pill computed top-K against the already-filtered rows, so values the filter excluded disappeared from the picker and users couldn't broaden the filter back out. Strip conditions targeting the requested column before computing top-K; other filters and the search query still apply.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
Contributor
|
@kirangadhave I have started the AI code review. It will take a few minutes to complete. |
Contributor
There was a problem hiding this comment.
No issues found across 2 files
Architecture diagram
sequenceDiagram
participant FE as Frontend (UI)
participant T as Table Component (Python)
participant TM as Table Manager (Data Backend)
Note over FE, TM: State Synchronization
FE->>T: _search(filters, query)
T->>T: NEW: Store _current_filters & _current_query
T->>TM: Apply all filters & query
TM-->>T: Return filtered results
T-->>FE: Update Table View
Note over FE, TM: Filter Picker Interaction (Top-K)
FE->>T: _calculate_top_k_rows(column, k)
alt NEW: Column is targeted by active filters
T->>T: NEW: _strip_filters_for_column(target_column)
Note right of T: Removes conditions on this column<br/>but keeps other column filters and query
T->>TM: CHANGED: _apply_filters_query_sort(stripped_filters, query)
TM-->>T: Return temporary "rescoped" manager
T->>TM: calculate_top_k_rows(column, k)
else Fast Path: No active filters on this column
T->>TM: calculate_top_k_rows(column, k) (using cached searched_manager)
end
TM-->>T: Return list of (value, count)
T-->>FE: CalculateTopKRowsResponse
Light2Dark
approved these changes
Apr 27, 2026
Contributor
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.4-dev9 |
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
roleto[admin, user]hidguestentirely — the user could no longer broaden the filter back out without clearing it._calculate_top_k_rowsnow strips conditions targeting the requested column before computing top-K. Filters on other columns and the active search query still narrow the result, so cross-column filter context is preserved._searched_manageris reused — zero extra cost for the common case.Before
Screen.Recording.2026-04-24.at.1.10.28.PM.mov
After
Screen.Recording.2026-04-24.at.1.11.05.PM.mov