You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c9a5f20
Browse filesBrowse the repository at this point in the historyBrowse files
Run a diff row's fill to the end of its line (#784)
Pierre sizes the diff's code column `1fr`, which is the width of the box
that scrolls, so a changed row painted its green or red only as far as
the reader could already see. On the walkthrough's widest file the line
runs 3,234px inside a 718px box and the fill stopped at 671px: scrolling
right left every addition and deletion sitting on the file's plain paper
with nothing to say which it was.
The track now takes its floor from the longest line and keeps `1fr` over
it, so a file whose lines all fit still fills its box rather than ending
at its longest line. That floor measures everything standing in the
column, which is where the other two changes come from. A thread outlet
stands there with the lines, and what it contributes is not its remark's
own length but the thread's own `max-width: 760px` cap plus the outlet's
padding — a 796px contribution from any remark long enough to reach that
cap, against the 671px of rows in the file it was measured on, so one
ordinary remark set a file that fit its box scrolling sideways with
843px of content in 718px of room. Inline-size containment keeps the
outlet out of the measure while it still stretches and wraps. And the
wrap switch and the print sheet both force `pre-wrap` while a wrapped
line still measures its unwrapped self, so both drop the floor.
Three probes had to move with it, because the rows are now all one width
— each sized to the longest line in its file — and a reading taken off a
row's own box no longer says anything about that row's line.
`DIFF_CLIPPING` and `_SELECT_IN_ROW` both measure the row's text now, by
a Range over its contents, against the room the scrolling box gives it;
without that, `DIFF_CLIPPING` reported the file's overhang for all 18 of
one file's rows where one line overflows, and named a trailing-context
line the reader could see whole. Each has an assertion holding it to
naming the overflowing line, so it cannot quietly degenerate again. The
new `DIFF_ROW_FILL` case asserts the fill reaches both the line's end
and the box's edge, and reads again after a comment lands; every one of
those was verified paired, green with the change and red without it.
Measured on the 47-file patch: 3,769 rows relayout in 147-150ms against
the baseline's 154-156ms, across two paired rounds, so the intrinsic
sizing costs nothing here.
One commit only adds a TODO: `lf-code` has a milder version of the same
defect, where a short highlighted line's tint ends at the scrollport
rather than at the block's width. Its notes share the column and
position sticky, so that fix wants its own change.
Thanks to @leaf-agent for both review findings — the untested
containment and the degenerated probe.
> _This was written by Claude Code on behalf of max-sixty_
---------
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
0 commit comments