[Bug]: Tag Filter Menu Doesn't Close on Button Press #25

Closed
opened 2026-06-09 04:58:03 +00:00 by ValleyGeek · 3 comments
Owner

App version

0.1.1

Platform

Windows

Steps to reproduce

  1. Click the tag filter button to open the tag filter menu
  2. While the tag filer menu is open, click the tag filter button a second time

Expected behavior

The tag filter menu should close

Actual behavior

The tag filter menu closes briefly but reopens immediately. The only way to close is to click elsewhere in the application

Additional context

The bug is not present on Linux

### App version 0.1.1 ### Platform Windows ### Steps to reproduce 1. Click the `tag filter` button to open the tag filter menu 2. While the `tag filer` menu is open, click the `tag filter` button a second time ### Expected behavior The tag filter menu should close ### Actual behavior The tag filter menu closes briefly but reopens immediately. The only way to close is to click elsewhere in the application ### Additional context The bug is not present on Linux
Member

Fixed on branch 0.1.2/issue-25-tag-filter-close (VERSION 0.1.3).

Root cause: On Windows, Qt.Popup auto-dismisses when the Tag Filter button is clicked (outside-click handling) before the button's clicked handler runs. The handler then saw isVisible() == False and reopened the popup.

Fix: When the popup is dismissed with the cursor over the anchor button, set _tag_filter_ignore_next_click so the subsequent button click closes cleanly instead of reopening. Linux behavior is unchanged.

Verification: Regression test test_tag_filter_anchor_click_stays_closed_after_popup_auto_dismiss simulates the Windows event ordering; smoke-ui-exit.sh passes.

Fixed on branch `0.1.2/issue-25-tag-filter-close` (VERSION 0.1.3). **Root cause:** On Windows, `Qt.Popup` auto-dismisses when the Tag Filter button is clicked (outside-click handling) *before* the button's `clicked` handler runs. The handler then saw `isVisible() == False` and reopened the popup. **Fix:** When the popup is dismissed with the cursor over the anchor button, set `_tag_filter_ignore_next_click` so the subsequent button click closes cleanly instead of reopening. Linux behavior is unchanged. **Verification:** Regression test `test_tag_filter_anchor_click_stays_closed_after_popup_auto_dismiss` simulates the Windows event ordering; `smoke-ui-exit.sh` passes.
Member

Fixed on branch 0.1.2/issue-25-tag-filter-close (VERSION 0.1.3).

Root cause: On Windows, Qt.Popup auto-dismisses when the Tag Filter button is clicked before the button clicked handler runs, so the popup briefly closed and immediately reopened.

Fix: When the popup is dismissed with the cursor over the anchor button, ignore the follow-up open request on the next button click.

Verification: Regression test test_tag_filter_anchor_click_stays_closed_after_popup_auto_dismiss; smoke-ui-exit.sh passes.

Fixed on branch `0.1.2/issue-25-tag-filter-close` (VERSION 0.1.3). **Root cause:** On Windows, `Qt.Popup` auto-dismisses when the Tag Filter button is clicked before the button `clicked` handler runs, so the popup briefly closed and immediately reopened. **Fix:** When the popup is dismissed with the cursor over the anchor button, ignore the follow-up open request on the next button click. **Verification:** Regression test `test_tag_filter_anchor_click_stays_closed_after_popup_auto_dismiss`; `smoke-ui-exit.sh` passes.
Member

Resolved in branch 0.1.2/issue-25-tag-filter-close (VERSION 0.1.7), PR to follow.

Windows toggle fix: When the Tag Filter button is clicked while the menu is open, Qt.Popup auto-dismisses before the button handler runs. The handler now ignores the follow-up open request when dismissal came from the anchor button.

Height improvements (same branch): Menu height fits tag list + fixed controls, capped at 500px. Layout sizeHint() is used (deferred one event tick) so fixed-height tag buttons measure correctly and a scrollbar does not appear prematurely.

Tests: test_tag_filter_anchor_click_stays_closed_after_popup_auto_dismiss, test_tag_filter_popup_height_fits_content_up_to_max.

Resolved in branch `0.1.2/issue-25-tag-filter-close` (VERSION 0.1.7), PR to follow. **Windows toggle fix:** When the Tag Filter button is clicked while the menu is open, `Qt.Popup` auto-dismisses before the button handler runs. The handler now ignores the follow-up open request when dismissal came from the anchor button. **Height improvements (same branch):** Menu height fits tag list + fixed controls, capped at 500px. Layout `sizeHint()` is used (deferred one event tick) so fixed-height tag buttons measure correctly and a scrollbar does not appear prematurely. **Tests:** `test_tag_filter_anchor_click_stays_closed_after_popup_auto_dismiss`, `test_tag_filter_popup_height_fits_content_up_to_max`.
Grok closed this issue 2026-06-10 01:18:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ai-collab/bulk-image-organizer#25
No description provided.