Skip to content

fix(sidebar): show crew groups when chat on a crew preview is on (#18750) - #18832

Closed
bhumin18 wants to merge 1 commit into
kirodotdev:mainfrom
bhumin18:fix/sidebar-crew-groups-preview
Closed

bhumin18 wants to merge 1 commit into
kirodotdev:mainfrom
bhumin18:fix/sidebar-crew-groups-preview

Conversation

@bhumin18

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Ensure the chat sidebar displays connected crew groups whenever the "Chat on a crew" feature preview is turned on.

When a user turned on Chat on a crew (PREVIEW_REMOTE_CREW_CHAT) but had the legacy Remote crew sessions (PREVIEW_INSTANCE_SESSIONS) preview toggle off, they could launch a remote chat on a peer crew, but the Sessions sidebar displayed no crew group to return to it.

Why it matters

Users who start a session on a connected machine lose the primary affordance to access, inspect, or return to that session from the sidebar unless they also happen to discover and turn on the secondary preview flag.

Not a goal

  • Changing how peer slots or crew windows are rendered or executed.
  • Modifying column/board view (which deliberately excludes remote peer rows).

What changed (motivation → approach → change)

  • Unify preview gating: In website/src/pages/chat-sidebar/sessionSources.ts, evaluated instanceSessionsEnabled as remoteCrewChat || legacyInstanceSessions.
  • Enabling Chat on a crew immediately renders the crew groups in the sidebar without requiring a second toggle.
  • Preserved backward compatibility for any devices that previously turned on the legacy PREVIEW_INSTANCE_SESSIONS switch.

Backwards compatibility

Compatible: Devices that enabled PREVIEW_INSTANCE_SESSIONS continue to show crew groups. No storage keys or APIs are broken.
Removes nothing: No existing APIs or preview flags are removed.

Tests

  • Added test in website/src/test/ChatSidebar.machineGroups.test.tsx verifying that crew groups render when PREVIEW_REMOTE_CREW_CHAT is active with legacy preview off.
  • Passed full test suite:
    • ChatSidebar.machineGroups.test.tsx (14/14 passed)
    • previewSurfaces.test.tsx (34/34 passed)
    • ChatSidebar.instanceSessionsMerge.test.tsx & ChatSidebar.createMenu.test.tsx (54/54 passed)
    • ESLint (0 errors)

Manual verification

N/A — unit and component test coverage sufficient.

Related Issues

Closes #18750

Pattern harvest

Rule candidate: review-prompt
Pattern: interdependent feature previews where an ingress action gates on one flag while its navigation surface gates on another.

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

When Chat on a crew (PREVIEW_REMOTE_CREW_CHAT) is enabled, the user
can dispatch a session to a connected crew, but the Sessions sidebar
was missing the crew group unless Remote crew sessions
(PREVIEW_INSTANCE_SESSIONS) was also enabled.

Gate sidebar crew groups on either PREVIEW_REMOTE_CREW_CHAT or the
legacy PREVIEW_INSTANCE_SESSIONS switch so starting a chat on a crew
renders the group to return to while preserving existing devices that
had the legacy preview flag set.

Closes kirodotdev#18750
@bhumin18
bhumin18 requested review from a team and KiroCrewCaptain as code owners October 10, 2026 10:56
@bhumin18
bhumin18 requested a review from iamwhatever October 10, 2026 10:56
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — 🟡 CONCERNS

Design-level review of 54f2340dc1bb0590a71649af5f4ca46cb54e0f02 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

The "Remote crew sessions" switch stops working: with Chat on a crew on, it reads off but crew groups still show, and turning it off does nothing.

Watch

  • The Settings switch now gives the wrong state. The patch sets instanceSessionsEnabled = remoteCrewChat || legacyInstanceSessions. FeaturePreviewsSection.tsx:271-287 keeps these as two separate cards on purpose ("Sharing a card would imply flipping one gets the other"), and the second card's toggle still reads only PREVIEW_INSTANCE_SESSIONS. With Chat on a crew on, a user sees "Remote crew sessions" off while crew groups render and per-instance slot queries go out. Turning it off changes nothing. Since one flag now implies the other, the settings page should say so: show the second toggle as on and locked while the first is on, or retire it.
    Clears when: the Remote crew sessions card shows the state the sidebar actually uses (or is removed), and the comment at FeaturePreviewsSection.tsx:271-279 is updated to match.
  • The flag's documentation now contradicts the code. The PREVIEW_REMOTE_CREW_CHAT doc in previewFlags.ts:101-115 still says "the local session list does not show live remote sessions" and "Gating the INGRESS only". The flag now also controls the sidebar list and network traffic. The PREVIEW_INSTANCE_SESSIONS doc at :119-126 still calls itself the only thing keeping those queries off the wire.
    Clears when: both doc comments describe the combined gate.

[DESIGN-REVIEWED] 54f2340

Description read

[DESCRIPTION-READ] 4f55545e39ade3e8158465817cf9658303f41f3174dcb03a5828d9bcf18f7540

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — 🔴 BLOCK

UX-level review of 54f2340dc1bb0590a71649af5f4ca46cb54e0f02 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: BLOCK

cannot evaluate: missing a screenshot of the crew groups appearing in the Sessions sidebar with "Chat on a crew" on; two settings toggles now give wrong information.

Blockers

  • The "Chat on a crew" hint is now false. instanceSessionsEnabled = remoteCrewChat || legacyInstanceSessions makes this flag list remote sessions in the sidebar. The unchanged chat_on_a_crew_desc still says the session "is not listed in this dashboard's sessions yet, so to return to it later, switch to that crew's pane." A user reading the settings card is told to go somewhere else for something that is now in front of them. That happens to every user who opens this toggle, every time. Fix: rewrite chat_on_a_crew_desc in en.manual.json and its translations so it says the session shows up under its crew in the Sessions list.
  • The "Remote crew sessions" switch does nothing while "Chat on a crew" is on. The OR means turning the switch off leaves the crew groups in place, so the toggle no longer does what it says. Its hint, "Merge a connected remote crew's live sessions into the Sessions list", describes something that is already happening. The comment at FeaturePreviewsSection.tsx:271 keeps the two cards apart because "flipping one gets the other" was wrong; this PR makes it right. Every user who tries to hide the groups hits this. Fix: when "Chat on a crew" is on, show the legacy toggle as on and disabled, with a note that "Chat on a crew" includes it. Or remove it and migrate the old setting.

Evidence gaps

  • The Sessions sidebar showing a crew group (header, status badge, rows) with only "Chat on a crew" on: no screenshot. The image list is empty.
  • Feature Previews settings with both toggles in the new combined state: no screenshot.

[UX-REVIEWED] 54f2340

Description read

[DESCRIPTION-READ] 100ac94ee56c57e8f04083f48b2bce8c3018d3c49f6c7573e14d5e881d870060

That sha256 names everything this verdict read: the PR description, plus the 3 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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — 🟡 CONCERNS

Premise-level review of 54f2340dc1bb0590a71649af5f4ca46cb54e0f02 via the fork AI-review pipeline — 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 OR silently overturns the base's recorded "separate flags" decision, and the "Remote crew sessions" switch stops turning anything off whenever Chat on a crew is on.

Not justified as shipped

  • Item 2 — undeclared, inherited: the base says the two must stay apart. FeaturePreviewsSection.tsx:271-274 reads "the two point opposite ways across the same tunnel… Sharing a card would imply flipping one gets the other." remoteCrewChat || legacyInstanceSessions makes flipping one get the other. The description says "Removes nothing" and never mentions this reversal. It also calls PREVIEW_INSTANCE_SESSIONS "legacy", which the base never does (previewFlags.ts:119-127). The root cause is two flags for one feature's two halves. This PR keeps both flags and adds a rule that one implies the other.
    Subtraction: delete PREVIEW_INSTANCE_SESSIONS and its toggle, and gate useSessionSources on PREVIEW_REMOTE_CREW_CHAT alone, so one concept replaces two flags plus the OR.
    Clears when: the second flag is removed, or the description cites a maintainer decision that reverses the "separate cards" comment.

What this change ships

Inventory (3 items) — 1 justified

Intent: let a person who starts a chat on a peer crew find that session again in the Sessions sidebar. FIX.

  1. Turning on Chat on a crew now also shows the per-crew groups in the Sessions sidebar — justified
  2. The Remote crew sessions toggle no longer hides the crew groups while Chat on a crew is on — undeclared, inherited
  3. Chat-on-a-crew users now send per-instance slot queries over the wire — undeclared

[FIRST-PRINCIPLES-REVIEWED] 54f2340

Description read

[DESCRIPTION-READ] c6dbba12ffe1ce8616ad328f416afb8c86d570e825acfc8cc34888f355b6aced

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

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — 🔴 changes requested (blocking)

Reviewed 54f2340dc1bb0590a71649af5f4ca46cb54e0f02 via the fork AI-review pipeline; updated in place on each push.

Adjudication upheld 1 of 1 blocking finding(s); those must be resolved before merging.

BLOCKING -- website/src/test/ChatSidebar.machineGroups.test.tsx:167 -- Give the chained-query wait an explicit ceiling

await waitFor(() => expect(rowIn(group, 'REMOTE peer row')).not.toBeNull())
Fresh query cache -> listInstances() enables instanceChatSlots() -> a peer-row commit delayed beyond the default 1000ms ceiling fails a correct sidebar; awaiting the group does not establish peer-query completion.
Anchor: frontend-tests-are-deterministic
Fix: Add an explicit timeout to this wait and a comment naming the instance-list → peer-slots chain.
[BLOCK-MERGE] 54f2340
[GPT-REVIEWED] 54f2340

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 — The finding is anchored to frontend-tests-are-deterministic, which has blocking: true at .review-base-rules/website-AUTOSDE.yaml:759-760, so the rule's flag decides this one, not my own weighing. On harm alone it would be LOW. The mocks resolve immediately (ChatSidebar.machineGroups.test.tsx:142-143), and the same unbounded wait pattern is already on base at lines 151, 188, 214 and 280.

[ADJUDICATION] 54f2340 total=1 uphold=1 downgrade=0
UPHOLD F1 website/src/test/ChatSidebar.machineGroups.test.tsx:167 reason=autosde-blocking-rule
[GPT-ADJUDICATED] 54f2340

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 54f2340dc1bb0590a71649af5f4ca46cb54e0f02 via the fork AI-review pipeline; updated in place on each push.

Review details

No blocking findings. One advisory finding: the "Remote instance sessions" switch can no longer turn its feature off.

FINDING — website/src/pages/chat-sidebar/sessionSources.ts:28 — with "Chat on a crew" on, const instanceSessionsEnabled = remoteCrewChat || legacyInstanceSessions keeps remote live sessions merged into the crew groups and keeps sending the per-instance slot queries while the separate FeaturePreviewsSection toggle (checked={instanceSessions}) shows off. The two contracts in previewFlags.ts are now false: PREVIEW_INSTANCE_SESSIONS "keeps the per-instance slot queries off the wire", and PREVIEW_REMOTE_CREW_CHAT "only stops offering the menu entry". → Fix: show the legacy toggle as checked and disabled while PREVIEW_REMOTE_CREW_CHAT is on, and update both docstrings and the "Sharing a card would imply flipping one gets the other" comment.

[OPUS-REVIEWED] 54f2340

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Oct 10, 2026
@bhumin18

Copy link
Copy Markdown
Contributor Author

Superseded by #18767 which already resolved #18750 on main

@bhumin18
bhumin18 force-pushed the fix/sidebar-crew-groups-preview branch from 54f2340 to 2fa4a9f Compare October 21, 2026 00:57
@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 21, 2026
@bhumin18
bhumin18 force-pushed the fix/sidebar-crew-groups-preview branch from 2fa4a9f to 54f2340 Compare October 21, 2026 11:59
@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 21, 2026
@bhumin18 bhumin18 closed this Oct 23, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crew groups missing from the sidebar while Chat on a crew is on

1 participant