Repository navigation
feat(sidebar): group sessions per machine behind the remote-sessions preview - #16756
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that relay slots ( [DESIGN-REVIEWED] d786c5f Description read[DESCRIPTION-READ] f6c04e6af57a742ef1249ad8d8c588d8a14d62dd23918f920f30cf0831346058 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The in-group tunnel-error notice is a fifth way of showing Not justified as shipped
What this change shipsInventory (8 items) — 7 justifiedIntent: let a user see which machine owns each session, and whether it is reachable, by grouping the Sessions list per crew. ADDITION (RFC wave 2,
[FIRST-PRINCIPLES-REVIEWED] d786c5f Description read[DESCRIPTION-READ] bb2b29414394a85b6c4c2260ce8a2c1960074725f0da6b3e7aaebb7b74b958b9 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🔴 BLOCKUX-level review of UX-Verdict: BLOCK cannot evaluate: missing the collapsed crew group and the shipped offline row hint. The offline screenshot shows copy that is not in this diff. Evidence gaps
Watch
Suggestions
[UX-REVIEWED] d786c5f Description read[DESCRIPTION-READ] 9e2e833879748018ed2bc0dd89e7809bd1a56b4cb1c39110ba8561eea6b9e5d2 That sha256 names everything this verdict read: the PR description, plus the 9 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
a3abf49 to
fff3dc7
Compare
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
…preview Wave 2 of the remote-crew sidebar RFC. With the Remote crew sessions preview on, the Sessions list shows Local first, then one collapsible group per crew. Each group header carries a badge from the tunnel state (online, reconnecting, error). A local slot whose turns run on a crew is filed in that crew's group. A crew that disconnects keeps its last listed rows in the query cache, rendered dimmed under a "not connected" line; nothing asks the offline crew again. Collapsing a group never changes the selection. With no crew group the sidebar draws no group chrome, so a single-machine list is unchanged. The board keeps every row in its columns. Part of #6180
7f46805 to
d786c5f
Compare
|
|
|
|
buluoray
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Reviewed at d786c5f.
Re-review after a force-push dismissed the approval at 7f46805. git range-diff shows the patch is the same except for rebase context: main replaced the adopt flow with the crew window, so the PR's ChatSidebar.tsx hunks now sit next to openCrewWindow instead of adopt state, and the feature-map row was rewritten on top of main's new "crew window" row. CrewGroups.tsx, useInstanceSessions.ts, sessionSources.ts, persistence.ts, history.md and the tests are unchanged. The earlier findings still hold. The red CI checks come from infrastructure, apart from one UX-bot BLOCK about missing screenshots. That BLOCK is about the PR's evidence, not its code, and it still gates readiness.
What I verified
- Range-diff 7f46805 → d786c5f. The only differing hunks are in
docs/feature-map/README.md(now built on main's crew-window row, with the badge list now includingoffline), the locale files (context only: main dropped theadopt_*keys) andChatSidebar.tsx(context only: adopt state becameopenCrewWindow/useCrewWindow;when: !!peerIdis main's line). The PR's own added lines are identical. - Flag-off is the same as main.
website/src/pages/chat-sidebar/sessionSources.ts:159-162returnscrewGroups = []while the preview is off. That makesshownCrewGroupsempty andcrewRowsById.size === 0, solaneSlots === filteredSlots(website/src/pages/ChatSidebar.tsx:3021-3025) andlocalGroupHeader/renderCrewGroups()render nothing (ChatSidebar.tsx:3611-3619). The board passesNO_CREW_GROUPS(ChatSidebar.tsx:3012).useInstanceSessionswithenabled=falsebuildslisted = [], so it makes no request (website/src/hooks/useInstanceSessions.ts:305-308). - Offline crews drop live state.
running: live && …andpending_approval: live && …(useInstanceSessions.ts:361,365). Only connected crews fetch:enabled: enabled && isConnected(inst)(useInstanceSessions.ts:384). This fails closed: a cached row never claims it is running or waiting for approval. - No credential or data leak. No new fields reach the browser. Peer rows go through the same
str()allowlist. The group header shows onlyinst.name, the badge andinst.status.error, the tunnel error text that four instance surfaces already render. - Specs.
docs/system-specs/modules/history.md:212-217,235-239describes the grouping, the offline caching and the new owners (CrewGroups.tsx, the collapsed-crews key inpersistence.ts). I grepped docs/ and website/src for the old "merged into the local list / ordered with local rows" wording and found no stale copies. - Tests run locally (vitest, targeted only):
ChatSidebar.machineGroups,useInstanceSessions,ChatSidebar.instanceSessionsMerge,ChatSidebar.chevronGrammar,ChatSidebar.ownerComposition. 5 files and 66 tests passed. Coverage on the new code:CrewGroups.tsx100% lines,useInstanceSessions.ts100% lines,sessionSources.ts96.7%. Inpersistence.ts, only thecatchofreadCollapsedCrews(line 116) is uncovered. That file's whole-file number in this subset (73.6%) is not comparable to the full-suite per-file gate. - Mutations (each reverted;
git status --shortis clean):- dropping
live &&onrunningturnsuseInstanceSessions > keeps a crew's last rows after it disconnectsred; - the same on
pending_approvalturns the same test red; enabled: enabled && isConnected(inst)→enabledturnsnever queries a disconnected instanceandmachineGroups > renders the same sidebar as the flag-off onered;- dropping
|| owned.has(inst.id)increwGroupsForturns 5 tests red (offline group, tunnel error, reconnecting/error badges, rename across disconnect); - dropping
live &&onr.isError(useInstanceSessions.ts:323) survives. See follow-ups.
- dropping
- CI at d786c5f. The run on attempt 1 tallied 1 failure, 28 in progress, 10 queued, 44 success and 7 skipped, read while attempt 2 of CI was still running.
- Await Fast Gate (attempt 1, job 111937564929) is infrastructure. Fast Gate attempt 1 had its
Working-Directory Path Gatejob cancelled, so the barrier never saw a verdict. Fast Gate attempt 2 succeeded, and Await Fast Gate attempt 2 (job 111960692613) passed. - Coverage Gate (job 111942394608) is downstream of that. Its failing step is "Require upstream coverage jobs to have succeeded": every test and coverage-merge job was skipped behind the failed barrier. It did not measure this diff. CI attempt 2 is re-running the shards now, so the real coverage verdict is still pending.
- UX Review is a real BLOCK, caused by this PR's evidence and not by flakiness. The screenshots predate the current copy: they show "Crew not connected; opens once it is back", while
en.jsonshipscrew_row_offline: "Not connected right now". There are also no stills of the collapsed group, the Reconnecting/Error badges, the in-group error notice or the empty group. The code is correct. The author has to re-capture screenshots at HEAD to clear the gate.
- Await Fast Gate (attempt 1, job 111937564929) is infrastructure. Fast Gate attempt 1 had its
- Auto-merge is ON,
reviewDecision=REVIEW_REQUIRED,mergeStateStatus=BLOCKED.
Non-blocking follow-ups
useInstanceSessions.ts:323: no test pins thelive &&guard onr.isError(the mutation survives). Add a case where a crew errors and then disconnects, and assert that it is not listed infailed. The guard fails closed either way: without it the user sees a stale error notice.persistence.ts:116: thecatchbranch ofreadCollapsedCrews(corrupt localStorage) has no test.- PR body: the test notes say "
crewBadgecovers only the three tunnel states", butcrewBadgenow maps four states (offlineincluded). The UX bot's copy suggestions ("Click to view here", keep a stale count while offline) and the First Principles CONCERN (the in-groupErrorNoticeduplicates existingstatus.errorsurfaces) are advisory and are the author's call. - Re-confirm Coverage Gate on CI attempt 2 before relying on the approval. Approving now arms the merge once UX Review and CI clear.
Before this merges
Auto-merge is armed, so this approval merges the PR as soon as the gates clear. Please re-capture the screenshots at HEAD (the current ones show the old offline copy, and there are no stills of the collapsed group, the Reconnecting/Error badges or the in-group error notice) instead of overriding the UX lane, and let CI attempt 2 finish: Backend Tests (Windows) (3) was red at the time of this review, on a frontend-only diff.
bolichen97
left a comment
There was a problem hiding this comment.
Requesting changes: no code bug found, but this regroups the Sessions list for everyone who turned on the remote sessions preview.
This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here.
The RFC was written and accepted by the same maintainer, so it does not yet carry a second sign-off. Checked website/src/pages/ChatSidebar.tsx: a row whose crew has no group stays in the Local list, so no row is lost, and a disconnected crew keeps its cached rows with live state cleared (website/src/hooks/useInstanceSessions.ts:361).
AI-assisted review, posted at maintainer request.
bolichen97
left a comment
There was a problem hiding this comment.
Approving: a maintainer has signed off on the design for this change, and my earlier review found no code bug at this head.
AI-assisted review, posted at maintainer request.
Problem / Motivation
Goal: With the Remote crew sessions preview on, the Sessions list shows one group per machine, so a user can tell at a glance which machine owns a session and whether it is reachable.
Today a connected crew's sessions are mixed into the local list, told apart only by a per-row badge. A crew that drops off takes its rows with it, so the list jumps and the user loses sight of what was running there.
Why it matters
The remote-crew sidebar RFC (
docs/request-for-change/rfc-remote-crew-sidebar.md, wave 2) makes origin a container, not a row property. Later waves (the window view, retiring relay slots) assume rows already sit under their crew's group.Not a goal
remote_not_connected).executor: 'remote'): they still render, inside their crew's group, until wave 4.What changed (motivation → approach → change)
Local, then one group per crewconnected→ Online,connecting→ Reconnecting,error→ Error,disconnected/stopped→ OfflineErrorNoticeinside the groupThe RFC overrules the old "merged, not sectioned" rationale, so
hooks/useInstanceSessions.tsnow also derives the groups (crewGroupsFor,crewBadge,crewOf). A crew gets a group when it can be listed, or when a row belongs to it. Each dashboard-running crew keeps its query observer, and only the fetch is gated onconnected, so react-query keeps the last answer in memory after a disconnect. A reload clears it. A cached row drops itsrunningandpending_approval, because neither is true now.pages/chat-sidebar/sessionSources.tsexposes the groups.pages/ChatSidebar.tsxsplits crew-owned rows (peer rows and relay slots) out of the filtered list, then renders them after the local rows and the Older Sessions link in the flat, tree and conductor lanes. Filters, sort and the folder filter apply to them unchanged, and the "No sessions match" notes in every lane count them. The newpages/chat-sidebar/CrewGroups.tsxdraws the headers with the sidebar'sDisclosureChevronand animates collapse throughFolderBody, which keeps the rows mounted. Collapse state is kept per crew id in localStorage (mc-sidebar-crew-collapsed, declared inpages/chat-sidebar/persistence.ts) and never touches the selection. "Reveal in sidebar" opens a collapsed crew group. The board view groups nothing. New strings are in every locale catalog underwebsite/src/i18n. The feature map row for peer-owned live sessions (docs/feature-map/README.md) and the Sessions sidebar section ofdocs/system-specs/modules/history.mddescribe the grouped list.Backwards compatibility
Compatible: everything sits behind the
PREVIEW_INSTANCE_SESSIONSflag. With the flag off, or with no crew group, the sidebar renders the same markup as main (pinned by a snapshot-equality test).Removes nothing: no route, field, key or public function is removed; peer rows move from the mixed list into their crew's group on the same screen.
Tests
website/src/test/ChatSidebar.machineGroups.test.tsx(new): one connected crew gives aLocalgroup and a crew group, with the relay slot inside it. Collapse keeps the selection. A disconnect keeps the rows, dimmed, with no online badge, and nothing refetches. A reconnecting crew is badged. With no crew group, the flag-on HTML equals the flag-off HTML. Badge and empty-state strings are read from the en catalog.website/src/test/ChatSidebar.machineGroups.test.tsxalso pins: no row crew chip inside a group, reveal opens a collapsed group, no "No sessions match" when the matches are in a crew group, the folder filter hides a crew row, and a tunnel error renders as an alert.website/src/test/useInstanceSessions.test.tsx: cached rows survive a disconnect with no new request and no live state;crewBadgecovers only the three tunnel states;crewGroupsForgroups an offline crew only while a row belongs to it.website/src/test/ChatSidebar.instanceSessionsMerge.test.tsx: the ordering and chip cases assert the crew group placement; the reveal case keeps its colliding-key check.ChatSidebar.chevronGrammar.test.tscounts the new disclosure site;ChatSidebar.ownerComposition.test.tspinsuseCollapsedCrewsin the hook order.Manual verification
Rendered the real
ChatSidebarin a vite capture page with one SSH crew, before (main) and after (this branch), light and dark, then flipped the crew todisconnectedon the mounted page.Screenshots / video
Before (main): crew rows mixed into the local list.
After:
Local, then thebuild-boxgroup with its Online badge. The relay slot "Deploy check on build-box" is in the crew group, and its rows name no machine.After the crew disconnects: an Offline badge, and the last rows stay dimmed with no live status or count. Each row says the crew is not connected.
Light theme
Related Issues
Part of #6180
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)