Repository navigation
feat(mobile): idle state with Archive pinned when no workers run - #7506
Conversation
🏆 Review leaderboardOct 23–30, 2026 · UTC
Ranked by distinct external PRs reviewed, then review rounds, then PR comments. Self-activity and bot activity are excluded. Show 8 more reviewers
|
Prasad-D-Ware
left a comment
There was a problem hiding this comment.
Changes requested.
The board change itself is solid. Moving the empty state and Archive toggle into a growing header keeps archived rows and the status row as list data, so paging and virtualization are untouched, and the readPastPinned + inline/paged merge for the last-finished time is careful. Two things need fixing (see inline comments):
- The archive-footer layout also applies on the project page (
app/project/[id].tsx), which now shows “No workers yet” above a non-empty Archive. - A mixed fleet (one machine open, one connecting) is reported as “All N machines are idle.”
Optional:
boardIdleignores the project/environment filters andfleetError, souseLatestArchivedAtreads up to 4 archive pages per machine while a filtered or error empty state is on screen and the result goes unused. The comment says the read runs “only while the idle board is on screen”; also requiringworkerProjectId === ALL_WORKER_PROJECTS && workerEnvironmentId === ALL_WORKER_ENVIRONMENTS && !fleetErrorwould make that true.- While the paged read is in flight (each time the idle board appears) the history line reads “New workers will show up here.” and then flips to “Last worker finished 2h ago.”, with Archive (N) right below it. Consider leaving the line blank until the read settles when a source has history.
selectedHost ? [selectedHost] : hostStates: the first branch never applies when the idle state renders, since it only shows with all environments selected.- The
latestEventAt/readPastPinnedtests could live in the existingarchiveOrder.test.tsrather than a new file. - The archive pages by
updatedAt, while the last finish useseventAtOf(lastEventAt), so “the first unpinned row holds the newest finish” assumes the two agree. Fine in practice because the whole page is read, but the comment overstates it.
Not run: tests/builds (review only).
Prasad-D-Ware
left a comment
There was a problem hiding this comment.
Changes requested (one small item).
Both findings from the last review are fixed:
archiveFooteris opt-in and only the Workers tab passes it. The project page keeps the plain Archive row and noflexGrow, and a test covers it.idleFleetnames only open machines while another is connecting, and has its own tests.
One gap is left in the new helper (inline): when every machine in scope is closed, idleFleet names them anyway and workersIdleCopy calls a closed machine idle.
Optional (carried over, still open):
boardIdlestill ignores the project/environment filters andfleetError, so the archive read runs while a filtered or error empty state is showing.- While that read is in flight the history line says “New workers will show up here.”
selectedHost ? [selectedHost] : hostStatescannot take its first branch when the idle state renders.
Not run: tests/builds (review only).
Prasad-D-Ware
left a comment
There was a problem hiding this comment.
Approved.
The last finding is fixed. workersIdleCopy now gives closed its own status line (“Not connected to Lab Mac.”, “Not connected to 2 machines.”, “Not connected to your machine.”), and the title is “Nothing running” only once a machine is open. Connecting and offline both read “Nothing to show yet”. Tests cover the all-closed idleFleet scope and the title rule. Nothing else changed since the last review, and the earlier fixes (opt-in archiveFooter, open-only machine naming) are intact.
Optional, none blocking:
- The doc comment above
workersIdleCopyhas one over-long line after the edit; rewrap it. - The New agent button still shows while the scope is offline. A spawn there will fail, so you could hide or disable it when
connectionisclosed. - Carried over:
boardIdleignores the project/environment filters andfleetError; the history line reads “New workers will show up here.” while the archive read is in flight; theselectedHost ? [selectedHost] : hostStatesfirst branch is unreachable for the idle state.
Not run: tests/builds (review only).
With only archived sessions, the Archive row was the board's only row, so the list never fell back to its empty state: a lone "Archive 8" sat at the top of a blank screen. The Workers tab now treats "only Archive" as empty, through the opt-in `archiveFooter` prop: the empty state fills the space the bars leave and Archive rests beneath it as a footer; opened, its rows follow and scroll as before. A project page, whose "no workers yet" copy is wrong under a project's history, keeps the plain Archive row. The default empty state is redesigned to match the app: the conductor mascot whose wand lamp is the live connection light, then which machine is idle and how long since the last worker finished, and a quiet New agent button. Only an open machine is called idle: one still connecting reads "Connecting to Windows…", an offline one "Not connected to Lab Mac.", and "Nothing running" is said only once a machine has answered. Machines that page their archive send only counts with the poll, so the last finish is read from the archive while the idle board is on screen: usually its first page, and on past any pinned rows that sort ahead of the newest one.
d569dbc to
5816fcb
Compare
Prasad-D-Ware
left a comment
There was a problem hiding this comment.
Approved.
Re-reviewed the squashed commit against the native-tabs main (base 5aced0acc6). The logic matches what I approved at d569dbc375; the rebase changes only how it fits into the new board:
- Workers tab (
app/(tabs)/(workers)/index.tsx):archiveFooteris passed only here.idleFleetand the inline/paged last-finish merge are unchanged.boardIdledrops the oldquerycheck, which is right now that the board has no search. - List sizing on iOS: the archive-only board reuses the measured
visibleHeightminHeightpath that an empty board already uses, so the grown header and the Archive footer get the same sizing as the empty-state centring main already relies on. Android keepsflexGrow: 1. - Header: the large-title header, StaleBanner and machine chips still render first inside the archive-only header, so the title stays at the top of the page’s one scroll view.
- Idle state:
variant=secondary,MascotLamp,useEnterTransitionand thetype/spacetokens all exist on the newmain. - Project page: still does not opt in.
Optional, none blocking:
worker-board-list-archive-footer.test.tsxmocksPlatform.OSas android, so the new iOS branch (listData.length === 0 || archiveOnlychoosingminHeight) has no test. One iOS case with a measured height would cover it.- The doc comment above
workersIdleCopystill has one over-long line. - The New agent button still shows while the scope is offline.
- Carried over:
boardIdleignores the project/machine filters andfleetError, so the archive read runs while a filtered or error empty state is showing; the history line reads “New workers will show up here.” while that read is in flight; theselectedHost ? [selectedHost] : hostStatesfirst branch is unreachable for the idle state.
Not run: tests/builds (review only).
ronishrohan
left a comment
There was a problem hiding this comment.
Approving. The lone-Archive board is still on main, and this branch merges into current main (e60670d) without conflicts. Typecheck is clean, and vitest run passes 353 files and 3455 tests. Archive stays collapsed by default.
@Prasad-D-Ware one change before merging, please: switch the idle state's mascot to the latest mascot and drop the glow on the wand. Right now WorkersIdleState renders <MascotLamp status={input.connection} size={64} />, which draws the halo and the lit wand tip. The status line under it already says whether the machine is idle, connecting or offline, so the lamp isn't needed here. Rendering the mascot without status (as the chat empty state does with <MascotLamp size={48} />) drops the lamp. Please also check that the artwork matches the current mascot.
Still optional from earlier rounds: hide or disable New agent while the scope is offline.
Generated by Claude Code
Code changes: +241 -10
Tests: +256 -0
Others: +0 -0
What
The mobile Workers board now has a proper idle state when nothing is running:
Why
With only archived sessions, the Archive row was the board's only row. The list never fell back to its empty state, so the screen showed a lone "Archive 8" at the top of a blank page. The old copy ("Spawn a worker to get started") also told a returning user nothing about their machines.
Before / After
How
worker-board-list.tsx: a new opt-inarchiveFooterprop, passed only by the Workers tab. When Archive is the only section (and no search is active), the empty state and the Archive toggle move into a list header that grows to fill the page. On iOS that reuses the board's measured visible height (the sameminHeightpath as an empty board), so the footer rests just above the tab bar. Archived rows and the paging status row stay list data, so virtualization and paging are untouched. A project's own page doesn't opt in: its "No workers yet" copy is wrong under a project's history, so it keeps the plain Archive row.workers-idle-state.tsxandworkers-idle-copy.ts: the idle state reusesMascotLamp, so the wand lamp is the live connection light, and uses thesecondarybutton.idleFleetdecides which machines in scope may be called idle: once any is open, only open ones are counted. With none open, connecting ones read "Connecting to Windows…" and offline ones "Not connected to Lab Mac.". "Nothing running" is said only once a machine has answered; otherwise the title is "Nothing to show yet".useLatestArchivedAt.ts: machines that page their archive (perf: page the archive instead of sending it with every poll #7155) send only counts with the poll, so the last-finished time is read from the archive, and only while the idle board is on screen. The archive lists pinned workers first, soreadPastPinnedreads pages until the first unpinned row (max 4). On a real machine with more than 10 pinned archived workers, a first-page-only read reported days instead of hours. Machines that still send the archive inline use those rows directly.Testing
npx tsc --noEmitandnpx vitest runinpackages/mobile: 349 files, 3428 tests pass.worker-board-list-archive-footer.test.tsx: empty state plus footer, archive rows once opened, live board unchanged, and a board that doesn't opt in keeping Archive as its only row.workers-idle-copy.test.ts: the copy rules andidleFleet, including a mixed open/connecting fleet and an all-offline scope.latestEventAt.test.ts:latestEventAtandreadPastPinned(newest across pinned rows, page cap, end of archive).Checklist
main(or continuing an existing PR branch)go, frontend, etc.)