fix(desktop): chat scrolling rubber-bands on macOS#29024

closed4
main
fix/issue-29019
opened10d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 1d ago

Problem

On macOS, trackpad-scrolling quickly to the end of a long chat thread stops dead instead of rubber-banding the way Safari, Notes and other Mac apps do. This happens in the desktop app and in Chrome on Mac.

Change

Two things stop the bounce in Chromium, and the fix needs both:

  • Desktop: Electron only turns on elastic overscroll for windows with webPreferences.scrollBounce (its scroll_bounce_flag.patch gates IsElasticOverscrollSupported on the renderer's --scroll-bounce switch). The main window now sets scrollBounce: true on macOS, following the disableAutoHideCursor pattern next to it.
  • Web: since M145, Chromium bounces inner scrollers. It checks the document's overscroll-behavior for every scroller, though, and drops the stretch when that is none. html, body { overscroll-behavior: none } (added for iOS safe areas in #2392) therefore turned the bounce off everywhere. On fine-pointer devices the vertical axis is now contain. Touch-primary devices keep none against page bounce and pull-to-refresh. The horizontal axis stays none so swipe navigation stays off.

The page itself still can't bounce: body overflow: hidden makes the viewport not user-scrollable, which Chromium checks before stretching the root.

Scope and approval

Fixes pingdotgg/t3code#29019

Verification

  • vp run check:changed: format, lint, knip, typecheck (3 packages) and apps/desktop/src/window/DesktopWindow.test.ts (22 tests) all pass.
  • Both causes were traced in source:
    • Electron v44.10.0 patches/chromium/scroll_bounce_flag.patch.
    • Chromium 152.0.7977.169:
      • cc/input/input_handler.cc passes ActiveTree().overscroll_behavior() with each scroll result.
      • blink/.../elastic_overscroll_controller.cc zeroes the stretch without local border effects.
      • cc/base/features.cc has kOverscrollEffectOnNonRootScrollers enabled by default.
  • Reproduction attempts on Linux, none of which produced a bounce:
    • Setup: Electron 44.10 under Xvfb, a synthetic page with an inner overscroll-behavior: contain scroller, and the root set to none, auto and contain.
    • Gestures: CDP wheel events, Input.synthesizeScrollGesture (mouse and touch), and chrome.gpuBenchmarking touchpad gestures, with and without scrollBounce and --enable-features=ElasticOverscroll.
    • Result: no stretch in any combination, including a plain root scroller. The elastic controller only starts on real touchpad phases (non-momentum, precise deltas), which Linux synthetic input doesn't send. So neither the bug nor the fix is reproducible on Linux.
  • cannot-verify macos. On a Mac:
    1. Desktop app: flick a long thread to its bottom and top with the trackpad. It should stretch and settle while the header, sidebar and composer stay still.
    2. Chrome on Mac: the same check.
    3. Safari on Mac: scroll vertically over the header. The whole app shell must not move.
  • Not checked:
    • Startup cost: scrollBounce windows can't use Electron's spare renderer.
    • Other inner scrollers now bounce on fine-pointer devices: sidebar, command palette and pickers.

Model and harness: Claude Opus 5.5 (Claude Code in T3 Code), reviews by GPT-6.1 Sol (Codex) and Claude Opus 5.5.

🤖 Generated with Claude Code

Checks

23 successful · 17 skipped · 1 neutral
All checks passed
33ca649

Added 4 commits

  • Merge remote-tracking branch 'origin/main' into fix/issue-2901933ca649
  • fix(desktop): enable macOS scroll bounce for the main window4ffa7f6
  • docs(web): scope overscroll comment to touch-primary devices9e5b5f4
  • fix(web): chat scrolling rubber-bands again on macOSae8e76e
Synced from GitHub

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — This enables macOS desktop scroll bounce and changes vertical overscroll behavior for fine-pointer web users. Human review is needed to confirm the new default scrolling experience and its broader web scope.

You can add or adjust custom eligibility rules. Learn more.

[gpt-6.1-sol][Codex] on behalf of shivam.

Issue watch started a separate investigation of https://github.com/pingdotgg/t3code/issues/29019. I found this PR and am handing that work over to Julius, with no competing changes.

The initial source search at main commit 4a5251b1c4b867ad2d89bf59d7a062ca8c40f2a6 found document-level overscroll-behavior: none in apps/web/src/index.css and overscroll-y-contain on the chat timeline in MessagesTimeline.tsx. No runtime reproduction, device testing, or checks were started before discovering the takeover. The macOS bounce remains unverified by this investigation.

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review.

External image Recent review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between 4a5251b1c4b867ad2d89bf59d7a062ca8c40f2a6 and 33ca649d051540db7eaca72e5622870a8acfcce9.

External image Files selected for processing: 2
  • apps/desktop/src/window/DesktopWindow.ts
  • apps/web/src/index.css

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

macOS desktop windows now enable Electron scroll bounce. Fine-pointer devices use contained vertical overscroll on html and body. Other pointer types and horizontal overscroll behavior remain unchanged.

Changes: Scroll overscroll behavior

Layer / File(s)Summary
Platform-specific overscroll settings
apps/desktop/src/window/DesktopWindow.ts, apps/web/src/index.css
The main window enables scrollBounce on macOS. A fine-pointer media rule sets vertical overscroll behavior to contain on html and body.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: t3dotgg

Merge Risk: External image Minimal · up to 33ca6

No actionable merge-blocking issue was identified. macOS gesture behavior still needs the planned manual check.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title names the fix (chat scrolling rubber-banding on macOS) and the desktop scope. The changeset enables scrollBounce for the macOS main window in DesktopWindow.ts and adds fine-pointer overscrol…
Description checkPassedThe description follows the template. It has Problem, Change, Scope and approval, and Verification sections. The Problem section states the expected behavior and the environment. The Change section ex…
Linked Issues checkPassedIssue #29019 requires rubber-band scrolling for long chat threads in the desktop app. The macOS main window now passes scrollBounce: true to Electron. The web document keeps horizontal overscroll di…
Out of Scope Changes checkPassedThe changes stay within issue #29019. The apps/web CSS change is required by the stated Chromium behavior and affects the renderer used by the desktop app. The macOS-only Electron option limits the …
Full details: Title check

Explanation

The title names the fix (chat scrolling rubber-banding on macOS) and the desktop scope. The changeset enables scrollBounce for the macOS main window in DesktopWindow.ts and adds fine-pointer overscroll-behavior-y: contain in index.css, which together target that bounce. The title is short, specific, and follows the conventional commit form the template asks for. It covers the desktop part but not the web CSS part, which is expected for a title.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope and approval, and Verification sections. The Problem section states the expected behavior and the environment. The Change section explains both the desktop and web causes and why both edits are needed. Scope links issue #29019. Verification lists the tests run, the Linux reproduction attempts with their results, and the macOS manual steps that remain unverified. The description also names what was not checked. Two template points are weaker: the Scope section links an issue but does not show a maintainer approval comment, and no before/after screenshot or recording is included. The UI-change template asks for these, but the bug is motion-related and the author states it cannot be reproduced on Linux, so the gap is minor. The model and harness line is present.

Full details: Linked Issues check

Explanation

Issue #29019 requires rubber-band scrolling for long chat threads in the desktop app. The macOS main window now passes scrollBounce: true to Electron. The web document keeps horizontal overscroll disabled and changes vertical overscroll to contain for fine-pointer devices. The existing body { overflow: hidden } remains unchanged. These changes address the reported desktop behavior. The PR also reports passing typecheck, lint, format, and 22 desktop window tests.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #29019. The apps/web CSS change is required by the stated Chromium behavior and affects the renderer used by the desktop app. The macOS-only Electron option limits the native change to the affected platform. No unrelated product behavior or unrelated files were changed.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks, Julius, for the earlier investigation and fix. Closing this as a duplicate of #29047 by @electrum, which addresses the same macOS desktop bounce and includes a real Mac trackpad verification. This older PR has had no push or reply in over a week, and main has changed both files since its base. If Chrome browser bounce remains important separately, a focused follow-up would be welcome.