[Bug]: Tag Filter is not reset to Settings defaults when opening a directory #186
Labels
No labels
Kind/Bug
Kind/Feature
Priority/High
Priority/Medium
Reviewed/Confirmed
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ai-collab/bulk-image-organizer#186
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Affected area
Tag Filter / directory open (
MainWindow.open_directory,_apply_tag_filter_defaults, session restore).Report
Tag Filter state from the previous working directory carries into the next one. Selected/exclude tags, Exclusive, orientation, and live toggles (Hide Deleted, Untagged Only, Show DUPE Tags) can still be active after Open Directory, so the new folder is shown through the old filter.
This contradicts the documented behavior:
open_directoryalready calls_apply_tag_filter_defaults(), but there is no MainWindow integration test for that, and other paths can put the old filter back:restore_session_if_available) re-applies the last livetag_filter(including active/exclude tags). On launch it is queued at the same time as auto-open last directory (QTimer.singleShot(0)restore, then an 80 ms delayedopen_directory). Any later restore, or a workbench activate that copies popup state onto the proxy (_apply_tag_filter_popup_state), can overwrite the directory-open reset._apply_tag_filter_defaultsupdates the proxy and popup withemit=Falseand does not call_refresh_tag_filter_views().TagFilterDropdown.set_tag_catalogkeeps active/exclude names that still exist in the new workspace. A later_refresh_tags_ui()after preload can therefore re-select tags that exist in both directories if_activewas not empty.Steps to reproduce
Expected
Every Open Directory (including auto-open last directory and switching from an already-open workspace) applies Settings → Tag Filter defaults and clears directory-specific criteria:
Session restore may still restore Tag Filter on launch when no directory is opened (current docs). Opening a directory after that must reset, not keep the previous workspace’s filter.
Actual
Live Tag Filter from the previous directory (or the persisted session filter) remains in effect, so the new workspace can look empty, hide DELETE, or keep a tag selection that does not belong to this folder.
Suggested fix direction
_apply_tag_filter_defaults()as the single chokepoint on every directory-open path; call_refresh_tag_filter_views()after it so the grid matches the proxy.tag_filterwhen a directory open is about to run._refresh_tag_filter_tags/set_tag_catalogmust not revive old active/exclude names.open_directorya second root, assert proxy + popup matchload_tag_filter_defaultsand empty tag sets.Acceptance criteria
TagFilterDropdown.apply_defaultsin isolation).Implemented on branch
0.9.2/issue-185-186-network-cache-tag-filter(commitfd7c1f5)._apply_tag_filter_defaults()now calls_refresh_tag_filter_views()so the grid/Duplicates/Trash views match the just-reset proxy immediately, not only on the next unrelated refresh.restore_session_if_available()/_restore_session_state()take adirectory_open_pendingflag;main.pycomputes it fromargs.directoryand the "open last directory on startup" preference and passes it through. When true, the persisted Tag Filter is skipped entirely during session restore instead of being applied and then overwritten a moment later byopen_directory()'s own defaults reset — this removes the race between theQTimer.singleShot(0)restore and the deferred auto-open call._apply_tag_filter_defaults()call inopen_directory()(added test confirms this); the startup/session-restore race was the remaining gap.tests/test_tag_filter_enhancements.py::test_open_directory_resets_tag_filter_to_defaults(MainWindow-level directory-switch coverage) andtests/test_pr13_config.py::test_restore_session_skips_tag_filter_when_directory_open_pending.Full suite green (792 passed). Not yet in a PR — will be included when a PR to
mainis requested.