Skip to content

fix(frontend): stop sidebar repeating the session id under the title#283

Open
AgentWrapper wants to merge 2 commits into
mainfrom
fix/sidebar-duplicate-session-label
Open

fix(frontend): stop sidebar repeating the session id under the title#283
AgentWrapper wants to merge 2 commits into
mainfrom
fix/sidebar-duplicate-session-label

Conversation

@AgentWrapper

Copy link
Copy Markdown
Contributor

Fixes #282

Summary

A worker session with no displayName/issueId gets its title from useWorkspaceQuery's fallback (session.displayName ?? session.issueId ?? session.id), which resolves to the session id. The sidebar then rendered the title line (Sidebar.tsx) and an id subtitle unconditionally, so the same string printed twice (e.g. reverbcode-2 over reverbcode-2) — the default state for any plainly-spawned, un-renamed worker.

This renders the id subtitle only when it differs from the title: it stays a useful secondary handle for renamed / issue-backed workers, and collapses to a single line otherwise.

Test

  • cd frontend && npm run typecheck — clean
  • cd frontend && npx vitest run src/renderer/components/Sidebar.test.tsx — 5 passed, including two new regression tests:
    • id subtitle suppressed when title === id (asserts the string renders once)
    • id subtitle shown under a distinct display name

🤖 Generated with Claude Code

A worker session with no displayName/issueId gets its title from
useWorkspaceQuery's fallback (`displayName ?? issueId ?? id`), which
resolves to the session id. The sidebar then rendered the title line and
an id subtitle unconditionally, so the same string printed twice
(e.g. "reverbcode-2" over "reverbcode-2").

Render the id subtitle only when it differs from the title, so it stays a
useful secondary handle for renamed/issue-backed workers and collapses to
a single line otherwise.

Fixes #282

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidebar shows worker session name twice (title line == id line) when worker has no displayName/issueId

2 participants