Skip to content

Keep a running agent's cost and × off the topbar controls - #1937

Merged
BarganConstantin merged 1 commit into
developmentfrom
fix/ribbon-and-map-stage
Oct 4, 2026
Merged

BarganConstantin merged 1 commit into
developmentfrom
fix/ribbon-and-map-stage

Conversation

@BarganConstantin

Copy link
Copy Markdown
Owner

What changes

  • A running agent's cost in the selection ribbon, from 641 to 1139px. Since Network map key, heartbeat Retry-After, skipped-release tray row, and two narrow-topbar fixes #1933 the ribbon comes back to the bar at 641px. From there up to 1040 nothing held its cost back, and the controls leave the ribbon less than its 24vw cap. A cost does not shrink, so the name ellipsed to nothing and the cost and × ran past the ribbon's edge. At 641px the × was drawn 67px into the controls, at 700 39px, and from 720 to 750 it sat on the Session list button and took its presses. The ribbon now drops the cost below 1140px, the same way it already did from 1040 to 1139. The cost is still on the agent's card, in the detail panel and in the ribbon's title.
  • The ribbon is never squeezed under its own parts. The ribbon needed min-width: 0 so the name could ellipse at all, and that left it with no lower limit. The bar shrinks the ribbon and the readout in proportion to their widths. With a short name or a +N chip, the ribbon was cut down past its state pill and ×, and the × was drawn outside its edge: 30px past it at 641 for an agent called "x", and with a +2 chip 18px into the Session list button. The ribbon now lays its parts out in columns, and only the name's column can go narrower than its content. Its min-content is then the state, the chips and the ×, with the name ellipsed to nothing, and min-width: min-content keeps it at least that wide. Where there is room it draws the same pixels as before.

Verification

  • npm run typecheck: clean.
  • Full suite (--maxWorkers=3 --minWorkers=1): 886 files, 11574 tests passed, exit 0. After rebasing onto development the touched and neighbouring tests passed again: 6 files, 79 tests.
  • New regression test topbar-ribbon-cost.test.ts. It adds the bar up from the sheet's own numbers: padding, the waiting pill, the gaps, the ribbon at its smallest with whatever the cascade still draws in it, and the controls. Before the fix it failed three ways:
    • the bar fell short wherever the cost was drawn ("641px needs 700", and on through the 600s);
    • the cost was drawn at 641px;
    • the ribbon was inline-flex with no lower width limit.
  • monthly-topbar-737.test.ts: the cost's band test now matches the band without its old 1040px lower bound. Its end points are still checked against both caps.
  • Browser, on an isolated deck with a running agent ("billing", cost $3.96 · $x/min), at 600, 620, 640, 641, 660, 680, 700, 720, 750, 800, 850, 900, 950, 1000, 1039, 1040 and 1100px, in light and dark. elementFromPoint was taken at the centres of the × and of the Session list button.
    • Before: at 641 to 750 the × was 14 to 67px into the controls. At 720 and 750 a press at the Session list button's centre landed on the ×. At 800 and 850 the × was 19px and 7px outside the ribbon's own edge.
    • After: at every width a press lands on its own control, and the × stays 7px inside the ribbon's edge.
    • Also measured with names of 1, 7 and 41 characters, each with and without a +2 chip, at 641 to 1440px. The × stayed inside the ribbon, never reached the controls, and the waiting pill was never clipped.
    • With room to spare, the new ribbon was screenshotted next to the old one at 1200, 1500 and 1700px, with and without a chip, in both themes. Both were shot twice. 20 of 24 old/new pairs were byte-identical. Each pair that differed had a matching difference between two shots of the same layout, or a ribbon placed at a different x because the readout beside it had changed. A long name ellipses the same way in both.
  • Checked, not changed: the network map's stage. A selection begun in the details panel and let go over the empty stage leaves the panel on the deck. The click lands on the panel and stage's shared parent, not on the stage. This held for the title, the presence line, a drag across a deck and the stacked layout at 900px.
  • tarball-install-smoke.test.ts passed locally this time. It usually times out in worktrees and passes in CI.

… 1140px

From 641px, where the selection ribbon comes back to the bar, up to 1040 nothing held its cost back, and the controls leave the ribbon less than its 24vw cap. The cost does not shrink, so the name ellipsed to nothing and the cost and × ran on past the ribbon's edge: 67px into the controls at 641, and over the Session list button, taking its presses, from 720 to 750. The cost now leaves the ribbon below 1140 as it already did from 1040; it stays on the card, in the detail panel and in the ribbon's title.

The ribbon also had no floor: with min-width: 0 the bar shrank it with the readout in proportion to their widths, so a short name or a +N chip still cut it under its own state and ×. Its parts now sit in columns where only the name's can go under its content, and the ribbon holds that min-content, so the × stays inside its edge at every width. With room to spare it draws the same pixels as before.
@BarganConstantin
BarganConstantin merged commit 690244c into development Oct 4, 2026
10 checks passed
@BarganConstantin BarganConstantin mentioned this pull request Oct 5, 2026
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