Skip to content

fix: collapse dropdown toggle on second click - #6725

Merged
omarchybot merged 1 commit into
omacom:quattrofrom
felixzsh:fix/dropdown-toggle-collapse
Oct 29, 2026
Merged

omarchybot merged 1 commit into
omacom:quattrofrom
felixzsh:fix/dropdown-toggle-collapse

Conversation

@felixzsh

@felixzsh felixzsh commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

dropdown, multi select, and searchable dropdown qml components try to expand again on click when they are already expanded, correct behavior should be to collapse

Copilot AI balanced review requested due to automatic review settings August 11, 2026 21:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds click-collapse handling for native dropdown components.

Changes:

  • Adds a 200 ms reopen guard.
  • Records popup closure times across all three dropdown variants.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
shell/Ui/Dropdown.qml Guards trigger clicks after popup closure.
shell/Ui/SearchableDropdown.qml Adds equivalent searchable-dropdown handling.
shell/Ui/MultiSelect.qml Adds equivalent multi-select handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shell/Ui/SearchableDropdown.qml Outdated
Comment on lines +200 to +203
onClosed: {
root.lastPopupClosed = Date.now()
searchField.text = ""
}
Comment thread shell/Ui/Dropdown.qml Outdated
id: popup
x: 0
y: trigger.height + Style.spacing.xxs
onClosed: root.lastPopupClosed = Date.now()
Comment thread shell/Ui/MultiSelect.qml Outdated
Comment on lines +397 to +400
onClosed: {
root.lastPopupClosed = Date.now()
searchField.text = ""
}
@felixzsh
felixzsh force-pushed the fix/dropdown-toggle-collapse branch from 882f279 to 67e9955 Compare August 11, 2026 22:01
Copilot AI review requested due to automatic review settings August 11, 2026 22:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (3)

shell/Ui/SearchableDropdown.qml:164

  • A rapid second click can still reopen the dropdown while its enter transition is running. Popup.opened remains false until the transition completes, even though the popup is visible; the release policy then closes it before onClicked, leaving both checks false and calling open() again. Capture popup.visible at press time so an opening or exiting popup is treated as expanded.
        onPressed: _wasOpenAtPress = popup.opened

shell/Ui/Dropdown.qml:142

  • A rapid second click can still reopen the dropdown while its enter transition is running. Popup.opened remains false until the transition completes, even though the popup is visible; the release policy then closes it before onClicked, leaving both checks false and calling open() again. Capture popup.visible at press time so an opening or exiting popup is treated as expanded.
        onPressed: _wasOpenAtPress = popup.opened

shell/Ui/MultiSelect.qml:330

  • A rapid second click can still reopen the dropdown while its enter transition is running. Popup.opened remains false until the transition completes, even though the popup is visible; the release policy then closes it before onClicked, leaving both checks false and calling open() again. Capture popup.visible at press time so an opening or exiting popup is treated as expanded.
        onPressed: _wasOpenAtPress = popup.opened

@felixzsh

Copy link
Copy Markdown
Contributor Author

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (3)
shell/Ui/SearchableDropdown.qml:164

  • A rapid second click can still reopen the dropdown while its enter transition is running. Popup.opened remains false until the transition completes, even though the popup is visible; the release policy then closes it before onClicked, leaving both checks false and calling open() again. Capture popup.visible at press time so an opening or exiting popup is treated as expanded.
        onPressed: _wasOpenAtPress = popup.opened

shell/Ui/Dropdown.qml:142

  • A rapid second click can still reopen the dropdown while its enter transition is running. Popup.opened remains false until the transition completes, even though the popup is visible; the release policy then closes it before onClicked, leaving both checks false and calling open() again. Capture popup.visible at press time so an opening or exiting popup is treated as expanded.
        onPressed: _wasOpenAtPress = popup.opened

shell/Ui/MultiSelect.qml:330

  • A rapid second click can still reopen the dropdown while its enter transition is running. Popup.opened remains false until the transition completes, even though the popup is visible; the release policy then closes it before onClicked, leaving both checks false and calling open() again. Capture popup.visible at press time so an opening or exiting popup is treated as expanded.
        onPressed: _wasOpenAtPress = popup.opened

I measured it on (Qt 6.11 + Quickshell): popup.opened is true during the enter transition (the Opening state), even with Material's 220ms
transition. So on a rapid second click, _wasOpenAtPress captures true and the popup collapses correctly the "both checks false -> reopen" scenario
can't happen here.

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 67e9955 and reproduced on a disposable Omarchy VM (Qt 6.11.2, Quickshell in a live Hyprland session). No changes needed.

The bug is real and still on quattro. A harness loaded the real Dropdown, SearchableDropdown and MultiSelect into Quickshell and clicked their triggers with synthetic mouse events. On current quattro (3faafba), a second click on the trigger of an open popup reopens it in all three controls. The default CloseOnPressOutside closes the popup on press, so onClicked sees it closed and opens it again. On this head, and on this head merged onto current quattro (it merges cleanly), all three collapse. With the three files reverted they reopen again.

Nothing else regressed. On every tree, clicking outside still closes the popup, clicking an option still selects it and closes, and clicking another control's trigger closes the first popup and opens the second. The shell suite gave the same result on this head as on its merge base: 1948 passed, and the same 2 files failed on both (monitor-state and update-lock), which depend on the VM's environment rather than on this change. ./test/cli passed.

Copilot's suggestion to capture popup.visible holds only for a Quick Controls style that animates the popup's entry. The shell sets no style, so it gets Fusion, which has no enter transition. A second click 30 ms after the first also collapses on this head. The line is fine as written.

Codex at medium effort reviewed the change separately and found no defect. It agreed the change is proportionate. It noted that CloseOnPressOutsideParent would be a smaller alternative for Dropdown and SearchableDropdown, but not for MultiSelect, whose popup is reparented to the window, so the uniform approach here is the right one. That agreement is not guaranteed to be independent of this review.

This is waiting on a maintainer.

@omarchybot omarchybot added ready Good to merge and removed ready Good to merge labels Sep 28, 2026
@felixzsh
felixzsh force-pushed the fix/dropdown-toggle-collapse branch from 67e9955 to 9094f31 Compare October 10, 2026 17:26
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous outside-click problem is fixed.

Summary

The PR makes a second click close each dropdown without disabling outside-click dismissal.

  • Clicking an open dropdown trigger closes its popup.

Reviews (2) · Last reviewed commit: "fix: collapse dropdown toggle on second ..." · Reviewed by Greptile

Comment thread shell/Ui/Dropdown.qml Resolved
@omarchybot omarchybot removed verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 10, 2026
@felixzsh
felixzsh force-pushed the fix/dropdown-toggle-collapse branch from 9094f31 to 51d154e Compare October 10, 2026 22:44
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 10, 2026
@omarchybot omarchybot added the ready Good to merge label Oct 10, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at 51d154e, the new approach using CloseOnPressOutsideParent, and tested it on a disposable Omarchy VM (Qt 6.11.2, Quickshell in a live Hyprland session). No changes needed.

The fix works. A harness loaded the real Dropdown, SearchableDropdown and MultiSelect into Quickshell and clicked them with synthetic mouse events. On current quattro (f2a39c4), and on this head with the three files reverted, a second click on an open popup's trigger reopens it in all three controls. On this head, and on this head merged onto quattro (it merges cleanly), all three collapse, including on a second click 30 ms after the first.

Nothing else regressed. On every tree, clicking outside still closes the popup, picking an option in Dropdown and SearchableDropdown still selects and closes, and clicking another control's trigger closes the first popup and opens the second. Greptile's earlier point about outside clicks applied to the previous CloseOnReleaseOutside version and does not hold for this one.

MultiSelect now has the trigger as its parent. Its popup is still drawn in the window overlay: inside an ancestor with clip: true it renders beyond the clip and its options still take clicks. It sits under the trigger as before, and near the bottom of the window it is clamped to the same height as on quattro. In a Flickable that scrolls while the popup is open, it now stays under its trigger, where on quattro it was left 30 px off.

Suite. ./test/cli passed. ./test/shell fails the same files on this head as on its merge base: all 75 failing here also fail there (most on a node the VM does not have), so none is down to this change.

Codex at medium effort reviewed the change separately and found no defect. It agreed the bug is real and the diff proportionate, and that the MultiSelect parent change does not bring back clipping. That agreement is not guaranteed to be independent of this review.

This is waiting on a maintainer.

@omarchybot
omarchybot merged commit c050166 into omacom:quattro Oct 29, 2026
1 check passed
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
berenddeboer pushed a commit to berenddeboer/omarchy that referenced this pull request Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants