From e115880c71e997e638ece139d0fe9dd7a480d9f1 Mon Sep 17 00:00:00 2001 From: itrytoohard Date: Wed, 17 Jun 2026 19:01:29 +0530 Subject: [PATCH 1/2] fix(frontend): stop sidebar repeating the session id under the title 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) --- .../src/renderer/components/Sidebar.test.tsx | 51 ++++++++++++++++++- frontend/src/renderer/components/Sidebar.tsx | 10 +++- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/frontend/src/renderer/components/Sidebar.test.tsx b/frontend/src/renderer/components/Sidebar.test.tsx index cd71be74..bd9b24ff 100644 --- a/frontend/src/renderer/components/Sidebar.test.tsx +++ b/frontend/src/renderer/components/Sidebar.test.tsx @@ -3,7 +3,7 @@ import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { Sidebar } from "./Sidebar"; -import type { WorkspaceSummary } from "../types/workspace"; +import type { WorkspaceSession, WorkspaceSummary } from "../types/workspace"; const { navigateMock } = vi.hoisted(() => ({ navigateMock: vi.fn() })); @@ -25,6 +25,21 @@ const workspace: WorkspaceSummary = { sessions: [], }; +function workerSession(overrides: Partial): WorkspaceSession { + return { + id: "reverbcode-2", + workspaceId: "proj-1", + workspaceName: "Project One", + title: "reverbcode-2", + provider: "claude-code", + kind: "worker", + branch: "session/reverbcode-2", + status: "working", + updatedAt: "2026-06-17T00:00:00Z", + ...overrides, + }; +} + function renderSidebar(onRemoveProject = vi.fn().mockResolvedValue(undefined)) { render( @@ -74,6 +89,40 @@ describe("Sidebar", () => { expect(onRemoveProject).not.toHaveBeenCalled(); }); + it("does not repeat the session id under the title when the title is the id", () => { + const sessions = [workerSession({ id: "reverbcode-2", title: "reverbcode-2" })]; + render( + + + , + ); + + // Title renders once; the id subtitle is suppressed because it would duplicate it. + expect(screen.getAllByText("reverbcode-2")).toHaveLength(1); + }); + + it("shows the session id under a distinct display name", () => { + const sessions = [workerSession({ id: "reverbcode-2", title: "fix the sidebar" })]; + render( + + + , + ); + + expect(screen.getByText("fix the sidebar")).toBeInTheDocument(); + expect(screen.getByText("reverbcode-2")).toBeInTheDocument(); + }); + it("hides the worker count in every state that reveals project actions", () => { renderSidebar(); diff --git a/frontend/src/renderer/components/Sidebar.tsx b/frontend/src/renderer/components/Sidebar.tsx index c0878d8a..7c26e43d 100644 --- a/frontend/src/renderer/components/Sidebar.tsx +++ b/frontend/src/renderer/components/Sidebar.tsx @@ -498,7 +498,15 @@ function ProjectItem({ > {session.title} - {session.id} + {/* The id is a secondary handle; when the worker has no + displayName/issueId the title already falls back to the + id (useWorkspaceQuery), so skip the line rather than + repeat the same string twice. */} + {session.title !== session.id && ( + + {session.id} + + )} From e315c78267093d9180d793f7b44113397367b1dc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 17 Jun 2026 13:32:04 +0000 Subject: [PATCH 2/2] chore: format with prettier [skip ci] --- frontend/src/renderer/components/Sidebar.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/renderer/components/Sidebar.tsx b/frontend/src/renderer/components/Sidebar.tsx index 7c26e43d..98bc3e1b 100644 --- a/frontend/src/renderer/components/Sidebar.tsx +++ b/frontend/src/renderer/components/Sidebar.tsx @@ -503,9 +503,7 @@ function ProjectItem({ id (useWorkspaceQuery), so skip the line rather than repeat the same string twice. */} {session.title !== session.id && ( - - {session.id} - + {session.id} )}