Skip to content

feat(sidebar): group sessions per machine behind the remote-sessions preview - #16756

Merged
chenmingwei23 merged 1 commit into
mainfrom
feat/sidebar-machine-groups
Oct 6, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
feat/sidebar-machine-groups

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

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

  • What clicking a crew row does (adopt, window view): RFC wave 3.
  • A "needs auth" badge: the tunnel cannot tell auth failure from an unreachable host yet.
  • What a click on a crew row does: it is unchanged; only its hint text changes while the crew is offline.
  • A composer-side send block: the server already refuses a send to a disconnected crew (remote_not_connected).
  • Migrating relay slots (executor: 'remote'): they still render, inside their crew's group, until wave 4.
  • Grouping inside the board view or federated Older Sessions search.
  • Folders and the conductor tree inside a crew group: wave 2 renders a crew group's rows flat, in the list's sort order. Nesting within a group (RFC §1, "Folders, pins and the conductor lane apply within a group") lands with the window view, once a crew row is the peer's own session (wave 3).

What changed (motivation → approach → change)

Part Before After
Sessions list (preview on) one mixed list Local, then one group per crew
Crew group header none name, badge, row count, collapse chevron
Badge none connected → Online, connecting → Reconnecting, error → Error, disconnected/stopped → Offline
Crew disconnects rows vanish Offline badge; last rows stay, dimmed, under "Not connected. Last known sessions; live status unavailable.", with no live running or approval state and no row count; each row's hint reads "Not connected right now"
Crew group with no rows — "No open sessions"; hidden entirely while a filter or search narrows the list
Tunnel error — the tunnel's error text in an ErrorNotice inside the group
Row inside a crew group "On " chip and "On — click to open here" no chip, "Click to open here"; the header names the machine
No crew group — no group headers; list identical to flag off

The RFC overrules the old "merged, not sectioned" rationale, so hooks/useInstanceSessions.ts now 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 on connected, so react-query keeps the last answer in memory after a disconnect. A reload clears it. A cached row drops its running and pending_approval, because neither is true now.

pages/chat-sidebar/sessionSources.ts exposes the groups. pages/ChatSidebar.tsx splits 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 new pages/chat-sidebar/CrewGroups.tsx draws the headers with the sidebar's DisclosureChevron and animates collapse through FolderBody, which keeps the rows mounted. Collapse state is kept per crew id in localStorage (mc-sidebar-crew-collapsed, declared in pages/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 under website/src/i18n. The feature map row for peer-owned live sessions (docs/feature-map/README.md) and the Sessions sidebar section of docs/system-specs/modules/history.md describe the grouped list.

Backwards compatibility

Compatible: everything sits behind the PREVIEW_INSTANCE_SESSIONS flag. 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 a Local group 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.tsx also 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; crewBadge covers only the three tunnel states; crewGroupsFor groups 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.ts counts the new disclosure site; ChatSidebar.ownerComposition.test.ts pins useCollapsedCrews in the hook order.

Manual verification

Rendered the real ChatSidebar in a vite capture page with one SSH crew, before (main) and after (this branch), light and dark, then flipped the crew to disconnected on the mounted page.

Screenshots / video

Before (main): crew rows mixed into the local list.

Before, dark: mixed list

After: Local, then the build-box group with its Online badge. The relay slot "Deploy check on build-box" is in the crew group, and its rows name no machine.

After, dark: Local and build-box groups

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.

After, dark: crew disconnected, rows dimmed

Light theme

Before, light

After, light

After, light, disconnected

Related Issues

Part of #6180

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested a review from a team October 4, 2026 11:15
@iamwhatever
iamwhatever requested a review from a team as a code owner October 4, 2026 11:15
@iamwhatever
iamwhatever requested a review from bolichen97 October 4, 2026 11:15
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of d786c5f7870946dbb80b60c990ea1d193514207b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that relay slots (executor: 'remote') the user filed in a local folder are still easy to find once they appear flat under their crew group.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of d786c5f7870946dbb80b60c990ea1d193514207b — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The in-group tunnel-error notice is a fifth way of showing status.error, and it replaces the RFC's "badge opens the existing instance card" with something new.

Not justified as shipped

  • Item 6 — duplicate of pages/settings/InstancesPanel.tsx:88: TunnelStatus.error is already shown in 4 places (I grepped status?.error: InstancesPanel.tsx, RemoteCrewPanel.tsx, InstanceTabBar.tsx:1372, InstancesViewport.tsx:1240). The accepted RFC row reads "Badge opens the existing instance card with TunnelStatus.error". The diff adds <ErrorNotice … message={group.error} askAgent /> instead, with a title taken from the peer-list failure string ("Sessions from {{names}} are unavailable"). The field's own comment says it is "shown as the badge's tooltip", which is not what the code does.
    Subtraction: delete CrewGroup.error, the inst.status?.error spread in crewGroupsFor, and the ErrorNotice block in CrewGroupSection. The error badge alone carries the state.
    Clears when: the inline notice is removed, or a linked report shows users who missed the error on the existing instance surfaces.

What this change ships

Inventory (8 items) — 7 justified

Intent: 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, accepted on base, default-off preview).

  1. Sessions list splits into Local plus one group per crew (preview on) — justified
  2. Crew group header with name, row count and collapse chevron — justified
  3. Online / Reconnecting / Error / Offline badge from tunnel state — justified
  4. Disconnected crew keeps its last rows, dimmed, with no live state or count — justified
  5. Collapse state per crew kept across reloads (mc-sidebar-crew-collapsed) — justified
  6. Tunnel error text shown inside the crew group — duplicate of existing instance error surfaces
  7. Crew rows lose their "On " chip; the hint becomes "Click to open here" or "Not connected right now" — justified
  8. "Reveal in sidebar" expands a collapsed crew group — justified

[FIRST-PRINCIPLES-REVIEWED] d786c5f

Description read

[DESCRIPTION-READ] bb2b29414394a85b6c4c2260ce8a2c1960074725f0da6b3e7aaebb7b74b958b9

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🔴 BLOCK

UX-level review of d786c5f7870946dbb80b60c990ea1d193514207b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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

  • Collapsed crew group. The diff adds a collapse chevron and keeps the collapsed state in localStorage (useCollapsedCrews). All six screenshots show the group expanded, and the recording list is empty. To close this, attach a still of build-box collapsed and a recording of collapse and expand going through FolderBody.
  • Offline row hint. shot-03/06 show "Crew not connected; opens once it is back". The diff ships "crew_row_offline": "Not connected right now", so the screenshots predate this revision and the real string has never been shown. It also drops the "opens once it is back" promise. To close this, re-capture the offline state at HEAD.
  • Other new states with no screenshot: the Reconnecting and Error badges, the in-group tunnel ErrorNotice, and the "No open sessions" empty group. To close this, attach one still per state.

Watch

  • "Click to open here" makes users hesitate. The blind reader said "not quite, because 'open here' might take it away from the other machine." This hint is on every online crew row, so many users will pause before clicking. The fix is a label that says the session stays on the other machine, e.g. "Click to view here".
  • The row count disappears while offline, with no explanation. The reader said: "it shows when build-box is online but disappears when it's offline. I don't know why." The offline note already explains the rows are stale, so keep the count and mark it stale, or say in the note that the count is hidden.

Suggestions

  • Change crew_row_offline to say what happens on click, e.g. "Not connected — opens when build-box is back". As shipped, the hint only states the problem; it doesn't say what clicking does or when the row will work again.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed d786c5f7870946dbb80b60c990ea1d193514207b — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] d786c5f

Verdict parsed from the review's SHA-scoped output markers for commit d786c5f7870946dbb80b60c990ea1d193514207b.

False positive or not applicable? A repository writer can comment:
/ai-review override fable d786c5f7870946dbb80b60c990ea1d193514207b: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of d786c5f7870946dbb80b60c990ea1d193514207b and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d786c5f

False positive or not applicable? A repository writer can comment:
/ai-review override gpt d786c5f7870946dbb80b60c990ea1d193514207b: <one-sentence reason>

@iamwhatever
iamwhatever force-pushed the feat/sidebar-machine-groups branch from a3abf49 to fff3dc7 Compare October 4, 2026 11:46
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 4, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 1 — grouped instead of merged rests on a draft RFC span=a40bec9ac51c

Accept-and-defer (inherited). The decision is docs/request-for-change/rfc-remote-crew-sidebar.md wave 2, merged in #16489.
Its status flip to accepted is its own wave-0 docs PR, open now. This PR does not flip it, by design.
Clears when that PR lands on main; nothing in this diff changes for it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 2 — relay slots move into their crew group span=99406d2c2f37

Accept-and-defer (inherited), same record as Item 1.
The RFC migration table, wave 2, says: "Relay slots still render, inside the crew's group, until wave 4."

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 4 — collapse state persisted in localStorage, undeclared span=c023cdf6318e

Fixed in fff3dc7. The body now declares the key mc-sidebar-crew-collapsed.
It moved into pages/chat-sidebar/persistence.ts, where every sidebar storage key lives.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Offline rows look live span=fd8f72cc89a8

Fixed in fff3dc7. A disconnected crew's cached rows drop running and pending_approval in useInstanceSessions.
No spinner or approval mark under "Not connected". Pinned in both test files; the after-disconnected frames are re-shot.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • "On build-box" says the same thing three times span=51a03b1975f0

Fixed in fff3dc7. Rows inside a crew group drop their RemoteCrewChip; the header names the machine, as the RFC says.
The "click to open here" line stays: it states what a click does, and wave 3 owns changing that.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Collapse snaps instead of sliding span=6c78ca395e87

Fixed in fff3dc7. The group body is a FolderBody open={!collapsed}, the same animated collapse folders use, with rows kept mounted.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Offline note could name the age of the list span=3eed2a60012b

Declined for this PR. The hook keeps no "last answered at" time, so showing one is new state and a new string.
Out of the wave-2 goal; the plain note stays truthful as written.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Reveal cannot reach a row in a collapsed crew group span=5184f56a0445

Fixed in fff3dc7. Reveal opens the crew group that holds the target, and rows stay mounted while collapsed.
Pinned by opens a collapsed crew group to reveal a session inside it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Crew rows bypass the empty-state notes and the folder filter span=63c73dc89e22

Fixed in fff3dc7, both sites. The "No sessions match" notes count crew rows, and crew rows obey isRowFolderHidden.
Pinned by does not say "no sessions match"... and hides a crew-group row whose folder the folder filter hides.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Tunnel failures bypass the required error surface span=a1dad843e277

Fixed in fff3dc7. The tunnel error renders through ErrorNotice (role alert, askAgent on: a list read holds no draft).
The tooltip is gone. Pinned by shows a crew's tunnel error through the shared error notice.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Folders and the conductor tree stop applying inside a crew group span=974fa5e1f4da

Recorded, per the clear condition. The description (1c1e80d681) now says wave 2 renders a crew group flat, in the list order.
It names when nesting inside a group returns: with the window view (wave 3), when a crew row is the peer's own session.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Send block moved out of scope span=d7cf20285594

Rebut. Send is blocked today: api_chat refuses a relay slot's send with 409 remote_not_connected while the tunnel is down.
The RFC §1 table says so, and that a windowed peer row needs its own disable in wave 3. Peer rows have no composer in wave 2.
A composer change in ChatPage.tsx here would collide with the wave-3 worker editing the same surface.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Grouped instead of merged rests on a draft RFC span=27269f2cd7fb

Accept-and-defer (inherited), same as the prior head. The wave-0 PR flips the RFC to accepted; a rebase follows it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Offline rows still invite "click to open here" span=a9b242474360

Accept-and-defer. What a click on a crew row does is out of this PR by scope (RFC wave 3 replaces adopt with a window).
Today an offline adopt is refused by the server, so nothing breaks; the row is dimmed under "Not connected".

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The row count reads as current when it is not span=1db0446adfa9

Fixed in 1c1e80d681. An offline group's header shows no count. Pinned in the disconnect case.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Conductor empty note and reveal lookup miss crew rows span=63c73dc89e22

Fixed in 1c1e80d681, both sites. The conductor lane's "No sessions match" counts crew rows.
Reveal finds its target in allRows, so a search-hidden row still opens its collapsed group. Both pinned by new cases.

@iamwhatever
iamwhatever enabled auto-merge (squash) October 5, 2026 18:17
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 5, 2026
…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
@iamwhatever
iamwhatever force-pushed the feat/sidebar-machine-groups branch from 7f46805 to d786c5f Compare October 5, 2026 19:12
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 5, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • "Click to open here" makes users hesitate span=3de2c447d3cb

Scope frozen by the conductor; the wave-2 offline items it ruled in scope are fixed.
Same item as b66de2e2f0ef and 268cd4e7a177; the label follows what the click does, owned by wave 3.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The row count disappears while offline span=452b5bb2bdd4

Scope frozen by the conductor; the wave-2 offline items it ruled in scope are fixed.
Hiding the count offline was the fix for 1db0446adfa9 (the count read as current). Copy refinement deferred.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Offline row hint could say what a click does span=779653a8c4ce

Scope frozen by the conductor; the wave-2 offline items it ruled in scope are fixed.
The hint was reworded to a plain state after 07dab818773f (it promised an open nothing performs). Deferred.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 6 — tunnel error rendered instead of opening the instance card span=f7829c23920c

Rebut, same as 77745c639ebc and 436a1b9b3544. The notice is what the GPT lane required (blocking AUTOSDE rule errors-use-error-notice rejected a tooltip).
A badge that opens the instance card is a new header click target, outside the frozen wave-2 scope.

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 including offline), the locale files (context only: main dropped the adopt_* keys) and ChatSidebar.tsx (context only: adopt state became openCrewWindow/useCrewWindow; when: !!peerId is 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-162 returns crewGroups = [] while the preview is off. That makes shownCrewGroups empty and crewRowsById.size === 0, so laneSlots === filteredSlots (website/src/pages/ChatSidebar.tsx:3021-3025) and localGroupHeader/renderCrewGroups() render nothing (ChatSidebar.tsx:3611-3619). The board passes NO_CREW_GROUPS (ChatSidebar.tsx:3012). useInstanceSessions with enabled=false builds listed = [], so it makes no request (website/src/hooks/useInstanceSessions.ts:305-308).
  • Offline crews drop live state. running: live && … and pending_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 only inst.name, the badge and inst.status.error, the tunnel error text that four instance surfaces already render.
  • Specs. docs/system-specs/modules/history.md:212-217,235-239 describes the grouping, the offline caching and the new owners (CrewGroups.tsx, the collapsed-crews key in persistence.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.tsx 100% lines, useInstanceSessions.ts 100% lines, sessionSources.ts 96.7%. In persistence.ts, only the catch of readCollapsedCrews (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 --short is clean):
    • dropping live && on running turns useInstanceSessions > keeps a crew's last rows after it disconnects red;
    • the same on pending_approval turns the same test red;
    • enabled: enabled && isConnected(inst) → enabled turns never queries a disconnected instance and machineGroups > renders the same sidebar as the flag-off one red;
    • dropping || owned.has(inst.id) in crewGroupsFor turns 5 tests red (offline group, tunnel error, reconnecting/error badges, rename across disconnect);
    • dropping live && on r.isError (useInstanceSessions.ts:323) survives. See follow-ups.
  • 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 Gate job 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.json ships crew_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.
  • Auto-merge is ON, reviewDecision=REVIEW_REQUIRED, mergeStateStatus=BLOCKED.

Non-blocking follow-ups

  • useInstanceSessions.ts:323: no test pins the live && guard on r.isError (the mutation survives). Add a case where a crew errors and then disconnects, and assert that it is not listed in failed. The guard fails closed either way: without it the user sees a stale error notice.
  • persistence.ts:116: the catch branch of readCollapsedCrews (corrupt localStorage) has no test.
  • PR body: the test notes say "crewBadge covers only the three tunnel states", but crewBadge now maps four states (offline included). The UX bot's copy suggestions ("Click to view here", keep a stale count while offline) and the First Principles CONCERN (the in-group ErrorNotice duplicates existing status.error surfaces) 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.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 5, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@chenmingwei23
chenmingwei23 disabled auto-merge October 6, 2026 05:30
@chenmingwei23
chenmingwei23 merged commit f97eeef into main Oct 6, 2026
183 of 194 checks passed
@chenmingwei23
chenmingwei23 deleted the feat/sidebar-machine-groups branch October 6, 2026 05:30
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 6, 2026
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.

4 participants