Skip to content

feat(control-ui): rename sessions from the sidebar via the server label patch (#90655) - #90833

Closed
lonexreb wants to merge 1 commit into
openclaw:mainfrom
lonexreb:feat/90655-rename-sessions-control-ui
Closed

lonexreb wants to merge 1 commit into
openclaw:mainfrom
lonexreb:feat/90655-rename-sessions-control-ui

Conversation

@lonexreb

@lonexreb lonexreb commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds an inline rename affordance to the Control UI sidebar session rows so a
session can be relabeled without opening the Sessions page (issue #90655).

What changed since the first revision

The first revision stored renames in a browser-only localStorage map, which the
review correctly flagged as a second source of truth: sidebar labels could
disagree with the Sessions page, other browsers, and the gateway.

This revision routes renames through the existing sessions.patch label path
(patchSession(state, key, { label })), the same path the Sessions-page editor
and the thinking/fast toggles already use. The label is persisted server-side and
the session list refresh re-renders the row from the server label — the single
source of truth. The localStorage store is gone entirely.

Also addressed from the review:

  • Button not nested in the link: the rename <button> is now a sibling of the
    session <a>, not a child (a button inside an anchor is invalid markup and
    ambiguous for keyboard/screen-reader users). The row is a position: relative
    wrapper; the button overlays the right edge and is revealed on hover/focus.
  • Escape vs blur race: Escape cancels the edit and a guard prevents the
    trailing blur from re-committing the canceled draft.
  • Localized copy: the "Rename session" label uses sessionsView.rename, and
    the i18n locale bundles + .i18n metadata are regenerated.
  • Empty input clears the custom label (patch label: null).

Verification

  • node scripts/run-vitest.mjs ui/src/ui/app-render.assistant-avatar.test.ts →
    17 passed, including new cases: rename commits via sessions.patch with the
    label; the rename control is not nested inside the <a>; Escape-then-blur
    cancels without patching.
  • node --import tsx scripts/control-ui-i18n.ts check → all locales clean.
  • pnpm tsgo:test:ui → clean. oxfmt --check / oxlint clean on changed files.
  • Rebased onto current main (re-implemented on top of it).

Real behavior proof

  • Behavior addressed: sidebar rename persists server-side via sessions.patch
    and re-renders from the server label; no client-only override.
  • Real environment tested: local Vitest (jsdom app-render suite) + i18n gate +
    UI typecheck.
  • Exact steps or command run after this patch: the commands above.
  • Evidence after fix: 17/17 app-render tests pass; the rename test asserts the
    sessions.patch RPC is called with { key, label }.
  • Observed result after fix: renaming a sidebar session issues sessions.patch
    and the row reflects the new server label after refresh.
  • What was not tested: a browser screenshot/recording of the hover affordance
    and inline editor styling (logic and markup are covered by the jsdom tests; a
    maintainer can request Mantis visual proof before merge).

Closes #90655

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 6, 2026
@clawsweeper

clawsweeper Bot commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 30, 2026, 1:10 PM ET / 17:10 UTC.

Summary
This PR adds inline Control UI sidebar recent-session rename controls backed by patchSession/sessions.patch, plus CSS, i18n output, and jsdom tests.

PR surface: Source +213, Tests +79. Total +292 across 40 files.

Reproducibility: not applicable. as a bug reproduction; this is a feature PR for a new Control UI sidebar rename affordance. Source inspection confirms current main has server-backed label editing elsewhere but no sidebar recent-session rename control.

Review metrics: 2 noteworthy metrics.

  • Session label cap: 120 introduced vs 512 existing. The new sidebar writer would impose a shorter persisted-label limit than the gateway protocol and existing Sessions page.
  • Persisted label write path: 1 added. The sidebar gains a new server-backed sessions.patch label mutation path, so state and upgrade behavior need review before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #90655
Summary: This PR is the direct implementation candidate for the focused Control UI sidebar rename request, with several broader or adjacent session-rename PRs overlapping but not yet merged as canonical replacements.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • [P1] Add redacted browser proof or live output for hover/open edit, Enter save, Escape cancel, blur save, and refreshed server-label persistence.
  • Align the sidebar label limit with the existing 512-character session-label contract and keep the clickable link selector stable.
  • Resolve the merge conflict and either narrow this PR or coordinate with the broader accessible session-history PR.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body only provides jsdom/unit, i18n, and typecheck output; it still needs redacted browser proof or live output showing the sidebar rename flow after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Proof path suggestion
A short browser proof would materially verify the visible sidebar hover/edit/save/cancel flow and server-label persistence. Mantis is currently scoped to Telegram, Discord, and web UI chat proof, so it is not the right proof path for this surface.
Use maintainer screenshot/manual proof, browser or Playwright proof, Crabbox where appropriate, or normal local artifact proof instead.

Risk before merge

  • [P1] Contributor proof is still jsdom/unit, i18n, and typecheck output rather than redacted browser proof for the visible sidebar rename flow.
  • [P1] GitHub reports the branch as dirty/conflicting, so the conflict-resolution result needs a fresh review before merge.
  • [P1] The new sidebar write path can silently shorten a valid persisted session label from the established 512-character contract to 120 characters.
  • [P1] Several open PRs target adjacent session rename surfaces, especially fix(ui): expose derived session titles accessibly #96267 and feat(ui): inline rename in the in-chat session picker #88479, so maintainers should avoid landing divergent UX or state-handling paths.

Maintainer options:

  1. Align contracts and prove the sidebar flow (recommended)
    Update the sidebar editor to use the established label contract, keep the clickable anchor selector stable, add row-specific accessible labels, resolve conflicts, and add redacted browser proof before merge.
  2. Adopt the broader accessible history PR
    If maintainers prefer fix(ui): expose derived session titles accessibly #96267 as the canonical UX, pause or close this branch after preserving any useful inline-edit tests or interaction details.
  3. Choose a shorter label policy deliberately
    Maintainers could intentionally choose a shorter label policy, but it should be aligned across protocol, Sessions page, sidebar UX, tests, and upgrade expectations before merge.

Next step before merge

  • [P1] Manual review is needed because the external PR lacks real browser proof, is merge-conflicting, overlaps a broader proof-positive rename PR, and still needs product/UX selection plus code fixes.

Security
Cleared: No dependency, workflow, secret, permission, package, lockfile, or third-party code-execution change was found in the PR surface.

Review findings

  • [P1] Use the existing session label limit — ui/src/ui/app-render.ts:626
  • [P2] Keep data-session-key on the clickable link — ui/src/ui/app-render.ts:704
  • [P2] Include the session name in the rename button label — ui/src/ui/app-render.ts:748-749
Review details

Best possible solution:

Land one canonical server-backed Control UI rename flow that preserves the 512-character label contract, keeps stable selectors and row-specific accessible labels, resolves conflicts, and includes real browser proof.

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

Not applicable as a bug reproduction; this is a feature PR for a new Control UI sidebar rename affordance. Source inspection confirms current main has server-backed label editing elsewhere but no sidebar recent-session rename control.

Is this the best way to solve the issue?

No, not yet: reusing patchSession is the right persistence path, but the implementation should preserve the label contract, selector stability, accessible names, and real browser proof before merge.

Full review comments:

  • [P1] Use the existing session label limit — ui/src/ui/app-render.ts:626
    The sidebar editor hard-caps and slices labels at 120 characters, but SessionLabelString and the existing Sessions-page editor allow the established 512-character contract. Editing a valid longer label through this new path can silently shorten persisted session state, so the sidebar should use the same contract.
    Confidence: 0.94
  • [P2] Keep data-session-key on the clickable link — ui/src/ui/app-render.ts:704
    Moving data-session-key onto the wrapper means current browser coverage that clicks a.sidebar-recent-session[data-session-key=...] no longer finds the clickable row. Keep the attribute on the <a> as well, or update the affected selectors and proof in the same change.
    Confidence: 0.9
  • [P2] Include the session name in the rename button label — ui/src/ui/app-render.ts:748-749
    Every icon-only rename button exposes the same accessible name, Rename session, so screen reader users tabbing through multiple recent sessions cannot tell which session will be edited. Include the row label or key in the button's accessible name and add 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 f284ce3b4df7.

Label changes

Label justifications:

  • P2: This is a normal-priority Control UI feature with limited blast radius, but it changes persisted session-label behavior and has concrete pre-merge defects.
  • merge-risk: 🚨 compatibility: The PR diverges from the existing 512-character session-label contract and changes the stable clickable sidebar selector shape.
  • merge-risk: 🚨 session-state: The PR adds a new UI path that writes persisted session labels and can truncate existing label state through that path.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body only provides jsdom/unit, i18n, and typecheck output; it still needs redacted browser proof or live output showing the sidebar rename flow after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +213, Tests +79. Total +292 across 40 files.

View PR surface stats
Area Files Added Removed Net
Source 39 303 90 +213
Tests 1 79 0 +79
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 40 382 90 +292

What I checked:

Likely related people:

  • Bradley Priest: Commit 51f1f23 added the Sessions-page label input and controller label patch support reused by this PR. (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, underpinning the persisted label contract. (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)
  • lin-hongkuan: Current blame for the sidebar renderer and label primitive points to commit bc7f0f1, though older feature commits are stronger ownership signals. (role: recent source carrier; confidence: low; commits: bc7f0f1223cd; files: ui/src/ui/app-render.ts, packages/gateway-protocol/src/schema/primitives.ts)
  • Alex Knight: Commit 5d01be1 changed the overlapping chat session picker search and pagination surface. (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)
  • Peter Steinberger: Commit 1fad8ef split chat session controls into the module used by adjacent picker rename work. (role: adjacent owner-boundary contributor; confidence: medium; commits: 1fad8efa12cf; files: ui/src/ui/chat/session-controls.ts, ui/src/ui/views/chat.test.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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jun 6, 2026
…el patch (openclaw#90655)

Adds an inline rename affordance to sidebar session rows. Renames go through the
existing sessions.patch label path (patchSession), so the label is stored
server-side and stays the single source of truth — the Sessions page, other
browsers, and the gateway all see the same name. There is no client-only
localStorage override.

Details:
- The rename button is a sibling of the session link, not nested inside the <a>
  (a button inside an anchor is invalid and ambiguous for keyboard/AT users).
- Escape cancels the edit; a guard prevents the trailing blur from re-committing
  the canceled draft.
- Empty input clears the custom label (patch label: null); patchSession refreshes
  the session list so the row re-renders from the server label.
- The "Rename session" string is localized (sessionsView.rename) and i18n bundles
  are regenerated.

Tests cover the server-patch commit, the button-not-nested-in-link markup, and
the Escape-then-blur cancel path.

Closes openclaw#90655
@lonexreb
lonexreb force-pushed the feat/90655-rename-sessions-control-ui branch from fc64e01 to 7c9fe21 Compare June 15, 2026 22:32
@lonexreb lonexreb changed the title feat(control-ui): allow renaming sessions in sidebar (#90655) feat(control-ui): rename sessions from the sidebar via the server label patch (#90655) Jun 15, 2026
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 15, 2026
@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 19, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jun 20, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Allow renaming sessions in the Control UI

1 participant