Skip to content

fix(mobile): a Crew proposal and Stop crew wait for a disconnected server - #1063

Merged
Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-1060
Nov 15, 2026
Merged

Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-1060

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Problem

With a server disconnected, a Crew proposal review the phone had already loaded kept Approve, Decline and Remove enabled, with no notice, while the Inbox shows a disconnected server's asks read-only with a notice (final audit, Android). Part of #1060.

What changed

  • useServerConnection reads the server's connection and name the way upstream's review and terminal screens do (useEnvironmentPresentation, phase connected).
  • Crew proposal review: while the server isn't connected, Approve, Decline and Remove are disabled, and the footer shows the Inbox's line, " isn't connected. You can answer when it's back." It recovers on reconnect. The cached roster stays readable.
  • Agents sheet: Stop crew is disabled while the server isn't connected, with " isn't connected." under the Crew's heading.

The Agents pill is unchanged (the Captain chose to leave it). On Android, it stays while the server is away, as upstream's segment does: after the backend dropped, and after leaving and reopening the Captain's thread, it kept all six children (two Crew seats and four Peer Agents), on base and head. It's lost only if the app is relaunched while the server is down. J5's spawned-children count is held in memory, and only thread history is persisted, so the pill doesn't return until the server reconnects. Keeping it through an offline relaunch would mean persisting another store, which isn't done for this rare case.

UI changes

The Crew proposal review, online:

Android before Android after
The Crew proposal review, online, Android before The Crew proposal review, online, Android after

The Crew proposal review with the server stopped:

Android before Android after
The Crew proposal review with the server stopped, Android before The Crew proposal review with the server stopped, Android after

The Agents sheet with a Crew seat running, online:

Android before Android after
The Agents sheet with a Crew seat running, online, Android before The Agents sheet with a Crew seat running, online, Android after

The Agents sheet with the server stopped:

Android before Android after
The Agents sheet with the server stopped, Android before The Agents sheet with the server stopped, Android after

The Agents pill after the server stops, without an app restart:

Android before Android after
The Agents pill after the server stops, without an app restart, Android before The Agents pill after the server stops, without an app restart, Android after

The Agents pill after leaving and reopening the thread offline:

Android before Android after
The Agents pill after leaving and reopening the thread offline, Android before The Agents pill after leaving and reopening the thread offline, Android after

No Agents pill after relaunching the app offline (unchanged):

Android before Android after
No Agents pill after relaunching the app offline (unchanged), Android before No Agents pill after relaunching the app offline (unchanged), Android after

The proposal's actions back after reconnecting:

The proposal's actions back after reconnecting, Android after

Stop crew back after reconnecting, with the seat resumed:

Stop crew back after reconnecting, with the seat resumed, Android after

Live testing

Android: PASS at cf893bf436 against base e9e5085cfd (crew tester, report test-reports/pr-1063/cf893bf436.md, stills only). The Captain had 2 Crew seats and 4 Peer Agents; only the tester's own backend was stopped.

  • Proposal review: on base, Approve, Decline and Remove stay enabled offline. On head, they're disabled with the Inbox's full notice, and all three come back on reconnect.
  • Stop crew: on base, it stays enabled offline with no notice. On head, it's disabled with " isn't connected.", and it comes back on reconnect, with the seat resuming.
  • Agents pill: with no relaunch, it keeps all six children after the backend drops and after leaving and reopening the Captain, on base and head. After an app relaunch while offline, it's gone on both base and head, so that's existing behaviour, left as decided above.
  • The working counts differ between the base and head captures (base had a seat and a Peer working; head had a seat working). The tester's report notes this.

Not exercised: pressing an action while offline, and iOS (Jackson's checkpoint).

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior: wiring only (a connection gate); proven by captures
  • UI changes: before/after above
  • Live testing: the section above says what ran live and what did not
  • Upstream-owned files: none
  • Upstream product: no change
  • Surfaces: mobile Crew proposal review and Agents sheet; the Inbox already does this; web is out of scope
  • Docs: none

Claude Opus 5.5 in J5 Code (Claude Code harness).

🤖 Generated with Claude Code

…rver

With its server away, a Crew proposal review the phone had loaded kept
Approve, Decline and Remove enabled, with no notice. It now shows the
Inbox's not-connected line and takes no action until the server is back;
the Agents sheet's Stop crew does the same.

Part of #1060

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 15, 2026 10:12pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 effective changed lines (test files excluded in mixed PRs). labels Nov 15, 2026
@Jacksondr5

Copy link
Copy Markdown
Owner Author

Review: reviewer-opus (single review, at the Captain's request), at 3b18c56

Verdict: approved. No code findings.

Checked and fine

  • The connection check matches upstream's. useServerConnection reads presentation?.connection.phase === "connected", as ReviewSheet and ThreadTerminalRouteScreen do. Before the catalog is ready it reports not connected, with the label "This server". That errs on the safe side and lasts only a moment.
  • The proposal review is read-only while disconnected. canResolve now also needs the connection, and it gates Approve (canApprove), Decline and each seat's Remove. The footer shows the Inbox's notice in place of the usual line.
  • Stop crew is disabled while disconnected, with accessibilityState and the dimmed style. The notice shows only when the group is stoppable.
  • No other Crew action on mobile needed this.
    • The only Crew commands under j5/crew are resolveCrewProposal and stopCrew; the rest are reads.
    • Seat approvals in the Inbox are already gated by their source.
  • Scope: three J5-owned files.
  • Checks: git diff --check, mobile typecheck, and src/j5/crew with the compiler coverage test (1099 passed) all pass.

UI wording (not blocking; for Jackson's call)

askWaitsForServerLine says "… isn't connected. You can answer when it's back." That fits approving a proposal, but reads oddly under Stop crew. One option is a neutral variant beside it in client-runtime j5/inbox.ts, such as "… isn't connected. Try again when it's back." Reusing the Inbox line as is is also fine.

The Agents pill (the builder's open question)

What I ruled out, from the source:

  • The store keeps the rows. scopedThreadReadStore.setConnections keeps them while prepared goes to null, and a forced request only queues the read, which readPending skips while there's no connection.
  • The thread's ref stays. selectedThreadDetailRef stays the route's ref, so useThreadSpawnedChildren isn't handed null.

Two things that could still empty the pill. These are untested guesses for the tester to tell apart:

  1. The count needs each child's shell. childCountsAtom skips a non-seat child (a Peer Agent) whose shell is null. If the disconnected server's shells aren't on the phone, Peer Agents drop out, while Crew seats still count.
  2. The store is in memory only. If the app was relaunched while the server was away, the store is empty and nothing can read it.

It would help if the tester's repro notes whether the app was relaunched, and whether the children were seats or Peer Agents.

— Claude Opus 5.5 (reviewer-opus), J5 Code

…ected

The Inbox's "You can answer when it's back." fits an ask, not Stop crew.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 5 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 59 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e9e5085 and cf893bf.

Files selected for processing: 3

  • apps/mobile/src/j5/crew/CrewProposalReviewScreen.tsx
  • apps/mobile/src/j5/crew/J5ThreadAgents.tsx
  • apps/mobile/src/j5/crew/serverConnection.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

This branch was successfully deployed

1 active deployment
Preview — cf893bf4 Deployed Nov 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant