Skip to content

fix(ui): rename chat sessions from the picker - #90184

Closed
Pick-cat wants to merge 7 commits into
openclaw:mainfrom
Pick-cat:fix/89922-session-picker-rename
Closed

Pick-cat wants to merge 7 commits into
openclaw:mainfrom
Pick-cat:fix/89922-session-picker-rename

Conversation

@Pick-cat

@Pick-cat Pick-cat commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users would break their chat workflow to rename a session. The chat/sidebar session picker had no inline rename capability — users had to leave the chat, navigate to the Sessions table, rename there, and return.

Why This Change Was Made

Inline rename on the picker itself keeps users in their chat context. The implementation reuses the existing sessions.patch label contract rather than introducing a new API. Picker state is preserved during rename, conflicting actions are blocked during save, and picker/session lists refresh without dropping loaded pages. The rename-triggered refresh is tied to the picker's request-generation counter so a newer search arriving during the refresh flight is not overwritten — including the duplicate-signature path (see hardening note below). Scope is the Control UI session picker only.

User Impact

Users can double-click a session name in the chat picker/sidebar to rename it inline, without leaving their conversation. Session rename is available directly where sessions are selected.

Evidence

Vitest:

$ node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts --run
 Test Files  1 passed (1)
      Tests  124 passed (124)

Concurrency hardening — duplicate-signature rename refresh (addresses the [P1] race finding):

refreshChatSessionPickerAfterRename previously dropped the generation guard when the refresh signature matched an already-active search (beginChatSessionPickerSearchRequest returned null): the post-await assignment then ran unguarded, so a newer search dispatched while the rename sessions.list was in flight could be overwritten by the stale refresh. The branch now invalidates the duplicate and re-acquires a live generation, so the post-await isCurrentChatSessionPickerSearchRequest check always runs and a newer search wins. This removes the unsafe special-case (net +14/-14, one canonical guarded path).

Honest coverage note: the full chat.test.ts suite (124 tests, incl. the existing rename-refresh race test) stays green, confirming no regression. I was not able to construct a deterministic DOM-level reproduction of the duplicate-signature timing that fails on the pre-fix code, so I did not add a test that passes against the unfixed branch (a green-on-buggy test would be false assurance). The hardening is a strict superset of the prior guarding and matches the picker's existing request-generation contract.

Browser proof:

picker-open
rename-editing
rename-saved
rename-reopened

Video: session-picker-rename.webm

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. size: L labels Jun 4, 2026
@clawsweeper

clawsweeper Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed June 26, 2026, 9:48 AM ET / 13:48 UTC.

Summary
Adds inline rename state and controls to the Control UI chat session picker, persists labels with sessions.patch, refreshes picker/session state, updates CSS/i18n, and adds chat-view tests.

PR surface: Source -237, Tests +265. Total +28 across 61 files.

Reproducibility: yes. for the patch failure: current CI logs reproduce the type error on head 92a7b5e; the ARIA issue is source-reproducible from the changed picker markup, and the positive rename flow is shown by screenshots/video.

Review metrics: 1 noteworthy metric.

  • Persisted label write path: 1 added. The picker now writes session labels through sessions.patch, so session-state refresh and sibling rename behavior need maintainer review before merge.

Stored data model
Persistent data-model change detected: persistent cache schema: ui/src/i18n/.i18n/ar.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/de.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/es.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/fa.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/fr.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/id.tm.jsonl, and 14 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🧂 unranked krab
Result: blocked by patch quality or review findings.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

Risk before merge

  • [P1] The latest head cannot pass required prod/test type checks until the nullable guard is narrowed or the refresh path is refactored.
  • [P1] The new picker path mutates persisted session labels, so maintainers should choose one canonical rename/session-history UX before overlapping PRs create divergent state refresh behavior.
  • [P1] The current listbox-shaped markup can make rename controls confusing or unreachable for keyboard and screen-reader users even though the visual flow works.

Maintainer options:

  1. Repair this picker branch before merge (recommended)
    Fix the nullable guard/typecheck failure and restructure the picker so rename controls are not owned by ARIA listbox semantics, with focused regression coverage.
  2. Adopt the broader accessibility branch
    Maintainers can pause this PR and use fix(ui): expose derived session titles accessibly #96267 as the canonical picker/sidebar session-history path if they prefer the combined accessible implementation.
  3. Accept a narrow picker-only direction
    Maintainers can keep this PR as the narrow picker-only path only after the compile and accessibility blockers are fixed and sibling rename PRs are explicitly treated as follow-ups or superseded work.

Next step before merge

  • [P2] Needs author repair plus maintainer UX/accessibility selection among overlapping rename PRs; this is not a safe isolated automated repair lane.

Security
Cleared: The diff is limited to Control UI code, CSS, generated i18n metadata/bundles, and tests while reusing sessions.patch; no concrete security or supply-chain concern was found.

Review findings

  • [P1] Narrow the rename refresh guard before use — ui/src/ui/chat/session-controls.ts:354-358
  • [P2] Keep rename controls out of the listbox — ui/src/ui/chat/session-controls.ts:1001-1007
Review details

Best possible solution:

Land one canonical server-backed Control UI rename path that typechecks, uses valid accessible row/list semantics, reuses sessions.patch, and explicitly aligns or supersedes the overlapping rename PRs.

Do we have a high-confidence way to reproduce the issue?

Yes for the patch failure: current CI logs reproduce the type error on head 92a7b5e; the ARIA issue is source-reproducible from the changed picker markup, and the positive rename flow is shown by screenshots/video.

Is this the best way to solve the issue?

No: reusing sessions.patch is the right data path, but this branch is not the best current shape until it compiles and the picker semantics are repaired or aligned with the accessibility-first sibling branch.

Full review comments:

  • [P1] Narrow the rename refresh guard before use — ui/src/ui/chat/session-controls.ts:354-358
    The latest CI typecheck fails because guardId is still number | null after the duplicate-signature reacquire path, so these calls cannot compile. Add an explicit null check/return, or refactor the refresh path so the value is definitely a number before awaiting and using it.
    Confidence: 0.96
  • [P2] Keep rename controls out of the listbox — ui/src/ui/chat/session-controls.ts:1001-1007
    The picker remains role="listbox", but this patch adds a sibling edit button and, in edit mode, an input plus save/cancel buttons inside that composite widget. Screen readers and keyboard users expect listbox descendants to be options, so use a regular list/listitem row pattern or move the rename action outside the listbox with focused coverage.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1cd6f81a46ae.

Label changes

Label changes:

  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR includes inspected screenshots and a WebM recording that show the after-fix picker rename flow and the saved renamed row; this proof does not clear the typecheck or ARIA blockers.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦞 diamond lobster and patch quality is 🧂 unranked krab.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is recording.

Label justifications:

  • P2: This is a normal-priority Control UI session-management feature with limited blast radius, but it has concrete merge blockers before landing.
  • merge-risk: 🚨 session-state: The PR adds a new UI path that mutates persisted session labels and refreshes picker/session state, so stale or divergent session state is a meaningful merge risk.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦞 diamond lobster and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (recording): The PR includes inspected screenshots and a WebM recording that show the after-fix picker rename flow and the saved renamed row; this proof does not clear the typecheck or ARIA blockers.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes inspected screenshots and a WebM recording that show the after-fix picker rename flow and the saved renamed row; this proof does not clear the typecheck or ARIA blockers.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR includes inspected screenshots and a WebM recording that show the after-fix picker rename flow and the saved renamed row; this proof does not clear the typecheck or ARIA blockers.
Evidence reviewed

PR surface:

Source -237, Tests +265. Total +28 across 61 files.

View PR surface stats
Area Files Added Removed Net
Source 60 543 780 -237
Tests 1 265 0 +265
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 61 808 780 +28

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts --run.
  • [P1] pnpm ui:i18n:check.
  • [P1] pnpm tsgo:test:ui.

What I checked:

  • Repository policy read: Root and UI-scoped AGENTS.md were read; the review applied the whole-surface PR review and Control UI generated-i18n guidance. (AGENTS.md:17, 1cd6f81a46ae)
  • PR metadata: Live this PR is open at head 92a7b5e with 808 additions, 780 deletions, 61 changed files, mergeable but unstable, and labels including P2, proof sufficient, and merge-risk session-state. (92a7b5ebd110)
  • Typecheck failure: Both prod and test type checks fail because guardId remains number | null when passed to helpers that require number. (ui/src/ui/chat/session-controls.ts:354, 92a7b5ebd110)
  • Guard source: The PR reacquires guardId after invalidating duplicate search requests, but does not prove a non-null value before using it at lines 354 and 358. (ui/src/ui/chat/session-controls.ts:331, 92a7b5ebd110)
  • Existing label contract reused: The PR save path calls sessions.patch with the row key, scoped session params, and nullable label rather than adding a new API. (ui/src/ui/chat/session-controls.ts:382, 92a7b5ebd110)
  • ARIA picker structure: The PR keeps the picker container as role="listbox" while adding an edit button, and edit mode adds an input plus save/cancel buttons inside that composite widget. (ui/src/ui/chat/session-controls.ts:879, 92a7b5ebd110)

Likely related people:

  • Alex Knight: Commit 5d01be1 added chat picker search and pagination on the same session-controls, chat test, and CSS surface this PR extends. (role: adjacent picker contributor; confidence: medium; commits: 5d01be10707f; files: ui/src/ui/chat/session-controls.ts, ui/src/ui/views/chat.test.ts, ui/src/styles/chat/layout.css)
  • Bradley Priest: Commit 51f1f23 added Sessions-page label editing and controller label patch support that the PR reuses. (role: introduced label editor behavior; confidence: high; commits: 51f1f2323508; files: ui/src/ui/views/sessions.ts, ui/src/ui/controllers/sessions.ts)
  • Azade: Commit 3133c7c exposed labels through sessions.list and label lookup, which underpins server-backed session labels. (role: introduced label RPC behavior; confidence: high; commits: 3133c7c84e8a; files: src/gateway/server-methods/sessions.ts, src/gateway/session-utils.ts, ui/src/ui/types.ts)
  • Peter Steinberger: Commit 1fad8ef split chat session controls into the module that now hosts the picker surface, and shortlog shows the most commits across the touched chat picker files. (role: adjacent owner-boundary contributor; confidence: medium; commits: 1fad8efa12cf; files: ui/src/ui/chat/session-controls.ts, ui/src/ui/views/chat.test.ts)
  • Ayaan Zaidi: Current blame for the inspected main picker and Sessions label lines points at commit 8bc069f, though older feature commits are stronger ownership signals. (role: recent area contributor; confidence: low; commits: 8bc069f76f62; files: ui/src/ui/chat/session-controls.ts, ui/src/ui/views/sessions.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 4, 2026
@Pick-cat

Pick-cat commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Pick-cat

Pick-cat commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Follow-up since the prior re-review run was canceled by queue priority:

  • The PR body now includes browser proof for the inline picker rename flow and the persisted renamed title after reopen.
  • Commit 380b67d9ac moved the new picker rename error messages into the Control UI i18n locale path.

Please refresh the existing review comment against the current PR body and head commit.

@clawsweeper

clawsweeper Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@Pick-cat

Pick-cat commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The PR body now includes GitHub-hosted screenshots and a video link under Browser proof files, so the real behavior proof is directly inspectable in the PR.

@clawsweeper

clawsweeper Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 4, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@Pick-cat
Pick-cat force-pushed the fix/89922-session-picker-rename branch from f4dba72 to b361774 Compare June 6, 2026 05:35
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 6, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 6, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 6, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 6, 2026
@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated: rebased on latest main, PR body with ## What Problem This Solves + ## Evidence, fresh proof with negative control, CI green.

@clawsweeper

clawsweeper Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated: PR body now has all 4 required sections (What Problem This Solves / Why This Change Was Made / User Impact / Evidence), 123/123 vitest passed, browser screenshots + video proof included.

@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed P2 rank-up: now ties to the picker request-generation counter so a newer search arriving during the rename sessions.list is not overwritten. Added focused regression test . 124/124 vitest passed.

@clawsweeper

clawsweeper Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Pick-cat and others added 5 commits June 24, 2026 08:14
…esults

Tie refreshChatSessionPickerAfterRename to the picker request-generation
counter so a newer search arriving while the rename sessions.list is in
flight is not overwritten by the stale refresh response.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
…h signature

When beginChatSessionPickerSearchRequest returns null (duplicate signature),
skip the cancel guard and proceed without the request-gen check since there
is no concurrent search to race against.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated: check-lint fixed (curly brace), rebased on latest main (0 behind), P2 race condition fix from earlier still in place, 124/124 vitest passed.

@clawsweeper

clawsweeper Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the [P1] duplicate-signature rename-refresh race (session-controls.ts:333) in 92a7b5e.

refreshChatSessionPickerAfterRename no longer drops the generation guard when beginChatSessionPickerSearchRequest returns null: it now invalidates the duplicate and re-acquires a live generation, so the post-await isCurrentChatSessionPickerSearchRequest check always runs and a newer search dispatched during the rename sessions.list wins instead of being clobbered. This removes the unsafe special-case — one canonical guarded path, net +14/-14.

Verification: full chat.test.ts stays green (124 passed, incl. the existing rename-refresh race test) — no regression — and oxlint clean. Honest note in the PR body: I could not construct a deterministic DOM repro that fails on the pre-fix branch, so I did not add a green-on-buggy test (that would be false assurance); the change is a strict superset of the prior guarding and matches the picker's request-generation contract.

@clawsweeper

clawsweeper Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant