Skip to content

Transcript: a note between tool rows is estimated from its wrapped lines - #31181

Merged
teamleaderleo merged 7 commits into
feat-cmux-nextfrom
transcript-note-height-estimate
Nov 2, 2026
Merged

teamleaderleo merged 7 commits into
feat-cmux-nextfrom
transcript-note-height-estimate

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #31148 (follow-up from the review of #30400).

model.ts activityStepHeight estimated a note folded between tool rows (turns.ts mergeShortNotes, drawn as .cv-tool-note) as one 20px line plus the 12px note gap above and below. A note that wraps draws taller than that until it is measured, so the scroll height could step once it scrolled into view. The note is now estimated from its text at the row's width with the file's textHeight (a new optional line-height argument gives the note's 20px lines), as replies are. The width is threaded through foldedRunSteps / foldedGroupHeight. Prepared texts are cached and cleared past 256, as the other estimate caches are; only notes are measured, so there is no new per-row or per-token work.

Red/green (rowEstimates.test.ts, new case "a note folded between tool rows is estimated as the lines it wraps to at the column's width"):

Spec: design/chat-transcript.md is unchanged; the note's drawn rhythm is unchanged, only its estimate.

Related: leo-workspace#1929 (grid.md's copy button 28/6 vs shipped 24/4) was settled in a notes PR; #29639 is #31176.

Risk: small, estimate only (first-layout heights of folded runs with notes).

Agent session: agent session

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the transcript's scroll-height estimate for a note folded between tool rows. The estimate previously assumed a single 20px line, so the scroll height stepped when a wrapping note scrolled into view. The note is now estimated from its flattened text at the column's width on 20px lines, matching how .cv-tool-note draws: white-space: normal collapses newlines and space runs to single spaces. Prepared note texts are cached and cleared past 256 entries, and only notes are measured, so there's no per-row or per-token cost. The new test measures wraps against the model's one-line height so it holds under the base merge's chromeScale.

Written for commit 259bdac. Summary will update on new commits.

View guided diff Turn on auto-fix

activityStepHeight gave a note folded between tool rows (turns.ts
mergeShortNotes, conversation.css .cv-tool-note) one 20px line; a note
that wraps drew taller until measured. Estimate it from its text on 20px
lines at the row's width, as replies are. Fixes #31148.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-92fa78a91e29868c5eaa
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review dcee8e4: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr31181 -f ref=transcript-note-height-estimate -f platform=macos -f backend_mode=local

Gallery before/after for 259bdac: 16 states rendered, 13 images differ, 2958 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41391549789 -R manaflow-ai/cmux -n gallery-advisory-31181-259bdac4e70358ef4d6ae33438d749747c84b3b7 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.prompt-after-tool-rows/centered Apple System Colors changed 0.101% own model.ts
agent-pane.prompt-after-tool-rows/centered Apple System Colors Light unchanged 0% own model.ts
agent-pane.access-offer/turn-no-credits Apple System Colors Light unchanged 0% imports model.ts (1 hops)
agent-pane.access-offer/turn-no-credits Apple System Colors unchanged 0% imports model.ts (1 hops)
agent-pane.access-offer/turn-low-credits Apple System Colors Light unchanged 0% imports model.ts (1 hops)
agent-pane.access-offer/turn-low-credits Apple System Colors unchanged 0% imports model.ts (1 hops)
agent-pane.access-offer/turn-no-offer Apple System Colors Light unchanged 0% imports model.ts (1 hops)
agent-pane.access-offer/turn-no-offer Apple System Colors unchanged 0% imports model.ts (1 hops)
agent-pane.acpmux-batch-send/batches Apple System Colors Light changed 0% imports model.ts (1 hops)
agent-pane.acpmux-batch-send/batches Apple System Colors changed 0% imports model.ts (1 hops)
agent-pane.acpmux-batch-send/batch-raw Apple System Colors Light changed 0% imports model.ts (1 hops)
agent-pane.acpmux-batch-send/batch-raw Apple System Colors changed 0% imports model.ts (1 hops)
agent-pane.acpmux-batch-send/batch-sending Apple System Colors Light unchanged 0% imports model.ts (1 hops)
agent-pane.acpmux-batch-send/batch-sending Apple System Colors unchanged 0% imports model.ts (1 hops)
agent-pane.addressed-message/relayed Apple System Colors Light unchanged 0% imports model.ts (1 hops)
agent-pane.addressed-message/relayed Apple System Colors unchanged 0% imports model.ts (1 hops)
agent-pane.agent-message-row/unicode-boundary Apple System Colors Light unchanged 0% imports model.ts (1 hops)
agent-pane.agent-message-row/unicode-boundary Apple System Colors unchanged 0% imports model.ts (1 hops)
agent-pane.agent-message-row/sent Apple System Colors Light changed 0.0166% imports model.ts (1 hops)
agent-pane.agent-message-row/sent Apple System Colors changed 0.0137% imports model.ts (1 hops)
agent-pane.agent-message-row/lanes Apple System Colors Light unchanged 0% imports model.ts (1 hops)
agent-pane.agent-message-row/lanes Apple System Colors unchanged 0% imports model.ts (1 hops)
agent-pane.agent-message-row/sent-subagents Apple System Colors Light unchanged 0% imports model.ts (1 hops)
agent-pane.agent-message-row/sent-subagents Apple System Colors unchanged 0% imports model.ts (1 hops)
agent-pane.agent-message-row/sent-hover Apple System Colors changed 0.0079% imports model.ts (1 hops)
agent-pane.agent-message-row/sent-hover Apple System Colors Light changed 0.0064% imports model.ts (1 hops)
agent-pane.agent-message-row/sent-opened Apple System Colors Light changed 0.0065% imports model.ts (1 hops)
agent-pane.agent-message-row/sent-opened Apple System Colors changed 0.0037% imports model.ts (1 hops)
agent-pane.agent-message-row/sent-opened-long Apple System Colors Light changed 0.0147% imports model.ts (1 hops)
agent-pane.agent-message-row/sent-opened-long Apple System Colors changed 0.0113% imports model.ts (1 hops)
agent-pane.agent-message-row/outcomes Apple System Colors Light unchanged 0% imports model.ts (1 hops)
agent-pane.agent-message-row/outcomes Apple System Colors unchanged 0% imports model.ts (1 hops)

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

web and size checks: green

Shipped in:

@teamleaderleo

teamleaderleo commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 1, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
main.DeveloperIdAppTests.test_download_prints_the_active_profile_only/
test_download_prints_the_active_profile_only
View Logs
stubs: /System/Library/Frameworks/Security.framework/Versions/A/Security has no stub/
Security has no stub
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_CFRetain']/
CoreFoundation, missing 1: ['_CFRetain']
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_log2']/
CoreFoundation, missing 1: ['_log2']
View Logs
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)/
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)
View Logs
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)/
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)
View Logs

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (independent Codex gpt-6.1-sol, high, via the review router; full diff from merge base 1629343 to this head): SHIP at 7f6b538.

No P1/P2 findings.

Conflicts resolved keeping both sides (base merged, no rebase).

Agent-Session: https://cmux.com/deeplink/agent?id=aid-159afad10a5ab45ea16c
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): BLOCK at 33f6374

BLOCK at 33f6374

Visual verdict: no images; Leo tries the build

  1. [P2][blocking] webviews/src/agent-session/acpmux/model.ts:1083 — Notes are measured with white-space: pre-wrap, but .cv-tool-note has the browser’s default white-space: normal (conversation.css:2175). A short note containing an embedded newline therefore renders as one line in a wide pane while the estimate reserves two, causing the row and scroll height to shrink when mounted. isTakeaway allows such notes, so this regresses the base behavior.

teamleaderleo and others added 3 commits November 1, 2026 18:48
A newline in a short note draws as a space in .cv-tool-note, so the estimate
no longer reserves a second line for it (review BLOCK at 33f6374).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-92fa78a91e29868c5eaa
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-92fa78a91e29868c5eaa
…he model

The base merge scaled the tool rows and note gap (chromeScale), so the test
measures wraps against the one-line note instead of hard-coded pixels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-92fa78a91e29868c5eaa
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Fixed the BLOCK at 33f6374 in 7190324: a note is measured with its whitespace collapsed, as .cv-tool-note's white-space: normal draws it, so a newline in a short note no longer reserves a second line. A test covers it. The base merge (#31294 and the chromeScale change) was hand-resolved: the width argument is kept, and so are base's noteGap() and toolRowHeight(). The note test now measures wraps from the one-line estimate. Fleet: bun run check plus rowEstimates and interim-prose-gap tests, 30/30 at 5a86781.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 5a86781

Reviewer: codex gpt-6-astra high, fast tier.

SHIP at 5a86781

Visual verdict: no images; Leo tries the build

Follow-ups: none

@cmux-bot cmux-bot 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.

cmux-bot approves 5a86781: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

…note-height-estimate

# Conflicts:
#	webviews/src/agent-session/acpmux/model.ts
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at dcee8e4

SHIP at dcee8e4

Visual verdict: no regression across all 16 gallery pairs; visible differences are spinner animation.

No correctness findings. Tests could not be rerun locally because Bun and dependencies are unavailable.

Follow-ups: none

cmux-bot[bot]
cmux-bot Bot previously approved these changes Nov 2, 2026

@cmux-bot cmux-bot 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.

cmux-bot approves dcee8e4: an independent review passed this exact head (next-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 2, 2026 05:00 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 2, 2026 05:04 Inactive
@cmux-bot
cmux-bot Bot dismissed their stale review November 2, 2026 05:14

A newer verdict blocks 259bdac (no independent SHIP at the head).

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (next-review patch-id; carried): SHIP at 259bdac

The independent SHIP at dcee8e4 carries to this head: the PR's own change (git diff $(git merge-base feat-cmux-next HEAD) HEAD) has the same git patch-id --verbatim (b3b7a280cea75ab2) at both heads, and no merge between them was resolved by hand. Nothing new to review. A newer BLOCK, or any change to the PR's own diff, ends the carry.

@teamleaderleo
teamleaderleo merged commit 14a5e1b into feat-cmux-next Nov 2, 2026
182 of 194 checks passed
@teamleaderleo
teamleaderleo deleted the transcript-note-height-estimate branch November 2, 2026 05:40

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 259bdac4 Deployed Nov 2, 2026 by cmux-bot[bot] via wait for same-key tree publisher #99375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant