@devries-cameron20 / t3code Mirror · read-only / commits / 001d16e969
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 13:15 UTC

feat(web): boring sidebar hides projects with no active threads (#26387)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Oct 28, 2026 at 02:59 UTC 001d16e9699ad22863f065e5d9a3bd36305901fc
4 files changed +21 -14
apps/web/src/components/Sidebar.logic.test.ts
+9 -8
@@ -1368,7 +1368,7 @@ describe("sidebarFolderExpansionKeys", () => {
1368 });
1369
1370 describe("groupSidebarThreadsByProject", () => {
1371 - it("puts each thread in its project's folder and keeps empty projects", () => {
1371 + it("puts each thread in its project's folder and drops empty projects unless kept", () => {
1372 const remoteEnvironmentId = EnvironmentId.make("environment-remote");
1373 const t3code = ProjectId.make("t3code");
1374 const t3codeRemote = ProjectId.make("t3code-remote");
@@ -1392,21 +1392,22 @@ describe("groupSidebarThreadsByProject", () => {
1392 },
1393 ];
1394
1395 - const folders = groupSidebarThreadsByProject(groups, [
1395 + const threads = [
1396 thread("a", localEnvironmentId, t3code),
1397 thread("orphan", localEnvironmentId, ProjectId.make("deleted")),
1398 thread("b", remoteEnvironmentId, t3codeRemote),
1399 - ]);
1400 -
1401 - expect(
1402 - folders.map((folder) => ({
1399 + ];
1400 + const summarize = (keepEmpty: boolean) =>
1401 + groupSidebarThreadsByProject(groups, threads, keepEmpty).map((folder) => ({
1402 projectKey: folder.group.projectKey,
1403 threads: folder.threads.map((entry) => entry.id),
1405 - })),
1406 - ).toEqual([
1404 + }));
1405 +
1406 + expect(summarize(true)).toEqual([
1407 { projectKey: "t3code", threads: ["a", "b"] },
1408 { projectKey: "fleet", threads: [] },
1409 ]);
1410 + expect(summarize(false)).toEqual([{ projectKey: "t3code", threads: ["a", "b"] }]);
1411 });
1412 });
1413
apps/web/src/components/Sidebar.logic.ts
+4 -3
@@ -918,8 +918,8 @@ export function sidebarFolderExpansionKeys(group: {
918 }
919
920 /**
921 - * Boring sidebar folders. Folders follow `groups` order and include empty
922 - * projects so each one can start a thread. Threads keep their input order.
921 + * Boring sidebar folders. Folders follow `groups` order and threads keep their
922 + * input order. A project with no threads gets a folder only with `keepEmpty`.
923 * A thread whose project is in no group has no folder and is left out.
924 */
925 export function groupSidebarThreadsByProject<
@@ -933,6 +933,7 @@ export function groupSidebarThreadsByProject<
933 >(
934 groups: readonly TGroup[],
935 threads: readonly TThread[],
936 + keepEmpty: boolean,
937 ): Array<{ group: TGroup; threads: TThread[] }> {
938 const folders = groups.map((group) => ({ group, threads: [] as TThread[] }));
939 const folderByProject = new Map<string, (typeof folders)[number]>();
@@ -944,7 +945,7 @@ export function groupSidebarThreadsByProject<
945 for (const thread of threads) {
946 folderByProject.get(`${thread.environmentId}:${thread.projectId}`)?.threads.push(thread);
947 }
947 - return folders;
948 + return keepEmpty ? folders : folders.filter((folder) => folder.threads.length > 0);
949 }
950
951 export type SidebarV2TopStatusKind =
apps/web/src/components/Sidebar.tsx
+6 -2
@@ -399,6 +399,8 @@ function useSidebarThreads(input: {
399 readonly routeRowThreadKey: string | null;
400 // Set in boring mode: the project groups to fold active threads into, in order.
401 readonly folderGroups: readonly SidebarProjectSnapshot[] | null;
402 + // Keeps folders with no active threads, so a project the user filtered to can start one.
403 + readonly keepEmptyFolders: boolean;
404 }) {
405 const {
406 projectScopeKey,
@@ -409,6 +411,7 @@ function useSidebarThreads(input: {
411 delegatedUnderParent,
412 routeRowThreadKey,
413 folderGroups,
414 + keepEmptyFolders: keepEmpty,
415 } = input;
416 // Folders already separate the work, so boring mode has no Working shelf.
417 const workingShelfEnabled =
@@ -495,7 +498,7 @@ function useSidebarThreads(input: {
498 const projectFolders =
499 folderGroups === null
500 ? null
498 - : groupSidebarThreadsByProject(folderGroups, activeThreads).map((folder) => {
501 + : groupSidebarThreadsByProject(folderGroups, activeThreads, keepEmpty).map((folder) => {
502 const collapsed = !resolveProjectExpanded(
503 projectExpandedById,
504 sidebarFolderExpansionKeys(folder.group),
@@ -1271,6 +1274,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
1274 ? projectGroups
1275 : scopedProjectGroups
1276 : null,
1277 + keepEmptyFolders: scopedProjectGroups.length > 0,
1278 });
1279
1280 // Ranked across environments as the palette ranks them, so one
@@ -1841,7 +1845,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
1845 const key = scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id));
1846 return { kind: "thread", key, section };
1847 });
1844 - // Boring mode keeps empty project folders, so each can start a thread.
1848 + // Boring mode keeps a project the user filtered to, so it can start a thread.
1849 if (
1850 !hasProjectFolders &&
1851 pinnedThreads.length +
docs/user/thread-sidebar.md
+2 -1
@@ -142,7 +142,8 @@ cannot drag or move threads within it. Your saved order returns when you turn it
142 ### Group threads by project (beta)
143
144 Turn on **Settings → Labs → Boring sidebar (group by project)** on web and desktop to put active
145 -threads in a folder for each project. Click a folder to open or close it. A closed folder shows how
145 +threads in a folder for each project. A project with no active threads has no folder until you
146 +pick it in the project filter. Click a folder to open or close it. A closed folder shows how
147 many threads it holds, and a dot when one of them needs you. Use the pen button on a folder, or
148 right-click it, to start a thread in that project. Pinned threads stay above the folders, and
149 Snoozed and Settled stay below them. In this mode you cannot drag threads, and the Working section