Skip to content

feat(spaces): Show a roll-up status on each Space in the pane - #4366

Merged
dcramer merged 5 commits into
mainfrom
feat/space-roll-up-status
Nov 25, 2026
Merged

dcramer merged 5 commits into
mainfrom
feat/space-roll-up-status

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Each Space row in the sidebar (desktop pane and phone entries) now shows one monochrome icon for what its Conversations need from the viewer. The first that applies wins:

  1. Waiting on you: question mark, the same shape as In flight.
  2. A Conversation failed: alert.
  3. Working: spinner.
  4. Idle: nothing.

GET /api/spaces adds treeState and latestTurnFailed to each Space. Feed rows already use these fields and their SQL. The roll-up covers the Space's Conversations that the viewer can read and that are not archived, the Lead included. It reuses readConversationTreeStates and conversationTurnFailedSql. A failed Turn waits on its starter, so the starter sees "Waiting on you" and other members see "failed". One read rolls up at most 200 Conversations, newest activity first.

The pane refreshes the Space list when the viewer's conversations or inboxItems version token moves. That is the same trigger as the feeds and the Space page. Work by other members that never touches the viewer's feed shows on the next token move or on focus. The Space page has the same lag today.

In flight rows now show their state on the right, as Space rows do. On hover, on focus, or while its menu is open, the row's ⋯ takes the state's place. Phones show both, because the ⋯ always shows there. The title takes the old icon column. Inbox rows already put the state on the right. Thread rows on a Conversation keep the status on the left, because their right slot holds the age or the running spinner.

Moving a Conversation to or from a Space, or archiving it, also refreshes the Space list.

design/spaces.md gets one rule for the roll-up and the In flight decision below.

In flight: keep Space Conversations (recommendation)

In flight keeps Space Conversations. The closest products keep project or Space work in their global lists. They group or filter by project, and they do not hide the rows:

  • Claude Code desktop: "The new sidebar puts every active and recent session in one place… You can filter by status, project, or environment, or group the sidebar by project." (source) When an update removed the running dot from each session, users said they "can no longer tell which ones are still working without opening each one." (anthropics/claude-code#108131)
  • Claude Code web: "Sessions appear in the sidebar at claude.ai/code." (source)
  • Amp threads: "The sidebar lists your recent threads. Pinned threads come first, then the rest grouped by project." Activity "shows every thread you can see… Filter by time, status, author, or project." (source)
  • Amp Spaces: each thread in a Space is "a live card that shows the thread's live status and whether it needs someone". People drag threads "from the sidebar onto the Space", "and the threads nested under it in the sidebar move with it." (source) Space threads seem to nest under the Space, but the docs do not say whether they leave the flat list. They still show in Activity.

One roll-up icon cannot stand in for the rows. It shows one state for many Conversations, so finding the one that works or failed takes a click. Its refresh also lags for other members' work, as described above. If In flight gets crowded, the evidence supports grouping its rows by Space, as Amp does, with pins first. It does not support hiding them.

Screenshots

Dark Light
Desktop
Phone
In flight, hover

Mock data, one state for each Space: Billing migration waits on you, Mobile app failed (one of its Conversations also works), and Pricing launch works.

via @dcramer.

--

View Session [Sentry]

@vercel

vercel Bot commented Nov 25, 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 25, 2026 10:11pm UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 25, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@dcramer

dcramer commented Nov 25, 2026

Copy link
Copy Markdown
Member

We probably need to change the other lists of conversations that have the status indicator on the right side, too. And the buttons just show up on hover and will hide the status indicator or something

@dcramer dcramer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of this should be able to just read the lead conversations aggregate state once we refactor the lead to use the standard parent-child relationships

@dcramer

dcramer commented Nov 25, 2026

Copy link
Copy Markdown
Member

Let's make sure we're getting this updated with main

sentry-junior Bot and others added 5 commits November 25, 2026 22:03
Each Space row in the pane shows what its Conversations need from the
viewer: waiting on you, then failed, then working. The Space list API
rolls up the tree state and the failed latest Turn of each Space's
Conversations that are not archived.

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 03d8045. Configure here.

props.selected ? "page" : undefined,
props.phone,
false,
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show all misaligned after icon move

Low Severity

In flight titles now start in the old leading-icon column, but Show all / Show fewer still uses ml-10 to match titles that sat after that column. The control sits indented relative to the names it expands.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 03d8045. Configure here.

@sentry-junior

sentry-junior Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

The branch is already current with main. I rebased the stack (this PR and #4375) onto main in 382a4d75c, and main has no newer commits. Checks are running on it now.

On the review note: agreed. Once the Lead is the parent of its Space's Conversations, readSpaceStates can read the Lead's tree state instead of rolling up the roots itself.

Comment on lines +344 to +351
const states = rows.map(
(row) =>
row.treeState ??
(row.status === "needs_input"
? "needs_you"
: row.turnActive || row.status === "working"
? "working"
: "done"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mock Space roll-up treats Billing migration as idle despite open viewer questions

spaceState only maps missing treeState from status/turnActive, but seeded internal:questions-qa stays status: "done" with no treeState while three open Inbox items wait on the viewer, so Billing migration’s pane icon stays empty instead of “Waiting on you”.

Evidence
  • SEEDED_CONVERSATION_SPACES puts internal:questions-qa in Billing migration (MOCK_SPACE_IDS.billing).
  • mockQuestionConversations never sets status or treeState; detail() defaults status to "done", and mock feed rows never add treeState.
  • Inbox seeds keep three status: "open" items on MOCK_QUESTIONS_CONVERSATION_ID for the viewer.
  • The new fallback only yields needs_you when row.status === "needs_input", so spaceState returns treeState: "done" and the Space row shows no icon.

Identified by Warden · code-review · E37-MWA

@dcramer
dcramer merged commit 204ade9 into main Nov 25, 2026
56 checks passed
@dcramer
dcramer deleted the feat/space-roll-up-status branch November 25, 2026 23:07
dcramer added a commit that referenced this pull request Nov 25, 2026
… is open (#4375)

Stacked on #4366.

The pane's Space row was current only on the Space page. Now a
Conversation page also marks its Space's row, with the same fill and
`aria-current="page"`. A child Thread or Task marks its root's Space.

The Space comes from the Conversation detail's `space` field, which the
server resolves from the root. The pane does not walk the parent chain,
so this keeps working if Space Conversations become children of the
Lead. `ConversationWorkspace` passes the id through `InboxNav` to
`SpacesNav`. The In flight row selection does not change.

A phone shows no pane beside a Conversation, so only the desktop pane
changes.

| | Before | After |
| --- | --- | --- |
| Dark | <img
src="https://junior-prod.sentry.dev/public/artifacts/6528d01c-8e5f-419c-bfa0-598931853594.png"
width="240"> | <img
src="https://junior-prod.sentry.dev/public/artifacts/4081bf1c-93e5-4f78-96d5-9296af6cec18.png"
width="240"> |
| Light | <img
src="https://junior-prod.sentry.dev/public/artifacts/cd6de1fc-2892-43f7-b061-244d79a0b3a3.png"
width="240"> | <img
src="https://junior-prod.sentry.dev/public/artifacts/90e08ae2-e402-445c-a450-3e5cd6c0d787.png"
width="240"> |

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

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

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ad6c98ca38047535e9cec28fafe1aeaa6)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ad6c98ca38047535e9cec28fafe1aeaa6/?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
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 #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](https://junior-prod.sentry.dev/public/artifacts/6d8fd9a8-bf35-43c0-b1b1-89fb4abbf6e4.png)
| ![light
desktop](https://junior-prod.sentry.dev/public/artifacts/9b4ea33f-598e-4d49-b7c4-9c59b3e5d956.png)
|
| Phone | ![dark
phone](https://junior-prod.sentry.dev/public/artifacts/222ca9d6-487f-4b8b-baa5-4c4442e79bb8.png)
| ![light
phone](https://junior-prod.sentry.dev/public/artifacts/b367ebb0-1fe8-4102-860a-9bdeee6063da.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
Every Conversation in a Space is now a child of that Space's Lead, so
the normal parent-child behavior applies to Space work: results go back
to the Lead, and the Lead can `messageAgent`, `listAgents`, watch, stop,
archive, and roll up its children.

Why: a Lead started Space work as separate roots that stored no link to
it, so it could not stop or archive that work, and results did not come
back to it. Space work now uses the same tree as every other agent's
child agents.

## Tree model

This is the normal parent-child tree. A Conversation in a Space has
`parent_conversation_id` = the Space's Lead, and the Lead is the
`root_conversation_id` of every Conversation in its Space, at any depth.
No column is added. Only the Lead stores `space_id`, and a Conversation
reads the Space of its root (`rootSpaceIdSql`). State that keys on the
root, such as Participants and access, comes from the Lead, so the
Space's Conversations inherit it as any child agent does. Top-level
Space work means a Lead's direct child (`topLevelConversation`: no
parent, or a parent that is a Lead).

## Behavior

- The Lead starts Space work with `startAgent`. `startConversation` is
gone: the tool, its registry entry, the Lead prompt lines, the dashboard
transcript card, and its evals. The Lead transcript shows its children
as child agent rows, as any parent's does. A person who starts work
directly in a Space also makes a child of the Lead, run as that person.
- A move into, out of, or between Spaces re-parents the Conversation.
Into a Space it becomes a child of the Lead. Out of a Space it becomes a
root again. Its subtree moves with it: `root_conversation_id` becomes
the new Lead or the Conversation itself, and a move into a private Space
makes the subtree private. A move of a private Conversation into a
public Space is refused. The moved root's Participants, pins, and
choices do not carry over to the Lead.
- A Slack Conversation that moves into a Space keeps delivering to its
own Slack Location, and keeps its own delivery pause. Only a
Conversation with its own Location delivers to it.
- A Lead has no 8-active-child cap, and its children count as roots for
`maxAgentDepth`.
- A Lead gets a Turn for each result of its children, like any parent.
- A stop of the Lead stops its children through the parent links.
- `listAgents` is now a direct Lead tool.
- Guardian: a deliberate Lead exception to judging a Lead's task like
any parent's. The rule that reads a member's worry as a request moves
from `startConversation` to a Lead's `startAgent`. Core marks the Lead's
Run (`context.lead` on the proposal), and review adds the rule only for
`startAgent` in that Run. This matches the `lead-member` rule in
design/guardian.md, which stays as it is.
- Top-level lists, the sidebar, In flight, and the Space roll-up treat a
Lead's children as top-level Space work. Access to a private Space's
work comes from being a Participant of its Lead.

## Space roll-up query

`readSpaceStates` (the sidebar's roll-up from #4366) now
reads the Lead and its direct children. A subquery finds the Leads of
the listed Spaces through `junior_conversations_space_lead_idx`. The
outer query reads the rows whose id is a Lead (primary key) or whose
parent is a Lead (`junior_conversations_parent_idx`), unarchived and
readable by the viewer, newest activity first, up to 200.
`readConversationTreeStates` then covers each child's own child agents.

## Space membership

A Space's members are now the Participants of its Lead. The separate
member table is no longer read or written.

- Creating a Space creates its Lead, with the creator as its first
Actor, so the creator is the first member.
- Joining or adding a person makes them a Participant of the Lead.
- On the web, only members post in a Space's Conversations. Before, only
the Lead refused non-members, so a web post in a public Space
Conversation made the poster a member.
- Leaving deletes the person's Participant row on the Lead. The last
member of a private Space still can't leave.
- Member lists, member counts, the viewer's membership, private-Space
access, and user search read Participants of the Lead. The member list
drops `joinedAt` and orders by email.

## Migration

`20261126033000_space_conversations_lead_children`, data only:
- Makes a Lead for every Space that has none yet. Its first Actor is the
Space's creator.
- A private Conversation in a public Space leaves the Space and stays a
private one-off. An Automation run leaves its Space, because it never
has a parent.
- The work of every other non-Lead root with a `space_id` joins the
Lead's tree: `root_conversation_id` becomes the Lead for the root and
all its child agents.
- Each such root becomes a child of its Space's Lead, with an agent
config, and its `space_id` is cleared.
- Copies each Space member onto its Lead as a Participant.

`junior_space_members` stays in the schema, unused. A later migration
drops it once a release that does not use it is live, as
`migration-locks` requires.

During the deploy build, the live release runs against the new tree for
minutes. In that window it reads a Space Conversation as a child of the
Lead, so its Turns report to the Lead instead of their Location. A
person who joins a Space through the old release in that window lands
only in the old table.

## Docs

- `design/spaces.md`, `design/child-agents.md`, and
`design/agent-teams.md` get the confirmed text. The
`design/agent-teams.md` gap "Agents use different tools…" stays as it
is, and `design/guardian.md` does not change.
- `TERMINOLOGY.md` defines "Top-level Conversation", updates the Lead,
and defines a Member as a Participant of the Lead.
- `policies/conversation-access.md` updates the Lead write exception,
the start line, and Space membership.

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

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

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A3592dde66d9c9d7cef31b8da632e1089)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A3592dde66d9c9d7cef31b8da632e1089/?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]>
Co-authored-by: David Cramer <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 382a4d75 Deployed Nov 25, 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.

1 participant