Skip to content

Show tool summaries at full row width - #933

Merged
AnthonyRonning merged 1 commit into
MaplePrivacyLabs:masterfrom
benthecarman:fix-tool-summary-truncation
Sep 15, 2026
Merged

AnthonyRonning merged 1 commit into
MaplePrivacyLabs:masterfrom
benthecarman:fix-tool-summary-truncation

Conversation

@benthecarman

Copy link
Copy Markdown
Contributor

Problem

In the GPUI Agent transcript, tool-card and thinking-row summaries were
truncated with a middle ellipsis (head…tail) well before the row's end,
even when the text would fit — cut off mid-sentence with most of the row
left empty.

Two causes in render_tool / render_thinking:

  • The title divs combined line_clamp(1) with text_ellipsis_middle()
    and had no min_w_0 / flex sizing. Middle truncation is for paths and
    identifiers; these titles are one-line prose summaries.
  • In the pinned gpui, the line_clamp truncation path decides from
    summed per-character advances (no shaping/kerning), which overestimates
    the real text width and cuts summaries that would actually fit.

Change

Both titles now use the canonical single-line treatment already used by
the subagent activity rows in the same file:

  • min_w_0() + flex_1() + .truncate() (overflow hidden + nowrap +
    end ellipsis). The title claims the row's width and only ellipsizes at
    its end when the honestly-shaped text overflows.
  • The redundant flex_1 spacer in the tool header row is gone.

Evidence

  • Measured pre-fix layout with a debug_bounds harness: the tool title
    was middle-ellipsized mid-sentence; post-fix it fills the row
    (723px → full row) and truncates only at the end.
  • New regression test test_tool_summary_title_fills_the_row pins the
    fills-the-row contract for both the tool card and the thinking row.
  • Full component gate green: just ci (fmt-check, clippy -D warnings
    across all four feature sets, workspace + headless tests).
  • Smoke-tested release builds (Nix and system-toolchain) locally.

Tool-card and thinking-row summaries are one-line prose, but their
title divs combined line_clamp(1) with a middle ellipsis and no
min_w_0/flex sizing. GPUI therefore middle-truncated sentences that
read head...tail, and the line-clamp wrap path decides truncation
from summed per-character advances, which overestimates shaped text
and cuts summaries that would fit.

Give both titles the canonical single-line treatment instead:
min_w_0 + flex_1 + overflow hidden + nowrap + end ellipsis. The title
now claims the row's width and only ellipsizes at its end when the
honestly-shaped text overflows, matching the subagent activity rows.
The redundant flex_1 spacer in the tool header goes away with it.

A debug_bounds layout test pins the fills-the-row contract.
@AnthonyRonning
AnthonyRonning merged commit b9ea85a into MaplePrivacyLabs:master Sep 15, 2026
22 checks passed
@benthecarman
benthecarman deleted the fix-tool-summary-truncation branch September 15, 2026 08:13
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.

2 participants