Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

feat(sidebar): show last reply dates in project sessions

vastsa09cbd2316c8b
diff --git a/apps/desktop/src/components/Sidebar.tsx b/apps/desktop/src/components/Sidebar.tsx
index 51fe9e913..32bdaee55 100644
--- a/apps/desktop/src/components/Sidebar.tsx
+++ b/apps/desktop/src/components/Sidebar.tsx
@@ -25,12 +25,12 @@ import {
} from "../lib/sidebar-floating-menu";
import { useTranslation } from "react-i18next";
import { api } from "../lib/api";
+import { formatSessionLastReplyDate } from "../lib/sidebar-session-date";
import { SessionHoverCard } from "../features/sessions/SessionHoverCard";
import { useSessionHoverCard } from "../features/sessions/useSessionHoverCard";
import { isDefaultSessionTitle, useAppStore } from "../stores/app-store";
import {
getGlobalPinnedSessions,
- groupSidebarSessionsByTime,
normalizeProjectPath,
sessionArchived,
sessionPinned,
@@ -259,7 +259,7 @@ export function Sidebar({
className?: string;
onAnimationEnd?: ReactAnimationEventHandler<HTMLElement>;
}) {
- const { t } = useTranslation();
+ const { t, i18n } = useTranslation();
const sessions = useAppStore((s) => s.sessions);
const activeSessionId = useAppStore((s) => s.activeSessionId);
const selectingSessionId = useAppStore((s) => s.selectingSessionId);
@@ -2113,7 +2113,12 @@ export function Sidebar({
const renderSessionRows = (
items: SessionSummary[],
- options?: { temporary?: boolean; projectPath?: string; global?: boolean },
+ options?: {
+ temporary?: boolean;
+ projectPath?: string;
+ global?: boolean;
+ showLastReplyDate?: boolean;
+ },
) => items.map((session) => {
const meta = sessionMeta[session.id] ?? {};
const normalizedProjectPath = normalizeProjectPath(session.projectPath);
@@ -2132,6 +2137,13 @@ export function Sidebar({
outcome: sessionOutcomes[session.id],
hasPendingPermission,
});
+ const lastReplyDate = options?.showLastReplyDate
+ ? formatSessionLastReplyDate(
+ session.updatedAt,
+ new Date(),
+ i18n.resolvedLanguage ?? i18n.language,
+ )
+ : "";
return (
<div
key={session.id}
@@ -2208,6 +2220,14 @@ export function Sidebar({
{isRemoteSession(session) && <span className="thread-item-source" title={session.remoteHostLabel}>{t("remote:remote")}</span>}
<WorktreeBadge worktree={session.worktree} sessionId={session.id} />
<span className="thread-item-title">{taskTitle(session.title)}</span>
+ {lastReplyDate ? (
+ <>
+ <span className="thread-item-date-separator" aria-hidden="true">
+ |
+ </span>
+ <span className="thread-item-last-reply">{lastReplyDate}</span>
+ </>
+ ) : null}
{options?.global ? (
<span className="thread-item-project">
{owningProject}
@@ -2246,7 +2266,7 @@ export function Sidebar({
const isMenuOpen = projectMenu === entry.key;
// Show the initial page by default; the remaining sessions stay folded
- // behind the same load-more affordance used for time-group overflow.
+ // behind the Load more affordance.
const sessionsExpanded = expandedProjectSessions[entry.key] ?? false;
const history = entry.sessions.filter((session) => !pinnedSessionIds.has(session.id));
const { visibleSessions, hiddenCount } = getVisibleProjectSessions(
@@ -2265,24 +2285,13 @@ export function Sidebar({
const showRunBadge = runningAffordances.badge && runIsLive;
const showRunRail = runningAffordances.rail && runIsLive;
- const renderTimeGroupedSessions = (sessions: SessionSummary[]) => {
- const result: React.ReactNode[] = [];
- for (const { group, sessions: groupSessions } of groupSidebarSessionsByTime(sessions)) {
- // For today, don't show header (as per requirement)
- if (group !== "today") {
- const i18nKey =
- group === "yesterday" ? "nav.timeGroupYesterday" :
- group === "thisWeek" ? "nav.timeGroupThisWeek" :
- group === "older14d" ? "nav.timeGroupOlder14d" :
- "nav.timeGroupArchived";
- result.push(
- <div key={`group-header-${group}`} className="sidebar-time-group-header">
- {t(i18nKey)}
- </div>
- );
- }
- result.push(...renderSessionRows(groupSessions, { projectPath: entry.path }));
- }
+ const renderProjectSessions = (sessions: SessionSummary[]) => {
+ const result: React.ReactNode[] = [
+ ...renderSessionRows(sessions, {
+ projectPath: entry.path,
+ showLastReplyDate: true,
+ }),
+ ];
// Add "load more" button if there are hidden sessions
if (hiddenCount > 0) {
result.push(
@@ -2443,7 +2452,7 @@ export function Sidebar({
>
<div className="sidebar-session-group-clip">
<div className="sidebar-session-group-list">
- {entry.sessions.length > 0 ? renderTimeGroupedSessions(visibleSessions) : (
+ {entry.sessions.length > 0 ? renderProjectSessions(visibleSessions) : (
<div className="sidebar-session-empty">{t("nav.noProjectSessions")}</div>
)}
</div>
@@ -2734,7 +2743,10 @@ export function Sidebar({
</section>
)}
<RemoteProjectGroups groups={remoteProjectGroups}
- renderSessions={(sessions) => renderSessionRows(sessions, { temporary: false })} />
+ renderSessions={(sessions) => renderSessionRows(sessions, {
+ temporary: false,
+ showLastReplyDate: true,
+ })} />
</div>
<div className="sidebar-footer no-drag">
diff --git a/apps/desktop/src/lib/sidebar-session-date.ts b/apps/desktop/src/lib/sidebar-session-date.ts
new file mode 100644
index 000000000..97a2093f4
--- /dev/null
+++ b/apps/desktop/src/lib/sidebar-session-date.ts
@@ -0,0 +1,32 @@
+const DAY_MS = 24 * 60 * 60 * 1000;
+
+/** Format the session's most recent update as a relative day or a calendar date. */
+export function formatSessionLastReplyDate(
+ value: string | undefined,
+ now = new Date(),
+ locale?: string,
+): string {
+ if (!value) return "";
+
+ const timestamp = Date.parse(value);
+ if (!Number.isFinite(timestamp)) return "";
+
+ const date = new Date(timestamp);
+ const today = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate());
+ const replyDay = Date.UTC(date.getFullYear(), date.getMonth(), date.getDate());
+ const daysAgo = Math.round((today - replyDay) / DAY_MS);
+
+ try {
+ if (daysAgo >= 0 && daysAgo <= 7) {
+ return new Intl.RelativeTimeFormat(locale || undefined, {
+ numeric: "always",
+ }).format(-daysAgo, "day");
+ }
+
+ return new Intl.DateTimeFormat(locale || undefined, {
+ dateStyle: "medium",
+ }).format(date);
+ } catch {
+ return new Intl.DateTimeFormat(undefined, { dateStyle: "medium" }).format(date);
+ }
+}
diff --git a/apps/desktop/src/lib/sidebar-session-groups.ts b/apps/desktop/src/lib/sidebar-session-groups.ts
index ac13045bb..b9d0b439b 100644
--- a/apps/desktop/src/lib/sidebar-session-groups.ts
+++ b/apps/desktop/src/lib/sidebar-session-groups.ts
@@ -85,35 +85,3 @@ export function getGlobalPinnedSessions(
);
});
}
-
-type TimeGroup = "today" | "yesterday" | "thisWeek" | "older14d" | "archived";
-
-function getTimeGroup(dateStr: string | undefined, now: Date): TimeGroup {
- if (!dateStr) return "older14d";
- const ts = Date.parse(dateStr);
- if (!Number.isFinite(ts)) return "older14d";
- const startOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
- const startOfYesterday = startOfToday - 86400000;
- const startOfWeek = startOfToday - 6 * 86400000; // last 7 days
- const startOf14d = startOfToday - 13 * 86400000;
- if (ts >= startOfToday) return "today";
- if (ts >= startOfYesterday) return "yesterday";
- if (ts >= startOfWeek) return "thisWeek";
- if (ts >= startOf14d) return "older14d";
- return "archived"; // older than 14 days
-}
-
-const TIME_GROUP_ORDER: TimeGroup[] = ["today", "yesterday", "thisWeek", "older14d", "archived"];
-/** Group only normal history; callers remove global pins before any row limit. */
-export function groupSidebarSessionsByTime(sessions: SessionSummary[], now = new Date()) {
- const grouped = new Map<TimeGroup, SessionSummary[]>();
- for (const session of sessions) {
- const group = getTimeGroup(session.updatedAt, now);
- if (!grouped.has(group)) grouped.set(group, []);
- grouped.get(group)!.push(session);
- }
- return TIME_GROUP_ORDER.flatMap((group) => {
- const rows = grouped.get(group);
- return rows?.length ? [{ group, sessions: rows }] : [];
- });
-}
diff --git a/apps/desktop/src/styles/sidebar-threads.css b/apps/desktop/src/styles/sidebar-threads.css
index 92cf79bb7..def1ccace 100644
--- a/apps/desktop/src/styles/sidebar-threads.css
+++ b/apps/desktop/src/styles/sidebar-threads.css
@@ -34,6 +34,8 @@
}
.thread-item-title {
+ min-width: 0;
+ flex: 1 1 auto;
overflow: hidden;
font-size: var(--text-md); /* session titles stay compact within the sidebar */
line-height: var(--leading-row);
@@ -41,6 +43,25 @@
white-space: nowrap;
}
+.thread-item-date-separator,
+.thread-item-last-reply {
+ flex: 0 0 auto;
+ color: var(--ds-text-muted);
+ font-size: var(--text-sm);
+ white-space: nowrap;
+}
+
+.thread-item-date-separator {
+ margin-left: auto;
+}
+
+.thread-item:hover .thread-item-date-separator,
+.thread-item:hover .thread-item-last-reply,
+.thread-item:focus-within .thread-item-date-separator,
+.thread-item:focus-within .thread-item-last-reply {
+ display: none;
+}
+
.thread-item:hover,
.thread-item.active,
.project-group > .sidebar-session-group-header:hover {
@@ -191,8 +212,8 @@
display: flex;
flex-direction: column;
/* One hairline between list rows: adjacent rounded row fills read as
- separate rows instead of one block. A time-group header and the load-more
- affordance are ordinary rows in that same rhythm. */
+ separate rows instead of one block. The load-more affordance follows the
+ same rhythm. */
gap: 1px;
overflow: hidden;
}
@@ -237,18 +258,6 @@
padding-left: 9px;
}
-.sidebar-time-group-header {
- padding: 4px 6px 4px 20px;
- color: var(--ds-text-muted);
- font-size: var(--text-2xs);
- font-weight: var(--font-weight-medium);
- letter-spacing: var(--tracking-wide);
- text-transform: uppercase;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
.sidebar-load-more {
display: flex;
width: 100%;
diff --git a/apps/desktop/test/sidebar-pinned-rendering.test.mjs b/apps/desktop/test/sidebar-pinned-rendering.test.mjs
index b3e914d34..99642dfff 100644
--- a/apps/desktop/test/sidebar-pinned-rendering.test.mjs
+++ b/apps/desktop/test/sidebar-pinned-rendering.test.mjs
@@ -46,14 +46,14 @@ test("sidebar renders global pins once, outside project folding and history limi
const meta = Object.fromEntries(pins.map(({ id }) => [id, { pinned: true }]));
meta["archived-pin"].archived = true;
const seed = {
- sessions: [...pins, ...normal, session("temporary-normal", null)],
+ sessions: [...pins, ...normal, session("date-row", "/dated"), session("temporary-normal", null)],
sessionMeta: meta,
projectMeta: {
"/closed": { name: "Closed project" },
"/collapsed": { collapsed: true },
"/archived": { archived: true },
},
- openProjectPaths: ["/open", "/collapsed"],
+ openProjectPaths: ["/open", "/collapsed", "/dated"],
openProjects: [],
workspace: null,
activeProjectPath: null,
@@ -146,6 +146,14 @@ test("sidebar renders global pins once, outside project folding and history limi
/<div class="sidebar-session-group-clip"><div class="sidebar-session-group-list">/,
);
assert.ok(rows(openGroup).length > 0, "an expanded group renders its rows");
+ assert.doesNotMatch(openGroup, /sidebar-time-group-header/);
+ assert.match(openGroup, /class="sidebar-load-more"/);
+
+ const datedGroup =
+ unpinned.match(/data-sidebar-project-group="\/dated"[\s\S]*?<\/section>/)?.[0] ?? "";
+ assert.deepEqual(rows(datedGroup), ["date-row"]);
+ assert.match(datedGroup, /class="thread-item-date-separator" aria-hidden="true">\|<\/span>/);
+ assert.match(datedGroup, /class="thread-item-last-reply">Jan 1, 2020<\/span>/);
// A retained project with no sessions is the empty state, and it has to sit
// in the same list layer so the fold animates it away too.
diff --git a/apps/desktop/test/sidebar-session-date.test.mjs b/apps/desktop/test/sidebar-session-date.test.mjs
new file mode 100644
index 000000000..525cb68bc
--- /dev/null
+++ b/apps/desktop/test/sidebar-session-date.test.mjs
@@ -0,0 +1,51 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { readFile } from "node:fs/promises";
+import { formatSessionLastReplyDate } from "../src/lib/sidebar-session-date.ts";
+
+const sidebarSource = await readFile(
+ new URL("../src/components/Sidebar.tsx", import.meta.url),
+ "utf8",
+);
+const sidebarStyles = await Promise.all([
+ readFile(new URL("../src/styles/sidebar-threads.css", import.meta.url), "utf8"),
+ readFile(new URL("../src/styles/sessions.css", import.meta.url), "utf8"),
+]).then((styles) => styles.join("\n"));
+
+test("formats session activity through seven calendar days and uses a date after that", () => {
+ const now = new Date(2026, 9, 16, 12);
+ const atLocalDay = (daysAgo) =>
+ new Date(2026, 9, 16 - daysAgo, 8).toISOString();
+
+ assert.equal(
+ formatSessionLastReplyDate(atLocalDay(0), now, "zh-CN"),
+ "0天前",
+ );
+ assert.equal(
+ formatSessionLastReplyDate(atLocalDay(7), now, "zh-CN"),
+ "7天前",
+ );
+ assert.equal(
+ formatSessionLastReplyDate(atLocalDay(8), now, "en"),
+ "Oct 8, 2026",
+ );
+});
+
+test("invalid timestamps do not render a misleading date", () => {
+ assert.equal(formatSessionLastReplyDate(undefined), "");
+ assert.equal(formatSessionLastReplyDate("not-a-date"), "");
+});
+
+test("project session rows show the date until hover or focus reveals actions", () => {
+ assert.match(sidebarSource, /showLastReplyDate:\s*true/);
+ assert.match(sidebarSource, /className="thread-item-date-separator"/);
+ assert.match(sidebarSource, /className="thread-item-last-reply"/);
+ assert.match(
+ sidebarStyles,
+ /\.thread-item:hover \.thread-item-last-reply,[\s\S]*?\.thread-item:focus-within \.thread-item-last-reply\s*\{\s*display:\s*none;/,
+ );
+ assert.match(
+ sidebarStyles,
+ /\.thread-item:hover \.thread-item-more[\s\S]*?\.thread-item:focus-within \.thread-item-more[\s\S]*?opacity:\s*1;/,
+ );
+});
diff --git a/apps/desktop/test/sidebar-session-groups.test.mjs b/apps/desktop/test/sidebar-session-groups.test.mjs
index 0184c8904..50a23cbf4 100644
--- a/apps/desktop/test/sidebar-session-groups.test.mjs
+++ b/apps/desktop/test/sidebar-session-groups.test.mjs
@@ -3,7 +3,6 @@ import test from "node:test";
import {
groupSidebarSessions,
getGlobalPinnedSessions,
- groupSidebarSessionsByTime,
normalizeProjectPath,
projectPathsForNewSessions,
sessionMatchesProject,
@@ -89,7 +88,7 @@ test("finds only newly imported project-bound sessions", () => {
);
});
-test("global pins include closed projects and temporary sessions without date buckets", () => {
+test("global pins include closed projects and temporary sessions", () => {
const sessions = [
session({ id: "today", projectPath: "/open", updatedAt: "2026-09-13T01:00:00Z" }),
session({ id: "old-pin", projectPath: "/open", updatedAt: "2025-01-01T00:00:00Z" }),
@@ -102,16 +101,10 @@ test("global pins include closed projects and temporary sessions without date bu
pins.map((row) => row.id),
["old-pin", "closed-pin", "temporary-pin"],
);
- for (const now of [new Date(2026, 8, 13, 12), new Date(2026, 8, 14, 12)]) {
- const ids = new Set(pins.map((row) => row.id));
- const history = groupSidebarSessionsByTime(
- sessions.filter((row) => !ids.has(row.id)),
- now,
- );
- const rendered = [...pins, ...history.flatMap((group) => group.sessions)].map((row) => row.id);
- assert.deepEqual(rendered, ["old-pin", "closed-pin", "temporary-pin", "today"]);
- assert.equal(new Set(rendered).size, sessions.length);
- }
+ const ids = new Set(pins.map((row) => row.id));
+ const rendered = [...pins, ...sessions.filter((row) => !ids.has(row.id))].map((row) => row.id);
+ assert.deepEqual(rendered, ["old-pin", "closed-pin", "temporary-pin", "today"]);
+ assert.equal(new Set(rendered).size, sessions.length);
assert.equal(sessions[1].projectPath, "/open", "pinning must not rebind a conversation");
});
@@ -144,18 +137,3 @@ test("global pins honor session and project archives including normalized paths"
0,
);
});
-
-test("ordinary date groups retain their order after pins are removed", () => {
- const date = (day) => new Date(2026, 8, day, 1).toISOString();
- const rows = [
- session({ id: "old", updatedAt: "2025-01-01T00:00:00Z" }),
- session({ id: "week", updatedAt: date(10) }),
- session({ id: "today", updatedAt: date(13) }),
- session({ id: "yesterday", updatedAt: date(12) }),
- session({ id: "fortnight", updatedAt: date(3) }),
- ];
- assert.deepEqual(
- groupSidebarSessionsByTime(rows, new Date(2026, 8, 13, 12)).map((group) => group.group),
- ["today", "yesterday", "thisWeek", "older14d", "archived"],
- );
-});
diff --git a/docs/spec/04-ux/01-ui-ia.md b/docs/spec/04-ux/01-ui-ia.md
index 6a9d6c230..477c59011 100644
--- a/docs/spec/04-ux/01-ui-ia.md
+++ b/docs/spec/04-ux/01-ui-ia.md
@@ -283,10 +283,12 @@ destination, chat as the home surface, tools and permissions inline.
first, and Name. Pinned rows precede unpinned rows. Project groups switch
to `manual` by dragging a title or using ArrowUp/ArrowDown on that
title. Session `manual` remains a compatibility value.
-- **Conversation list**: each group shows the ten most-recent sessions in the
- active sort order by default; the remainder folds behind a **Load N more…**
- row that expands the full time-grouped list on click. Pinned rows precede
- unpinned rows and are never pushed behind the fold; the expansion state is
+- **Conversation list**: each project group shows the ten most-recent sessions
+ in the active sort order by default; the remainder folds behind a **Load N
+ more…** row. The list has no time-group headings. Rows show the title and a
+ localized last-reply age through seven calendar days, then a concrete date;
+ hovering or focusing a row replaces the date with its session actions. Pinned
+ rows precede unpinned rows and are never pushed behind the fold; expansion is
not persisted.
- **Standalone sessions**: path-less sessions remain in the separate Sessions
section and never inherit the last active project's workspace.
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index 3c6921c27..a3b3f2cc9 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -593,9 +593,9 @@ visually distinct from list content.
and Open session path (the session scratch directory in the system file
manager).
- Pinned conversations appear once in a global section above Sessions and
- Projects, independent of date buckets, project collapse, retained tabs, and
- each project's ten-row history limit. Each pin shows its project display
- name (full path on hover), or Temporary space for a path-less conversation.
+ Projects, independent of project session dates, project collapse, retained
+ tabs, and each project's ten-row history limit. Each pin shows its project
+ display name (full path on hover), or Temporary space for a path-less conversation.
The section is omitted when empty and scrolls within `min(233px, 30vh)` when
needed. Its rows reuse normal selection, status, hover, and overflow actions.
- Pinning moves the existing row into that section; unpinning returns it to
@@ -737,7 +737,7 @@ controls.
| Project archive | omitted from default view; restorable from archived view |
| Project delete | the row-menu danger action always opens a confirmation dialog naming the project and session count; X, Cancel, Escape, and backdrop dismiss without changes; explicit confirmation stops listed running sessions before removing the durable project row, owned sessions/transcripts, and project memory; the folder is never deleted; deleting a root of a stored multi-folder project group is refused until the root is detached through Edit project. Chats on a detached root remain available as a standalone project. A path the host no longer knows is still removed from the list. |
| Project memory | row-menu editor reads and saves a compact list of titled or untitled memory cards for the exact project path; cards can be added, edited, and removed, the context is available in later chats, and it is never a higher-priority instruction |
-| Session list | exact-path matches only; no basename grouping; the latest ten unpinned sessions appear initially, Load more reveals the remaining history, and collapsing the project clears that expanded-list state so the next expansion returns to the initial ten |
+| Session list | exact-path matches only; no basename grouping; the latest ten unpinned sessions appear initially without time-group headings, and Load more reveals the remaining history; each project row shows the title, a divider, and a localized last-reply age through seven calendar days or a concrete date afterward; hovering or focusing the row replaces that date with session actions; collapsing the project clears the expanded-list state so the next expansion returns to the initial ten |
| Active group | exactly one group reflects the selected host workspace |
| Task state | In-progress, selected, completed, and failed indicators update by session without replacing the visible transcript; precedence is in-progress, selected, then terminal outcome |
diff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.md
index b9926b327..8d9b20427 100644
--- a/docs/spec/04-ux/09-interaction-patterns.md
+++ b/docs/spec/04-ux/09-interaction-patterns.md
@@ -297,10 +297,11 @@ may be retained while exactly one workspace supplies the visible shell context.
ahead of the manual order; projects without an assigned order fall back to
a stable path order until they are moved.
- Each project group shows the ten most-recent rows in the active sort order
- by default; the remaining sessions fold behind a **Load N more…** control
- (the same affordance used for time-grouped overflow). Selecting it expands
- the full time-grouped list, and the expanded state is per-group, for the
- current session only, and not persisted.
+ by default; the remaining sessions fold behind a **Load N more…** control.
+ The expanded list remains flat. Each project session row shows its title and
+ localized last-reply age through seven calendar days, then a concrete date;
+ hover or keyboard focus replaces the date with the session actions. Expanded
+ state is per-group, for the current session only, and not persisted.
- Presentation changes are saved best-effort. Storage failure must not block
project activation, session selection, or agent execution.
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index 89654cfdd..6e1b4ce4e 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -4331,19 +4331,22 @@ window; opening a normal panel afterward must still work.
- **Preconditions**: One retained project contains more than ten durable
sessions with distinct updated timestamps; the sidebar uses the default
Recently updated sort; another retained project has ten or fewer sessions.
-- **Steps**: 1) Inspect the large project's session rows and count them. 2)
- Select the **Load N more…** control. 3) Switch the sort to Name and inspect
- the same group before expanding. 4) Restart the app and inspect the group
- again.
+- **Steps**: 1) Inspect the large project's session rows and count them. Check
+ rows with recent and older replies. Hover a row, then focus one with the
+ keyboard. 2) Select the **Load N more…** control. 3) Switch the sort to Name
+ and inspect the same group before expanding. 4) Restart the app and inspect
+ the group again.
- **Expected**: The group shows exactly ten session rows by default plus a
- **Load N more…** control (N = remaining session count) styled like the
- time-grouped overflow; the ten rows are the first rows in the active sort
- order, so pinned rows are never pushed behind unpinned rows and a Name sort
- folds everything after the first ten alphabetically; selecting Load more
- expands the full time-grouped list (Yesterday/Previous 7 days/Previous 14
- days/Older headers appear as applicable) and the control disappears;
- expansion is per group and resets on restart (not persisted); the project
- with ten or fewer sessions shows no fold control.
+ **Load N more…** control (N = remaining session count); there are no time-group
+ headers. Every row places the title before a divider and the localized last
+ reply date. Replies within seven calendar days show an exact relative day
+ (including 0–7 days); older replies show a concrete localized date. Hovering
+ or focusing a row hides its date and reveals the session action. The ten rows
+ are the first rows in the active sort order, so pinned rows are never pushed
+ behind unpinned rows and a Name sort folds everything after the first ten
+ alphabetically; selecting Load more expands the flat list and the control
+ disappears. Expansion is per group and resets on restart (not persisted); the
+ project with ten or fewer sessions shows no fold control.
- **Specs linked**: `04-ux/01-ui-ia.md`, `04-ux/09-interaction-patterns.md`
- **Acceptance**: C (session organization)
- **Milestone**: M5
@@ -16090,14 +16093,14 @@ plugin-form fixtures in an isolated temporary directory at runtime.
#### E2E-LAYOUT-sidebar-project-group-fold
- **Preconditions**: Five retained sidebar project groups, seeded through the
- host: one holding five sessions across four date buckets, one holding a single
- session, one holding none, and one holding ten pinned sessions.
+ host: one holding five sessions with recent and old reply dates, one holding
+ a single session, one holding none, and one holding ten pinned sessions.
A fifth group has twelve unpinned sessions for the project history pager.
`prefers-reduced-motion` is unset.
- **Steps**:
- 1. Inspect the groups: body layering, row and date-label counts, the empty
- state, the tail each expanded group contributes to the next one, and the
- non-project lists' budgets.
+ 1. Inspect the groups: body layering, row and per-row date counts, no time
+ headings, the empty state, the tail each expanded group contributes to
+ the next one, and the non-project lists' budgets.
2. Collapse the multi-row group with a real pointer click on its directory row —
scrolled into view and confirmed to hit that button — and read the group
body's height, opacity, resolved `grid-template-rows`, and the distance to
@@ -16125,7 +16128,9 @@ plugin-form fixtures in an isolated temporary directory at runtime.
reduced motion both endpoints are kept and the travel is dropped. The pinned
list holds eight rows inside `min(233px, 30vh)` and scrolls to its remaining
rows, and the standalone list keeps its flex column and 146px budget. The group
- indent, ordering, and workspace state are unchanged.
+ indent, ordering, and workspace state are unchanged. The five seeded project
+ sessions remain in one flat list with no time headings and each has its own
+ date label.
- **Specs linked**: `04-ux/01-ui-ia.md`, `04-ux/07-ui-design-system.md` §6.1 and
§13, `04-ux/08-component-spec.md` §6.2, `08-meta/decisions-log.md`
(2026-09-16, sidebar list rhythm and project-group fold)
@@ -16146,8 +16151,10 @@ plugin-form fixtures in an isolated temporary directory at runtime.
a current workspace; built desktop with isolated data and profile directories.
- **Steps**: In dark and light themes, select a project conversation, hover its
project title and an unselected conversation, then hover the selected row.
- Exercise the window-blur handler, drop-target styling, project action hover
- and keyboard Tab/Shift+Tab focus. Fold and reopen its group. Select pinned and
+ Check that a project session date is visible at rest and replaced by its
+ action on hover and focus. Exercise the window-blur handler, drop-target
+ styling, project action hover and keyboard Tab/Shift+Tab focus. Fold and
+ reopen its group. Select pinned and
standalone conversations. Open Settings and return. Enable reduced motion and
inspect both row transition durations. In a separate twelve-session project,
load the remaining two sessions, fold and reopen the group, and verify only
@@ -16160,10 +16167,11 @@ plugin-form fixtures in an isolated temporary directory at runtime.
retains an outline, action buttons retain local feedback, drop-target paint
wins over hover, and blur releases hover without clearing selection. Settings
replaces sidebar navigation, and returning restores conversation and workspace
- context without a second selected row. Loading more sessions reveals all
- twelve; folding and reopening restores the initial ten and the two-session
- remainder control. Rendered component tests additionally cover no selected
- session, a pending destination and non-chat page state.
+ context without a second selected row. Project session rows show dates at rest
+ and reveal actions in their place on hover and focus. Loading more sessions
+ reveals all twelve; folding and reopening restores the initial ten and the
+ two-session remainder control. Rendered component tests additionally cover no
+ selected session, a pending destination and non-chat page state.
- **Specs linked**: `04-ux/01-ui-ia.md`, `04-ux/08-component-spec.md`,
`04-ux/09-interaction-patterns.md` §9.1c
- **Acceptance**: C, D, Quality
diff --git a/scripts/e2e-three-column-layout.mjs b/scripts/e2e-three-column-layout.mjs
index 2a1bb9321..70b2a629c 100644
--- a/scripts/e2e-three-column-layout.mjs
+++ b/scripts/e2e-three-column-layout.mjs
@@ -61,8 +61,8 @@ function resolveHostBinary() {
* Seed five retained project groups into the same throwaway data directory the
* app will open, using only the host protocol:
*
- * alpha five sessions across four date buckets, so the group draws date
- * labels as well as rows
+ * alpha five sessions across recent and old reply dates, so the flat group
+ * draws per-row dates as well as sessions
* beta one session, the smallest non-empty group
* gamma no sessions, the empty group
* delta ten sessions that the renderer pins, so the Pinned section has more
@@ -92,8 +92,8 @@ async function seedSidebarProjects(hostBinary, dataDir, tempDirs) {
startOfToday.setHours(0, 0, 0, 0);
const dayStart = startOfToday.getTime();
const stamp = (ms) => new Date(ms).toISOString();
- // `getTimeGroup` buckets on the calendar day, so these offsets are anchored to
- // local midnight rather than to the current clock time.
+ // These offsets are anchored to local midnight so the calendar-day boundary
+ // is stable even when this suite runs late in the day.
const alphaRows = [
["alpha today b", Date.now() - 120_000],
["alpha today a", Date.now() - 60_000],
@@ -1381,7 +1381,8 @@ async function main() {
bottom: box.bottom,
opacity: Number(style.opacity),
rows: rows.length,
- dateHeaders: body.querySelectorAll(".sidebar-time-group-header").length,
+ timeHeaders: body.querySelectorAll(".sidebar-time-group-header").length,
+ dateLabels: body.querySelectorAll(".thread-item-last-reply").length,
emptyState: !!body.querySelector(".sidebar-session-empty"),
clipMinHeight: clip ? getComputedStyle(clip).minHeight : null,
clipOverflowY: clip ? getComputedStyle(clip).overflowY : null,
@@ -1572,12 +1573,12 @@ async function main() {
JSON.stringify({ alpha, beta, gamma }),
);
check(
- alpha?.rows === 5 && alpha.dateHeaders === 3 && alpha.height > 0,
- "the seeded multi-row group draws its rows and every date label",
+ alpha?.rows === 5 && alpha.timeHeaders === 0 && alpha.dateLabels === 5 && alpha.height > 0,
+ "the seeded multi-row group stays flat and shows a date for every session",
JSON.stringify(alpha),
);
check(
- beta?.rows === 1 && beta.height > 0 && beta.dateHeaders === 0,
+ beta?.rows === 1 && beta.height > 0 && beta.timeHeaders === 0 && beta.dateLabels === 1,
"a one-row group folds the same way",
JSON.stringify(beta),
);
diff --git a/scripts/e2e/sidebar-row-states.mjs b/scripts/e2e/sidebar-row-states.mjs
index ab1696ca4..b833d5d52 100644
--- a/scripts/e2e/sidebar-row-states.mjs
+++ b/scripts/e2e/sidebar-row-states.mjs
@@ -140,6 +140,19 @@ export async function checkSidebarRowStates({ cdp, check, waitFor, seed }) {
current: element.getAttribute('data-current-workspace'),
};
})()`);
+ const sessionDateActions = (id) => cdp.evaluate(`(() => {
+ const row = document.querySelector(${JSON.stringify(row(id))});
+ const date = row?.querySelector('.thread-item-last-reply');
+ const separator = row?.querySelector('.thread-item-date-separator');
+ const action = row?.querySelector('[data-action="session-menu"]');
+ return {
+ dateText: date?.textContent?.trim() ?? "",
+ dateDisplay: date ? getComputedStyle(date).display : "missing",
+ separatorDisplay: separator ? getComputedStyle(separator).display : "missing",
+ actionOpacity: action ? Number.parseFloat(getComputedStyle(action).opacity) : -1,
+ actionPointerEvents: action ? getComputedStyle(action).pointerEvents : "missing",
+ };
+ })()`);
const point = async (selector) => {
let target;
await waitFor(async () => {
@@ -232,6 +245,32 @@ export async function checkSidebarRowStates({ cdp, check, waitFor, seed }) {
`${theme} project and conversation hover share one row surface, never a nested title fill`,
JSON.stringify({ groupHover, titleHover, rowHover }),
);
+
+ const datedRowId = seed.alphaSessionIds.at(-1);
+ await move(600, 120);
+ const dateAtRest = await sessionDateActions(datedRowId);
+ await hover(`${row(datedRowId)} .thread-item-main`);
+ const dateOnHover = await sessionDateActions(datedRowId);
+ check(
+ dateAtRest.dateText.length > 0 && dateAtRest.dateDisplay !== "none" &&
+ dateAtRest.separatorDisplay !== "none" && dateAtRest.actionOpacity === 0 &&
+ dateAtRest.actionPointerEvents === "none" && dateOnHover.dateDisplay === "none" &&
+ dateOnHover.separatorDisplay === "none" && dateOnHover.actionOpacity === 1 &&
+ dateOnHover.actionPointerEvents === "auto",
+ `${theme} project session rows swap the resting date for actions on hover`,
+ JSON.stringify({ dateAtRest, dateOnHover }),
+ );
+ await cdp.evaluate(`document.querySelector(${JSON.stringify(row(datedRowId) + " .thread-item-main")}).focus()`);
+ const dateOnFocus = await sessionDateActions(datedRowId);
+ check(
+ dateOnFocus.dateDisplay === "none" && dateOnFocus.actionOpacity === 1 &&
+ dateOnFocus.actionPointerEvents === "auto",
+ `${theme} keyboard focus reveals session actions in place of the date`,
+ JSON.stringify(dateOnFocus),
+ );
+ await cdp.evaluate("document.activeElement instanceof HTMLElement && document.activeElement.blur()");
+ await move(600, 120);
+
await hover(`${row(id)} .thread-item-main`);
const selectedHover = await paint(row(id));
check(
@@ -242,7 +281,13 @@ export async function checkSidebarRowStates({ cdp, check, waitFor, seed }) {
await hover(title(seed.paths.alpha));
await cdp.evaluate("window.dispatchEvent(new Event('blur'))");
- await delay(180);
+ await waitFor(async () => {
+ const [headerPaint, selectedPaint] = await Promise.all([
+ paint(header(seed.paths.alpha)),
+ paint(row(id)),
+ ]);
+ return headerPaint.background === transparent && selectedPaint.background === selectedRest.background;
+ }, `${theme} window blur releases hover without clearing selection`);
const blurredHeader = await paint(header(seed.paths.alpha));
const blurredSelected = await paint(row(id));
check(