Skip to content

Show one spinner when the session pill row folds - #1115

Merged
ivanfenenko merged 3 commits into
mainfrom
fix/session-pill-row-single-spinner
Nov 23, 2026
Merged

ivanfenenko merged 3 commits into
mainfrom
fix/session-pill-row-single-spinner

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • The compact Working pill hides beside a running activity pill and gives its width to that pill's label. The activity pill's accessibility label now starts with the turn status, for example "Working. 1 subagent and 2 shells running."
  • The activity-only slot measures its row, so it folds like the full row on both platforms.
  • Android counts the gaps around the right-side pills and the navigation pill when it works out the fold.
  • iOS shows a spinner instead of a pulsing dot on a collapsed summary pill for live work. Android already showed a spinner there.
  • iOS now reports the width the row was given. It used to measure the overflowing content, so the row never folded and its pills ran off both screen edges while Syncing was showing.

Checks

  • iOS and Android both covered
  • Screenshots for UI changes (in the comment below)
  • Tests run

Unit tests ran on this branch based on 654aba060. The branch merges cleanly with 76f969ff7 (#1100) and shares no files with it, but the suites were not rerun on that merge.

  • Android: 772 Session Chat and floating pill tests passed. ktlint reports nothing on the changed lines; the task still fails on existing violations elsewhere.
  • iOS: 946 tests in 49 Session Chat and floating pill suites passed.
  • Live, on an iPhone SE simulator and a 360 dp Android emulator against the scenario harness (v2 server):
    • A running subagent and shells beside Working show one spinner when the row folds, with the activity label readable.
    • The full Working pill returns when there is room.
    • The collapsed pill shows one spinner when scrolled away from the end.
    • Attention and Failed keep their own pills beside the running shells.
    • Done keeps its own pill, confirmed from the accessibility tree because it faded before a screenshot.
    • The merged accessibility label was read back on both apps.

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

  • Not run live against a v1 server. The change is in the view layer and does not touch protocol code.
  • The row was forced to fold differently per platform: Syncing and the keyboard on iOS, a 1.3 font scale on Android. Android's fold with Syncing showing and with the keyboard open was not checked live.
  • A running /btw side question beside Working is covered by unit tests only. The live runs used subagent and shell activity.

Proof this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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.
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Harness data only (v2 server, iPhone SE simulator, 360 dp Android emulator).

Step iOS Android
Room for both pills iOS full row Android full row
Row folds to one spinner (iOS: Syncing showing; Android: 1.3 font scale) iOS folded Android folded
Keyboard open iOS keyboard Not checked
Full Working pill returns iOS full row returns Android full row returns
Scrolled away from the end iOS scrolled away Android scrolled away
Attention beside running shells iOS attention Android attention
Failed beside running shells iOS failed Android failed

The key shown in the Failed step is the harness's masked fake value.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review: 1 finding(s) that 2+ of 3 passes agreed on.

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.084 · 1 pass(es) stopped early

},
onClose = turnItem?.takeIf { turnStatus.isClosable }?.let { item -> { onClose(item) } },
)
SessionChatPillReveal(visible = !turnMerged) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@ivanfenenko
ivanfenenko added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 0f386ce Nov 23, 2026
@ivanfenenko
ivanfenenko deleted the fix/session-pill-row-single-spinner branch November 23, 2026 13:54
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.

1 participant