Clone menu popover doesn't close on outside click #255
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#255
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?
What's wrong
After clicking Clone to open the clone popover, clicking anywhere outside the popover does not close it. It stays open until the user presses Escape or toggles the Clone pill again.
Root cause (code evidence)
CloneMenu(web/src/pages/Repo.jsx:39-149) renders the popover as a<details class="clone-menu">element (:85). It wires an Escape handler (:80-84,onKey→root.open = false) but never registers a document-level outside-click handler — there is nodocument.addEventListener("click", …)anywhere in the component.RefPicker(Repo.jsx:240-243):const close = (e) => { if (root && !root.contains(e.target)) { setOpen(false); … } }; document.addEventListener("click", close);with removal inonCleanup.TasksOverlay(Repo.jsx:417-420): identicalonDocoutside-click close with cleanup.CloneMenumanagesgetOpenvia the<details>onToggleevent (:85) but nothing closes it. Note the outside-click check must exclude clicks on the trigger itself (the<summary>pill) so the toggle doesn't fight the close — the RefPicker pattern handles this correctly because its trigger is insideroot(same shape applies here:summaryis insidedetails, so a plain!root.contains(e.target)check works and the summary's native toggle still fires).NotificationTrayandTasksOverlay— TasksOverlay already closes on outside click; verify NotificationTray does too while in this file (it uses the tray pattern from #133; fix in this issue only if it shares the gap).Fix
Add the standard outside-click close to
CloneMenu: document click listener that setsroot.open = falsewhen the click target is outside thedetails, registered on mount and removed inonCleanup(mirror Repo.jsx:417-420). Keep the Escape handler and focus-return behavior (:80-84) unchanged.Acceptance criteria
onCleanuppattern).NotificationTraychecked for the same gap; fixed in the same change if affected (note which way it went in the PR).Fixed by #265 (branch fix/issue-255): CloneMenu gets the standard outside-click close (document listener → root.open=false, removed in onCleanup), mirroring TasksOverlay/RefPicker. NotificationTray shared the gap and is fixed in the same change. 522/522 web tests green (smoke.test.js hangs identically on main — needs a live server). Browser check open.
Review of PR #265 (fix/issue-255,
150e2c4) — clone menu + notification tray outside-click close.What was checked (scratch worktree /tmp/pr265, since removed; main worktree untouched, still clean on main):
Findings:
Tests (no browser per instructions — node tests + reasoning, stated explicitly):
No fixes pushed — nothing broken. MERGE RECOMMENDATION: ready to merge.
Fixed by PR #265 (review clean incl. NotificationTray same-gap fix; 525/525), merged. Closing.