Repository navigation
fix(chat): share a slot's Auto-title state across panes - #25601
Conversation
9038a97 to
c22462b
Compare
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the blind reader took both panes' spinners as one naming job. The narrow-pane fix is shown, and nothing else on screen changes. Notes
[UX-REVIEWED] b187942 Description read[DESCRIPTION-READ] 98396e806f55791062eba6e7e56e87a11ebf3a9edd7bfea27807e89fbd7ddb2b That sha256 names everything this verdict read: the PR description, plus the 7 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 Nothing blocks. The header now uses the existing per-slot store, which fixes the double model call where it starts. The only extra is a screenshot script that nothing imports. Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: pressing Auto-title on a slot open in several panes runs one generation, and every pane shows its spinner. It is a FIX (#10502).
[FIRST-PRINCIPLES-REVIEWED] b187942 Description read[DESCRIPTION-READ] 5d4fa407a57596d9e627274717d04f103ff1f83b19469f0c765e8f02e81ed662 That sha256 names the PR description this verdict read. Recompute it with |
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: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the header now claims a generation through the per-slot store the menus already use, so there is one generation per slot. The narrow-pane hiding is limited to compact mode and is reversible. Notes
[DESIGN-REVIEWED] b187942 Description read[DESCRIPTION-READ] a456a98708482af45c8ae359763d032a2ccb5260bfa99bdc40cfd1b6738f701d 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 |
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: |
c22462b to
13072da
Compare
13072da to
c869c3b
Compare
With one slot open in two panes, each SessionTitleControl kept its own generating set, so the second pane's Auto-title press fired a second generateTitle for the same slot (two LLM calls, last writer wins). The set now lives at module level, like renameRecovery, read through useSyncExternalStore, so the press is a no-op and every pane shows the spinner. In a split pane narrower than 20rem the Pen and the Auto-title button hide (the pane's title row is now a size container), so the title stays readable; tapping it still renames, and Auto-title is offered in wider panes. The hover-none persistent state the issue asked for is already on main, and a rename cannot be truncated by the server because the editor already caps at its 200 characters. Fixes #10502
c869c3b to
b187942
Compare
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: the pane header's Auto-title button now uses the shared per-slot generation claim, so two panes on one slot send one request and both show the spinner; a narrow pane hides the button. Tests and a capture script added.
Problem / Motivation
Goal: the session title control's Auto-title behaves as one control per slot, however many panes show that slot.
Follow-ups from the review of #10140 (shared
SessionTitleControlin split-pane headers):generatingSlotslives in component state. With one slot open in two panes, theif (generating) returnguard does not hold across panes: pressing Auto-title in the second pane fires a secondapi.generateTitlefor the same slot (two LLM calls, last writer wins), and only the pressed pane shows the spinner.Why it matters
Item 1 spends two model calls for one press and lets the slower one overwrite the faster. Item 2 makes the pane's own controls hard to read and hit.
Not a goal
(hover: none)item: it is already on main ([@media(hover:none)]:opacity-70on the Auto-title button,website/src/pages/chat/SessionTitleControl.tsx:476), so nothing changes there.maxLength={TITLE_MAX_LENGTH},SessionTitleControl.tsx:70-76, commented "the client cap is never looser than the server's"), and the server only does.strip()[:200](chat_title.py:1937), so a confirmed rename is already the server's title.Intended? / Repro
Intended? No. The code comment above
generatingSlotssays the spinner "must follow the slot that is generating", and the Design Review ona36553478asked for this.Repro (on current main):
website/src/pages/chat/SessionTitleControl.tsx:120:const [generatingSlots, setGeneratingSlots] = useState<Set<string>>(new Set()), per instance.generate-titlePOSTs. On this branch → 1.What changed (motivation → approach → change)
claimSlotTitleGenerationinwebsite/src/hooks/slotTitleGeneration.ts, the per-slot in-flight set the sidebar row and phone menu "Regenerate title" already use, and reads the spinner throughuseSlotTitleGenerating. One slot open in two panes, or in a pane and a menu, starts one generation, and every control showing the slot shows the spinner. The header keeps its own.thenfor Undo.ChatPane's title row is a named size container (@container/panehead). In compact mode, below 20rem of that row the Pen and the Auto-title button hide (@max-[20rem]/panehead:hidden), so the title keeps the space and stays readable. Tapping the title still opens the rename editor; Auto-title is offered in a wider pane. Hiding only the label left a title cut to one letter beside two bare glyphs. Tailwind 4 has container queries built in, so no plugin is added.website/scripts/capture-pane-title-shared-generating.mjs: the capture harness behind the screenshots.Screenshots
Real SPA builds (main and this branch) against stubbed
/api(Playwright,capture-pane-title-shared-generating.mjs).Same slot in both panes, Auto-title pressed in each, generate POST held. Before (main): both panes spin because both buttons were pressed, and the harness counted 2 generate POSTs.
After: the second press is a no-op, both panes spin, 1 generate POST.
Narrow pane, hovered. Before: the "Regenerate title" label overlaps the pane's buttons.
After: the Pen and the Auto-title button hide, and the title stays readable.
Backwards compatibility
Compatible. Wide panes and the main header look as before.
Removes nothing: no key, field or error path is removed.
Tests
website/src/test/SessionTitleControl.test.tsx:one slot open in two panes generates once, and both panes show the spinner: fails on main (the second pane keeps its button).Proof: not provable -- other: this host runs no local tests; CI runs them
Manual verification
Capture harness run against both builds (screenshots above); with
EXPECT_FIXED=1it asserts 2 spinners and 1 POST, and that the narrow pane shows neither the label nor the button. Static gates run locally: eslint,tsc --noEmit.Related Issues
Fixes #10502
Sibling sweep
Swept: git grep -n "generateTitle|setGeneratingSlots" -- website/src
Sibling: website/src/pages/chat/SessionTitleControl.tsx -- changed here (the shared control both hosts use)
Sibling: website/src/hooks/slotTitleGeneration.ts -- changed here (the menus' per-slot store the header now claims through)
Sibling: website/src/pages/chat/page/MobileTopBar.tsx -- not affected (already starts generations through the shared per-slot store)
Pattern harvest
Not generalizable: the header's per-instance flag moves onto the per-slot store its menu siblings already share.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.