Repository navigation
fix(mobile): cap the host list's Bots section at three with Show more - #52737
Merged
orca-remote-automation[bot] merged 2 commits intoNov 29, 2026
Merged
orca-remote-automation[bot] merged 2 commits into
orca-remote-automation[bot] merged 2 commits into
Conversation
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.
[Medium impact] The PR appears safe to merge, with no outstanding findings. SummaryCaps 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.
Reviews (2) · Last reviewed commit: "fix(mobile): keep a group whose members ..." · Reviewed by Greptile |
10 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
usePublishedBotStatuses), the header count, and the needs-you mark all read the full section.Checked against how comparable products handle this.
Testing
pnpm check:changed: 17/17 checks pass.pnpm --dir mobile typecheckpasses.buildHostBotSections), the cap,MobileBotsSectionHeader,WorktreeListRowbot and workspace rows, andMobileBotsShowMorewith React Native Web, the waybuild:mobile-webdoes. I rendered them in aSectionListin touch-enabled headless Chromium.Performance
This is reasoning over the diff and its callers. Nothing here was measured.
buildHostBotSectionsruns 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 callsmobileBotRowNeedsYoufor each entry past the third, which reads that bot's agents, and builds one capped array of at most kept + 1 items.useHostListSectionsadds two memo dependencies (capBots, the per-host "shown all" flag). When capped, it makes one shallow copy of the Bots section object.useSyncExternalStorewith one listener per mounted host list. It adds no RPCs, subscriptions to the host, polling or timers.SectionList. A long list mounts fewer bot rows at first, so fewer per-rowuseSharedNowand usage-limit store reads run.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:
0, 1, 3, 4, 12 and 30 bots, dark:
The same in 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: