Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(sidebar): preserve Recent project labels
Tioit-Wangf2020d68422b
diff --git a/apps/desktop/src/components/Sidebar.tsx b/apps/desktop/src/components/Sidebar.tsxindex f3e8e83da..2f9803179 100644--- a/apps/desktop/src/components/Sidebar.tsx+++ b/apps/desktop/src/components/Sidebar.tsx@@ -2100,6 +2100,7 @@ export function Sidebar({temporary?: boolean;projectPath?: string;global?: boolean;+ recent?: boolean;showLastReplyDate?: boolean;/** The `Remote` section heading already says these rows live on a host. */insideRemoteSection?: boolean;@@ -2132,7 +2133,7 @@ export function Sidebar({return (<divkey={session.id}- className={`thread-item ${active ? "active" : ""} ${archived ? "archived" : ""} ${draggingSessionId === session.id ? "is-dragging" : ""} ${selectedIds.has(session.id) ? "selected" : ""}`}+ className={`thread-item ${active ? "active" : ""} ${archived ? "archived" : ""} ${draggingSessionId === session.id ? "is-dragging" : ""} ${selectedIds.has(session.id) ? "selected" : ""} ${options?.recent && normalizedProjectPath ? "recent-project-session" : ""}`}data-sidebar-session-row={session.id}draggable={!running && !isRemoteSession(session)}onDragStart={(event) => {@@ -2208,7 +2209,10 @@ export function Sidebar({<WorktreeBadge worktree={session.worktree} sessionId={session.id} /><span className="thread-item-title">{taskTitle(session.title)}</span>{options?.global ? (- <span className="thread-item-project">+ <span+ className="thread-item-project"+ title={options?.recent && normalizedProjectPath ? owningProject : undefined}+ >{owningProject}</span>) : null}@@ -2675,7 +2679,7 @@ export function Sidebar({>{visibleRecentSessions.length > 0 ? (<>- {renderSessionRows(visibleRecentSessions, { global: true })}+ {renderSessionRows(visibleRecentSessions, { global: true, recent: true })}{recentNextPageCount > 0 ? (<buttontype="button"diff --git a/apps/desktop/src/styles/sidebar-threads.css b/apps/desktop/src/styles/sidebar-threads.cssindex c60d2ad93..54fe29d69 100644--- a/apps/desktop/src/styles/sidebar-threads.css+++ b/apps/desktop/src/styles/sidebar-threads.css@@ -368,6 +368,12 @@white-space: nowrap;}+/* Recent rows share one line between task and project identity. Let a long+ task title take only the space left after the project label. */+.thread-item.recent-project-session .thread-item-project {+ flex: 0 0 auto;+}+/* Multi-select highlight: visually distinct from the single active row. */.thread-item.selected {background: color-mix(in oklab, var(--ds-accent) 12%, transparent);diff --git a/apps/desktop/test/sidebar-navigation.test.mjs b/apps/desktop/test/sidebar-navigation.test.mjsindex 7d4ff2e4c..4d3ec8b81 100644--- a/apps/desktop/test/sidebar-navigation.test.mjs+++ b/apps/desktop/test/sidebar-navigation.test.mjs@@ -142,7 +142,7 @@ test("sidebar shows a bounded Recent session list before retained projects", ()assert.match(standaloneSessions, /t\("nav\.recentSessions"\)/);assert.match(standaloneSessions, /data-action="new-standalone-session"/);assert.match(standaloneSessions, /createSession\(\{ projectPath: null \}\)/);- assert.match(standaloneSessions, /renderSessionRows\(visibleRecentSessions, \{ global: true \}\)/);+ assert.match(standaloneSessions, /renderSessionRows\(visibleRecentSessions, \{ global: true, recent: true \}\)/);assert.match(standaloneSessions, /data-action="recent-sessions-load-more"/);assert.ok(sidebarSource.indexOf('data-sidebar-session-section="temporary"') <@@ -157,6 +157,32 @@ test("sidebar shows a bounded Recent session list before retained projects", ()assert.doesNotMatch(sidebarSource, /data-sidebar-project-group="temporary"/);});+test("Recent project labels keep their width ahead of long session titles", () => {+ const recentRows = sidebarSource.match(+ /renderSessionRows\(visibleRecentSessions, \{[^}]*\}\)/,+ )?.[0] ?? "";+ const rowClass = sidebarSource.match(+ /className=\{`thread-item \$\{active[\s\S]*?\n data-sidebar-session-row/,+ )?.[0] ?? "";+ const projectLabel = sidebarSource.match(+ /<span\s+className="thread-item-project"\s+title=\{options\?\.recent && normalizedProjectPath \? owningProject : undefined\}/,+ )?.[0] ?? "";++ assert.match(recentRows, /recent:\s*true/);+ assert.match(rowClass, /options\?\.recent && normalizedProjectPath/);+ assert.match(projectLabel, /title=\{options\?\.recent && normalizedProjectPath \? owningProject : undefined\}/);+ assert.match(+ globalStyles,+ /\.thread-item\.recent-project-session \.thread-item-project\s*\{[^}]*flex:\s*0 0 auto;/,+ );+ assert.match(+ sidebarSource,+ /renderSessionRows\(pinnedSessions, \{ global: true \}\)/,+ "pinned rows keep their existing presentation path",+ );+ assert.doesNotMatch(recentRows, /temporary:\s*false/);+});+test("sidebar project and session lists stay coordinated with the global type scale", () => {assert.match(globalStyles,diff --git a/apps/desktop/test/sidebar-pinned-rendering.test.mjs b/apps/desktop/test/sidebar-pinned-rendering.test.mjsindex a452d47c4..a2f1628e3 100644--- a/apps/desktop/test/sidebar-pinned-rendering.test.mjs+++ b/apps/desktop/test/sidebar-pinned-rendering.test.mjs@@ -25,7 +25,7 @@ test("sidebar renders global pins once, outside project folding and history limiconst old = "2020-01-01T00:00:00Z";const session = (id, projectPath, updatedAt = old) => ({id,- title: id,+ title: id === "normal-00" ? `${id} with a deliberately long session title that must not crowd its project` : id,projectPath,createdAt: old,updatedAt,@@ -118,6 +118,17 @@ test("sidebar renders global pins once, outside project folding and history limiassert.ok(recentRows.every((id) => !expectedPins.includes(id)), "Recent skips pins");assert.deepEqual(recentRows.slice(0, 3), ["normal-00", "normal-01", "normal-02"]);assert.match(recentSection(html), /data-action="recent-sessions-load-more"/);+ assert.match(+ recentSection(html),+ /class="thread-item[^\"]*recent-project-session[^\"]*" data-sidebar-session-row="normal-00"/,+ );+ assert.match(+ recentSection(html),+ /<span class="thread-item-title">normal-00 with a deliberately long session title that must not crowd its project<\/span><span class="thread-item-project" title="[^"]+">[^<]+<\/span>/,+ );+ assert.match(recentSection(html), /data-action="session-menu"/);+ assert.doesNotMatch(pinnedSection(html), /recent-project-session/);+ assert.doesNotMatch(recentSection(html), /recent-project-session[^\"]*" data-sidebar-session-row="temporary-normal"/);const openProject =html.match(/data-sidebar-project-group="\/open"[\s\S]*?<\/section>/)?.[0] ?? "";assert.equal(rows(openProject).filter((id) => id.startsWith("normal-")).length, 10);@@ -127,6 +138,14 @@ test("sidebar renders global pins once, outside project folding and history limicatalogs.en.nav.loadMoreCount.replace("{{count}}", "6"),));assert.ok(!rows(html).includes("archived-pin"));+ const temporaryOnly = render({+ sessionMeta: {},+ sessions: [session("temporary-only", null)],+ });+ const temporaryOnlyRows = recentSection(temporaryOnly);+ assert.deepEqual(rows(temporaryOnlyRows), ["temporary-only"]);+ assert.doesNotMatch(temporaryOnlyRows, /recent-project-session/);+ assert.match(temporaryOnlyRows, /class="thread-item-project">Temporary<\/span>/);assert.ok(!rows(html).includes("archived-project-pin"));const unpinned = render({ sessionMeta: {} });@@ -169,6 +188,7 @@ test("sidebar renders global pins once, outside project folding and history limi);assert.ok(rows(openGroup).length > 0, "an expanded group renders its rows");assert.doesNotMatch(openGroup, /sidebar-time-group-header/);+ assert.doesNotMatch(openGroup, /recent-project-session/);assert.match(openGroup, /class="sidebar-load-more"/);const datedGroup =diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.mdindex 412a97ea2..3a3e0f51e 100644--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@ -1727,6 +1727,12 @@ near-zero duration. A folded group keeps its rows mounted, `aria-hidden`, andor scrolling and remains visible while dragging, so the independent regionsstay available without becoming persistent visual rails.+ Project-bound rows in Recent keep their project label ahead of an+ ellipsizing session title, so long titles cannot consume the label's width.+ The label retains its full name on hover. This sizing applies only to+ unpinned project rows in Recent; pinned rows, path-less sessions, and rows+ inside project groups keep their existing layout and session semantics.+---## 7. ChatTranscriptdiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex a189fad06..f8ef23386 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -254,6 +254,7 @@ identify the platform validation still needed.| Security | E2E-SETTINGS-inline-capability-imports, E2E-028, E2E-029, E2E-030, E2E-024J, E2E-024K, E2E-024M, E2E-049, E2E-068, E2E-086, E2E-102c, E2E-102d, E2E-102e, E2E-105, E2E-106, E2E-107, E2E-108, E2E-109, E2E-110, E2E-112, E2E-113, E2E-115, E2E-116, E2E-117, E2E-119, E2E-121, E2E-122, E2E-123, E2E-142, E2E-148, E2E-151, E2E-153, E2E-158, E2E-187, E2E-196c, E2E-196b, E2E-196, E2E-PROVIDER-custom-endpoint-no-api-key, E2E-PLUGIN-fs-root-follows-the-calling-session, E2E-PLUGIN-provider-catalog-add-service, E2E-PLUGIN-reviews-public-reads || Quality | E2E-SETTINGS-inline-capability-imports, E2E-CHAT-long-history-stream-keeps-responsive, E2E-CHAT-running-status-survives-output-pauses, E2E-032, E2E-033, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-053, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-103, E2E-AGENTS-001, E2E-021a, E2E-024N, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-111, E2E-114, E2E-117, E2E-118, E2E-119, E2E-120, E2E-122, E2E-123, E2E-142, E2E-143, E2E-144, E2E-145, E2E-146, E2E-147, E2E-148, E2E-150, E2E-151, E2E-153, E2E-155, E2E-158, E2E-159, E2E-160, E2E-161, E2E-162, E2E-163, E2E-168, E2E-172, E2E-173, E2E-174, E2E-011g, E2E-176, E2E-177, E2E-178, E2E-179, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-196a, E2E-196b, E2E-196c, E2E-198, E2E-199, E2E-200, E2E-196, E2E-201, E2E-204, E2E-202, E2E-203, E2E-205, E2E-206, E2E-207, E2E-208, E2E-209, E2E-210, E2E-UPDATE-preference-and-once-only-reminder, E2E-218, E2E-259, E2E-219, E2E-250, E2E-252, E2E-102i, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-PLUGIN-imported-pi-package-skills, E2E-PLUGIN-fs-root-follows-the-calling-session, E2E-SUBAGENT-resume-a-settled-delegation, E2E-PLUGIN-provider-catalog-add-service || Quality (sidebar menu placement) | E2E-021c |+| Quality (Recent project label width) | E2E-SIDEBAR-recent-project-label-width || Quality (project ordering) | E2E-253 || Quality (work-panel tab close visibility) | E2E-WORK-PANEL-active-tab-close-visibility || Quality (turn changed-files disclosure) | E2E-CHAT-turn-changed-files-summary |diff --git a/docs/spec/06-delivery/e2e/ui-shell.md b/docs/spec/06-delivery/e2e/ui-shell.mdindex a27e4e6e6..246d55734 100644--- a/docs/spec/06-delivery/e2e/ui-shell.md+++ b/docs/spec/06-delivery/e2e/ui-shell.md@@ -1781,6 +1781,28 @@supported window size. Existing hover cards, context menus, drag/drop, andproject pinning retain their normal behavior.+## E2E-SIDEBAR-recent-project-label-width++- **Preconditions**: Sidebar contains an unpinned project conversation and a+ path-less Temporary conversation in Recent; at least one project session has+ a title much longer than its project display name. The same project also has+ a pinned conversation and a visible project-group row.+- **Steps**: 1) Open the chat sidebar at its default width and inspect the+ Recent rows. 2) Focus the session row and hover the project label.+ 3) Open the row menu and select the conversation. 4) Repeat at the minimum+ supported sidebar width, then compare the Pinned, Temporary, and project+ history rows.+- **Expected**: The long Recent session title ellipsizes before it needlessly+ consumes the project label's width; the full project name remains available+ on hover. The session row remains selectable and its existing actions open.+ Temporary rows have no Recent project-label sizing, and Pinned and+ project-history row presentation and semantics are unchanged.+- **Specs linked**: `04-ux/08-component-spec.md` §6.6.+- **Acceptance**: Quality (sidebar layout and navigation).+- **Milestone**: M5.+- **Status**: Documented; SSR regression coverage in+ `sidebar-pinned-rendering.test.mjs`.+## US-UI-59 Session-rooted background tools- Start a visible turn in project A, switch to project B while it runs, andinspect both sidebar status indicators.