Skip to content

feat(web): group flagged threads into sidebar sections with a colour rail - #43

Merged
tomaswitek merged 2 commits into
livemapfrom
jarvis/flag-sections
Nov 26, 2026
Merged

tomaswitek merged 2 commits into
livemapfrom
jarvis/flag-sections

Conversation

@michischuerm

Copy link
Copy Markdown
Contributor

Problem

Thread flags (urgent / later / working, #21) only show as a small icon per row. In a long sidebar, flagged threads don't stand out, so people fall back to title prefixes like "WORKING:".

Change

  • Flag sections inside Active: Urgent → In progress → Later → Other (unflagged), each with a header, icon and count. Headers only appear when at least one active thread is flagged; empty sections hide. Grouping is a stable split of the existing active sort, so order within a section doesn't change.
  • Colour rail: flagged card rows get a 3px rail in the flag colour (red / amber / grey), in Pinned, the flag sections and the Working shelf. Settled and snoozed rows stay plain.
  • "In progress", not "Working": the existing Working shelf already means "agent running", so the section header uses a different word.
  • Kept to fork-owned files where possible: grouping and labels live in threadFlags.ts, the header and rail in a new SidebarFlagSectionHeader.tsx. Upstream files get small hooks only (a marker type, SortableSidebarMarker exported, an optional railClassName on card rows), to keep upstream syncs easy.

Not in this PR:

  • Dragging a row into a flag section doesn't set the flag. Flag headers hide during a drag; the Pinned / Active boundaries work as before.
  • No flag headers in project-folder mode, because folders already group the rows.
  • Section labels are English only, like the existing flag menu.

Scope

Livemap fork feature on top of the thread flags, not for upstream.

Verification

  • groupThreadsByFlag unit tests (section order, order within sections, empty sections left out); existing Sidebar.logic + Sidebar.drag tests pass (131).
  • vp run check:changed: format, typecheck and react compiler pass; knip passes after the fix. Lint fails only on existing untranslated copy in other fork files; tests fail only in packages/ssh tunnel tests (macOS shasum/gzip), both untouched here.
  • Manual check in vp run dev on a pruned copy of real threads: sections appear and update when flagging from the context menu; red/amber/grey rails show on flagged rows, including pinned ones.

🤖 Generated with Claude Code

…rail

Urgent, In progress and Later get their own headers inside the active
section, above unflagged threads (Other). Flagged card rows carry a
coloured rail in Pinned, the flag sections and the Working shelf.
Headers show only when an active thread is flagged; project folders
keep their own grouping.
Flag sections regrouped the active list and drew rails for everyone,
including with thread flags off and inside project folders, where no
header explains the new order.

A Flag sections switch under Settings → Ari now controls the grouping
and the rail (on by default). It follows Thread flags: with flags off,
the sidebar keeps its usual order and shows no rail. Folders keep
their own order.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@tomaswitek

Copy link
Copy Markdown
Contributor

Review notes before merging. I pushed one follow-up commit (8c0ac00) instead of asking for changes:

  • Flag sections is now a setting. Settings → Ari → Flag sections (ariThreadFlagSectionsEnabled, on by default) turns the grouping and the rail off and leaves the flag icon. It is searchable in settings and documented in docs/user/ari.md.
  • Thread flags off was ignored. With Settings → Ari → Thread flags off, the active list was still regrouped, headers still showed and rows still got a rail, while the icon, filter and menu were hidden. The sections now follow that switch.
  • Folders were reordered without headers. partitionSidebarThreads grouped by flag in every mode, so project-folder rows were silently re-sorted by flag although the headers are flat-list only. Grouping is now skipped in folder mode.

Left as is, worth knowing:

  • With the Working section on, a thread that returns to the inbox lands at the top of its flag group, so an unflagged thread that needs you sits below every Urgent / In progress / Later thread.
  • Dragging an active row across flag groups snaps back to its group (already listed under "Not in this PR").
  • Section labels are English only.

Checked: threadFlags, Sidebar.logic, Sidebar.drag, settingsSearch, contracts settings, useSettings and DesktopClientSettings tests pass; typecheck passes for contracts, client-runtime, web and desktop; lint, format and knip pass on the changed files. Not run in a browser.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants