Skip to content

fix(chat): a drag down at the top of a chat no longer reloads the app on Android - #413

Merged
devswha merged 3 commits into
mainfrom
fix/mobile-chat-scroll
Oct 3, 2026
Merged

devswha merged 3 commits into
mainfrom
fix/mobile-chat-scroll

Conversation

@devswha

@devswha devswha commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Change

On an Android phone, dragging down in the chat while the transcript was already at its top reloaded the whole app. .chat-view had no overscroll-behavior, so the drag was handed on to the page, and Chrome takes a downward drag on a page at its top for pull-to-refresh. After the reload the chat opens at its end again, so reading back through a conversation kept ending in a reload.

.chat-view now has overscroll-behavior: contain, as the terminal, the sidebar, the file viewer, the directory browser and the command palette already have.

Validation

Reproduced and checked in Chrome 133 on an Android 16 emulator (Pixel 9), against the demo build of this branch, with adb shell input swipe as the finger and Chrome's devtools port to read the page:

before after
drag down, transcript at its end scrolls to the top scrolls to the top
drag down again, transcript at its top page reloads no reload, scrollTop stays 0
third drag scrolls (it reloaded to the end) no reload
  • bun scripts/keyboard-viewport-demo-regression.ts passes; checkMobileViewport now also asserts the computed overscroll-behavior-y of .chat-view, so bun run test:ui covers it too.
  • bun run typecheck passes.

Limits

  • A transcript too short to scroll still reloads on a drag down in Chrome 133: that Chrome applies overscroll-behavior only to an element with something to scroll. The sidebar and the other lists behave the same way, and pull-to-refresh stays the way to reload an installed app, so this PR does not turn it off for the whole page.
  • Checked in a Chrome tab on the emulator, not in an installed app on a real phone. Pull-to-refresh is the same gesture in both.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 63bdeb5b-9f9c-4060-b2d8-eef8cbcb2b30
📥 Commits

Reviewing files that changed from the base of the PR and between 8c1bb96 and c970107.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • scripts/mobile-viewport-regression.ts
  • src/components/ChatView.css
 __________________
< X marks the bug. >
 ------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@devswha
devswha merged commit cb29304 into main Oct 3, 2026
3 checks passed
@devswha
devswha deleted the fix/mobile-chat-scroll branch October 3, 2026 20:30
devswha added a commit that referenced this pull request Oct 4, 2026
Bumps package.json and herdr-plugin.toml to 0.3.49 and moves the
Unreleased notes under [0.3.49] - 2026-10-04, with the compare link.
Every entry already carries its PR link and contributor credit. Raises
the remote PC bundle to 16: a runtime notice is titled by its own first
line on a remote PC too (`source` on the notice part, #418), and the
Antigravity meter reads the token file on a Linux PC (#399). Push the
`remote-v16` tag and let the bundle workflow publish before running
release.yml.

Carries #357, #399, #411, #413, #415, #414, #416, #417, #418, #346.
devswha added a commit that referenced this pull request Oct 13, 2026
## Problem
On Android Chrome before 144, dragging down in a chat too short to
scroll (a new or short conversation) starts Chrome's pull-to-refresh and
reloads the whole app, dropping held drafts and restarting the terminal
client. #427 measured it 3 of 3 on Chrome 133.

## Cause
#413 put `overscroll-behavior: contain` on `.chat-view`, but Chrome
before 144 ignores the property on a scroll container whose
`scrollHeight == clientHeight`, so the drag chains to the page. `html`
and `body` were `overscroll-behavior: auto`; nothing at the page root
contained it.

## Fix
`overscroll-behavior-y: contain` on both `html` and `body` in
`src/styles.css` (option 2 in #427). #427's experiment on Chrome 133
found `html` alone still reloaded and `html` + `body` did not, so both
are set. This only stops overscroll chaining / pull-to-refresh at the
page root; it does not change what scrolls, and every existing scroll
container keeps its own rule.

## Tests
- `scripts/mobile-viewport-regression.ts` (`checkMobileViewport`, run by
`keyboard-viewport-demo-regression.ts` and the `ui-contexts` checks) now
asserts the computed `overscroll-behavior-y` of `html` and `body` is
`contain`.
- `bun run check run bun scripts/keyboard-viewport-demo-regression.ts`:
passes with the fix; fails on the new assertion with `src/styles.css`
reverted.
- `bun run typecheck`, `bun run test:unit` (3069 pass, 0 fail),
`changelog-fold.test.ts` and `conventions.test.ts` pass.

## Notes
- Closes #427. A real Chrome 133 drag was not re-run here: the browser
test checks the computed style, the effect itself comes from #427's
emulator measurement. Untested, as in #427: a real phone, the installed
home-screen app, Samsung Internet.
- Side effect by design: pull-to-refresh is off for the whole app on
every browser, including newer Chrome.
- No open PR touches the root `html, body` rule; #943, #909 and #887
edit `src/styles.css` elsewhere.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
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