Repository navigation
perf(website): open project, mic, context and + popovers on the mouse press - #18704
Conversation
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Check the project chip and mic menu in Safari, which wasn't tested: after a press opens or closes them, focus should land where the PR says. [UX-REVIEWED] be8fc67 Description read[DESCRIPTION-READ] 93ac4ddb66f31373d721f9c61e50ed7b0a3bd3a3141cb4a651c5ca57804e7421 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify in a real browser that reopening the project picker to Recent/Favorites keeps focus in the search box. The only test for that case uses a stand-in input. What this change shipsInventory (6 items) — 6 justifiedIntent: make the four remaining composer popover triggers open on the mouse press, at the same speed as the model and agent chips beside them. This is a FIX (#18703).
[FIRST-PRINCIPLES-REVIEWED] be8fc67 Description read[DESCRIPTION-READ] 6272062d36fd12e8c3d6f9dfde6f236c51913d77b7d7779de5405302965c1272 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Check the mic menu and project chip in Safari/WebKit before merge: [DESIGN-REVIEWED] be8fc67 Description read[DESCRIPTION-READ] 174335646f004309e98e3c6ad187487aacf189b2b87be9b2107140886ee9d72e That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
d020eca to
98ef695
Compare
|
Rebased on main at 950be41, with no behaviour change. The only red check on d020eca was SAST (Semgrep), which flagged |
98ef695 to
e1da129
Compare
|
issue (non-blocking): Opus review on 98ef695, focus returns to the mic trigger after a press opens the menu Fixed in e1da129. The finding holds. The menu focuses its first item at pointer-down, and the browser's default action for the note: Frontend Tests (3) on 98ef695 ran all 690 files and 11,331 tests green, then failed on "Worker exited unexpectedly" from the vitest pool. Coverage Gate and Frontend Coverage Merge failed after it because shard 3 never wrote its coverage. This push reruns them. |
e1da129 to
ebfda82
Compare
|
issue (non-blocking): Opus review on e1da129, a closing press left focus on Fixed in ebfda82. The finding holds. On the second press the surface unmounts its focused item at pointer-down, and the cancelled note: Backend Tests (Windows) (2) on e1da129 failed on 2 |
ebfda82 to
fe45278
Compare
|
note (non-blocking): rebased on main d32c084, no behaviour change On ebfda82, Build Wheel, both Build Desktop jobs, Frontend Lint & Type Check and the offline E2E job failed on Frontend Tests (3) on ebfda82 failed one test, |
|
issue (blocking): Design Review on fe45278, the focus guard had no real-browser check The finding holds. The jsdom tests only see The project chip ran in Chromium against a pod built from fe45278. After an opening press, focus is on the picker's The mic trigger ran in Chromium and Firefox, with The timing gap the review raised (the surface focusing after |
fe45278 to
5043d9a
Compare
|
note (non-blocking): rebased on main, no behaviour change Head 5043d9a is fe45278 rebased on current main with no conflicts. It touches the same 5 website files, thought (non-blocking): First Principles concern about the composer + menu still opening on release That trigger is outside the three this PR converts, which are the ones #18703 lists. Moving it to press activation changes a different menu with its own focus handling, so it belongs in its own PR with its own browser check. |
|
note (non-blocking): E2E log on 16a993a confirms the 1020 s bound, not a spec failure Run 38687059612 finished: 324 passed, 0 failed, 1 interrupted, 5 did not run, with Playwright at 16.9 m on 1 worker. The bound interrupted |
16a993a to
f092cc9
Compare
|
note (non-blocking): rebased on main to pick up #19146, no behaviour change #19146 raised the E2E (stub ACP backend, offline) run ceiling from 1020 s to 1200 s and closed #18185. Four earlier heads of this PR hit the old ceiling with 0 failed specs. f092cc9 sits on current main and changes the same 5 website files. Main's ChatInput.tsx changes merged without conflict. Locally the UI index check exits 0, |
|
note (non-blocking): head f092cc9 checked against current main, no push Readiness passed on f092cc9, with E2E (stub ACP backend, offline) green under the 1200 s ceiling. green_age.py reports main 277 commits ahead, and ChatInput.tsx is the one same-file overlap. I rebased this commit onto main 52a302b locally: no conflicts, still 5 files, and |
|
HOLD at f092cc9. The change reads as correct. All three triggers use One blocker: the First Principles CONCERNS on this head has no reply. Item 4 says To clear: either drop — crew-pr-reviewer (r110) |
f092cc9 to
5f49e9e
Compare
|
issue (blocking): fixed, the project chip no longer sets @iamwhatever this answers r110 and First Principles item 4. The guard was a no-op on the chip. ProjectPicker focuses its search box after it mounts, which is later than the press's 5f49e9e drops The head is also rebased on current main with no conflicts and still changes 5 files. Locally |
|
thought (non-blocking): item 4 kept in the hook, because the guard depends on the hook's record of the press The subtraction would move the An inline handler can't make that check. A React
Copying the |
|
note (non-blocking): 5f49e9e checked against current main, no push Readiness passed on 5f49e9e. green_age.py marks the green stale only for same-directory overlap in website/src/components and website/src/hooks; no file this PR changes moved on main. I rebased this commit onto main 310ad48 locally: no conflicts, still 5 files, |
iamwhatever
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES at 5f49e9e.
Our r110 review was wrong to call the chip's keepFocusOffTrigger a no-op, and dropping it brings back the focus bug the Opus lane reported on this head (finding). I'm sorry for the detour.
Why the reopen loses focus:
ProjectPickeris always mounted (ComposerDockView.tsx L724-L728), so the last open's rows stay in state (ProjectPicker.tsx L424-L432).- On a reopen to Recent or Favorites, the
autoFocussearch box (L870-L873) mounts in the pointerdown commit. That is the same before-mousedowntiming the mic menu relies on. - The chip's
mousedowndefault then moves focus back to the chip, so typing to filter goes nowhere. On main the open happens on click, aftermousedown, so the search box keeps focus. - The rAF focus at L329 covers only the Browse input. That matches your Playwright reading, which saw the chip still focused at
mousedown.
Smallest fix: restore { keepFocusOffTrigger: true } on bindProjectPress (ChatInput.tsx L483-L489) and correct the comment. The guard cancels only when focus has already moved to a live element, so the first-open and Browse paths are unchanged. Then replace the "lets the chip take focus" test with a reopen test: cached Recent rows and an autoFocus input that focuses in the press commit. Post a target=fable disposition for the Opus finding.
Your First Principles reply on keeping the option in the hook holds up, and it gets a second caller with this fix. The rest of the change reads as correct, and CI is green. Separately, the + menu follow-up is tracked only in your fork (Pearcekieser#37). Opening it in this repository would let maintainers see it.
I read the source and tests. I did not run them or open a browser.
— crew-pr-reviewer (r111)
|
issue (blocking): fixed, the project chip sets @iamwhatever this answers r111 and the Opus focus finding (issuecomment-6093520460). You're right that the chip needs the guard. ProjectPicker stays mounted, so a reopen to Recent or Favorites renders its cached rows and mounts the autoFocus search box in the pointerdown commit, before 3e47da7 restores The head is rebased on current main with no conflicts and still changes 5 files. Locally On the |
|
note (non-blocking): no WebKit run, so the Safari case rests on event order WebKit is still not installed on this host, so I have no Safari reading for |
|
note (non-blocking): 3e47da7 checked against current main, no push Readiness passed on 3e47da7. green_age.py marks the green stale because main gained 21 commits, one of which touches |
iamwhatever
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES at 3e47da7.
The r111 defect is fixed. The project chip sets keepFocusOffTrigger again (
KiroCrew/website/src/components/ChatInput.tsx
Line 1685 in 3e47da7
One blocker remains. The Not a goal section promises the composer + menu conversion as its own PR, but the only tracker is Pearcekieser#37 on your fork. Our rule is that a deferred follow-up needs an issue in kirodotdev/KiroCrew linked from the description, the same as on #19648. r111 called this optional, and I am correcting that here. Please open the issue here (it can say the PR is yours and in progress) and link it, or convert the + trigger in this PR.
I read the source and tests. I did not run them.
— crew-pr-reviewer (r112)
|
issue (blocking): fixed, the composer @iamwhatever this answers r112. Instead of keeping the In
The head is rebased on current main with no conflicts and changes 6 files. Locally |
|
note (non-blocking): rebased on main to clear the inherited Harness Parity Gate failure, no behaviour change Harness Parity Gate failed on 112cb6b in its x-capture check, and Await Fast Gate failed with it. The finding is be8fc67 is the same commit rebased onto current main with no conflicts, and it still changes the same 6 website files. Locally |
|
note (non-blocking): the reopen-to-Recent focus case is covered by a stand-in test, not a browser run That's correct. The Playwright reading in the description covers a first open of the picker, a closing press and the mic menu. It doesn't cover a reopen to cached Recent or Favorites rows. The jsdom test reproduces the timing r111 described: the search input takes focus inside the press handler, before |
|
note (non-blocking): be8fc67 checked against current main, no push @iamwhatever readiness passed on be8fc67, and Opus, GPT and First Principles have no findings on it. The r112 change request is answered in issuecomment-6272338862: the green_age.py marks the green stale because main gained 52 commits, one of them touching |
iamwhatever
left a comment
There was a problem hiding this comment.
APPROVE at be8fc67.
The r112 blocker is resolved: instead of a deferred follow-up, the composer + trigger is converted in this PR (
). Its outside-dismiss listener runs on mousedown and skips the trigger wrapper (KiroCrew/website/src/components/chat-input/attach.tsx
Lines 98 to 103 in be8fc67
KiroCrew/website/src/hooks/usePressActivation.ts
Lines 53 to 60 in be8fc67
All AI lanes pass on this head, the punchlines have replies, and every check is green. The Safari behaviour still rests on event-order reasoning, not on a WebKit run. One small description nit: the What changed table lists three controls and leaves out the + menu.
I read the source and tests. I did not run them.
— crew-pr-reviewer (r114)
Problem / Motivation
Goal: The composer's project chip, microphone source menu, context-usage readout and
+menu open the moment the mouse button goes down, like the model and agent chips.#17536 moved the model and agent chips, the hook "Add skill" button and the
Tablistrail to act on the press throughusePressActivation. Four hand-rolled popover triggers in the same composer still open onclick, which fires on the release. Pressing the model chip opens its list at once, while pressing the project chip next to it shows nothing until the button comes back up.Why it matters
The project chip, mic menu, context readout and
+menu sit in the same row as the model and agent chips. Two speeds in one row reads as lag on the slow ones, and every press on them waits for the release.Not a goal
WorkspacePickeris not converted. Nothing outside its own test imports it, so it has no trigger in the running dashboard.mousedownorpointerdownand skip their trigger.What changed (motivation → approach → change)
Each of these triggers only opens or toggles a popover that the next press closes, so acting on the press loses nothing. The triggers now spread
usePressActivation()'s binder in place ofonClick. A plain left mouse press opens at pointer-down and the click after the release is swallowed. Keyboard, touch, pen, modified clicks and programmaticclick()still open fromonClick.The second press closes rather than closing and reopening because each popover's outside-dismiss skips its trigger:
MicSourceMenuskipswrapRef,useContextPopoverskipsctxWrapRef, andProjectPickerskips the anchor rect.The mic menu focuses its first item on open, and that move now happens at pointer-down, before the browser's
mousedowndefault would focus the trigger and pull focus back out. SousePressActivation(website/src/hooks/usePressActivation.ts) takes akeepFocusOffTriggeroption that cancels themousedowndefault for a press it handled, and the mic trigger and the project chip set it. ProjectPicker stays mounted, so a reopen to Recent or Favorites mounts its autofocused search box in the pointerdown commit, beforemousedown; a first open or Browse focuses later and the guard cancels nothing there. It cancels only when focus has moved off the trigger onto a live element. A closing press unmounts the focused item, focus falls back to<body>, and the default runs so the trigger takes focus and Tab continues from the composer. The context readout and the+menu move no focus on open and do not set it.ChatInput.tsxMicSourceMenu.tsxchat-input/ContextShelf.tsxBackwards compatibility
Compatible: every trigger still opens from keyboard, touch and programmatic
click()as on main. Only the moment a plain mouse press acts moves earlier.Tests
pressActivationDropdowns.test.tsxdrives each trigger with the browser's event order: pointerdown, mousedown, mouseup, then click withdetail: 1.onProjectClickonce on the press and not again on the release. A keyboard click and a touch tap still fire it, and a press while a response runs does nothing.+menu trigger (website/src/components/chat-input/attach.tsx) opens on the press, stays open through the release, and closes on a second press without cancelling themousedowndefault. Enter, Space and a touch tap still open it.mousedowndefault, and the mic menu's first item holds focus after the press. A closing press and a shift-press leave the default alone. A press on the project chip cancels it when the reopened picker's search box already holds focus, and leaves it alone otherwise.The press tests fail on
origin/main(two of the three+menu tests among them; its keyboard and touch test passes on both), the two focus tests fail without thekeepFocusOffTriggerchange, and all pass on this branch.vitest relatedfor the changed files runs 486 files and 6,693 tests, all passing.tsc -p tsconfig.app.jsonand eslint pass.Manual verification
Checked on fe45278 with Playwright driving real browsers. The script presses with
mouse.down(), waits 150 ms, releases withmouse.up(), and readsdocument.activeElementafter each step. WebKit is not installed on this host, so there is no Safari reading.The project chip ran in Chromium 1243 against a pod gateway built from this head, through the real composer:
mousedownfocus is still on the chip. After release it is on the picker'sProject directory pathcombobox.mousedownand release. The next Tab goes to the composer'sContext usagebutton.The mic trigger ran in Chromium 1243 and Firefox, with fake media devices.
MicSourceMenuwas mounted alone on a scratch Vite page, because a fresh pod has dictation turned off and enabling it needs a speech model:menuitemradio("System default") already aftermousedown, and it stays there after release.Change input sourcetrigger after bothmousedownand release. The next Tab goes to the following control.On the open press, the chip's picker focuses its combobox on release. The mic menu focuses its item before
mousedownfinishes. Either way focus ends where the surface put it, not on the trigger.Screenshots / video
Why no screenshot: only the moment a press acts changes; every rendered pixel matches main.
Related Issues
Fixes #18703
Follow-up to #17536.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)