Skip to content

fix(session): stack the composer pills only when they don't fit - #233

Merged
Tarquinen merged 2 commits into
devfrom
composer-pill-fit
Nov 21, 2026
Merged

Tarquinen merged 2 commits into
devfrom
composer-pill-fit

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The pills above the composer chose between one row and a stack by font scale alone. At normal size a long label was squeezed: in German the queued pill read "1 in der" instead of "1 in der Warteschlange".

Now the pills share a row, at least 8 dp apart, unless background work and queued messages don't fit side by side at full width. Jump to latest joins the queued pill's row only when its whole slot fits, and otherwise floats above the rows at its full size, so it never changes their layout. When the rows stack or unstack, their height slides on the composer column's curve instead of stepping. This ports iOS ComposerPillRows (p551: 41e2b90d, 6a02dc7d).

Top row is dev, bottom row is this branch. Columns: English at font 1.0, English at 2.0, German at 1.0, German at 2.0.

before and after

A queued message arriving and leaving under background work, German at font 1.0, animations slowed 2.5x. Dev squeezes the label; this branch stacks, and the work pill slides up and back down.

queue-arrive-leave-de-1.0.mp4

Jump to latest hidden and shown (German, 1.0): the rows keep their height and the queued pill slides over.

jump hidden and shown

  • German at 1.0 now stacks and shows the whole queued label.
  • English looks the same as before at both sizes.
  • German at 2.0 floats Jump above the stack. On dev its slot was squeezed to fit.
  • Android keeps its own 10 dp gap between stacked rows.
  • Motion: the rows' slide happens only when a message is queued or delivered while background work is running and the two pills don't fit one row, a few times a day at most.
  • The app turns right-to-left off (supportsRtl="false"), so there's no right-to-left case to show.
  • Conflicts: the pill-row-exit branch edits the same ComposerPills/QueuedActivity code (it should keep the agents, shells and scripts counts while leaving), and PR feat(session): add an up arrow that jumps to the previous user message #182 adds its previous-message action to the jump call, which is now one call.

Verified: full scripts/check.sh on the VM. On the emulator with session-lab (background work plus a held queued message), I compared dev and this branch in English and German at font scale 1.0 and 2.0, recorded a queued message arriving and leaving with animations at 5x on both, and checked Jump hidden and shown.

The pills above the composer (background work, queued messages, Jump to
latest) chose between one row and a stack by font scale (>= 1.8). A long
label at normal size, like German "1 in der Warteschlange", was squeezed
to "1 in der", and the row's split never looked at the real widths.

ComposerPills is now one measured Layout, as iOS ComposerPillRows
(p551: 41e2b90d, 6a02dc7d): the pills share a row unless background work
and queued overflow it at full width. Jump to latest joins the queued
pill's row only when its full slot fits, and otherwise floats above the
rows' top end, so it never changes their layout. Android's 10 dp stacked
gap stays; no new motion.

Verified: scripts/check.sh (full, on the VM). On the emulator with
session-lab (background work + a held queued message, scrolled up),
English and German at font scale 1.0 and 2.0 on dev and on this branch:
German at 1.0 now stacks with the full queued label instead of clipping
it; English at 1.0 and 2.0 look the same as before; German at 2.0 floats
Jump above the stack where dev squeezed its slot.
… jump whole

Review fixes for the composer pill fit:
- The rows' height moves on the composer column's curve when the queued
  pill stacks under background work or leaves, so the work pill and the
  transcript slide instead of stepping (dev stepped too at font scale 2).
- At least 8 dp between the pills before they count as fitting a row.
- A floating jump button keeps its full 48 dp slot; only the slot beside
  the queued pill collapses. The pills are measured first
  (SubcomposeLayout), so the fit decision picks the jump's slot.
- The jump slot follows the queued pill still on screen, so its exit no
  longer moves the jump mid-way.
- The KDoc no longer points at the iOS counterpart.

Verified: scripts/check.sh on the VM (full). Emulator with session-lab,
animations at 5x: German at font scale 1.0, a queued message arriving and
leaving under background work (dev vs branch recording); German at 2.0
with the jump floating at 48 dp; the jump hidden vs shown keeps the
rows' height.
@Tarquinen
Tarquinen merged commit 3bc59cd into dev Nov 21, 2026
2 checks passed
@Tarquinen
Tarquinen deleted the composer-pill-fit branch November 21, 2026 03:14
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