Skip to content

fix(messages): lift history with a growing composer in channels and threads - #864

Open
baxen wants to merge 2 commits into
mainfrom
baxen/thread-follow-resize
Open

baxen wants to merge 2 commits into
mainfrom
baxen/thread-follow-resize

Conversation

@baxen

@baxen baxen commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

If you're at the bottom of a conversation, your text should move up smoothly as the composer grows. Instead:

  • Thread: the thread panel scrolled back down only when thread data changed (the ThreadPanel positioning effect). When the composer grew, the latest reply slid under it. On the next unrelated update (a peer reply, a reaction, a profile load) the thread then jumped 70–100px. Late media and link previews made rows taller with the same result. This is the "thread view moves while typing" report.
  • Channel: a viewport resize only scrolled back down through setSize → effect → requestAnimationFrame. On each growth the composer covered the last line for 2–3 painted frames, then history jumped up to catch up.

Change

  • ThreadPanel: a ResizeObserver on the scroller and its rows scrolls back to the bottom while the reader is following.
  • ChannelTimeline: the existing resize observer scrolls back to the bottom before paint, but only when the viewport shrinks and the reader was at the bottom of the previous viewport. The deferred restore path is unchanged.

Both corrections run in ResizeObserver callbacks, which run after layout and before paint. History moves up in the same frame the composer grows, with no animation.

Validation

  • New browser test in typing.spec.mjs for the channel and thread composers. It records the bottom gap at paint time in a ResizeObserver created after the app's. Without the fixes, both cases fail with the last 16px covered; with them, both pass in Chromium and WebKit.
  • These browser specs pass in Chromium and WebKit (98 passed): typing, thread-window, thread-opening, thread-unread, navigation-thread-history, initial-position, navigation-scroll-intent, history-loading, timeline-scrollbar-gutter and image-scroll.
  • Measurement projects (scroll.spec, channel-opening) pass in Chromium and WebKit (12 passed).
  • Full Vitest run: 654 files and 9203 tests pass.

buzz-review-completed

🤖 Generated with Claude Code

baxen and others added 2 commits October 11, 2026 13:06
…sizes

The thread panel re-pinned to its latest reply only when thread data
changed. A composer growing with wrapped or multi-line text shrinks the
thread viewport, so the latest reply slid under the composer and later
snapped back on the next reply or profile update. Late media and link
previews growing rows had the same effect.

Observe the scroller and its rows and re-pin while the reader follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
A bottom reader re-pinned after a viewport resize only through a state
update and a deferred frame, so each composer growth covered the last
line for two or three frames before history caught up. Pin before paint
in the resize observer so history rises with the composer, and assert
the painted bottom for both the channel and thread composers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
@baxen baxen changed the title fix(threads): keep a bottom reader pinned when the thread viewport resizes fix(messages): lift history with a growing composer in channels and threads Oct 11, 2026
@baxen
baxen marked this pull request as ready for review October 11, 2026 21:21
@baxen
baxen requested a review from a team as a code owner October 11, 2026 21:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T21:24:59.273125Z 23914c5 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23914c5a57

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

next.edgeHeight === measuredSize.edgeHeight
)
return;
// A growing composer shrinks the viewport. Pin a reader who was at the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Sign off the commit before submitting it

Commit 37d48c5ac12d2e8f1efa2595d55526fde751aeac has no Signed-off-by trailer, so submitting this exact commit will fail the hosted DCO Check; recreate the commit with git commit --signoff before it is pushed.

AGENTS.md reference: AGENTS.md:L194-L200

Useful? React with 👍 / 👎.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes requested. The resize corrections stay with the existing channel/thread scroll owners and preserve their follow/positioning guards; the new browser cases target real composer/viewport geometry.

Star Lord automated source review via Wes’s account: head 23914c5a5757006de403d1fa2a5acdd8ccc69a5c, base d55d70a071bdaa2b499673dcd40ffa37a7a5d793. Source-only: no tests or app execution; theme/width/enlarged-text and keyboard/pointer acceptance were not exercised, and the author’s reported results were not independently reproduced.

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