Skip to content

fix(ui): keep status badges on one line in collapsed tool rows - #64116

Open
phon-t wants to merge 1 commit into
anomalyco:devfrom
phon-t:tool-badge-wrap
Open

phon-t wants to merge 1 commit into
anomalyco:devfrom
phon-t:tool-badge-wrap

Conversation

@phon-t

@phon-t phon-t commented Nov 15, 2026 •

Copy link
Copy Markdown

Issue for this PR

Fixes #64100

Type of change

  • Bug fix

What does this PR do?

In a collapsed shell tool row, the status badge (Exit 1 / Failed / Timed out) folded onto two lines inside its fixed 16px height, so the second line was clipped and a border segment went missing — and a long command ran into the badge with no ellipsis.

Root cause is twofold:

  • The badge is a flex item of the collapsed row. Flex shrink is proportional to flex-basis, so the badge lost ~30px to the long command and wrapped at its space ("Exit" / "1").
  • The command text lives in an atomic inline-block inside the truncating subtitle, so the subtitle's own text-overflow: ellipsis never reached its text — the command just overflowed and was covered by the badge.

Changes:

  • packages/ui/src/data-display/badge/badge.css: the tag gets white-space: nowrap and flex-shrink: 0. A badge is an atomic label; a squeezed row now truncates the text beside it instead of folding the badge.
  • packages/session-ui/src/components/shell-submessage.css: the command value gets max-width: 100%, overflow: hidden, and text-overflow: ellipsis, so a long command ends in "…" before it reaches the badge.
  • The 0.5px border is unchanged: it is design-system-wide, and the clipped border in the report was the wrap, not the border width.

How did you verify your code works?

  • New Playwright component test (packages/session-ui/component-tests/shell-badge.spec.ts, story packages/session-ui/src/timeline-next/stories/shell-badge.stories.tsx): a failed shell call with a long command at 420px width. It asserts the badge reads "Exit 1", has no overflowing second line, the command truncates, and the command ends before the badge starts. It fails before the fix (badge overflow 5px, folded "Exit"/"1" in the screenshot) and passes after. Note the badge lives only in the new timeline (timeline-next/tools/shell.tsx); the current timeline's shell renderer has no badge.
  • bun run check: 35/35 tasks pass.
  • Full packages/session-ui component suite, cold: 214 passed. 4 pre-existing failures in markdown.spec.ts (inline code in links, mermaid diagrams) fail identically on clean dev in this environment — the story never mounts there; unrelated to this change.

Screenshots / recordings

The reviewer (opencodejr) reproduced the bug on the base code with this test and confirmed the fix, with before/after screenshots in the comments below: on base the badge overflows its 16px height by 5px and wraps; with this PR the test passes and the row shows a truncated command ending in "…" next to a single-line badge.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Nov 15, 2026

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. I reproduced the problem on the base by copying the new story and test there. The test fails: the badge content overflows its 16px height by 5px, so "Exit"/"1" wraps and gets clipped, and the command is cut off with no ellipsis. With this PR the test passes, and the row shows a truncated command ending in "…" next to a single-line badge (screenshots below). The nearby session-ui component tests and tsc on packages/session-ui pass.

The badge style change is app-wide, so I checked the other <Badge> uses. The one badge meant to shrink (provider-connected in the connect dialog) sets shrink truncate, and those utility classes still override badge.css (components layer), so nothing that relies on wrapping breaks.

Public API: unchanged (CSS, a story and a component test only).

The issue also mentions a border edge disappearing at some zoom levels. The PR keeps the 0.5px border and attributes the missing edge to the wrap, which matches the base screenshot. I couldn't check fractional zoom in the desktop app.

Before

After

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

This branch has not been deployed

No deployments
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.

desktop: status badge (Exit/Failed/Timed out) clips border and wraps text in collapsed tool call rows

1 participant