From ad9e8c9b574ec6937cc09d8901ca83a769225963 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Fri, 14 Aug 2026 01:24:02 -0500 Subject: [PATCH] feat(desktop): expose data-attributes on sidebar sessions area for custom skinning Add data-sessions-mode ('flat' | 'projects' | 'project' | 'archived' | 'search') and data-sessions-project (entered project id) to the sidebar sessions wrapper so custom UIs can target project mode without relying on internal class names. --- apps/desktop/src/app/chat/sidebar/index.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/app/chat/sidebar/index.tsx b/apps/desktop/src/app/chat/sidebar/index.tsx index 2e83cd75f199f..7cab99808a50f 100644 --- a/apps/desktop/src/app/chat/sidebar/index.tsx +++ b/apps/desktop/src/app/chat/sidebar/index.tsx @@ -1368,6 +1368,20 @@ export function ChatSidebar({ const showSessionSections = showSessionSkeletons || filtersActive || sortedSessions.length > 0 || projectModel.length > 0 + // The sidebar's session-area mode — exposed as data-attributes so custom + // skins can target project mode (overview vs. entered), archived, or search + // without relying on internal class names. `data-sessions-project` carries + // the entered project's id for per-project targeting. + const sessionsMode: 'archived' | 'flat' | 'project' | 'projects' | 'search' = trimmedQuery + ? 'search' + : showArchived + ? 'archived' + : inProject + ? 'project' + : worktreeGroupingActive + ? 'projects' + : 'flat' + // Each reorderable list reports its OWN new id order; persisting is a direct, // typed write — no id-prefix sniffing to figure out which level moved. const reorderSessions = (ids: string[]) => { @@ -1514,7 +1528,11 @@ export function ChatSidebar({ )} {showSessionSections && ( -
+
{trimmedQuery && (