Apply Filter gramplet in Bottombar when sidebar hidden#2443
Open
eduralph wants to merge 1 commit into
Open
Conversation
The Filter gramplet (available whether docked in the sidebar or Bottombar) sets view.generic_filter and calls build_tree() to apply the filter. However, ListView.build_tree() and column_clicked() decided between using generic_filter or the Search bar's value purely on Search-bar visibility. Because sidebar_toggled() shows the Search bar exactly when the sidebar is hidden, a set generic_filter was silently dropped whenever the sidebar was hidden — the user's filter from the Bottombar gramplet took no effect. Restore the filter by checking for a non-None generic_filter before checking Search-bar visibility at both filter-selection sites. This makes an explicitly-set filter apply to the list regardless of which bar hosts the gramplet, restoring the invariant that a filter the user has explicitly set must be applied, not silently dropped because an unrelated bar happens to be visible. - gramps/gui/views/listview.py:335 (build_tree) - gramps/gui/views/listview.py:786 (column_clicked) Fixes #8617 Signed-off-by: Eduard Ralph <eduard@ralphovi.net>
This was referenced Jul 3, 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.
Summary
User impact: If you move the Filter gramplet down into the Bottombar and then hide the sidebar, applying a filter does nothing — the list stays unfiltered. It only works while the sidebar is showing. This affects every list view (People, Events, Sources, Places, and so on).
This makes an explicitly chosen filter apply whether the sidebar is shown or hidden, so the Bottombar Filter gramplet works again.
Reported in Mantis #8617.
What to look at
The list view now checks for an explicitly-set filter before falling back to the Search bar, so a filter set via the gramplet wins regardless of sidebar visibility. To reproduce pre-fix: open the People view, add the Filter gramplet to the Bottombar, hide the sidebar (View → Sidebar), type a surname in the gramplet's Name field, and press Find — pre-fix the list is unchanged, post-fix it filters to only matching rows.
Root cause
The Filter gramplet (the same UI component whether docked in the sidebar or Bottombar) sets
view.generic_filterand callsbuild_tree()to apply the user's chosen filter. However,build_tree()andcolumn_clicked()decided whether to use thatgeneric_filteror the Search bar's value purely on Search-bar visibility. The sidebar toggle directly couples Search-bar visibility to sidebar visibility: the Search bar is shown exactly when the sidebar is hidden. So: sidebar hidden → Search bar visible →build_treeuses the empty Search value and the gramplet's filter is silently dropped.Fix
Change the filter-selection condition at both sites to check whether
generic_filter is not Nonebefore checking Search-bar visibility. This makes an explicitly-set filter win over Search-bar visibility, restoring the invariant that a filter the user has explicitly set via the gramplet must be applied to the list, whichever bar hosts it.The change is in the shared
ListViewbase class (gramps/gui/views/listview.py), so it applies to everyListViewsubclass (People, PersonTree, Events, Sources, Places, Citations, Repositories, Media, Notes, Families) rather than being a single-view special case.Verification
generic_filteris applied to the list whether the sidebar is shown or hidden, across everyListViewsubclass.gramps/gui/views/listview.py:335— the filter-selection condition inbuild_tree()that decides betweengeneric_filterand Search-bar valuegramps/gui/views/listview.py:786— the identical filter-selection condition incolumn_clicked()for re-sort model rebuildsgramps/plugins/gramplet/filter.py:76-77— the Filter gramplet setsself.gui.view.generic_filterand callsself.gui.view.build_tree()to apply the user's selectiongramps/gui/views/listview.py:432-440—sidebar_toggled()coupling Search-bar visibility to sidebar visibilityengine/interface/test_bug_0008617_bottombar_filter.py(Bug8617BottombarFilterTest, AT-SPI/dogtail repro in the testbed) — RED (unpatched worktree): sidebar hidden, Filter gramplet in Bottombar, apply "Warner" surname filter → list unchanged, status barPeople: 100/100. GREEN (patched worktree): same sequence → list filtered, status barPeople: 14/100. The oracle is the status-bar filter label, which reflects the actual count of model rows displayed — immune to GtkTreeView row virtualization and valid for the grouped default People view.Fixes #8617