Repository navigation
fix(session-tags): right-click on another row while the tag picker is open - #9658
Conversation
|
Intent: While the session tag picker is open, a right-click on another session row must close the picker and open that row's Kiro Crew context menu instead of the native OS/browser menu. |
UX Review (Fable 5, fork) — 🟡 CONCERNSUX-level review of Reconciliation: the diff adds no new visible element or string — it changes the behavior of one existing control, the picker's dismiss backdrop ( UX-Verdict: CONCERNS The fix restores expected right-click behavior with no new vocabulary; the only shortfall is that the after-state screenshots aren't verifiable in this lane. Evidence gaps
[UX-REVIEWED] cf920ed |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS A real, reproducible UX defect fixed at its actual cause (the backdrop swallowing Suggestions
[DESIGN-REVIEWED] cf920ed |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of All evidence gathered. The fix has solid provenance (issue #9657, an e2e test proven red on base), First-Principles-Verdict: CONCERNS The author's own pattern-harvest names the general defect, yet one counted sibling scrim ( Not justified as shipped
What this change shipsInventory (8 items) — 6 justifiedIntent: right-clicking another session row while the tag picker is open should close the picker and open that row's menu — a FIX (issue #9657, e2e proven red on base).
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] cf920ed |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
d33b2a6 to
e93540f
Compare
|
Re-pushed as e93540f (rebased onto current main, still one commit). Only |
e93540f to
fce4286
Compare
… open The tag picker's full-viewport backdrop swallowed `contextmenu`. The row under the pointer never saw the gesture, so the OS/Electron menu opened and the picker stayed put. The backdrop now prevents the native menu, closes the picker, and re-issues the same gesture to the element beneath the pointer (document.elementsFromPoint, skipping the backdrop). A right-click on another session row therefore opens that row's Kiro Crew context menu, fresh. A right-click inside the dialog is untouched. Tests: vitest regressions for forward / no-target / no-API / inside-dialog, plus a real-Chromium Playwright spec (17b) proven RED without the fix.
fce4286 to
cf920ed
Compare
|
Re-pushed as cf920ed (rebased onto main 2188f02; diff unchanged, one commit). Reason: on fce4286 the PR-body edit right after the push spawned duplicate |
|
|
|
bolichen97
left a comment
There was a problem hiding this comment.
Maintainer review (agent-assisted, on behalf of @bolichen97), head cf920eda8.
Verified: SlotTagPopover.tsx:73-90 checks e.target === e.currentTarget, prevents default, resolves the element under the pointer via elementBeneath() (skips the backdrop), closes, then dispatches a bubbling contextmenu at the same point — close and re-issue land in the right order and the test drives the exact sequence.
Non-blocking notes:
- Keyboard-close focus parity: on the forwarded path Escape returns focus to
<body>rather than row B, because the focused picker option is removed before Radix capturesactiveElement. - A keyboard-originated
contextmenu(Shift+F10 with the backdrop focused) enters this handler with synthesised coordinates; gating onpointerTypewould exclude it. - The unit test asserts
clientX/Y/buttonbut not the modifier keys the body claims are forwarded.
… open (kirodotdev#9658) The tag picker's full-viewport backdrop swallowed `contextmenu`. The row under the pointer never saw the gesture, so the OS/Electron menu opened and the picker stayed put. The backdrop now prevents the native menu, closes the picker, and re-issues the same gesture to the element beneath the pointer (document.elementsFromPoint, skipping the backdrop). A right-click on another session row therefore opens that row's Kiro Crew context menu, fresh. A right-click inside the dialog is untouched. Tests: vitest regressions for forward / no-target / no-API / inside-dialog, plus a real-Chromium Playwright spec (17b) proven RED without the fix.
Problem / Motivation
Open the tag picker on one session (right-click → Tags…). Now right-click a different session row. The Mac / browser context menu appears. The picker stays open. Kiro Crew's own session menu never shows.
Why it matters
Tagging several sessions in a row is a common flow. Today every second right-click lands on the wrong menu. The user has to press Escape, then right-click again. It feels like the app lost the click.
What changed (motivation → approach → change)
The picker draws a full-screen backdrop (
fixed inset-0 z-[9999]). The backdrop only listens foronClick. A right-click firescontextmenu. Nothing stopped it, and nothing passed it on. So the row under the pointer never saw it, and the browser showed its own menu.The backdrop now handles
onContextMenu. It callspreventDefault()so the native menu stays hidden. It closes the picker. Then it re-issues the samecontextmenu(same point, same modifier keys) to the element under the pointer.elementBeneath()finds that element withdocument.elementsFromPoint, skipping the backdrop itself. The row's RadixContextMenuTriggerreceives the event and opens that row's menu, fresh.flowchart LR subgraph Before A1[right-click row B]:::ctx --> B1[picker backdrop]:::changed --> C1[browser native menu]:::removed end subgraph After A2[right-click row B]:::ctx --> B2[backdrop: preventDefault + close]:::changed --> D2[elementBeneath → row B]:::added --> E2[row B Kiro Crew menu]:::ctx end classDef added fill:#DCFCE7,stroke:#16A34A,color:#14532D,stroke-width:2px classDef changed fill:#FEF3C7,stroke:#D97706,color:#78350F,stroke-width:2px classDef removed fill:#FEE2E2,stroke:#DC2626,color:#7F1D1D,stroke-dasharray:4 3 classDef ctx fill:#E0F2FE,stroke:#0284C7,color:#0C4A6E linkStyle 0,1 stroke:#DC2626,stroke-dasharray:4 3 linkStyle 2,3,4 stroke:#16A34A,stroke-width:2px🟩 added · 🟨 changed · 🟥 removed · 🟦 unchanged
The backdrop now hands the right-click to the row under it, and the row's own menu opens.
Scope kept small on purpose. Only the backdrop element forwards. A right-click inside the dialog (for example on the "New tag…" input) keeps its native menu. If nothing selectable is under the pointer, the picker just closes. If the platform has no
document.elementsFromPoint, the picker just closes.Tests
website/src/test/SlotTagPopover.test.tsx(vitest, happy-dom):defaultPrevented), picker unmounts, the row beneath receives onecontextmenuat the sameclientX/Ywithbutton: 2, and its Radix menu is open.elementsFromPoint: does not throw, suppresses + closes.elementBeneath(): skips the backdrop and its descendants; returnsnullwhen only the backdrop is hit or the API is missing.website/playwright/session-tags-e2e.spec.ts#17b (real Chromium against the ephemeral harness): open picker on row A,page.mouseright-click on row B → picker hidden,defaultPreventedtrue, row B's menu open; choosing Tags… there and toggling a tag updates B and not A. Proven RED with the production hunk reverted (expect(picker).toBeHidden()failed withReceived: visible), GREEN with it.test/test_playwright_e2e.py:MIN_EXECUTED_SPECS223 → 224 for the added spec.Manual verification
Same flow driven in headless Chromium for the screenshots below. Full gate set run locally: website vitest 1947 files / 30,673 tests,
tsc -b, eslint (0 warnings), i18n check + render, phantom-classes, jscpd, Electron 1831/0, mypy / isort / flake8 / black, allscripts/check_*gates, cfn-lint, bundle-size.Screenshots / video
Before the fix there is nothing to show inside the app: the native OS menu appears and the picker does not move. After:
Picker open on Session A:
Right-click on Session B — picker gone, B's Kiro Crew menu open at the pointer:
Related Issues
Fixes #9657
Pattern harvest
Rule candidate: review-prompt
Pattern: a full-viewport dismiss backdrop that handles
onClickbut notonContextMenulets the native menu through and blocks the app's own context menus beneath it.Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)