estimatedMsgHeight is ~4 rows high for a kind: 'diff' message with
structured diffData. Measured at cols=80 and cols=100: estimate 10, paint 6.
On origin/main before #834 it was 9 against 6, so most of this predates that
PR; #834 added one row via a call-row counting fix that is correct everywhere
else, and explicitly scoped this branch out.
Two causes, both in the kind: 'diff' path:
- The estimator counts
wrappedLines(msg.text) for a markdown fallback that
the structured branch never renders (messageLine.tsx returns its own
wrapper with DiffView instead).
- It adds 2 for a
Response separator that branch never paints —
shouldShowResponseSeparator returns false for msg.kind === 'diff'.
It also does not model DiffView's own rows at all, so the sign of the error
depends on the patch size.
Why it matters: the virtualized transcript positions rows from this estimate
before Yoga measures anything, so a wrong number shows up as scrollbar drift
and blank gaps. Edit/Write segments are common.
kind: 'diff' is now the only message kind with no estimate-vs-paint coverage
in toolBrief.test.ts's parity suite (which renders real ToolTrail and
MessageLine output and asserts the estimate equals the painted row count).
Adding a structured-diff case there — which needs structuredDiffSupported()
and real diffData — would both pin the fix and stop it regressing.
Found during the review of #834.
estimatedMsgHeightis ~4 rows high for akind: 'diff'message withstructured
diffData. Measured at cols=80 and cols=100: estimate 10, paint 6.On
origin/mainbefore #834 it was 9 against 6, so most of this predates thatPR; #834 added one row via a call-row counting fix that is correct everywhere
else, and explicitly scoped this branch out.
Two causes, both in the
kind: 'diff'path:wrappedLines(msg.text)for a markdown fallback thatthe structured branch never renders (
messageLine.tsxreturns its ownwrapper with
DiffViewinstead).Responseseparator that branch never paints —shouldShowResponseSeparatorreturns false formsg.kind === 'diff'.It also does not model
DiffView's own rows at all, so the sign of the errordepends on the patch size.
Why it matters: the virtualized transcript positions rows from this estimate
before Yoga measures anything, so a wrong number shows up as scrollbar drift
and blank gaps. Edit/Write segments are common.
kind: 'diff'is now the only message kind with no estimate-vs-paint coveragein
toolBrief.test.ts's parity suite (which renders realToolTrailandMessageLineoutput and asserts the estimate equals the painted row count).Adding a structured-diff case there — which needs
structuredDiffSupported()and real
diffData— would both pin the fix and stop it regressing.Found during the review of #834.