Skip to content

fix(mobile): cap the host list's Bots section at three with Show more - #52737

Merged
orca-remote-automation[bot] merged 2 commits into
mainfrom
orca-remote-automation/mobile-cap-bots-list
Nov 29, 2026
Merged

orca-remote-automation[bot] merged 2 commits into
mainfrom
orca-remote-automation/mobile-cap-bots-list

Conversation

@orca-remote-automation

@orca-remote-automation orca-remote-automation Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What changed

On a phone, a host's Bots section listed every bot above the workspaces. With a dozen or more bots, the workspaces moved off the first screen and looked like they were gone.

  • When the Bots section is expanded, it shows its first 3 bots or groups, then one muted 12 pt row, "Show {n} more". The row is aligned with the left edge of the bot rows.
  • A bot that needs you is never hidden. Bots past the cap that need you, or that hold the open (last-visited) row, stay listed in their usual order. The "{n}" counts only the hidden bots.
  • Tapping "Show {n} more" lists every bot. This state is phone-local and per host. Folding the section with the header chevron takes the list back to its first 3.
  • These are unchanged: lists of 3 or fewer bots, search (which shows every match), the iPad sidebar and wide layouts, the Bots header (count, needs-you mark, +), end lines, the bottom bar, and collapse persistence.
  • The section is still built and counted in full. Only the rows the phone draws are sliced. Bot statuses (usePublishedBotStatuses), the header count, and the needs-you mark all read the full section.
  • The copy uses i18n in every mobile locale. The row is a 44 pt button with the accessibility label "Show {n} more bots".

Checked against how comparable products handle this.

Testing

  • pnpm check:changed: 17/17 checks pass. pnpm --dir mobile typecheck passes.
  • I bundled the real builder (buildHostBotSections), the cap, MobileBotsSectionHeader, WorktreeListRow bot and workspace rows, and MobileBotsShowMore with React Native Web, the way build:mobile-web does. I rendered them in a SectionList in touch-enabled headless Chromium.
    • 0, 1 and 3 bots: no change and no row. 4, 12 and 30 bots: 3 bots plus "Show 1/9/27 more", and the workspaces header sits at y=290 on every capped list.
    • Bots Fix update checker 406 error and add menu feedback #8 and Capitalize app name to Orca for desktop installs #11 need you: both stay listed and the row reads "Show 7 more".
    • Searching 30 bots for "Builder" lists all 3 matches with no row.
    • Tapping the row lists all 30, and scrolling reaches the workspaces. Folding and reopening returns to the first 3.
    • With the cap off (sidebar path), all 30 bots are listed.
    • 390×844, 320×568 and 320×480: no horizontal overflow (scrollWidth equals the viewport), nothing is clipped, and the row text starts at 16 px, the same edge as the bot avatars. Checked in dark and light themes.
    • The row's accessible name is "Show 1 more bot" or "Show 27 more bots", with role button and a 390×44 hit area.

Performance

This is reasoning over the diff and its callers. Nothing here was measured.

  • buildHostBotSections runs under the same memo dependencies as before. It now keeps each entry's rows in an array before flattening, which allocates the same items as before. When there are more than 3 entries and no search, it makes one more O(entries) pass. That pass calls mobileBotRowNeedsYou for each entry past the third, which reads that bot's agents, and builds one capped array of at most kept + 1 items.
  • useHostListSections adds two memo dependencies (capBots, the per-host "shown all" flag). When capped, it makes one shallow copy of the Bots section object.
  • The "shown all" store is a module-level useSyncExternalStore with one listener per mounted host list. It adds no RPCs, subscriptions to the host, polling or timers.
  • The list stays a virtualized SectionList. A long list mounts fewer bot rows at first, so fewer per-row useSharedNow and usage-limit store reads run.
  • Risk: the needs-you check uses the clock at build time. An agent whose waiting state goes stale keeps its bot listed until the next rebuild. That errs toward showing the bot, never toward hiding it.

Risk

Low. The change only affects which rows a phone draws when a Bots list has more than 3 entries. The full section still drives counts, statuses and the header. The iPad sidebar and wide layouts skip the cap. A revert needs no migration.

Visual proof

Before (all 30 bots, the cap off) and after (3 plus "Show 27 more"), in dark and light:

before and after

0, 1, 3, 4, 12 and 30 bots, dark:

bot counts, dark

The same in light:

bot counts, light

From left: 320×568 dark and light, 320×480, needs-you bots past the cap kept, a search with every match, and the expanded list scrolled:

narrow and states

Files Added Deleted Net
Test 0 0 0 0
Prod 20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​217 $\color{#cf222e}{\Huge{\mathbf{−}}}$​30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​187

A long Bots section pushed every workspace below the first screen. On a
phone the section now lists its first three bots, plus any that need you
or hold the open row, then a "Show {n} more" row. Search, the iPad
sidebar and lists of three or fewer are unchanged.
@orca-remote-automation
orca-remote-automation Bot marked this pull request as ready for review November 29, 2026 23:30
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge, with no outstanding findings.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no outstanding findings.

Summary

Caps the phone’s Bots list at three entries, with “Show more” and exceptions for entries needing attention or containing a drawn active row. The latest change also keeps groups whose members need attention.

  • Phone Bots lists show three entries first and reveal the rest on demand.

Reviews (2) · Last reviewed commit: "fix(mobile): keep a group whose members ..." · Reviewed by Greptile

Comment thread mobile/src/bots/host-bots-cap.ts Resolved
Comment thread mobile/src/bots/host-bots-cap.ts Resolved
@orca-remote-automation
orca-remote-automation Bot merged commit 9b27fdb into main Nov 29, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants