Repository navigation
feat(sidebar): a bot's row carries its running threads, its conversation leaves the chats (#24) - #27
Conversation
…ion leaves the chats (#24) A bot's conversation showed twice — in the Bots section (its row) and again in the chats list — and the count of running threads (the activity row's pill) only reached the second one. - `screens/shell/sidebar`: the bots' rows take `subagents` from their conversation's chat row (its subagents plus its working side chats, the same sum an activity row's pill shows), and the lists of chats skip the conversations of the bots `sessions.bots` names: one bot, one row. A thread a bot started stays an ordinary chat. - `ds/bot_row`: the row shows `SessionRow.subagents` where an activity row's pill stands, between its state badge and its corner. - ADR 0009 amended with both.
crcrworks
left a comment
There was a problem hiding this comment.
VERDICT: APPROVE_OK
patch-id: 9d07932cccd0c11dd22101dcdcb454dbdab99ad2
Status
Reviewed head e15017558, light depth (no agent/risky, no reviewHighRiskPaths for this repo). PR is open, not draft, MERGEABLE, base main, closingIssuesReferences = #24 (Closes #24).
Result
APPROVE_OK. Every acceptance condition below is confirmed; three things are recorded as follow-ups and one thing was not run.
受け入れ条件 (established before reading the diff)
| # | Condition (issue #24) | How I checked | Result |
|---|---|---|---|
| A1 | A bot with a running thread shows the count badge on its row, and the count is the same one an activity row would show | diff of screens/shell/sidebar.luau (bots computed) vs the activity row's subagents; ds/bot_row.luau uses SessionRow.subagents; ran cargo test --test bot_rows; read compare/bots-before-after-s.png |
確認済み |
| A2 | No bot conversation appears in the Activity section; ordinary chats unaffected | diff of the projects computed (bot_chats, skipped in listed and when filling group.sessions); bot_rows::a_bot_conversation_is_not_a_chat_of_the_activity_list; the same screenshot pair |
確認済み |
| A3 | State badge, context ring, click-to-open keep working | bot_rows::a_rows_state_is_its_conversations, a_click_on_a_bot_opens_its_conversation, a_bot_row_is_one_line_tall_with_its_content_centred all pass in the same run; badge + ring visible in after shot |
確認済み |
| A4 | cargo check --workspace --locked and cd apps/zgx && cargo check --locked pass |
local-ci commit status on this head = success (2 commands); I did not re-run them |
確認済み |
| A5 | VM screenshots (vmux, crosspond-<n>): sidebar with a bot running a thread, before/after |
read Shared/crosspond-24/compare/bots-before-after-s.png; Shared/crosspond-24/baseline/{bot_row,sidebar}.luau are byte-identical to origin/main's copies (diff -q), so the "before" half really is the base |
確認済み |
| A6 | The scope decision (all chats with a bot id, or only the main conversation) is decided and recorded on issue #24 | gh issue view 24 comments: main conversation only (sessions.bots[].conversation), with the reasoning (a spawned thread is what the child strip and the right-sidebar archive open) |
確認済み |
Mine, beyond the record (spot checks, 2 commands):
cargo test --test bot_rows→ 7 passed / 0 failed (the two new tests included).cargo test --bin zeron-zgx zeron_v2_is_in_step→ 1 passed. This matters: the diff touchesui/screens/shell/sidebar.luauandui/ds/bot_row.luau, and the shell sidebar is the default's (not v2's overlay file), whileBotRow's props are only added to (a new optionalsubagentsfield), so v2's copy needs no change and.base.jsonneed not be re-recorded. The staleness guard agrees.- Read
Shared/crosspond-24/verification.mdandscenario.sh: the record names the head SHA, the base SHA compared, the failure sets that match base (reload::a_reload_keeps_the_project_editor_open,pointer_cursor::the_sidebar_edge_shows_the_resize_cursor_and_a_row_the_hand), and the exact operations behind the before/after shots.
The count is not a second read: row.subagents = (c.running_subagents or 0) + (c.working_side_chats or 0) at sidebar.luau:496 is the same expression the activity row uses at sidebar.luau:666, both off the chat row the shell already has. SessionRow.subagents hides itself at n <= 0, so a bot with nothing running carries no empty pill (checked in the test: Umi's row has none).
反証 (three ways this could break)
- A person's chats vanish from the list. The filter is keyed on the bot's conversation id only (
bot_chats[b.conversation]), never on a chat's bot id, so neither a person's chat nor a bot-spawned thread is touched. Grounds:bot_rows::a_bot_conversation_is_not_a_chat_of_the_activity_listasserts "Write the docs" is present while both bot conversations are absent; the screenshot shows the same four person chats in the same order and with the same corners before and after. - A project disappears because its only listed chats were bot conversations. The diff also drops bot chats from
listed[group], so an "Atlas" whose chats are all bot conversations is not counted as listed and would fall into the empty/unused bucket. That is the intended direction (a bot conversation with no session of its own makes no session row), and in the fixture Atlas still holds a1/a2/a3/z1 plus Kite's conversation, so the group stays. It is the same behaviour the person sees today for a project whose only chats are archived. - The pill lands on top of the corner, or the row grows. The pill is placed between the state badge and
corner(bot), exactly whereSessionRow.Rowputs it; the test assertsbadge.x >= row.x && badge.x + badge.width <= row.x + row.width + 1, and after #22 the row is one line (SessionRow.SLOT), unchanged here. The screenshot shows the row's height and the ring's place identical before and after.
確認していないこと
zgx test ui(the Luau UI suite) was not run, by the implementer or by me; this environment has nozgxCLI.scripts/ci/test-zgx.sh uicovers it in CI. The two behaviours have headless coverage inapps/zgx/tests/bot_rows.rsagainst the same fixture.- I did not re-run the repo's two verify commands; I relied on the
local-cistatus for the identical head SHA. - An archived bot conversation:
sessions.botsleaves archived bots out (by design,account/sessions.luau), so such a conversation would keep appearing on the sidebar's Archived shelf instead of being filtered. Same for a bot conversation that a person pinned by hand before this change. Both are narrow and a matter of taste; neither is in the issue's conditions. - I did not check
zgx's ownright sidebar/palette/routereaders ofnow.chats; the issue scopes the removal to the sidebar's chat lists.
本文との食い違い
None material. Two small notes:
- The PR body does not list
cargo test --bin zeron-zgx zeron_v2_is_in_stepamong the commands. It passes (I ran it), and the body's v2 note ("needed no change,.base.jsonwas not re-recorded") is correct. - "The two behaviours it would cover are covered by
tests/bot_rows.rson the same fixture" — accurate: those tests mount the real shell UI through the host, not a mock of the sidebar.
FOLLOWUP (not blocking)
ARCHITECTURE.md's "The bots' place in the sidebar" paragraph still describes only the state badge and the context ring. The pill and "a bot's conversation is not a chat of its own" live in ADR 0009's amendment only. Worth a sentence there so the spec's architecture section does not read as if the row's pill never arrived.- Optional: consider the Archived shelf as well if a bot's conversation archived directly should also be represented only by its bot — but that turns on how a bot is archived at all, which this PR does not change.
Closes #24
What
Two related sidebar findings, both in the bots' section and the chats list:
A bot's row now carries how many of its threads run now. The count is
the conversation's chat row's own (
running_subagents + working_side_chats— exactly the sum an activity row's pill shows), read where the shell
already reads that row's state and title: no new call, nothing polled. The
badge is
SessionRow.subagents, the same part the activity rows use, and itstands between the state badge and the corner — where an activity row has
it.
A bot's conversation leaves the chats list. Its row in the Bots
section is the bot (a click opens the conversation, ADR 0009), so listing
it again below was one bot twice. The lists skip the conversations of the
bots
sessions.botsnames. A thread a bot started stays an ordinary chat:it is what the child strip and the right sidebar's archive open, and a
conversation carries the bot's own id whereas a thread carries it too but is
a chat of its own.
Scope decided here (also commented on the issue): only each bot's
main conversation is filtered —
sessions.bots[].conversation. Everychat carrying a bot id is not, because a bot's spawned threads would then
have nowhere to be reached from in the sidebar.
Shared/crosspond-24/before-sidebar.pngShared/crosspond-24/after-sidebar.pngShared/crosspond-24/compare/bots-before-after.png(small:-s.png)In the before shot Sora's row is
Sora @sora Working (ring)and "Umi'sconversation" leads the Activity list; after, the row is
Sora @sora Working ●3 (ring)and the conversation is gone from the list whilethe four chats of the person's own are untouched (Working's count drops 2 → 1
with it).
Files
apps/zgx/ui/screens/shell/sidebar.luau— thebotscomputed takessubagentsfrom the conversation's chat row; theprojectscomputed skipsbot_chats(and does not count them as making a project listed).apps/zgx/ui/ds/bot_row.luau—Bot.subagentsin the type,SessionRow.subagentsin the row.
apps/zgx/ui/shell_fixture.luau—fixture.sora_threads(Sora'sconversation at 2 subagents + 1 working side chat).
apps/zgx/tests/bot_rows.rs— two tests.docs/adr/0009-mvp-bot-ui.md— decision 1 amended (ADR 0009 is the spec'sword on the bots' UI; no new ADR: the same decision, extended).
No Rust host change:
running_subagents,side_chatsandworking_side_chatswere already on the scripts' chat rows, and
sessions.botsalready names eachbot's conversation.
Acceptance (from the issue)
bot_rows.rs::a_bot_row_carries_how_many_threads_run(row reads "3 subagents running" afterfixture.sora_threadssets 2 subagents + 1 working side chat; the other bot's row has none; the pill sits inside the row). Same expression as the activity row'ssubagentsinscreens/shell/sidebar.luaubot_rows.rs::a_bot_conversation_is_not_a_chat_of_the_activity_list(both conversations absent with Activity on, "Write the docs" present) and the screenshotsa_rows_state_is_its_conversations(Working → Input follows the chat row),a_click_on_a_bot_opens_its_conversation(route becomes/session/bot-sora),a_bot_row_is_one_line_tall_with_its_content_centredstill passes; badge and ring are visible inafter-sidebar.pngcargo check --workspace --lockedandcd apps/zgx && cargo check --lockedpasslocal-cistatus on this head)crosspond-<n>): sidebar with a bot running a thread, before/aftercrosspond-24, aboveVerification
Full record:
/Users/crcr/OpenBot/Shared/crosspond-24/verification.md(re-run with
scenario.sh checkandscenario.sh shots [before|after]+scenario.sh compare; scenario atShared/crosspond-24/scenario.sh).cargo check --workspace --lockedcd apps/zgx && cargo check --lockedcd apps/zgx && cargo test --locked --test bot_rowscd apps/zgx && cargo test --locked --test design_lintcd apps/zgx && cargo test --locked --test sidebar_row_ink --test leftovers --test archived_list --test chat_dropcd apps/zgx && cargo test --locked --test reloadcd apps/zgx && cargo test --locked --test pointer_cursorci-local.sh crcrworks/crosspondlocal-ci= successKnown failures, compared on
origin/main(78237f723) in a separate worktreewith the same UI:
reload::a_reload_keeps_the_project_editor_openandpointer_cursor::the_sidebar_edge_shows_the_resize_cursor_and_a_row_the_handfail identically there (same panic, same numbers). Same failure set as base.
Not run:
zgx test ui(the Luau UI suite) — this environment has no zgx CLI(
~/zgx-cli/bin/zgxis absent and installing it builds zgx's own binary at thepinned rev). The two behaviours it would cover are covered by
tests/bot_rows.rson the same fixture; CI'sscripts/ci/test-zgx.sh uirunsit. A
crosspond v2note: v2'sds/sidebar.luaucopy passes no new prop toBotRow, so it needed no change and.base.jsonwas not re-recorded.要相談
None.