Skip to content

Commit 5157446

Browse files
authored
feat(ui): rename, delete, and toggle sidebar session groups (#101117)
* feat(ui): rename, delete, and toggle sidebar session groups Sidebar group headers gain a kebab + right-click menu with Rename group, New group, and Delete group. Rename/delete enumerate every member session (active + archived, across agents) via unbounded sessions.list queries and patch category per session; delete keeps sessions and moves them to Ungrouped. Stored-but-empty groups render as sections, and the sidebar sort popover gains a persisted Group by toggle (Custom groups / None). * test(ui): capture sidebar group management UI proof shots * fix(ui): page session-group enumeration past the gateway's 100-row default sessions.list caps an absent limit at SESSIONS_LIST_DEFAULT_LIMIT (100), so the rename/delete member enumeration now walks nextOffset pages explicitly; a silent cap would strand members in the old group on stores >100 sessions. * chore(i18n): restore fallback-key tracking for new sidebar group strings after rebase * chore(i18n): translate new sidebar group strings across locales
1 parent 333a77f commit 5157446

69 files changed

Lines changed: 1074 additions & 131 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/web/control-ui.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Appearance also has a browser-local Text size setting, stored with the rest of C
117117

118118
## Sidebar navigation
119119

120-
The sidebar pins navigation above a scrollable recent-session list split into **Pinned**, one section per custom group (the session `category`, sorted alphabetically), and **Ungrouped** for the rest. Every pinned session stays visible, while unpinned sessions keep an independent nine-item recent budget. Opening a visible session moves the selection highlight without reordering the rows; an off-list deep link is surfaced at the top. Sessions with new activity since they were last read show an unread dot, and opening one marks it read. Each session row has a context menu (kebab button or right-click) with Pin/Unpin, Mark as unread/read, Rename, Fork, Move to group (including New group and Remove from group), Archive, and Delete; touch layouts keep the direct pin and menu controls visible. Multi-agent setups show a compact scope control in the Ungrouped header. **Overview** is the only destination pinned by default; expand **More** to reach every other destination. Select **Customize sidebar** under More, or right-click the navigation area, to pin or unpin destinations and restore the defaults. The pinned set and More expansion state are stored in the current browser profile and survive reloads.
120+
The sidebar pins navigation above a scrollable recent-session list split into **Pinned**, one section per custom group (the session `category`, sorted alphabetically), and **Ungrouped** for the rest. Every pinned session stays visible, while unpinned sessions keep an independent nine-item recent budget. Opening a visible session moves the selection highlight without reordering the rows; an off-list deep link is surfaced at the top. Sessions with new activity since they were last read show an unread dot, and opening one marks it read. Each session row has a context menu (kebab button or right-click) with Pin/Unpin, Mark as unread/read, Rename, Fork, Move to group (including New group and Remove from group), Archive, and Delete; touch layouts keep the direct pin and menu controls visible. Group headers have their own menu (kebab button or right-click) with Rename group, New group, and Delete group; renaming or deleting a group updates every member session, including archived ones, and deleting a group keeps its sessions and moves them back to Ungrouped. Groups created from the header start empty and stay visible as move targets. The sort control in the session list header also has a Group by toggle: Custom groups (default) or None for one flat list (Pinned stays separate); the choice is stored in the current browser profile. Multi-agent setups show a compact scope control in the Ungrouped header. **Overview** is the only destination pinned by default; expand **More** to reach every other destination. Select **Customize sidebar** under More, or right-click the navigation area, to pin or unpin destinations and restore the defaults. The pinned set and More expansion state are stored in the current browser profile and survive reloads.
121121

122122
The compact footer keeps connection status, **Settings**, **Docs**, mobile pairing, and the sidebar collapse toggle together. Collapsing shrinks the sidebar to an icon rail with the expand button at the top of the footer stack. At drawer breakpoints, the topbar hamburger button replaces that control.
123123

‎ui/src/components/app-sidebar.ts‎

Lines changed: 233 additions & 8 deletions
Large diffs are not rendered by default.

‎ui/src/e2e/session-management.e2e.test.ts‎

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function sessionRow(
2727
updatedAt: number,
2828
options: {
2929
archived?: boolean;
30+
category?: string;
3031
pinned?: boolean;
3132
pinnedAt?: number;
3233
hasActiveRun?: boolean;
@@ -360,6 +361,101 @@ describeControlUiE2e("Control UI session management mocked Gateway E2E", () => {
360361
await context.close();
361362
}
362363
});
364+
it("renames, deletes, and toggles sidebar session groups", async () => {
365+
const baseTime = Date.parse("2026-07-01T16:00:00.000Z");
366+
const context = await browser.newContext({
367+
locale: "en-US",
368+
serviceWorkers: "block",
369+
viewport: { height: 900, width: 1280 },
370+
});
371+
const page = await context.newPage();
372+
const gateway = await installMockGateway(page, {
373+
methodResponses: {
374+
"sessions.list": {
375+
cases: [
376+
{
377+
match: { archived: true },
378+
response: sessionsListResponse([
379+
sessionRow("agent:main:old-notes", "Old notes", baseTime - 300_000, {
380+
archived: true,
381+
category: "Research",
382+
}),
383+
]),
384+
},
385+
{
386+
match: {},
387+
response: sessionsListResponse([
388+
sessionRow("agent:main:main", "Main", baseTime),
389+
sessionRow("agent:main:paper-a", "Paper A", baseTime - 60_000, {
390+
category: "Research",
391+
}),
392+
sessionRow("agent:main:paper-b", "Paper B", baseTime - 90_000, {
393+
category: "Research",
394+
}),
395+
]),
396+
},
397+
],
398+
},
399+
"sessions.patch": {},
400+
},
401+
sessionKey: "agent:main:main",
402+
});
403+
404+
try {
405+
await page.goto(`${server.baseUrl}chat`);
406+
407+
// Categorized rows render as their own sidebar group section.
408+
const groups = page.locator(".sidebar-recent-sessions__group");
409+
const researchGroup = groups.filter({ hasText: "Research" });
410+
await researchGroup.waitFor({ state: "visible", timeout: 10_000 });
411+
await expect.poll(() => researchGroup.locator(".sidebar-recent-session").count()).toBe(2);
412+
await captureUiProof(page, "sidebar-session-groups.png");
413+
414+
// Rename group: every member session is patched, including the archived
415+
// row that only the unbounded archived list window can see.
416+
const groupMenuButton = researchGroup.getByRole("button", {
417+
name: "Group options for Research",
418+
});
419+
await researchGroup.locator(".sidebar-recent-sessions__head").hover();
420+
await groupMenuButton.click();
421+
await page.getByRole("menuitem", { name: "Rename group…" }).waitFor({ state: "visible" });
422+
await captureUiProof(page, "sidebar-group-menu.png");
423+
page.once("dialog", (dialog) => void dialog.accept("Projects"));
424+
await page.getByRole("menuitem", { name: "Rename group…" }).click();
425+
for (const key of ["agent:main:paper-a", "agent:main:paper-b", "agent:main:old-notes"]) {
426+
const patch = await waitForPatch(
427+
gateway,
428+
(params) => params.key === key && params.category === "Projects",
429+
);
430+
expect(requireRecord(patch.params)).toMatchObject({ category: "Projects", key });
431+
}
432+
433+
// Delete group: sessions survive and move back to Ungrouped.
434+
await researchGroup.locator(".sidebar-recent-sessions__head").hover();
435+
page.once("dialog", (dialog) => void dialog.accept());
436+
await groupMenuButton.click();
437+
await page.getByRole("menuitem", { name: "Delete group…" }).click();
438+
const dissolvePatch = await waitForPatch(
439+
gateway,
440+
(params) => params.key === "agent:main:paper-a" && params.category === null,
441+
);
442+
expect(requireRecord(dissolvePatch.params)).toMatchObject({
443+
category: null,
444+
key: "agent:main:paper-a",
445+
});
446+
447+
// Group by "None" flattens the category sections into the plain list.
448+
await page.getByRole("button", { name: "Sort sessions" }).click();
449+
await page.getByRole("menuitemradio", { name: "None" }).waitFor({ state: "visible" });
450+
await captureUiProof(page, "sidebar-groupby-sort-menu.png");
451+
await page.getByRole("menuitemradio", { name: "None" }).click();
452+
await expect.poll(() => groups.count()).toBe(1);
453+
await expect.poll(() => groups.first().locator(".sidebar-recent-session").count()).toBe(3);
454+
} finally {
455+
await context.close();
456+
}
457+
});
458+
363459
it("does not duplicate the active chat when its only session is pinned", async () => {
364460
const context = await browser.newContext({
365461
locale: "en-US",

‎ui/src/i18n/.i18n/ar.meta.json‎

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)