Repository navigation
Show one spinner when the session pill row folds - #1115
Conversation
A folded Working pill beside a running activity pill repeated its spinner. Hide it there, give its width to the activity label, and keep its status in that pill's accessibility label. Measure the activity-only row so it folds like the full row, count the Android trailing pill gaps, and use a spinner for a live collapsed summary pill on iOS.
The row measured its own width, which grows with overflowing pills, so the fold always saw enough room. Report the width the row was given.
| }, | ||
| onClose = turnItem?.takeIf { turnStatus.isClosable }?.let { item -> { onClose(item) } }, | ||
| ) | ||
| SessionChatPillReveal(visible = !turnMerged) { |
There was a problem hiding this comment.
medium: Merged turn pill leaves an 8 dp gap that the fold does not count
The turn pill is now hidden by wrapping it in SessionChatPillReveal(visible = !turnMerged) inside a Row(horizontalArrangement = Arrangement.spacedBy(...)). A hidden AnimatedVisibility still occupies a zero-width child slot, but Arrangement.spacedBy adds spacing between all children, including that zero-width one, so the primary activity pill stays indented by the row spacing (8 dp) instead of sitting at the row's leading edge the way it does when turnStatus == null (no child at all) and the way it does on iOS (view removed from the HStack, which has spacing 0). The width accounting has the same blind spot: rememberSessionChatPillRowFold with turnMergesWhenCompact computes foldedTurn = 0 and total() filters out the zero turn, so it never counts the gap the invisible child still consumes. The result is both a misaligned activity pill and a fold that can be 8 dp short, so a row that exactly fits on paper can still overflow.
Failure scenario: Working turn + a running subagent/shell activity on a narrow row where turnMergesWhenCompact makes the fold succeed at foldedTurn = 0: the turn reveal collapses to zero width but the row's spacedBy still inserts 8 dp before the activity pill, so the pill renders 8 dp right of the row padding (unlike the no-turn state and iOS), and because total() omitted that 8 dp the row can exceed its available width by 8 dp at the fold boundary, pushing/clipping the trailing Syncing/navigation pills. The same gap appears in the activity-only slot's new measured fold.
Found by 2 of 3 passes.













Summary
When the Session Chat pill row runs out of room, a folded Working spinner no longer sits beside a running activity pill's spinner.
Checks
Unit tests ran on this branch based on
654aba060. The branch merges cleanly with76f969ff7(#1100) and shares no files with it, but the suites were not rerun on that merge.Evidence
Screenshots from the harness runs are in the comment below.
Issue
No linked issue. This came from a report that side-by-side Shell and Working spinners look wrong.
Risks / Follow-ups
/btwside question beside Working is covered by unit tests only. The live runs used subagent and shell activity.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.