Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(sidebar): group sessions by status preference

Darren Kattan9dcfe286ad6a
diff --git a/src/renderer/components/SessionRow.tsx b/src/renderer/components/SessionRow.tsx
index 9f550d457..0091aa79a 100644
--- a/src/renderer/components/SessionRow.tsx
+++ b/src/renderer/components/SessionRow.tsx
@@ -92,7 +92,19 @@ export function SessionRow({
)}
<div className="ss-row__body">
<div className="ss-row__titleline">
- <span className="ss-mark" style={{ background: row.color }} />
+ {row.projectColor ? (
+ // Status mode: rows are flattened across projects, so each row shows its project's
+ // monogram (colored circle with the project initial) instead of the plain color mark.
+ <span
+ className="ss-mark ss-mark--project"
+ style={{ background: row.projectColor }}
+ title={row.projectName}
+ >
+ {(row.projectName?.trim() || '?').charAt(0).toUpperCase()}
+ </span>
+ ) : (
+ <span className="ss-mark" style={{ background: row.color }} />
+ )}
{editing ? (
<input
className="ss-title-input"
@@ -148,8 +160,9 @@ export function SessionRow({
×
</button>
</div>
- {(row.cwd || row.sshHost) && (
+ {(row.projectName || row.cwd || row.sshHost) && (
<div className="ss-meta">
+ {row.projectName && <span className="ss-meta__project">{row.projectName}</span>}
{row.sshHost && <span className="ss-meta__ssh">⇅ {row.sshHost}</span>}
{row.cwd && <span className="ss-meta__cwd">{dirName(row.cwd)}</span>}
</div>
diff --git a/src/renderer/components/SessionsSidebar.tsx b/src/renderer/components/SessionsSidebar.tsx
index 2fd88138c..def21a416 100644
--- a/src/renderer/components/SessionsSidebar.tsx
+++ b/src/renderer/components/SessionsSidebar.tsx
@@ -1,6 +1,7 @@
import { useEffect, useMemo, useState } from 'react'
import {
buildSessionList,
+ buildStatusList,
groupCollapseKey,
groupSessionCount,
groupSessionRows,
@@ -11,9 +12,12 @@ import {
projectSignalCounts,
pruneCollapsedItems,
type GroupBucket,
- type SessionNodeInput
+ type SessionNodeInput,
+ type SessionRowVM,
+ type StatusSection
} from '../lib/sessionList'
import { SessionRow } from './SessionRow'
+import { SegmentedPill } from '@renderer/ui/SegmentedPill'
import { IconBellFilled, IconCircleCheck, IconPin } from './icons'
import { useProjects } from '../state/projects'
import { useSettings } from '../state/settings'
@@ -98,6 +102,8 @@ export function SessionsSidebar(props: SessionsSidebarProps): JSX.Element | null
// sidebarAutoCollapse now only supplies the DEFAULT for a row nobody ever toggled.
const autoCollapse = useSettings((s) => s.settings.sidebarAutoCollapse)
const collapsedItems = useSettings((s) => s.settings.sidebarCollapsedItems)
+ const grouping = useSettings((s) => s.settings.sidebarGrouping)
+ const updateSettings = useSettings((s) => s.update)
// Look up the current git branch for each project cwd (best-effort, cached). Gated on `open`
// and caches a NEGATIVE result too — without the '' fallback a non-git cwd re-fired a git
@@ -132,6 +138,15 @@ export function SessionsSidebar(props: SessionsSidebarProps): JSX.Element | null
open ? buildSessionList(projects, liveActiveNodes, activeProjectId, statusById, filter) : [],
[open, projects, liveActiveNodes, activeProjectId, statusById, filter]
)
+ // Status-grouped sections (only computed in status mode — flattens all projects' sessions by
+ // live agent status so attention floats to the top). Same inputs as `groups`.
+ const statusSections = useMemo(
+ () =>
+ open && grouping === 'status'
+ ? buildStatusList(projects, liveActiveNodes, activeProjectId, statusById, filter)
+ : [],
+ [open, grouping, projects, liveActiveNodes, activeProjectId, statusById, filter]
+ )
const projectCount = (g: (typeof groups)[number]): number =>
g.groups.reduce((n, b) => n + groupSessionCount(b), 0) + g.ungrouped.length
@@ -403,6 +418,26 @@ export function SessionsSidebar(props: SessionsSidebarProps): JSX.Element | null
)
}
+ // A status-mode row. Unlike project mode, the row carries its own project id (rows are flattened
+ // across projects), so the project-scoped callbacks read it off the row. Drag/drop reorder and
+ // move-to-group are project-mode concepts — their drop targets (project headers, sub-groups)
+ // aren't rendered in status mode, so the row is not draggable here. It stays clickable,
+ // closable, renameable, and right-clickable.
+ const renderStatusRow = (row: SessionRowVM): JSX.Element => (
+ <div key={row.id} className="ss-rowdrop">
+ <SessionRow
+ row={row}
+ onClick={() => props.onFocusNode(row.id)}
+ onClose={() => props.onCloseSession(row.projectId!, row.id)}
+ onRename={(title) => props.onRenameSession(row.projectId!, row.id, title)}
+ onAiName={() => props.onAiNameSession(row.projectId!, row.id, row.cwd)}
+ onContextMenu={(e) => props.onRowContextMenu(e, row.projectId!, row.id)}
+ onDragStart={() => {}}
+ onDragEnd={() => {}}
+ />
+ </div>
+ )
+
if (!open) return null
return (
@@ -414,6 +449,15 @@ export function SessionsSidebar(props: SessionsSidebarProps): JSX.Element | null
<div className="sessions-sidebar__head">
<span className="sessions-sidebar__title">Sessions</span>
<span className="sessions-sidebar__count">{total}</span>
+ <SegmentedPill<'project' | 'status'>
+ value={grouping}
+ ariaLabel="Group sessions by"
+ options={[
+ { value: 'project', label: 'Project' },
+ { value: 'status', label: 'Status' }
+ ]}
+ onChange={(v) => updateSettings({ sidebarGrouping: v })}
+ />
<div className="sessions-sidebar__head-actions">
<button
className={pinned ? 'is-on' : ''}
@@ -453,8 +497,34 @@ export function SessionsSidebar(props: SessionsSidebarProps): JSX.Element | null
setDropProj(null)
}}
>
- {groups.length === 0 && <div className="sessions-sidebar__empty">No sessions yet.</div>}
- {groups.map((g) => {
+ {groups.length === 0 && grouping !== 'status' && (
+ <div className="sessions-sidebar__empty">No sessions yet.</div>
+ )}
+ {grouping === 'status' ? (
+ statusSections.length === 0 ? (
+ <div className="sessions-sidebar__empty">No sessions yet.</div>
+ ) : (
+ statusSections.map((section: StatusSection) => (
+ <div key={section.kind} className="ss-status">
+ <div className="ss-status__head">
+ {section.kind === 'attention' ? (
+ <span className="ss-status__icon ss-status__icon--attention">
+ <IconBellFilled />
+ </span>
+ ) : (
+ <span className={`ss-status__icon ss-status__icon--${section.kind}`} />
+ )}
+ <span className="ss-status__label">{section.label}</span>
+ <span className="ss-status__count">{section.rows.length}</span>
+ </div>
+ <div className="ss-status__rows">
+ {section.rows.map((row) => renderStatusRow(row))}
+ </div>
+ </div>
+ ))
+ )
+ ) : (
+ groups.map((g) => {
const collapseKey = projectCollapseKey(g.projectId)
// While filtering, never collapse — a collapsed project would hide its own matches.
const isCollapsed = filter
@@ -596,7 +666,8 @@ export function SessionsSidebar(props: SessionsSidebarProps): JSX.Element | null
)}
</div>
)
- })}
+ })
+ )}
</div>
</aside>
)
diff --git a/src/renderer/components/settings/sections/BehaviorSection.tsx b/src/renderer/components/settings/sections/BehaviorSection.tsx
index ac69b686c..64387cb72 100644
--- a/src/renderer/components/settings/sections/BehaviorSection.tsx
+++ b/src/renderer/components/settings/sections/BehaviorSection.tsx
@@ -5,6 +5,7 @@ import { FieldRow } from '../FieldRow'
import { Switch } from '@renderer/ui/Switch'
import { NumberField } from '@renderer/ui/NumberField'
import { Select } from '@renderer/ui/Select'
+import { SegmentedPill } from '@renderer/ui/SegmentedPill'
import { hintLabel } from '@shared/platform-utils'
const ROWS = {
@@ -28,6 +29,10 @@ const ROWS = {
title: 'Sidebar: collapse inactive by default',
keywords: ['sidebar', 'sessions', 'collapse', 'expand', 'project', 'switch', 'group', 'tree']
},
+ sidebarGrouping: {
+ title: 'Sidebar: group by',
+ keywords: ['sidebar', 'sessions', 'group', 'status', 'project', 'attention']
+ },
wheelZoom: { title: 'Scroll wheel zooms', keywords: ['zoom', 'wheel', 'scroll', 'mouse', 'pan'] },
trackpadPan: {
title: 'Trackpad scroll pans',
@@ -167,6 +172,23 @@ export function BehaviorSection({ isActive }: { isActive: boolean }): React.JSX.
}
/>
</SearchableRow>
+ <SearchableRow {...ROWS.sidebarGrouping}>
+ <FieldRow
+ label="Sidebar: group sessions by"
+ description="Group the sessions sidebar by project (the default) or by live status, so sessions needing attention float to the top across all projects. Status reflects local-core sessions; remote sessions show as idle."
+ control={
+ <SegmentedPill<'project' | 'status'>
+ value={settings.sidebarGrouping}
+ ariaLabel="Group sessions by"
+ options={[
+ { value: 'project', label: 'Project' },
+ { value: 'status', label: 'Status' }
+ ]}
+ onChange={(v) => update({ sidebarGrouping: v })}
+ />
+ }
+ />
+ </SearchableRow>
<SearchableRow {...ROWS.wheelZoom}>
<FieldRow
label="Scroll wheel zooms"
diff --git a/src/renderer/lib/sessionList.test.ts b/src/renderer/lib/sessionList.test.ts
index f45a89e89..a98a8a781 100644
--- a/src/renderer/lib/sessionList.test.ts
+++ b/src/renderer/lib/sessionList.test.ts
@@ -1,6 +1,7 @@
import { describe, it, expect } from 'vitest'
import {
buildSessionList,
+ buildStatusList,
groupSessionCount,
groupSessionRows,
liveCollapseKeys,
@@ -399,3 +400,88 @@ describe('projectSignalCounts', () => {
expect(projectSignalCounts(p1)).toEqual({ attention: 1, unread: 0, working: 1 })
})
})
+
+describe('buildStatusList', () => {
+ // Two projects, sessions in various states spread across them.
+ const status: Record<string, AgentNodeStatus> = {
+ a1: { unread: false, state: 'waiting' }, // attention
+ a2: { unread: false, state: 'blocked' }, // attention
+ d1: { unread: false, state: 'done' }, // done
+ w1: { unread: false, state: 'working' }, // working
+ i1: { unread: false } // idle (no state)
+ }
+ const proj: ProjectInput[] = [
+ {
+ id: 'p1',
+ name: 'Alpha',
+ color: '#111',
+ cwd: '/a',
+ nodes: [node('a1', { title: 'zebra' }), node('d1', { title: 'apple' }), node('i1', { title: 'idle1' })]
+ },
+ {
+ id: 'p2',
+ name: 'Beta',
+ color: '#222',
+ nodes: [node('a2', { title: 'mid' }), node('w1', { title: 'runner' }), node('s1', { kind: 'sticky' })]
+ }
+ ]
+
+ it('groups by status in the fixed order attention → idle → done → working', () => {
+ const sections = buildStatusList(proj, null, 'p1', status, '')
+ expect(sections.map((s) => s.kind)).toEqual(['attention', 'idle', 'done', 'working'])
+ })
+
+ it('flattens across projects and tags each row with its project', () => {
+ const sections = buildStatusList(proj, null, 'p1', status, '')
+ const attention = sections.find((s) => s.kind === 'attention')!
+ expect(attention.rows.map((r) => r.id).sort()).toEqual(['a1', 'a2'])
+ const a1 = attention.rows.find((r) => r.id === 'a1')!
+ expect(a1.projectId).toBe('p1')
+ expect(a1.projectName).toBe('Alpha')
+ expect(a1.projectColor).toBe('#111')
+ const a2 = attention.rows.find((r) => r.id === 'a2')!
+ expect(a2.projectId).toBe('p2')
+ })
+
+ it('sorts rows within a section by project store-order then title', () => {
+ const sections = buildStatusList(proj, null, 'p1', status, '')
+ // attention: p1/zebra then p2/mid (project order wins over title — zebra before mid)
+ expect(sections.find((s) => s.kind === 'attention')!.rows.map((r) => r.id)).toEqual(['a1', 'a2'])
+ })
+
+ it('keeps only terminal nodes (drops stickies/editors)', () => {
+ const sections = buildStatusList(proj, null, 'p1', status, '')
+ const ids = sections.flatMap((s) => s.rows.map((r) => r.id))
+ expect(ids).not.toContain('s1')
+ })
+
+ it('uses live nodes for the active project', () => {
+ const live = [node('a1', { title: 'renamed live', agentId: 'claude' })]
+ const sections = buildStatusList(proj, live, 'p1', status, '')
+ const a1 = sections.flatMap((s) => s.rows).find((r) => r.id === 'a1')!
+ expect(a1.title).toBe('renamed live')
+ })
+
+ it('omits empty sections and filters by title/session', () => {
+ // 'runner' only matches w1 (working)
+ const filtered = buildStatusList(proj, null, 'p1', status, 'runner')
+ expect(filtered.map((s) => s.kind)).toEqual(['working'])
+ expect(filtered[0].rows.map((r) => r.id)).toEqual(['w1'])
+ })
+
+ it('returns only non-empty sections (no empty headers)', () => {
+ // Only attention + done present, no idle/working sessions.
+ const onlyTwo: ProjectInput[] = [
+ { id: 'p1', name: 'Alpha', color: '#111', nodes: [node('a1'), node('d1')] }
+ ]
+ const two: Record<string, AgentNodeStatus> = { a1: { unread: false, state: 'waiting' }, d1: { unread: false, state: 'done' } }
+ const sections = buildStatusList(onlyTwo, null, 'p1', two, '')
+ expect(sections.map((s) => s.kind)).toEqual(['attention', 'done'])
+ })
+
+ it('falls through to idle when state is unknown', () => {
+ const sections = buildStatusList(proj, null, 'p1', status, '')
+ const idle = sections.find((s) => s.kind === 'idle')!
+ expect(idle.rows.map((r) => r.id)).toEqual(['i1'])
+ })
+})
diff --git a/src/renderer/lib/sessionList.ts b/src/renderer/lib/sessionList.ts
index 0d7a9ffef..f38cce749 100644
--- a/src/renderer/lib/sessionList.ts
+++ b/src/renderer/lib/sessionList.ts
@@ -26,6 +26,9 @@ export interface ProjectInput {
export type StatusKind = 'working' | 'attention' | 'done' | 'idle'
+/** Sessions sidebar top-level grouping mode. */
+export type SidebarGrouping = 'project' | 'status'
+
const STATE_LABEL: Record<StatusKind, string> = {
working: 'Running',
attention: 'Needs you',
@@ -43,6 +46,14 @@ export function groupCollapseKey(projectId: string, groupId: string): string {
return `project:${projectId}:group:${groupId}`
}
+/**
+ * Status section order when the sidebar is grouped by status. Anything needing you floats to the
+ * top; working sinks to the bottom (a turn in flight is the least urgent to revisit). Idle sits
+ * above done so a session whose state was lost — including a waiting one a scraper misclassified
+ * as idle — stays above the finished pile.
+ */
+const STATUS_ORDER: StatusKind[] = ['attention', 'idle', 'done', 'working']
+
/**
* Whether a project row is collapsed in the sessions sidebar. `settings.sidebarAutoCollapse`
* only supplies the DEFAULT for a project the user never toggled: on (the default) keeps the
@@ -50,7 +61,8 @@ export function groupCollapseKey(projectId: string, groupId: string): string {
* explicit toggle, recorded in `overrides` under `projectCollapseKey` (true = collapsed), always
* wins — and since 2026-08 those choices are PERSISTED (`settings.sidebarCollapsedItems`), so a
* project switch no longer discards them. Group rows are not defaulted at all: an untouched
- * frame is expanded, which is why `renderBucket` reads the map directly.
+ * frame is expanded, which is why `renderBucket` reads the map directly. (Status mode ignores
+ * collapse entirely — its sections are always expanded.)
*/
export function isGroupCollapsed(
overrides: Record<string, boolean>,
@@ -177,6 +189,12 @@ export interface SessionRowVM {
sshHost?: string
sessionId?: string
usesContext: boolean
+ /** Populated only when the sidebar is grouped by status (rows are flattened across projects):
+ * the project the session belongs to, so the row can show a project monogram and route
+ * project-scoped callbacks. Absent in project mode, where the enclosing group carries it. */
+ projectId?: string
+ projectName?: string
+ projectColor?: string
}
/** A canvas group frame, the sessions directly inside it, and the frames nested inside it. */
@@ -213,7 +231,11 @@ export interface SessionGroup {
ungrouped: SessionRowVM[]
}
-function toRow(n: SessionNodeInput, status: AgentNodeStatus | undefined): SessionRowVM {
+function toRow(
+ n: SessionNodeInput,
+ status: AgentNodeStatus | undefined,
+ project?: Pick<ProjectInput, 'id' | 'name' | 'color'>
+): SessionRowVM {
const statusKind = sessionStatusKind(status?.state)
return {
id: n.id,
@@ -234,7 +256,11 @@ function toRow(n: SessionNodeInput, status: AgentNodeStatus | undefined): Sessio
cwd: n.cwd,
sshHost: n.ssh?.host,
sessionId: status?.sessionId,
- usesContext: n.agentId ? hasUsage(n.agentId) : false
+ usesContext: n.agentId ? hasUsage(n.agentId) : false,
+ // Only populated in status mode (flattened across projects); absent in project mode.
+ projectId: project?.id,
+ projectName: project?.name,
+ projectColor: project?.color
}
}
@@ -323,3 +349,73 @@ export function buildSessionList(
// array), and hoisting the active project to the top made every click reshuffle the list.
return needle ? groups.filter((g) => g.groups.length > 0 || g.ungrouped.length > 0) : groups
}
+
+/** A status section in status-grouping mode: one live status kind and the sessions in it,
+ * flattened across all (local-core) projects. Order is fixed by STATUS_ORDER. */
+export interface StatusSection {
+ kind: StatusKind
+ label: string
+ rows: SessionRowVM[]
+}
+
+/**
+ * Build the status-grouped session list: every project's terminal nodes flattened into one list,
+ * bucketed by live agent status so sessions needing attention float to the top. Project walls and
+ * canvas sub-group frames are dropped — this is a flat regrouping keyed on status, not a
+ * re-sort within project. Within a section, rows keep a stable order (project store-order, then
+ * title) so the list doesn't reshuffle as statuses change.
+ *
+ * Status comes from the same global `statusById` map `buildSessionList` reads; for local-core
+ * projects that map is live for every node regardless of which project is active. Remote/relay
+ * nodes are absent from it, so they fall through to `idle` — the same way they render in project
+ * mode today, so this introduces no regression.
+ */
+export function buildStatusList(
+ projects: ProjectInput[],
+ liveActiveNodes: SessionNodeInput[] | null,
+ activeProjectId: string,
+ statusById: Record<string, AgentNodeStatus>,
+ filter: string
+): StatusSection[] {
+ const needle = filter.trim().toLowerCase()
+ const keep = (r: SessionRowVM): boolean => !needle || matches(r, needle)
+
+ // Flatten every project's terminal nodes into status-tagged rows. The active project reads its
+ // live React Flow nodes (same rule as buildSessionList); the rest read their serialized nodes.
+ // Canvas sub-group frames are ignored here — status mode is flat by design. The project index
+ // rides alongside (not on the VM) so we can sort by project store-order without a scratch field.
+ const tagged: { row: SessionRowVM; pidx: number }[] = []
+ projects.forEach((p, projectIndex) => {
+ const isActive = p.id === activeProjectId
+ const source = isActive && liveActiveNodes ? liveActiveNodes : p.nodes
+ for (const n of source) {
+ if (n.kind !== 'terminal') continue
+ const row = toRow(n, statusById[n.id], p)
+ if (keep(row)) tagged.push({ row, pidx: projectIndex })
+ }
+ })
+
+ // Bucket by status, then stable-sort each bucket by project store-order then title.
+ const byStatus = new Map<StatusKind, { row: SessionRowVM; pidx: number }[]>()
+ for (const { row, pidx } of tagged) {
+ const list = byStatus.get(row.statusKind)
+ if (list) list.push({ row, pidx })
+ else byStatus.set(row.statusKind, [{ row, pidx }])
+ }
+ for (const list of byStatus.values()) {
+ list.sort((a, b) =>
+ a.pidx !== b.pidx
+ ? a.pidx - b.pidx
+ : a.row.title.toLowerCase().localeCompare(b.row.title.toLowerCase())
+ )
+ }
+
+ // Non-empty sections only, in the fixed order. An empty section has no rows to surface (a
+ // misclassified-as-done session still has a row, so Done is rendered) — see the design's
+ // done/idle-visibility rule.
+ return STATUS_ORDER.map((kind) => {
+ const list = byStatus.get(kind)
+ if (!list || list.length === 0) return null
+ return { kind, label: STATE_LABEL[kind], rows: list.map((t) => t.row) }
+ }).filter((s): s is StatusSection => s !== null)
+}
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 1babb1981..d20b3e54d 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -6546,6 +6546,42 @@ body,
.ss-group { position: relative; }
.ss-group.is-drop-before::before { content: ''; position: absolute; top: -1px; left: 6px; right: 6px; height: 2px; border-radius: 1px; background: var(--accent); pointer-events: none; z-index: 1; }
+/* Sidebar head grouping toggle: a compact SegmentedPill (Project | Status). */
+.sessions-sidebar__head .seg-pill { padding: 1px; gap: 1px; }
+.sessions-sidebar__head .seg-pill-opt { font-size: 10.5px; padding: 2px 8px; }
+
+/* Status-grouped sections (sidebar grouped by status). Always expanded — no chevron, no
+ collapse; the whole point is that needs-attention sessions are visible at a glance. */
+.ss-status { margin: 2px 0; }
+.ss-status + .ss-status { margin-top: 8px; }
+.ss-status__head { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; background: rgba(var(--tint-rgb), 0.035); }
+.ss-status__label { font-size: 12px; font-weight: 600; color: var(--text); }
+.ss-status__count { font-size: 10px; color: var(--muted); }
+.ss-status__icon { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
+.ss-status__icon--attention { width: auto; height: auto; border-radius: 0; color: var(--danger); display: inline-flex; }
+.ss-status__icon--attention svg { width: 11px; height: 11px; }
+.ss-status__icon--working { background: var(--accent); }
+.ss-status__icon--done { background: var(--muted); }
+.ss-status__icon--idle { background: rgba(var(--tint-rgb), 0.25); }
+.ss-status__rows { padding: 2px 0 2px 2px; }
+
+/* Status-mode row: project monogram in place of the plain color mark. */
+.ss-mark--project {
+ width: 18px;
+ height: 18px;
+ border-radius: 5px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 10.5px;
+ font-weight: 700;
+ color: rgba(var(--tint-rgb), 0.95);
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
+ flex: 0 0 auto;
+}
+.ss-meta__project { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.ss-meta__project + .ss-meta__cwd::before { content: '· '; }
+
.sessions-icon-cluster { position: absolute; top: 54px; left: 14px; z-index: 11; }
.sessions-icon-cluster button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: rgba(var(--menu-rgb), 0.92); border: 1px solid var(--border); border-radius: 9px; color: var(--text); cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, calc(0.3 * var(--shadow-k))); }
.sessions-icon-cluster button:hover { background: var(--panel-header); }
diff --git a/src/shared/types.ts b/src/shared/types.ts
index db1882649..033fcf8d4 100644
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@ -915,6 +915,11 @@ export interface Settings {
* `project:<id>:group:<groupId>` (true = collapsed). Pruned on every write against the live
* tree, so a deleted frame or project cannot grow settings.json forever. */
sidebarCollapsedItems: Record<string, boolean>
+ /** Sessions sidebar top-level grouping. 'project' (the default, the historical behavior) groups
+ * sessions under their project; 'status' flattens across projects and regroups by live agent
+ * status so sessions needing attention float to the top. Remote/relay sessions have no live
+ * status in the sidebar and show as idle in either mode. */
+ sidebarGrouping: 'project' | 'status'
/** Fallback view for projects the user hasn't explicitly toggled (canvas or the kanban board).
* Personal machine-local preference; per-project explicit choices override it. */
defaultProjectView: 'canvas' | 'kanban'
@@ -1141,6 +1146,7 @@ export const DEFAULT_SETTINGS: Settings = {
defaultNodeHeight: 440,
sidebarAutoCollapse: true,
sidebarCollapsedItems: {},
+ sidebarGrouping: 'project',
defaultProjectView: 'canvas',
panHoverDelay: 600,
doubleClickFocus: true,