Skip to content

Keep the Mac transcript laid out for its pane's width, however the width changed - #1468

Merged
dylanplayer merged 2 commits into
mainfrom
codevisor/passionfruit
Nov 24, 2026
Merged

dylanplayer merged 2 commits into
mainfrom
codevisor/passionfruit

Conversation

@dylanplayer

Copy link
Copy Markdown
Member

What was wrong

Opening a chat could show its messages shifted to the left, laid out for a narrower pane than the one on screen, until something else changed the width (opening or closing the inspector did). The chat had last been laid out at another width, for example half width in a split, and the resize on return landed while its rows were being re-prepared. That layout was skipped and nothing asked for it again. An earlier fix (851-2838) covered one of the two places this could be skipped; this was the other.

What changes

The Mac transcript no longer depends on reacting to each width change.

  • Rows sit at the leading edge of one column, and the document view keeps that column centered in its own width. No row stores a horizontal position that can go stale.
  • Each layout pass compares the width the rows are laid out for with the pane's width and reflows on a mismatch, also while the scroll position is paused for stale rows.
  • That pause now guards the scroll position only. When it ends with a layout still owed, the layout is requested from one place, which replaces the hand-written reminders in configure.
  • A transcript whose viewport got shorter while its rows were re-prepared is pinned to the bottom again.

The at-bottom animation and report stay away from the transcript's own resize (second commit).

  • The fade for the jump-to-bottom and collapse-steps buttons covered the whole chat surface; it now covers only those buttons.
  • The transcript reports its bottom state only for a viewport size it has laid out.

Verification

  • Four new tests fail on main and pass here; the transcript suite passes (81 tests).
  • In the dev app: returning to a chat after the window got narrower or wider, removing a split while its chat was hidden, scroll position restore, text selection through a resize, tables, the inspector, and sending a message.
  • Chat switch timing, five matched runs each on 200-turn chats, shows no measurable difference (medians 34.6 to 28.7 ms at the same width, 50.6 to 52.4 ms when rows reflow, with about 20% spread between runs).

Not confirmed

  • The original shifted transcript did not reproduce on demand on main, so the failing-before tests are the proof.
  • The displaced frames while a window grows taller did not reproduce in this worktree before or after, so the second commit is not confirmed as the full fix for that glitch.
  • The jump-to-bottom button shows and hides correctly; its fade was not captured.

🤖 Generated with Claude Code

dylanplayer and others added 2 commits November 23, 2026 16:25
…dth changed

Opening a chat could show its messages shifted to the left, laid out for
a narrower pane than the one on screen, until something else changed the
width (opening or closing the inspector did). The chat had last been
laid out at another width, for example half width in a split, and the
resize on return landed while its rows were being re-prepared. That
layout was skipped and nothing asked for it again.

The transcript no longer depends on reacting to each width change:

- Rows sit at the leading edge of one column, and the document view
  keeps that column centered in its own width. No row stores a
  horizontal position that can go stale.
- Each layout pass compares the width the rows are laid out for with
  the pane's width and reflows on a mismatch, also while the scroll
  position is paused for stale rows.
- That pause now guards the scroll position only. When it ends with a
  layout still owed, the layout is requested from one place, which
  replaces the hand-written reminders in configure.

This also re-pins a transcript to the bottom when its viewport got
shorter while its rows were re-prepared.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…n resize

While a window grew taller with a chat pinned to the bottom, the whole
transcript could be drawn displaced for a moment and the composer could
vanish, then both snapped back. Two things fed that:

- The fade for the jump-to-bottom and collapse-steps buttons was applied
  to the whole chat surface, so a change of "at bottom" also animated
  the transcript and composer while they were being resized. It now
  covers only those buttons.
- The transcript could report that it had left the bottom for a viewport
  size it had not laid out yet. It now reports its bottom state only for
  a size it has laid out; the layout pass that follows reports the
  settled state.

The displaced frames did not reproduce in this worktree before or after
(nine window-grow passes on main, six with this change), so this is not
confirmed as the full fix for that glitch.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@dylanplayer
dylanplayer merged commit bf5b353 into main Nov 24, 2026
@dylanplayer
dylanplayer deleted the codevisor/passionfruit branch November 24, 2026 00:26
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.

1 participant