Skip to content

Work sidebar: promote 'stale' badge into a 'settled' thread lifecycle tier #870

Description

@arul28

Why

The Work sidebar accumulates finished/idle chats with no way to auto-quiet them. Competitor t3code shipped a "settled" thread lifecycle: finished threads auto-quiet into a paged tail but stay in the live list (distinct from archive); auto-settle on PR merge/close or N-day idle; auto-unsettle on new activity. We already have the visual for this — the SessionCard "stale" badge — but it is purely cosmetic today (it does not re-bucket, quiet, or page the row).

Approach (mostly derivation, not a new subsystem)

  • Add a settled classifier as a sibling of the running/awaiting/ended bucket in lib/terminalAttention.ts (:188), split out where buckets are built in useWorkSessions.ts (:1291-1308). Derived every render → auto-unsettle-on-activity is free.
  • Settle triggers from fields we already have: N-day idle via lastActivityAt (generalize STALE_RUNNING_CLI_SESSION_MS, lib/sessions.ts:44, from CLI-only to all tool types) + PR merged/closed via selectPrimaryLanePr(lane, prsByLaneId).
  • Render in the live list (not archive): a 4th "Settled" section below "Ended" in Status grouping (SessionListPane.tsx:757-790) and/or a collapsed paged tail per lane/time group.
  • Filter: a "Show settled" toggle chip in the funnel panel next to the Lane combobox (SessionListPane.tsx:1012-1035), backed by a new boolean in WorkProjectViewState (appStore.ts:145-184).
  • Reuse the existing stale visual (outlined/muted + Clock glyph, SessionCard.tsx:164-186).
  • Ordering is already startedAt DESC (creation order), so no row jitter — matches t3code's "activity never reorders rows" rule for free.

Optional (cross-device manual override)

Add settledAt? to TerminalSessionSummary + a terminal_sessions.settled_at column (mirror archive pattern: kvDb.ts:1867, sessionService.ts:1115-1136). Only needed if manual settle/unsettle must sync phone↔desktop.

Acceptance

  • Finished/idle + PR-merged/closed chats collapse into a Settled tier but remain openable in-stream.
  • New activity instantly un-settles; no reordering/jitter.
  • "Show settled" toggle in the filter panel.

Source

t3code Sidebar v2 / settled lifecycle (PRs #4026/#4243/#4280); ADE slot-in analysis this session.

Activity

  1. linear-code commented on Jul 22, 2026

    @linear-code
  2. self-assigned this
    on Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions