Skip to content

fix(web): a dismissed folder picker stays closed when its label forwards the click - #460

Merged
theogravity merged 1 commit into
mainfrom
fix/dir-picker-label-reopen
Oct 26, 2026
Merged

theogravity merged 1 commit into
mainfrom
fix/dir-picker-label-reopen

Conversation

@theogravity

Copy link
Copy Markdown
Contributor

The bug

Clicking the field's Working directory label while the folder picker was open closed the panel and bounced it right back. One label click is two events: the outside pointerdown dismisses the panel, and the browser's label activation then dispatches the same gesture's click on the input — which still holds focus and fires no focus event of its own — and the input's onClick={openPicker} reopened it.

The fix

An outside-pointerdown dismissal arms a flag; every new gesture's capture-phase pointerdown clears it (spec-anchored ahead of the dismiss handler on the same event), and a click-driven open arriving while armed is the tail of the dismissing gesture and drops. Focus-driven opens are untouched: Tab-in and a label click onto an unfocused field still open the picker.

Verified

  • New regression test pins both edges (gesture must end closed; the next label click must open) — red on the pre-fix code, green after.
  • Picker suite 47/47; full @internal/server-web suite 3054/3054; tsc and biome clean.
  • e2e specs 00+01+06 (launch dialog end to end) pass 4/4.
  • Code-review pass: zero MAJOR, zero MINOR.

…rds the click

Clicking the field's "Working directory" label closed the open panel on the
outside pointerdown, and the browser's label activation then dispatched the
same gesture's click on the input, which still held focus, reopening it. A
dismiss now arms a flag that the next gesture's capture-phase pointerdown
clears; a click-driven open that arrives while it is armed is the tail of the
dismissing gesture and drops.
@theogravity
theogravity merged commit bfb4e72 into main Oct 26, 2026
13 checks passed
@theogravity
theogravity deleted the fix/dir-picker-label-reopen branch October 26, 2026 20:52
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant