Skip to content

feat(mobile): idle state with Archive pinned when no workers run - #7506

Merged
Prasad-D-Ware merged 1 commit into
mainfrom
ao/agent-orchestrator-mo-288/workers-idle-state
Nov 7, 2026
Merged

Prasad-D-Ware merged 1 commit into
mainfrom
ao/agent-orchestrator-mo-288/workers-idle-state

Conversation

@Prasad-D-Ware

@Prasad-D-Ware Prasad-D-Ware commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

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:

  • When the only thing on the board is Archive, the empty state fills the space between the header and the tab bar, and Archive rests at the bottom as a footer. Opening it lists the archived workers underneath and scrolls as before. With live workers the board is unchanged.
  • The generic moon tile, "No active workers" and solid New agent button are replaced by the conductor mascot, "Nothing running", which machine is idle, how long since the last worker finished, and a quieter New agent button.

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

Before After
Only the Archive row; the empty state never shows Idle state centred, Archive just above the tab bar
Archive opened: rows follow under the toggle

How

  • worker-board-list.tsx: a new opt-in archiveFooter prop, 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 same minHeight path 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.tsx and workers-idle-copy.ts: the idle state reuses MascotLamp, so the wand lamp is the live connection light, and uses the secondary button. idleFleet decides 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, so readPastPinned reads 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.
  • The Workers tab's project- and machine-filtered empty states ("No workers in …", "No workers on …") are unchanged.

Testing

  • npx tsc --noEmit and npx vitest run in packages/mobile: 349 files, 3428 tests pass.
  • New tests:
    • 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 and idleFleet, including a mixed open/connecting fleet and an all-offline scope.
    • latestEventAt.test.ts: latestEventAt and readPastPinned (newest across pinned rows, page cap, end of archive).
  • iOS 26.5 simulator, Debug build on the native-tabs board (feat(mobile): native tabs, board, New task and chat (native overhaul 4/4) #7839), paired to a real daemon through a read-only loopback proxy that blanked live workers. Checked the idle state with the footer above the tab bar, Archive opened, and the last finish read past pinned rows ("21h ago", matching the daemon's newest unpinned archived worker).

Checklist

  • Branched from main (or continuing an existing PR branch)
  • One focused change; links the related issue when applicable
  • Follows AGENTS.md conventions and PR hygiene
  • Tests added/updated for user-visible behavior where it makes sense
  • Relevant CI checks pass for the area touched (go, frontend, etc.)

@github-actions

Copy link
Copy Markdown
Contributor

🏆 Review leaderboard

Oct 23–30, 2026 · UTC

Rank Reviewer PRs reviewed Review rounds PR comments
🥇 @ronishrohan @ronishrohan 54 97 20
🥈 @Vaibhaav-Tiwari @Vaibhaav-Tiwari 40 59 19
🥉 @mohakchakraborty2004 @mohakchakraborty2004 14 16 6
4 @illegalcall @illegalcall 11 20 3
5 @Prasad-D-Ware @Prasad-D-Ware 9 16 0
6 @nikhilachale @nikhilachale 8 25 4
7 @neversettle17-101 @neversettle17-101 8 18 0
8 @Pritom14 @Pritom14 8 10 9
9 @ApexYash11 @ApexYash11 6 12 3
10 @Meraj-08 @Meraj-08 5 16 5

Ranked by distinct external PRs reviewed, then review rounds, then PR comments. Self-activity and bot activity are excluded.

Show 8 more reviewers
Rank Reviewer PRs reviewed Review rounds PR comments
11 @somewherelostt @somewherelostt 5 10 3
12 @harshitsinghbhandari @harshitsinghbhandari 4 7 0
13 @Rishet11 @Rishet11 3 7 146
14 @Annieeeee11 @Annieeeee11 2 6 0
15 @codebanditssss @codebanditssss 1 2 0
16 @OrcInc @OrcInc 1 1 15
17 @AgentWrapper @AgentWrapper 1 1 1
18 @MohamedKamran @MohamedKamran 1 1 0

@OrcInc OrcInc added comp/mobile Expo mobile product surface. enhancement New feature or request labels Oct 30, 2026
@OrcInc OrcInc added this to the Desktop & UI milestone Oct 30, 2026

@Prasad-D-Ware Prasad-D-Ware left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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):

  1. 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.
  2. A mixed fleet (one machine open, one connecting) is reported as “All N machines are idle.”

Optional:

  • boardIdle ignores the project/environment filters and fleetError, so useLatestArchivedAt reads 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 requiring workerProjectId === ALL_WORKER_PROJECTS && workerEnvironmentId === ALL_WORKER_ENVIRONMENTS && !fleetError would 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/readPastPinned tests could live in the existing archiveOrder.test.ts rather than a new file.
  • The archive pages by updatedAt, while the last finish uses eventAtOf (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).

Comment thread packages/mobile/app/(tabs)/index.tsx Resolved

@Prasad-D-Ware Prasad-D-Ware left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changes requested (one small item).

Both findings from the last review are fixed:

  • archiveFooter is opt-in and only the Workers tab passes it. The project page keeps the plain Archive row and no flexGrow, and a test covers it.
  • idleFleet names 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):

  • boardIdle still ignores the project/environment filters and fleetError, 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] : hostStates cannot take its first branch when the idle state renders.

Not run: tests/builds (review only).

@Prasad-D-Ware Prasad-D-Ware left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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 workersIdleCopy has 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 connection is closed.
  • Carried over: boardIdle ignores the project/environment filters and fleetError; the history line reads “New workers will show up here.” while the archive read is in flight; the selectedHost ? [selectedHost] : hostStates first 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.
@Prasad-D-Ware
Prasad-D-Ware force-pushed the ao/agent-orchestrator-mo-288/workers-idle-state branch from d569dbc to 5816fcb Compare November 6, 2026 15:09

@Prasad-D-Ware Prasad-D-Ware left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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): archiveFooter is passed only here. idleFleet and the inline/paged last-finish merge are unchanged. boardIdle drops the old query check, which is right now that the board has no search.
  • List sizing on iOS: the archive-only board reuses the measured visibleHeight minHeight path 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 keeps flexGrow: 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, useEnterTransition and the type/space tokens all exist on the new main.
  • Project page: still does not opt in.

Optional, none blocking:

  • worker-board-list-archive-footer.test.tsx mocks Platform.OS as android, so the new iOS branch (listData.length === 0 || archiveOnly choosing minHeight) has no test. One iOS case with a measured height would cover it.
  • The doc comment above workersIdleCopy still has one over-long line.
  • The New agent button still shows while the scope is offline.
  • Carried over: boardIdle ignores the project/machine filters and fleetError, 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; the selectedHost ? [selectedHost] : hostStates first branch is unreachable for the idle state.

Not run: tests/builds (review only).

@ronishrohan ronishrohan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

@Prasad-D-Ware
Prasad-D-Ware merged commit 71c5413 into main Nov 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/mobile Expo mobile product surface. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants