Skip to content

feat(mobile): an Owner's worktree cleanups in the Inbox, to finish on web or desktop - #991

Merged
Jacksondr5 merged 1 commit into
j5/mainfrom
j5code/inbox-worktree-cleanup-836
Nov 9, 2026
Merged

Jacksondr5 merged 1 commit into
j5/mainfrom
j5code/inbox-worktree-cleanup-836

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Problem

An Owner's mobile Inbox bell counted worktree cleanups (the server's open count includes them for an Owner), but the Inbox screen couldn't show them, so the count could have no matching item. Closes #910. Part of #836 (piece 7).

What changed

The mobile Inbox lists an Owner's open worktree cleanups, read-only, as Jackson decided in #836 (decision 5).

  • Each item names the Crew and how many worktrees it kept, with its project, server and age, as web's item does.
  • Expanded, each worktree shows its thread, branch, uncommitted files, commits not on the default branch, and a link to its pull request. They're ordered and capped at five rows ("Show N more"), as on web.
  • It says removing keeps the branch and discards uncommitted changes, and to keep or remove them on web or desktop. There are no Keep or Remove actions on the phone.

Reads: the same j5.crews.listWorktreeCleanups read web uses, open items only. The server lists them to Owners alone, so nobody else sees anything. The server's inbox revision rereads them, as do coming into view and a pull, with no timer. A server that can't be read shows its own source line.

Shared logic: web's crewWorktreeCleanup.logic.ts moves unchanged to packages/client-runtime/src/j5/crewWorktreeCleanup.ts (export ./j5/crew-worktree-cleanup), with its test. The only edits are sort on fresh copies in place of toSorted, which Hermes lacks.

Tests: the moved logic's tests come with it. The screen adds no logic of its own, so its proof is the tester's captures.

UI changes

Android, base (before) and this PR (after), with a real Haiku Crew archived with two unfinished worktrees, viewed as the server's Owner.

State Before After
Bell while a cleanup is open Inbox bell while a worktree cleanup is open, before Inbox bell while a worktree cleanup is open, after
Inbox with the cleanup open Inbox with unfinished Crew worktrees, before Inbox with unfinished Crew worktrees, after
The cleanup expanded Inbox with unfinished Crew worktrees, before Expanded worktree cleanup with each worktree's details, after
Bell after Keep all on web Inbox bell after Keep all on web, before Inbox bell after Keep all on web, after

After: a Viewer on the same server sees no cleanup.

Viewer's Inbox with no worktree cleanup, after

After: answered with Keep all on web, the item leaves the phone.

Inbox after Keep all on web and a pull, after

pull-after-web-keep-faf845c-after.mp4

Live testing

Android: PASS at faf845c1d3, this PR's head, by the crew tester (Sol 6.1).

The setup was a real Haiku 5.5 Crew with two workers in J5-created worktrees: one left an uncommitted file, the other a local commit, both checked with git. Archiving the Captain kept both worktrees and filed the cleanup.

  • Owner, before and after: base's bell counted the cleanup (2) but the Inbox showed only the one ask. This head shows the "FYI" card. Expanded, it lists both worktrees (1 uncommitted file · 0 commits not on the default branch; 0 uncommitted files · 1 commit not on the default branch) with the note to keep or remove them on web or desktop. It has no Keep or Remove controls.
  • Viewer: a project Viewer paired on the phone sees no count and no cleanup.
  • Reverse: Keep all on web, then a pull, removes the card. On a clean repeat, the card left on its own within a second, and the bell went from 2 to 1 without a pull.
  • One-off: after re-pairing the phone from Owner to Viewer and back to Owner in one session, the bell once stayed at 2 after the answer until the app reloaded. It didn't recur in clean reruns on base or head, so it isn't recorded as a regression.

Not exercised:

  • PR links: the fixture's branches were never pushed.
  • More than five worktrees ("Show N more").
  • An offline server, several servers, dark theme, and iOS.
  • Remove on web: only Keep all was used, since the phone is read-only either way.

Upstream impact

  • packages/client-runtime/package.json: appends the ./j5/crew-worktree-cleanup export, recorded in FORK.md case 101 (and case 102's bell count now names the cleanups).

No upstream product behaviour changes.

Checklist

  • One concern: an Owner's worktree cleanups on the mobile Inbox
  • Tests: the moved logic's tests
  • UI changes: before/after stills and a video above
  • Live testing: Android passed; the section above says what was not exercised
  • Upstream-owned files: packages/client-runtime/package.json, recorded in FORK.md case 101
  • Upstream product: no change
  • Surfaces: mobile Inbox (iOS and Android), every connected server; web unchanged apart from its import path. Reverse state: an item answered on web or desktop leaves on the next read. Non-Owners get nothing from the server. No contract change.
  • Docs: in the wave's docs PR

Built by Claude Opus 5.5 in Claude Code (J5 crew seat builder-identity).

🤖 Generated with Claude Code

… web or desktop

An Owner's mobile bell counted worktree cleanups that the Inbox screen
couldn't show. The screen now lists each one, read-only: the worktrees a
Crew's archive kept, with each one's thread, branch, uncommitted files,
commits not on the default branch and pull request, and a note to keep or remove them on web or
desktop. The logic moves from web to client-runtime.

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

vercel Bot commented Nov 9, 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 9, 2026 5:54am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 10 billable files and costs up to $2.50.

  • 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 13 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available. Your 32 included PR review attempts over the past 7 days set your current allowance at 4 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 355672f and faf845c.

Files selected for processing: 10

  • FORK.md
  • apps/mobile/src/j5/inbox/InboxBell.tsx
  • apps/mobile/src/j5/inbox/InboxScreen.tsx
  • apps/mobile/src/j5/inbox/InboxWorktreeCleanups.tsx
  • apps/mobile/src/j5/inbox/inboxSources.ts
  • apps/web/src/j5/a2a/CrewWorktreeCleanupSection.tsx
  • apps/web/src/j5/a2a/HumanInboxPage.tsx
  • packages/client-runtime/package.json
  • packages/client-runtime/src/j5/crewWorktreeCleanup.test.ts
  • packages/client-runtime/src/j5/crewWorktreeCleanup.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 effective changed lines (test files excluded in mixed PRs). labels Nov 9, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Combined review: reviewer-opus and reviewer-sol (Claude Opus 5.5 and GPT Sol 6.1), head faf845c

Both of us reviewed the PR independently. Neither found anything that blocks merge.

  • Nothing on the phone can answer an item. WorktreeCleanupsSection only expands a row, shows more, and opens the PR URL through Linking. There's no keep, remove or respond command, and the note sends the Owner to web or desktop, per Jackson's decision 5 in #836.
  • The Owner gate is the server's alone. clientReadRpc's cleanupsReached returns [] for anyone who isn't an Owner, so a non-Owner's source is ready and empty, with no error notice. readOpenInboxCount already adds open cleanups, so the bell's count is unchanged, and its comment now says so.
  • Source. worktreeCleanupSourcesAtom uses the same source input (capability and writesNowhere) with status "open", and the inbox revision rereads it. It's joined to focus (refreshAll), pull (readInboxSources), the notices and the empty state. Project and environment data stay scoped per item.
  • Web. The lift of crewWorktreeCleanup.logic.ts to client-runtime/j5/crewWorktreeCleanup.ts is a rename. mergeWorktreeCleanupSources sorts the fresh array from flatMap, and orderCleanupRows now sorts a copy. Web's two files change only their import paths, so their behaviour is unchanged. FORK cases 101 and 102 and the export are recorded.
  • Tests. 83 focused tests pass: 27 runtime cleanup and Inbox tests, and 56 mobile pull, seam and dependency-graph tests.

Code approval: the panel has no open code findings. Still pending: the native captures, the tester's verdict and green J5 CI.

This branch was successfully deployed

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

Labels

size:L 100-499 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.

Mobile: Inbox bell can count a worktree cleanup the screen can't show

1 participant