Skip to content

feat(spaces): Group a Space's Threads by what they need - #4416

Merged
dcramer merged 2 commits into
mainfrom
feat/space-threads-panel
Nov 26, 2026
Merged

dcramer merged 2 commits into
mainfrom
feat/space-threads-panel

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

The Space panel beside the Lead now lists the Space's Threads in groups, like the Threads tab of Claude Code Projects:

  • Needs you · N first: the tree waits on the viewer, or the latest Turn failed (as in the Space roll-up from feat(spaces): Show a roll-up status on each Space in the pane #4366, a failure outranks work that runs).
  • Working · N, then Waiting · N (the tree watches for an Event or a Timer).
  • Done · N last, collapsed. Its heading opens it.
  • In each group, the newest Message comes first. A row shows its title, a one-line summary (or its latest activity), and its age. One click opens the Thread.

Waiting starts open. Those Threads still have work in flight, and In flight shows them too, so hiding them would put active work two clicks away. Only Done needs nothing and grows without limit, so only Done starts collapsed.

One order

attentionGroups in conversationSections.ts is the only sort. The Threads panel groups with it, and In flight's busy rows (after pins, which keep the viewer's order) use attentionOrder, which flattens the same groups. This changes In flight in two ways: a row that needs the viewer now sorts above rows that work or watch, and busy rows sort by last Message instead of the feed's activity time, like every other list.

Why the Space list was out of order

On main, the Space list sorted only by last Message (newestFirst) and took its icons from the Inbox waiting map. State never changed the order, so a Thread that needed you could sit below newer done ones. The earlier fix (feat/space-conversation-order, c9a4fc55b) added a shared attentionOrder for both lists, but it never shipped: the In flight change waited on a decision, and then the work was held for Lead-children PR 2. This PR replaces that branch.

Copy

A Space's child Conversations are Threads in the dashboard: the panel card and its empty and error text, the Space row's failed label ("A Thread failed"), and the Lead's first-run intro. Internal names do not change.

Mock data

The mock Space feed now gives each row a tree state the way the API does, with needs-you from the viewer's open action items. So in the mock, Billing migration's pane row now shows Waiting on you, and the existing Space and Lead screenshots change with it.

Waits on Lead-children PR 2

agents/lead-children has no open PR and is behind main, so this PR builds on main and does not depend on it. The panel reads GET /api/conversations?spaceId=, so after Space Conversations become children of the Lead:

  • Point the panel's read at the Lead's direct children and their tree state, and drop the spaceId feed filter.
  • The feed reads only the 50 newest roots. A Thread past that is not in the panel, and reading the Lead's children fixes this too.
Dark Light
Desktop dark desktop light desktop
Phone dark phone light phone

via @dcramer.

--

View Session [Sentry]

The Space panel lists its Threads under Needs you, Working, Waiting, and
Done, each newest Message first, with Done collapsed. One shared
attentionGroups order sorts the panel and the busy rows of In flight, so
the Space list no longer sorts by last Message alone.

User-facing copy for a Space's child Conversations says Thread.

Co-Authored-By: David Cramer <[email protected]>
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 26, 2026 3:35am UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 26, 2026
@sentry-junior sentry-junior Bot mentioned this pull request Nov 26, 2026
2 of 12 tasks
@github-actions

Copy link
Copy Markdown
Contributor

285 screenshot changes — 281 changed · 4 added · 0 removed

Review screenshots in Frameshift

Automation Attention · Desktop
Automation Attention · Desktop
Changed
Automation Details Failing · Desktop
Automation Details Failing · Desktop
Changed
Automation Details Failing Light · Desktop
Automation Details Failing Light · Desktop
Changed
Automation Details Healthy · Desktop
Automation Details Healthy · Desktop
Changed
Automation Details Long Instruction · Desktop
Automation Details Long Instruction · Desktop
Changed
Automation Editor · Desktop
Automation Editor · Desktop
Changed
Show 12 more changed screenshots
Automation Editor Conflict · Desktop
Automation Editor Conflict · Desktop
Changed
Automation Editor Public · Desktop
Automation Editor Public · Desktop
Changed
Automation Event Editor · Desktop
Automation Event Editor · Desktop
Changed
Automation Event Editor Any Resource · Desktop
Automation Event Editor Any Resource · Desktop
Changed
Automation Overview Run Details · Desktop
Automation Overview Run Details · Desktop
Changed
Automation Page · Desktop
Automation Page · Desktop
Changed
Automation Page Light · Desktop
Automation Page Light · Desktop
Changed
Automation Paused · Desktop
Automation Paused · Desktop
Changed
Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Automation Run Details Light · Desktop
Automation Run Details Light · Desktop
Changed
Automation Runs · Desktop
Automation Runs · Desktop
Changed
Automation Skill Drawer · Desktop
Automation Skill Drawer · Desktop
Changed

263 more changed screenshots in Frameshift.

Also stop the mock Space roll-up from reading Inbox items, so the pane in
other screenshots stays as it was.

Co-Authored-By: David Cramer <[email protected]>
@dcramer

dcramer commented Nov 26, 2026

Copy link
Copy Markdown
Member

I'm not sure how I feel about this yet because these aren't totally the styles we use elsewhere. And this wouldn't go farther away from unifying it with agent trees and the parent-child hierarchy we already have. It is a little bit more useful, I think, but it also might just be useful enough if it's in sorted order, like this with the icons and the rest of the metadata we have here

@dcramer
dcramer merged commit 1264884 into main Nov 26, 2026
54 checks passed
@dcramer
dcramer deleted the feat/space-threads-panel branch November 26, 2026 03:48
dcramer added a commit that referenced this pull request Nov 26, 2026
Stacked on #4413 (Space Conversations become children of
the Lead). Merge that first; this PR's base is `agents/lead-children`.

A Space's Threads are now the Lead's child Threads, so the Space panel
beside the Lead renders the same Threads panel that every Conversation
with children shows, instead of its own list. #4416
added that custom list; this PR removes it (`SpaceThreads.tsx`).

### The Threads panel, everywhere

`ConversationThreads` now groups its rows, for every Conversation with
Threads and for a Space:

- **Needs you · N**: the child's tree waits on the viewer, or its run
failed or is blocked.
- **Working · N**, then **Waiting · N** (it watches for an Event or a
Timer, or its run is paused).
- **Done · N** last, collapsed. Its heading opens it. Archived Threads
go here, so "Show archived" opens it.
- In each group, the most recent update comes first.

A row's icon now shows a wait on the viewer, work in its tree, or a
Watch over the run's own status, so a row under Needs you or Working
does not show a check mark. Tasks keep their flat list.

Waiting starts open. Those Threads still have work in flight, and In
flight shows them too, so hiding them would put active work two clicks
away. Only Done needs nothing and grows without limit, so only Done
starts collapsed.

### One order

`attentionGroups` in `conversationSections.ts` is the only sort. It
takes rows of any shape with a reader for their group and time. In
flight's busy rows read feed rows (`attentionOrder`), and the Threads
panel reads child agent rows. The group order and the newest-first rule
live in one place.

### API

`GET /api/conversations/:id/agents` now returns each child's `treeState`
and `watching`, from the same `readConversationTreeStates` read that
feed rows and the Space roll-up use. Without it, the panel could not
tell a child that waits on the viewer from one that is done. It adds one
SQL statement to the read, in parallel with the metrics reads. Redacted
rows keep both fields: they show no content.

### Mock data

The mock `/agents` route answers a Lead with its Space's Conversations
as child Threads, as the API does after #4413.

### Follow-up deletion

Space-only code that the Lead's children now duplicate. This PR keeps
it:

- `packages/junior-dashboard/src/client/spaces/queries.ts`
`useSpaceConversationsData`, and its read in
`packages/junior-dashboard/src/client/lead/useLeadWork.ts`
`useLeadWork`: the Lead looks up its Space's Conversations from the
`spaceId` feed, which are now its child Threads.
- `packages/junior/src/api/conversations/list.ts`
`conversationSpaceFilter`, the `spaceId` field of
`conversationFeedQuerySchema` in
`packages/junior/src/api/schema/conversation-feed.ts`, and the mock
`filterMockConversationsBySpace` in
`packages/junior-dashboard/src/mock-reporting/spaces.ts` (and its branch
in `conversation-reports.ts`): the feed filter goes once nothing reads
it.
- `packages/junior-dashboard/src/client/lead/leadWork.ts`
`LeadWorkState` and
`packages/junior-dashboard/src/client/lead/LeadWorkStatus.tsx`
`leadWorkStatus`: a second set of states and icons beside
`ConversationStateIcon`, used by the Lead's watch reports
(`lead/watchReport.ts`, `lead/LeadWatchReport.tsx`).

| | Dark | Light |
| --- | --- | --- |
| Desktop | ![dark
desktop](https://junior-prod.sentry.dev/public/artifacts/cc616c98-0230-4cae-86c4-706801ad0f9b.png)
| ![light
desktop](https://junior-prod.sentry.dev/public/artifacts/3cdbc28c-0180-4e93-93d7-d07693c50980.png)
|
| Phone | ![dark
phone](https://junior-prod.sentry.dev/public/artifacts/8371ad70-450b-4fc4-ab48-18865a29a51d.png)
| ![light
phone](https://junior-prod.sentry.dev/public/artifacts/ba207bc6-165e-4ca4-b8bc-e871f0f8ea04.png)
|

<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ab5ee8d5333087bc45e7c6d1574b48eaf -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ab5ee8d5333087bc45e7c6d1574b48eaf)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab5ee8d5333087bc45e7c6d1574b48eaf/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>
dcramer added a commit that referenced this pull request Nov 26, 2026
…ead design (#4428)

States where Spaces and the Lead are heading. A Space uses the core
Conversation tree (parents, roots, Participants, access, stops,
archives, Watches, updates), and only a few Space-specific layers sit on
top of it.

- `design/spaces.md` is rewritten. The Lead is the root of the Space's
tree. Every Space Conversation, whether the Lead starts it, a person
starts it in the Space, or a person moves it in, is a child of the Lead
and has the Lead as its root. Children inherit the Lead's Participants.
Archive and snooze act per child. The file lists the Space layers
explicitly: metadata, membership, configuration, the Lead's prompt and
tools, moves, and rendering (the sidebar, the Threads panel, and
top-level lists).
- `design/lead.md` is new. It covers the Lead's role, its curated
manager tool set (it runs Threads, reads, plans, and asks people, and it
never writes or runs code), and the Turn gates: explicit reply on child
and Event Turns, quiet `done` updates, and child results as claims. Gaps
record what is not on main yet.
- `design/agent-teams.md`: a Lead's team is its Space, and the Lead gaps
move to `lead.md`.
- `design/child-agents.md`: removes contradictions with Spaces. A move
changes a child's parent, a moved Conversation delivers to its own
Location, and the 8-child limit does not apply to a Lead's children.
- `TERMINOLOGY.md`: updates Lead, Space, Thread, Team, Delivery, and
Participant, and adds Top-level Conversation (derived, not stored).

Related: #4377 (`thread` kind), #4411
and #4414 (moves), #4416 (Threads
panel).

#4413 edits some of the same lines. After this merges,
it should drop those doc changes and delete only the gaps it closes.

<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A56172fc7761dc3a4c09f6bc7 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3A56172fc7761dc3a4c09f6bc7)
[[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A56172fc7761dc3a4c09f6bc7/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>
@sentry-junior

sentry-junior Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Agreed, and the follow-ups took that path. #4433 replaced this custom list with the shared agent-tree Threads list: the same rows, icons, and metadata, in attention order with Done collapsed. #4444 then made a Lead render the regular ConversationDetailsPanel, with the Space's About, Members, and Settings as a small section inside it. It also deleted SpaceDetailsPanel. SpaceThreads is gone from main, so the Space view now uses the same parent-child panel as any Conversation with children.

This branch was successfully deployed

1 active deployment
Preview – junior-docs — eebffca6 Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants