Fix #255: clone menu outside-click close #265

Merged
crueber merged 1 commit from fix/issue-255 into main 2026-09-10 01:56:17 +00:00
Owner

Fixes #255.\n\nCloneMenu (web/src/pages/Repo.jsx) had an Escape handler but no document-level outside-click handler. This adds the standard close mirroring the TasksOverlay/RefPicker onDoc pattern: document click listener sets root.open=false when the target is outside the

, removed in onCleanup. The trigger lives inside root so its native toggle never fights the handler; Esc + focus-return unchanged.\n\nNotificationTray shared the same Esc-only gap (verified while in the file) and gets the same close in this change: bell + dropdown wrapped in a root ref, outside clicks setOpen(false), listener removed in onCleanup.\n\nTests: new web/test/unit/clone-outside-close.test.js (4 tests, source-pinning per repo convention); full web suite 522/522 green excluding smoke.test.js, which hangs identically on pristine main (needs a live server; loopback blocked in this env). No new deps. Dark + light N/A (behavior-only). Browser check open (shared daemon blocks loopback; close verified by code reasoning: handler fires only for targets outside root, trigger inside root).

Fixes #255.\n\nCloneMenu (web/src/pages/Repo.jsx) had an Escape handler but no document-level outside-click handler. This adds the standard close mirroring the TasksOverlay/RefPicker onDoc pattern: document click listener sets root.open=false when the target is outside the <details>, removed in onCleanup. The <summary> trigger lives inside root so its native toggle never fights the handler; Esc + focus-return unchanged.\n\nNotificationTray shared the same Esc-only gap (verified while in the file) and gets the same close in this change: bell + dropdown wrapped in a root ref, outside clicks setOpen(false), listener removed in onCleanup.\n\nTests: new web/test/unit/clone-outside-close.test.js (4 tests, source-pinning per repo convention); full web suite 522/522 green excluding smoke.test.js, which hangs identically on pristine main (needs a live server; loopback blocked in this env). No new deps. Dark + light N/A (behavior-only). Browser check open (shared daemon blocks loopback; close verified by code reasoning: handler fires only for targets outside root, trigger inside root).
CloneMenu had an Escape handler but no document-level outside-click
handler; mirror the TasksOverlay/RefPicker onDoc pattern (close when the
click target is outside root, removed in onCleanup). The <summary>
trigger lives inside the <details> root so its native toggle never
fights the handler. NotificationTray shared the same Esc-only gap and
gets the same close in this change. Headless cover:
web/test/unit/clone-outside-close.test.js.
Sign in to join this conversation.
No description provided.