Repository navigation
fix(schedule): keep the empty-folder chip rename open and return focus after it - #24632
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a small, contained fix to focus handling on one component, and the shape matches the existing CronFolderHeader fix. Notes
[DESIGN-REVIEWED] fd7108b Description read[DESCRIPTION-READ] fc3cf2d6819b70e2a30d7bfdb5e0f6259b1fd7e5927d22186266e4fe6c387e0b 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Both items are fixes for the defects reported in #23904, and the tests pin them. The only cost is a pre-existing twin, Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: let a keyboard user rename an empty Schedule folder and keep their place afterwards. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] fd7108b Description read[DESCRIPTION-READ] 6dd7ff89a64c8d2fa3725bbc20f828efab7c0a211d1113db63668cd562346c91 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS This PR adds no new visible control or copy. It only changes where focus lands after a rename, and both screenshots show the focus ring back on the folder-actions button. Notes
[UX-REVIEWED] fd7108b Description read[DESCRIPTION-READ] ef863fbf31d3cc308f41d7610372bde58884eccef904a97866c7983cefb42d0b That sha256 names everything this verdict read: the PR description, plus the 5 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: dispositions for the advisory notes on Design Review note (the UX Review note (captions under the two shots). Each image already carries a caption line directly above it in the Screenshots section (renamed to "Nightly reports"; draft "Discarded name" dropped, name unchanged). Both exits are meant to end in the same place, so the two frames are intentionally identical apart from that caption. No push for this: editing the description alone starts no review round. Board. The one red, |
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed at head 1a34f5c. The change looks good to ship.
What I checked:
closeEditorcommits on Enter and blur, cancels on Escape, and restores focus to the folder-actions trigger only for Enter and Escape. The three new tests pin each branch, and the mutation table in the description matches the logic.Btnis aforwardRefcomponent incomponents/ui.tsx, sotriggerRefreaches the real button throughDropdownMenuTrigger asChild.onCloseAutoFocusskips the Radix restore only when Rename was picked and clears the flag on first read, so Delete keeps the default restore and a later menu close is not affected.useRefis already imported inSchedulePage.tsx; the only API change is the addedexportonEmptyFolderChip.- Scope is 5 files, frontend only, linked issue is tier T1, no security sensitive paths.
Remaining before merge: Backend Tests (Windows) (6) failed with a FileNotFoundError in platform_compat_wintree.py, which this frontend only diff does not touch, so PR Readiness is red. A rerun of that job should clear it; I will approve once readiness passes on this head.
…s after it (#23904) Picking Rename on the Schedule page's empty-folder chip opened an editor that closed itself: Radix restored focus to the folder-actions trigger after the input had autofocused, the blur committed the unchanged name and unmounted the input. When the editor did close on Enter or Escape, focus fell to document.body. Skip the Radix close-focus restore when Rename was picked (Delete keeps it), and hand focus back to the folder-actions trigger on Enter and Escape. A pointer blur still commits and moves focus nowhere. Closes #23904
1a34f5c to
fd7108b
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Approving at fd7108b. This head is a rebase of 1a34f5c onto current main; the range diff shows the same patch, so the earlier review with no findings still applies. Checked on this head: range diff, the readiness signal passed, no check is failing, base is main, 5 files, no merge conflict, no security path touched.
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (5 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: UI bug fix that keeps the empty-folder chip rename open and returns focus to the folder-actions trigger, with tests and a capture harness.
Cherry-picks these main commits onto release/0.11.0, in merge order: - fix(desktop): say why a pop-out cannot open instead of blaming the browser (#23922) (cherry picked from commit 99c2474) - fix(crew): list a crewmate's own script and command schedules (#24023) (cherry picked from commit d2d8d14) - fix(mcp-gateway): show a refused share outside Developer Mode (#23917) (cherry picked from commit c612613) - fix(apps): negative-cache failed app.json fetches in the store listing (#23925) (cherry picked from commit 455e8ec) - fix(power): say that Windows Modern Standby can still sleep on lock (#18259) (cherry picked from commit 0480058) - fix(chat): show nothing in the transcript when the context cap trims (#24492) (cherry picked from commit 1411fcc) - fix(frontend): seed settings rows from the served config during render (#24625) (cherry picked from commit e198b63) - fix(schedule): keep the empty-folder chip rename open and return focus after it (#23904) (#24632) (cherry picked from commit 9f51b91) - feat(website): swipe to dismiss the notification banner on mobile (#24674) (cherry picked from commit e4fad39) - fix(agent): drop a gateway-inherited scratch temp before an agent spawn (#24645) (cherry picked from commit 1f28708)
Parts 2 and 3 of the 0.11.0 list, combined after part 3 (#25666) was merged into part 2's branch. Cherry-picks these main commits onto release/0.11.0, in merge order: - fix(desktop): say why a pop-out cannot open instead of blaming the browser (#23922) (cherry picked from commit 99c2474) - fix(crew): list a crewmate's own script and command schedules (#24023) (cherry picked from commit d2d8d14) - fix(mcp-gateway): show a refused share outside Developer Mode (#23917) (cherry picked from commit c612613) - fix(apps): negative-cache failed app.json fetches in the store listing (#23925) (cherry picked from commit 455e8ec) - fix(power): say that Windows Modern Standby can still sleep on lock (#18259) (cherry picked from commit 0480058) - fix(chat): show nothing in the transcript when the context cap trims (#24492) (cherry picked from commit 1411fcc) - fix(frontend): seed settings rows from the served config during render (#24625) (cherry picked from commit e198b63) - fix(schedule): keep the empty-folder chip rename open and return focus after it (#23904) (#24632) (cherry picked from commit 9f51b91) - feat(website): swipe to dismiss the notification banner on mobile (#24674) (cherry picked from commit e4fad39) - fix(agent): drop a gateway-inherited scratch temp before an agent spawn (#24645) (cherry picked from commit 1f28708) - fix(dashboard): tell the crewmate about unresolved fields, draw no stale band (#24069) (cherry picked from commit f9d8e19) - fix(mcp-gateway): never pool a credential vendor (#24672) (cherry picked from commit 2464225) - fix(acp): keep MCP tools direct on KAS when the spec grants no tool_search (#24297) (cherry picked from commit ddc1fea) - fix(crew): move a working icon avatar as one still image so it cannot tear (#24678) (cherry picked from commit e062153) - fix(crew-mode): keep a crewmate's own chat on the conductor (#24894) (cherry picked from commit 7582829) - fix(memory): name a damaged memory.db instead of restore advice (#24567) (cherry picked from commit efe7624) - fix(env): search Builder Toolbox's Windows bin dir for agent binaries (#24563) (cherry picked from commit 686d39a) - fix(discord): re-admit bot-opened threads after a gateway restart (#21776) (cherry picked from commit 072a37b) - fix(web): keep a hidden model hidden after a harness switch respells its id (#24564) (cherry picked from commit 501f455) - fix(gateway): say the gateway is running once boot finishes (#25029) (cherry picked from commit 02627ec) - fix(mcp): say why an mcp.json settings file could not be read (#22169) (#24572) (cherry picked from commit ed75593)
Backports parts 2-4 of the 0.11.0 insider list (#25665, #25666, #25667) onto release/0.11.0. Parts 0-1 landed in e379f74 (#25663, #25664). - fix(desktop): say why a pop-out cannot open instead of blaming the browser (#23922) (cherry picked from commit 99c2474) - fix(crew): list a crewmate's own script and command schedules (#24023) (cherry picked from commit d2d8d14) - fix(mcp-gateway): show a refused share outside Developer Mode (#23917) (cherry picked from commit c612613) - fix(apps): negative-cache failed app.json fetches in the store listing (#23925) (cherry picked from commit 455e8ec) - fix(power): say that Windows Modern Standby can still sleep on lock (#18259) (cherry picked from commit 0480058) - fix(chat): show nothing in the transcript when the context cap trims (#24492) (cherry picked from commit 1411fcc) - fix(frontend): seed settings rows from the served config during render (#24625) (cherry picked from commit e198b63) - fix(schedule): keep the empty-folder chip rename open and return focus after it (#23904) (#24632) (cherry picked from commit 9f51b91) - feat(website): swipe to dismiss the notification banner on mobile (#24674) (cherry picked from commit e4fad39) - fix(agent): drop a gateway-inherited scratch temp before an agent spawn (#24645) (cherry picked from commit 1f28708) - fix(dashboard): tell the crewmate about unresolved fields, draw no stale band (#24069) (cherry picked from commit f9d8e19) - fix(mcp-gateway): never pool a credential vendor (#24672) (cherry picked from commit 2464225) - fix(acp): keep MCP tools direct on KAS when the spec grants no tool_search (#24297) (cherry picked from commit ddc1fea) - fix(crew): move a working icon avatar as one still image so it cannot tear (#24678) (cherry picked from commit e062153) - fix(crew-mode): keep a crewmate's own chat on the conductor (#24894) (cherry picked from commit 7582829) - fix(memory): name a damaged memory.db instead of restore advice (#24567) (cherry picked from commit efe7624) - fix(env): search Builder Toolbox's Windows bin dir for agent binaries (#24563) (cherry picked from commit 686d39a) - fix(discord): re-admit bot-opened threads after a gateway restart (#21776) (cherry picked from commit 072a37b) - fix(web): keep a hidden model hidden after a harness switch respells its id (#24564) (cherry picked from commit 501f455) - fix(gateway): say the gateway is running once boot finishes (#25029) (cherry picked from commit 02627ec) - fix(mcp): say why an mcp.json settings file could not be read (#22169) (#24572) (cherry picked from commit ed75593) - fix(mcp-gateway): render a refused share through ErrorNotice (#25660) (cherry picked from commit d895a90) - fix(crew): write a crewmate's hidden welcome and check-ins in the user's language (#24966) (cherry picked from commit d5a76e6) - feat(crew-mode): move every used crewmate to its conductor on upgrade (#24954) (cherry picked from commit 76e89ae) - fix(hooks): Reads mode auto-approves Kiro Crew's own read-only MCP tools (#24910) (cherry picked from commit d8f2038) - fix(members): list crewmates the person created, even with an empty chat (#24987) (cherry picked from commit 163652b) - feat(cron): let a script cron feed its crewmate's Dashboard page (#24692) (cherry picked from commit 959b35a) - fix(kas): honour a server's autoApprove through the derived permissions (#25106) (cherry picked from commit 073c83a) - fix(chat): keep a scrolled-up reader still when a reprice clamps them (#24591) (cherry picked from commit 9a73292) - fix(security): restore every allowed link on a host, not only identical ones (#20487) (cherry picked from commit b161144) - fix(website): swipe the mobile notification banner up to dismiss it (#25151) (cherry picked from commit e68a716) - test: carry the _card_outcomes helper #24910's tests read (cherry picked from commit 9df4d01) The #24987 decision entry is new on this branch, so its Evidence lines now link the owner restatement and the maintainer approval on #24987 instead of describing them. Main keeps its shipped (immutable) copy.
Problem / Motivation
Goal: Renaming an empty folder on the Schedule page works from the keyboard: the editor stays open once picked, and Enter or Escape hands focus back to the folder-actions button.
On the Schedule page, a folder with no jobs renders as
EmptyFolderChip(website/src/pages/SchedulePage.tsx). Its inline rename has two defects, both observed in Chromium through the committed capture harness:INPUT addedat 109.6ms,focusout INPUT -> BUTTONat 109.8ms,INPUT removedat 111.5ms). The blur commits the unchanged name and unmounts the input, so the user never gets to type.document.body. The chip name is a plain<span>, so the folder-actions trigger is the only control that opens the rename and survives it.Why it matters
A keyboard or screen-reader user cannot rename an empty folder on the Schedule page at all today, and after any inline edit that does close they lose their place in the page and have to tab back in from the top. Mouse users are not blocked but see the same lost focus ring.
Not a goal
CronFolderHeader.tsx: fix(schedule): return focus to the cron folder toggle after rename #23907 already restores focus there, and its menu already skips the Radix restore.What changed (motivation → approach → change)
Observed symptom → root cause → change:
DropdownMenuContentrunsonCloseAutoFocuson a timer after unmount and focuses the trigger, which blurs the just-mounted input; the chip'sonBlurcommits and closes. →renamePickedRefis set when the Rename item is selected;onCloseAutoFocusreads and clears it and callspreventDefault()only in that case. Delete keeps Radix's default restore, so its confirmation appears with focus still on the trigger beside it (unlike an unconditionalpreventDefault, which would strand Delete ondocument.body; the chip's confirmation has noautoFocus).setEditing(false)unmounts the focused input and the browser drops focus todocument.body. → AtriggerRefon the folder-actionsBtn(it forwards refs), and acloseEditor(reason)that commits onenterandblur, closes on all three, and onenter/escapefocuses the trigger inrequestAnimationFramewithpreventScroll. A pointer blur moves no focus: the user already chose where it goes (WCAG 3.2.2).EmptyFolderChipis now exported so the test and the capture harness mount the real component, asJobSecretsPanelandCollapsibleMessagealready are.Same pattern as the #23907 fix for
CronFolderHeader.tsx. The sibling'sclosedRefguard against a blur fired by the unmounting input is not copied: React disables its DOM event listeners for the duration of a commit (setEnabled(false)inprepareForCommit), so a blur dispatched while the input is being removed never reachesonBlur. I checked this by dispatchingfocusoutfrom a patchedremoveChildduring the unmount: the handler did not run.Backwards compatibility
Compatible: the Rename item, the input's Enter/Escape/blur semantics and the Delete flow all accept what they accepted before; only where focus lands afterwards changes.
Removes nothing: no path, record, key or public function is removed or renamed; one function gains an
export.Tests
website/src/pages/SchedulePage.emptyFolderRenameFocus.test.tsx(new, 3 tests):Enter commits once and returns focus to the folder-actions trigger—onRenamecalled exactly once with the trimmed draft;document.activeElementis the trigger.Escape cancels and returns focus to the folder-actions trigger—onRenamenot called; focus on the trigger.a pointer blur commits but leaves focus where the user put it—onRenamecalled with the draft; after a frame, focus is still on the element the user focused.Proof: not provable -- frontend test (prove.py runs Python only)
Revert proof, run by hand: with the production hunks reverted (base
5285bc2878), the Enter and Escape tests fail (expected <body> to be <button aria-label="Folder actions">) and the blur test passes, 2 failed | 1 passed. Mutations, each applied alone with the file restored between runs:requestAnimationFrame(... focus ...)linecommitRename()unconditional)reason !== 'blur')reason === 'blur'only)Not pinned by the unit test: the
onCloseAutoFocusskip. happy-dom does not reproduce the Radix restore ordering (the input kept focus on base there), so a unit test for it stays green with the skip removed. It is pinned by the committed capture harness instead:capture/shoot-empty-folder-chip-rename-focus.mjswaits for the menu to detach, gives the Radix timer its turn, and throws if the rename input no longer holds focus. Before the skip was added that harness failed at exactly that point (timeout waiting for theRenametextbox); with it, both frames shoot.Also run:
npx tsc -bclean;npx eslinton the changedsrc/files clean;src/pages/SchedulePage.secrets.test.tsxandsrc/components/CronFolderHeader.renameFocus.test.tsxstill pass;jscpd --min-tokens 180over the new files and theirCronFolderHeadersiblings finds 0 clones.Manual verification
Chromium (Playwright
chromium_headless_shell, Linux) through the harness: Folder actions → Rename → editor stays open and focused after the menu is gone → type → Enter: name updates, focus ring on the folder-actions button; → Escape: draft discarded, focus ring on the folder-actions button. Logged by the script asEnter -> focused: Folder actions | name: Nightly reportsandEscape -> focused: Folder actions | name: Nightly reports.Not verified: Firefox, Safari, Windows and macOS. The change is checked against source and Chromium on Linux only.
Screenshots / video
Dark theme, focus ring on the folder-actions button after each exit.
After Enter (renamed to "Nightly reports"):
After Escape (draft "Discarded name" dropped, name unchanged):
Related Issues
Closes #23904
Refs #22900, #13598, #23907
Sibling sweep
Swept:
git grep -n "onBlur" -- website/src | grep "bindEnter"(edit-in-place inputs that close on Enter, Escape and blur) andgit grep -n "setTimeout(() => setEditing(true)" -- website/src(menu items that open an autofocusing editor)Sibling: website/src/components/CronFolderHeader.tsx:71 -- not affected -- focus restore landed in #23907 and its menu already skips the Radix restore
Sibling: website/src/apps/meetings/components/MeetingTitle.tsx:73 -- not affected -- already restores focus to its trigger through
triggerRefon Enter and EscapeSibling: website/src/apps/crew-companion/RemindersSection.tsx:76 -- tracked in #24630 --
close()unmounts the input and nothing focuses the Edit button or More-actions trigger it stood in forSibling: website/src/apps/issue-radar/views/settings/CrewProtocolSettings.tsx:334 -- not affected -- a persistent settings field with no Escape and no unmount on commit; the input keeps focus
Pattern harvest
Rule candidate: review-prompt
Pattern: an inline editor that replaces its own opener on close must name the element that gets focus back; and a Radix menu item that opens an autofocusing input must skip the menu's deferred close-focus restore, or the restore blurs and closes the input.
Decision for the owner
The decision is whether the chip's rename should restore focus to the folder-actions trigger after Enter and Escape, and whether fixing the editor-closes-on-open race belongs in the same change. This draft does both, scoped to the Rename item only (Delete keeps Radix's default restore), because without the open-path fix the acceptance in the issue is unreachable in a real browser; the rejected alternative was an unconditional
onCloseAutoFocusskip as inCronFolderHeader.tsx, which would strand Delete's focus ondocument.body.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.