Skip to content

fix(channels): fix pin to bottom - #6247

Merged
synoet merged 1 commit into
mainfrom
synoet/channel-pin-bottom-jank
Sep 8, 2026
Merged

fix(channels): fix pin to bottom#6247
synoet merged 1 commit into
mainfrom
synoet/channel-pin-bottom-jank

Conversation

@synoet

@synoet synoet commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Changes core virtualized scroll pinning and measurement timing for all channels; behavior shifts for users slightly above the bottom (1px vs 50px), though covered by new e2e tests.

Overview
Fixes channel message list bouncing away from the bottom during sends, acks, and layout changes by tightening when the list is considered “pinned” and when row geometry is measured.

NEAR_BOTTOM_THRESHOLD drops from 50px to 1px so append-follow, composer/viewport resize, and saved snapshots share one strict end tolerance. A looser threshold could treat optimistic height estimates (e.g. after ID swap on ack) as still pinned and apply a backward scroll correction.

In ThreadList, useAnimationFrameWithResizeObserver is disabled so ResizeObserver-driven measurements apply in the current frame instead of the next, avoiding stale sizer/composer geometry that could drop the end anchor on send. Row measureElement runs in a queueMicrotask after child effects render Markdown, so the virtualizer does not measure an empty row shell and temporarily shrink the scroll extent.

Docs (sticky-scrolling.md, channels.md) describe the 1px boundary and measurement timing. New Playwright e2e (local-channel-send-scroll.spec.ts) asserts zero bottom presentation violations across consecutive sends, wrapped/tall messages, mobile touch viewports, sends at various gaps from bottom, composer growth, and simulated keyboard viewport shrink.

Reviewed by Cursor Bugbot for commit d237f62. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: d5738427-beb5-442f-b3f6-725caa8981ae

📥 Commits

Reviewing files that changed from the base of the PR and between 17a1dc1 and d237f62.

📒 Files selected for processing (5)
  • apps/web/src/features/channel/Channel/ThreadList.tsx
  • apps/web/src/features/channel/Channel/constants.ts
  • apps/web/src/features/channel/docs/sticky-scrolling.md
  • apps/web/tests/e2e/local-channel-send-scroll.spec.ts
  • docs/AGENT_GUIDE/channels.md

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Improved channel message scrolling to remain pinned to the bottom during consecutive sends, server acknowledgements, composer resizing, and viewport changes.
    • Preserved the reader’s position when scrolling through message history or loading older messages.
    • Improved behavior when returning to the bottom of a channel, ensuring new messages are followed reliably.
  • Documentation

    • Updated channel scrolling guidance to reflect the refined bottom-pinning and history-navigation behavior.

Walkthrough

The channel virtualizer now measures resize changes synchronously and remeasures rows in a microtask after child rendering. The near-bottom threshold is 1px. Documentation defines the updated scrolling and measurement behavior. New local Playwright tests cover consecutive sends, server acknowledgements, composer resizing, viewport contraction, and non-pinned scroll stability across desktop and mobile viewports.

Merge Risk: ⚪ Minimal · up to d237f

Channel scrolling now uses a precise bottom threshold and synchronous/deferred measurements to keep pinned views stable while preserving positions when reading history. The covered send and resize scenarios indicate no remaining merge-blocking risk.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the conventional commits format with the fix(channels): prefix, describes the channel pinning fix, and is 32 characters long.
Description check ✅ Passed The description directly explains the channel scroll-pinning fix, the threshold and measurement changes, documentation updates, and the added end-to-end tests.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

@synoet
synoet merged commit 1ecc7b2 into main Sep 8, 2026
27 checks passed
@synoet
synoet deleted the synoet/channel-pin-bottom-jank branch September 8, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant