Repository navigation
fix(chat): share the rename/regenerate title control with split-view pane headers (#9727) - #10140
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Shared control extraction fixes the drift at its root, and every scope addition (Undo, label, held-window hook) is disclosed, tested, and evidenced. [DESIGN-REVIEWED] e20bc73 |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of All evidence is read and verified where the repository can verify it: the server rename cap ( First-Principles-Verdict: CONCERNS The #9727 fix carries a full Undo-after-auto-title capability — a new hook, two catalog keys ×13, held-window semantics — whose only provenance is this PR's own review-lane comments. Not justified as shipped
What this change shipsInventory (10 items) — 3 justifiedIntent: let a user rename or auto-title a session from a split-view pane without leaving split view — a FIX (#9727).
WatchThe Undo capability (item 5) and both relabels (4, 6) rest entirely on findings recorded as PR comments (e.g. issuecomment-5658980816, -5652072740) that this review cannot open; if those comments do not say what the description claims, three riders lose their named harm at once. The client-side Undo baseline is admitted symptom-level — "what the server itself replaced is only knowable server-side" — with the cause deferred to #10149's conditional write. [FIRST-PRINCIPLES-REVIEWED] e20bc73 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
UX Review (Fable 5) — ✅ PASSUX-level review of All evidence is in hand. Reconciling: the blind reader correctly identified every control this PR adds — the Pen/rename ("lets me retype it", sure, would click), the Auto-title button ("make the app invent a name", would click), the spinner ("thinking up a name", would wait), the Undo ("puts the previous name back... undo buttons feel safe", which the reader said answered their overwrite fear), the error notice, and both main-header states. All ten states (rest, hover en/zh, editing, renamed, error, generating, undo, main-header hover/editing) appear in supplied screenshots; the pane title↔editor swap has the required recording; the opaque "title store unavailable" detail in shot-07 is the fixture's stubbed server body, not a string this PR authors. The only residual: the tooltip promises Undo without mentioning the ~8-second window. UX-Verdict: PASS Cold readers named every new control and its outcome, and the visible Undo offer resolved the only hesitation — fear of overwriting a hand-typed name. Suggestions
[UX-REVIEWED] e20bc73 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsNo blocking issues; one advisory finding. FINDING — website/src/pages/chat/SessionTitleControl.tsx:1365 — the regenerate button now renders visible text [OPUS-REVIEWED] e20bc73 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
eefaca1 to
1d15b73
Compare
1d15b73 to
fe193cf
Compare
fe193cf to
0a29053
Compare
0a29053 to
c90cc4d
Compare
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
…pane headers (#9727) Split-view pane headers rendered a bare title span, so a session could not be renamed (Pen / inline editor) or given an LLM title (Sparkles) without leaving split view. The single-session header's inline-edit + regenerate block moves into one shared SessionTitleControl, mounted by both ChatPage and ChatPane, so the two headers cannot drift again. Closes #9727
|
|
|
|
|
|
|
|
|
|
bolichen97
left a comment
There was a problem hiding this comment.
Maintainer review (agent-assisted), pinned to e20bc73.
Re-reviewed all 25 changed files. The earlier double-failure rename blocker is addressed by per-slot generation-guarded recovery with a confirmed local baseline, partial title reconciliation, and regression tests for both requests failing and newer concurrent renames. Independently checked the shared commit handler and regression tests. No blocking findings.
Verification: reviewed source/tests and observed passing CI and PR Readiness on this exact head; no local test rerun or manual UI reproduction. Approval is for this commit only.
Summary
In split view every pane header showed only the session title: the rename (Pen / inline editor) and auto-rename (Sparkles) controls the single-session header offers were missing, so a session could not be renamed without leaving split view. The single-session header's inline-edit + regenerate block now lives in one shared
SessionTitleControl, mounted by bothChatPageandChatPane, so the two headers cannot drift again.Closes #9727
What changed
website/src/pages/chat/SessionTitleControl.tsx(new): the memory-mode glyph, the title (click / Enter → inline editor), the Pen revealed ongroup/headerhover, and the Sparkles button (api.generateTitle→sseSlotTitle, per-slot spinner that keeps the "Auto-title…" label beside it as arole=statuslive region; once the generated title lands, the previous name is offered back inline — an "Undo" button (pages.chatPage.undo_auto_title, 13 catalogs) that TAKES THE AUTO-TITLE BUTTON'S PLACE while the offer stands (so the row never holds more than two actions: rename + one of Auto-title / Undo), visible at rest, not hover-gated, whosearia-label/tooltip name the title it restores; pressing it goes through the normal rename path (optimistic +renameSlot+ recovery). The baseline it restores is the title on screen at the moment the generated one replaces it — not the one at click time — so a rename that landed during the generation (another pane, another client via SSE) is what Undo brings back; what the server itself replaced is only knowable server-side and is Session title writes are last-writer-wins: generate-title can overwrite a concurrent manual rename #10149's conditional write. The offer is one-shot and keyed by slot, and it is a WINDOW rather than a permanent state (it occupies the Auto-title button's place, so a user who wants to re-roll a disliked name must not have to Undo first): it ends when used, after the session-move undo bar's horizon (MOVE_UNDO_MS, 8 s — one undo window across the product, not a second constant; and it runs on that bar's clock, literally: the deadline/hold/remainder logic ishooks/useHeldWindow.ts, extracted fromuseMoveUndoand consumed by both, so the product has one held-window implementation (FP lane ondc1ae57ac); the window is HELD while the pointer is over the row or focus is inside it (tracked apart, either holds — a pointer leaving cannot release a hold keyboard focus still owns; GPT lane ondc1ae57ac) and resumes with its remainder when the hold lifts — the tooltip that persuades the user to press promises the way back, so the window must not run out under a hand still weighing the new name; UX lane on05b6a996e. Re-rolling under a parked pointer is Undo then Auto-title, two clicks), when the user opens the editor, when the title moves on (a remote or SSE rename — and it ENDS then, it is not merely hidden: a title that bounces away and back to the generated string inside the window cannot bring a stale Undo back that would write the pre-generation name over the intervening rename; GPT lane onee8eb9ab0), when the user starts another rename or generate, or when the header re-targets another slot (and a generation completing for a slot the control no longer shows creates no offer). The server also pushes the generated title over the slots stream and that push can land before the POST resolves; when the store already shows the generated title at landing, the baseline falls back to the title at click time so the offer is still made. Requested as a BLOCK by the UX lane onab85844d6— cold readers named the control correctly and still refused to press it for fear of overwriting a hand-typed name with no way back; finding and fix recorded at fix(chat): share the rename/regenerate title control with split-view pane headers (#9727) #10140 (comment)) whose hover-revealed state now carries visible text — Auto-title (pages.chatPage.auto_title, translated in all 13 catalogs) — so the glyph is no longer an unexplained sparkle next to the composer's (requested by this PR's UX review lane on head2b28f0319— "Auto-rename is undiscoverable and unnerving", a blind reader could not decode the icon-only glyph with the tooltip present; finding and fix recorded at fix(chat): share the rename/regenerate title control with split-view pane headers (#9727) #10140 (comment)); the hover-revealed button sits at 70% opacity with muted text (not the 40% the icon-only glyph used: with a text label beside it that read as "disabled" to every cold reader across five UX rounds — the lane's Watch items and their recorded dispositions: a1ffc8fb4, 76b97d3e9, bb6f98937, 7f3636afd, 841f1251b; full opacity on hover). Keyboard parity with hover (UX round onc2bcab101): the Pen reveals when the title has focus-visible (group/titleon the title,group-focus-visible/title:opacity-60on the Pen) and the Auto-title button at full opacity on its own focus-visible, so a Tab through the header never draws a focus ring around nothing; thearia-label/tooltip say "Regenerate title with LLM — the current name can be restored with Undo" (13 catalogs): reversibility is stated at the decision point, not only after the fact — the UX lane's second BLOCK on357079fc3was that readers understood the Undo state once shown and still would not dare the first press. Commit on blur/Enter when the trimmed draft is non-empty and differs →sseSlotTitle(optimistic) +api.renameSlot. A refused rename carries the failure semantics fix: revert refused optimistic title on header rename failure (#10203) #10237 landed for the main header (Header rename failure keeps the refused optimistic title (mirror of #10151) #10203), ported into the shared control so both headers have exactly one (with one addition: a SUPERSEDED attempt's late refusal is not reported — the user has already renamed again, and a late notice would undo the clearing the newer attempt's start performed on the host; the recovery still runs, gated the same way) (the sidebar row rename is a separate spelling, tracked in Sidebar rename failure recovery is a no-op (invalidateQueries on unregistered 'chat-slots' key) #10151): the control re-reads the server truth (deduped throughqueryClient.fetchQuery(['chat-slots']), so overlapping failures share one request) and applies ONLY this slot's title — never the whole snapshot, whose late fulfillment could clobber a newer write of another slot; a recovery applies only while ITS OWN attempt is still the slot's latest generation AND the store still shows its refused value, so a delayed recovery can never overwrite a newer attempt's outcome, including a newer confirmed rename to the identical string; and when the re-read fails too (offline / expired auth takesrenameSlotandchatSlotsdown together) it falls back to a local revert to the per-slot recovery baseline — the last CONFIRMED title, refreshed at commit time from any store title that is not one of this slot's own pending optimistic values. The per-slot record (baseline/inflight/gen) is module-level and keyed by slot, not per instance;inflightis a per-title count rather than a set, so two overlapping attempts at the identical string both stay marked until each settles and neither can be mistaken for a confirmed baseline; andbaselineadvances on a confirmed write only when that confirmation is newer than the last one applied (confirmedGen), not only when the attempt is still the slot's latest — so a rename that succeeds while a later one is in flight is still recorded, and a failure of that later one falls back to it rather than past it to a title the server no longer holds (GPT round on2b28f0319). It is module-level because the main header re-targets one instance across slots and split view mounts one per pane, and the guard is about the slot. The host is notified once, at rename rejection, whichever way the recovery then settles. Escape cancels; IME-safe Enter via the existinguseImeGuard. The editor is mounted per edit, so opening seeds the draft and closing drops it; an untouched editor writes nothing on blur (it compares against the seed it opened with, not the live title, so a generated or remote rename that landed while the editor was open is never overwritten by the stale seed). The editor caps the draft at 200 characters — the rename route keepstitle.strip()[:200](chat_title.py), so without the cap a longer name showed whole in the optimistic write and lost its tail only on the next re-read (GPT lane on05b6a996e; same figure as the task-run rename field inProjectsPage, and JSmaxLengthcounts UTF-16 units against the server's code points, so the client cap is never the looser one). Failures go to the host'sonError(message, lead); the control renders no error surface of its own. Optionalediting/onEditingChangelet a host own the flag;compactswitches to pane typography.ChatPage.tsx: the inline block — including therenameRecoveryRefrecovery fix: revert refused optimistic title on header rename failure (#10203) #10237 added to it — is replaced by<SessionTitleControl editing={editingTitle} onEditingChange=… onError={showActionError} />.editingTitleSlot(the slot-pinned editor flag, also opened from the header menu and used for the z-index lift) stays in ChatPage; the host clears itsactionErrornotice ononAttempt, as ChatPane does, so a retry never sits under a stale rename failure;titleDraft,generatingTitleSlots,cancelTitleRef,titleIme,renameRecoveryRefand the now-unused imports are removed; the fix: revert refused optimistic title on header rename failure (#10203) #10237 recovery is ported into the shared control and then HARDENED there (not verbatim:inflightbecomes a per-title count and aconfirmedGenbaseline rule is added — both described under the SessionTitleControl bullet with the GPT findings that required them, and pinned by the two new fallback tests); main'sChatPage.titleRenamePin.test.tsx(the six Header rename failure keeps the refused optimistic title (mirror of #10151) #10203 cases) is kept unchanged as the pin that every behaviour the header had before still holds — the hardening only changes outcomes in races that pin never exercised (a later attempt failing after an earlier one succeeded). Markup is unchanged apart from the shared hover state: same class strings, same aria-labels/titles, same i18n keys, plus the visible "Auto-title" text label the control now renders next to the Sparkles button on hover (see the screenshots below). One micro-change: the control is mounted only whenactiveSlotis set, so with no active session the header renders no title cluster (previously an empty string plus a hover Pen); the header block itself already lives inside theactiveSlotbranch, so this is not reachable in practice.ChatPane.tsx: the bare title span becomes<SessionTitleControl compact />; the pane bar gainsgroup/headeras the hover target; a new inlineErrorNotice(chat-pane-title-error) reports a failed rename/regenerate in the pane whose control failed, and is cleared the moment a new rename/regenerate starts on that pane (onAttempt), so a stale "Couldn't rename" never sits beside the spinner of the attempt superseding it (UX round on7f3636afd, reader shot-08). Members-page DM threads renderframeless(host owns the header) and are untouched.pages.chatPage.auto_title("Auto-title"), added to all 13 catalogs (en-XA regenerated withgen-pseudolocale.mjs); everything else reuses the existingpages.chatPage.*keys.sessionTitleSqueeze.test.ts(source-contract test for the phone-width title shrink) now reads ChatPage + the shared control, since the title cluster moved.website/src/hooks/useHeldWindow.ts(new) +useMoveUndo.ts: the held countdown (deadline, hold, remainder) thatuseMoveUndoran inline is now a hook of its own, consumed byuseMoveUndo(hold keyed to the offer id, as before) and bySessionTitleControl(hold = pointer over the row or focus inside it). Behaviour of the session-move bar is unchanged and its hold/resume test (ChatSidebar.moveUndo.test.tsx) still passes; the one addition, needed by the header, is that a fresh offer arriving under a standing hold holds a FULL window rather than a remainder read off the previous offer's deadline.docs/feature-map/README.md: the Session title row (not the Sessions row — GPT lane on357079fc3) now ownspages/chat/SessionTitleControl.tsx, names its two hosts (ChatPage.tsx,ChatPane.tsx) and the sidebar row's own rename, and its Reach column covers hover → Auto-title in the single-session header and every split-view pane header, plus the Undo window.SessionTitleControl.test.tsx(23: render, click→editor→Enter commits viarenameSlot+ optimistic store, unchanged/blank draft is a no-op, an untouched editor writes nothing even after the title moved on while open, Escape restores without API, Sparkles→generateTitleapplies title, spinner while generating, rename refused + re-read succeeds →onError+ the server title replaces the optimistic one, rename refused + re-read fails → local revert to the confirmed title, exactly oneonError(the fix: refetch slots when a sidebar rename is refused (#10151) #10172 / Header rename failure keeps the refused optimistic title (mirror of #10151) #10203 double failure), a slow OLDER rename failing after a NEWER rename landed leaves the newer title and reports nothing, a delayed recovery never overwrites a newer confirmed rename to the identical string (generation guard), a later failed rename falls back to the last CONFIRMED write, never past it (A→X succeeds while X→Y is in flight; Y and its re-read fail → X), generate failure→onError+ title unchanged, memory glyph, the editor opens with the whole title selected, backward-anchored, scrolled to the start, a one-shot Undo after a generated title lands restores the previous name through the rename path and stands in the Auto-title button's place, the Undo offer ends when the title moves on or another attempt starts, the Undo baseline is the title on screen when the generated one lands, not the one at click time, retargeting the control ends the offer and a late completion for the old slot creates none, Undo is offered even when the slots stream pushed the generated title before the POST resolved, the offer is a window: closes on its own and when the editor is opened, no Undo when the generated title equals the current one, keyboard focus reveals what hover reveals) andChatPane.headerRename.test.tsx(8: header renders the control insidegroup/header, rename viarenameSlot(slotKey, …), Escape,generateTitle(slotKey), failed rename re-pulls the server title + showschat-pane-title-error, rename and re-read both fail → the pane reverts locally and the notice stays visible, failed regenerate shows the notice and leaves the title, a new attempt clears the previous failure notice).ChatPage.titleRenamePin.test.tsxfrom main (12, incl. the six Header rename failure keeps the refused optimistic title (mirror of #10151) #10203 recovery cases) runs unchanged against the shared control, plus one added: 'a new rename attempt clears the previous rename failure from the header notice'.website/scripts/capture-pane-header-autotitle.mjs: fixture harness (real built SPA + stubbed/api/**through the sharedscripts/lib/split-pane-fixture.mjsstubSplitPaneswiring, with only themc-langseed and the rename/generate intercepts local; two-pane split viamc-split-layouts, no pod) that produces the hover frames (asserting the hovered pane's regenerate button is visible and carries the catalog text while the pane at rest does not; en and zh-CN) and the rename story on the current control: editing on a long title (asserts whole-title selection andscrollLeft === 0), the refused rename (PATCH …/title→ 500; asserts the notice and the rolled-back title) the heldgenerate-titlespinner (asserts the label beside it), the undo offer after the generated title lands (asserts it is fully visible at rest, presses it, asserts the previous title is restored and the offer gone), and the two single-session-header frames (hover, editing; asserts exactly one hover group and the selected-at-start editor). The rest and renamed frames and the recording are from the pod harness.gh pr edit --attach(permanentuser-attachmentsURLs, per chore: upload PR evidence with gh --attach instead of committing it #10010) and is NOT in the diff;temp-screenshots/stays gitignored and is only where the harness writes locally.website/scripts/capture-pane-header-rename.mjs: pod evidence harness against a REAL gateway (2×2 grid; drives and asserts hover, edit, commit, a route-forced 500 on the rename for the rollback, and a held regenerate response for the spinner; shoots only the frames a pod is needed for — the 2×2 rest frame, the committed rename against the real store, and the click → edit → Enter recording; the four states the fixture harness renders are asserted here but not re-shot, one source per frame).What was tested
e20bc7346(rebased onto currentmainat f739452 — past fix: revert refused optimistic title on header rename failure (#10203) #10237, fix(chat): keep shell controls reachable and show focus in split view #10585, the feat: unify panel controls and add workspace fullscreen #10119 revert in revert: unify panel controls and add workspace fullscreen (#10119) #10626 and fix(sidebar): show the crew's own refusal when a peer-session adopt fails #10735, whoseslotIsRemoteBoundimport in ChatPage.tsx was the only conflict; select-all-on-open added on top):npx tsc -bclean;eslintclean on every touched file;I18N_BASE_REF=origin/main node scripts/i18n-check.mjsok;FEATURE_MAP_BASE_REF=origin/main python3 scripts/check_feature_map.py✓.SessionTitleControl.test.tsx(25 — the 14 from the previous round plus 'caps the draft at the 200 characters the rename route keeps', 'the Undo window is held open while the pointer is over the row or focus is inside it, and resumes where it stopped' and 'opens with the whole title selected, so a long name shows its start rather than a scrolled tail', pinning the select-all-on-open the UX round on15c5cbc04asked for; it changes the editing default on BOTH hosts, the main header included, since the editor is shared) +ChatPane.headerRename.test.tsx(8, incl. 'a new attempt clears the previous failure notice') +ChatPage.titleRenamePin.test.tsxfrom main (12, incl. the six Header rename failure keeps the refused optimistic title (mirror of #10151) #10203 recovery cases, + 1 added) +sessionTitleSqueeze+ the wholesrc/i18nsuite (catalog parity, glossary, dead keys…) — 721 green in the last run; everyChatPane.*test file green on main's currentdata-pane-title-rowheader (1001 across the targeted set in the last run). The five session-move undo suites that exerciseuseMoveUndothrough the extracted clock (ChatSidebar.moveUndo,ChatSidebar.moveUndoStale,ChatSidebar.folderMoveUndo,ArtifactsPage.moveUndo,MoveUndoBar) — 97 green together with the three title suites. Full suite left to CI.kirocrew pod upon this worktree,session_gridon, four sessions in a 2×2 grid): every pane header carries the Sparkles button, hover reveals Pen + Sparkles, click opens the seeded editor, Enter renames — the new title appeared in the pane and landed in the pod's session file server-side. A second rename with the PATCH forced to 500 re-pulled the server title and showed the in-pane notice; Sparkles with the response held showed the per-pane spinner and applied the title on release. The pod frames below were captured onc90cc4dd4; the twopane-header-autotitle-*frames were captured on this head with the fixture harness (the pod's user systemd bus is not reachable from the agent sandbox after a gateway restart), and they are the frames that show the new label.UX CONCERNS
flex-1spacer — the same left/right structure the single-session header already has. If the lane reads the whole bar as one row, the answer is that the cap is per visual group and the title group is the established header pattern being ported, not a new row.opacity-0until the bar is hovered, exactly as in the main header. Reviewers may want a persistent low-opacity state under(hover: none); that would be a change to the main header too, so it is left for a follow-up rather than diverging the two.flex-1 min-w-0) as in the main header; in a quarter-width pane a long title can still scroll while typing (see the editing frame). What did change (requested by this PR's UX review lane on head15c5cbc04, reader shot-03: a tail-scrolled editor read as "part of the name is already deleted" — finding and fix recorded at fix(chat): share the rename/regenerate title control with split-view pane headers (#9727) #10140 (comment)): the editor opens with the whole title selected, anchored BACKWARD (setSelectionRange(0, len, 'backward')+scrollLeft = 0): a plainselect()keeps the selection focus at the end and Chromium still scrolls to the tail, which the first fixture capture showed; with the focus at the start the input scrolls to 0 and the START of a long title is what shows. Retype / append-after-End stay one keystroke each. Routed through the IME guard's focus handler, which owns the input'sonFocus; pinned by a newSessionTitleControltest (selection range, direction andscrollLeft) and by the fixture harness'sscrollLeft === 0assertion before the editing frame.pane-header-rename.webmbelow records click → edit → Enter in one pane. Playwright's bundled ffmpeg has no GIF encoder on this host, so the clip is WebM (the harness writes a GIF beside it when a system ffmpeg is present).Pattern harvest
Rule candidate: source-contract test. Pattern: two hosts render the same UI concept (here the session title) from separately hand-written JSX — the pane header was a copy that never received the affordances added to the original. A shared component is the fix; a pin that fails when a second
title-rendering header appears outside the shared control would catch the next copy. Not generalizable as a lint rule: "same concept, two renderers" is a review judgment, not a syntactic shape.Screenshots
2×2 split at rest (controls hidden, titles only):
Hover on the left pane's bar — Pen, Sparkles and the Auto-title label revealed beside the title (fixture harness, current control; the right pane stays at rest):
Hover with the visible Auto-title label (fixture harness, two-pane split; left pane hovered, right at rest) — en and zh-CN:
Title clicked — inline editor open in that pane on a LONG title: the whole title is selected and the input is scrolled to its START (
scrollLeft 0, asserted by the harness), so the beginning of the name is what shows:Enter committed (server accepted the PATCH) — the pane shows the new title at rest, controls hidden (fixture harness, current control; replaces the pre-label pod capture the UX lane flagged on
dc1ae57ac):Server refused the rename (
PATCH …/titleanswered 500): title rolled back to the previous name in the header, in-pane error notice above the composer:Auto-title pressed,
generate-titleresponse held: the pane's Auto-title button becomes a spinner that keeps the label ("Auto-title…",role=status), so busy-naming is named rather than an anonymous glyph (UX round ond2bdd0b85, reader shot-08):Generated title landed — the previous name is offered back inline in the Auto-title button's place, visible at rest; the harness then presses it and asserts the previous title is restored and the offer gone:
The SAME control on the single-session header (ChatPage, non-compact host; fixture harness, no split layout): hover reveals Pen + Sparkles + Auto-title, and the editor opens on a long title selected from its start:
Recording — click → inline editor → Enter in one pane: pane-header-rename.webm