Skip to content

🤖 fix: pin transcript during composer resize#3035

Merged
ammario merged 1 commit intomainfrom
fix/send-layout-shift
Mar 23, 2026
Merged

🤖 fix: pin transcript during composer resize#3035
ammario merged 1 commit intomainfrom
fix/send-layout-shift

Conversation

@ammar-agent
Copy link
Collaborator

Summary

Keep the transcript bottom pinned when send-time composer changes resize the chat viewport.

Background

Sending a message clears draft UI immediately, which can collapse the composer before the matching user row and stream-starting tail UI are appended to the transcript. Because the transcript and composer share a flex column, that footer collapse changes the transcript viewport height and can produce a visible jump while the transcript is re-pinned.

Implementation

  • observe the transcript viewport itself in ChatPane
  • when auto-scroll is enabled and the viewport height changes, immediately pin scrollTop to scrollHeight
  • leave the existing send flow intact so the input still clears responsively
  • add a UI regression test that simulates the composer-driven viewport resize directly, alongside the existing send-time tail-height test

Validation

  • bun x jest tests/ui/chat/bottomLayoutShift.test.ts --runInBand
  • make static-check

Risks

Low. The new resize observer only forces bottom pinning while auto-scroll is enabled, so users who have intentionally scrolled away from the bottom should keep their current behavior. The change is limited to transcript viewport resizes, which is the send-time path that was producing the visible shift.


Generated with mux • Model: openai:gpt-5.4 • Thinking: high • Cost: $6.63

Keep the transcript bottom pinned when the composer/footer resize changes the
scroll viewport during send.

Add a resize observer for the transcript viewport so auto-scroll stays anchored
when the composer collapses before the matching user row and stream UI land in
the transcript. Cover the regression with a UI test that simulates the viewport
height change directly.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `high` • Cost: `$6.63`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=high costs=6.63 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ 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".

@ammario ammario merged commit 76c0ded into main Mar 23, 2026
24 checks passed
@ammario ammario deleted the fix/send-layout-shift branch March 23, 2026 14:58
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