Chat transcript snaps back to bottom / jumps while scrolling up — content-visibility:auto placeholder heights conflict with the auto-scroll logic
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- css, react, typescript
- Domain
- accessibility, frontend
Research direction
Find the .chat-message CSS rule that sets content-visibility: auto and check the transcript scroll and auto-scroll behavior described in the issue. The report identifies removing that declaration as a locally verified fix; start by locating the source CSS and reproducing the long-transcript case with images or code blocks. Done when scrolling up stays in place, including while messages stream or render.
Written by the indexing model from the issue text.
Description
Describe the bug
While scrolling up in a chat session, the transcript repeatedly snaps back to the bottom, and the scroll position jumps by large distances (hundreds to thousands of px) at once. The problem is worst around user messages containing pasted screenshots or long code blocks. In long sessions (100k+ tokens) this makes reviewing history nearly impossible.
To Reproduce
Open a chat session with a long transcript containing user messages with pasted screenshots / large code blocks
Scroll up slowly from the bottom through the history
Optionally: while an answer is still streaming in, scroll up away from the bottom
See: the view snaps back to the bottom, or jumps a large distance in one step — especially right after passing user messages with images
Expected behavior
Scrolling up should stay exactly where the user scrolls. The transcript must not snap back to the bottom and must not shift under the cursor, even while new messages arrive or off-screen messages render for the first time.
Error message
None — pure UI behavior issue, no console errors.
Desktop (please complete the following information):
OS: Windows 11 (23H2, build 22631)
Browser: Edge (Chromium)
Version: 158.0.4370.45
App: CloudCLI 1.37.11 (a distribution of claudecodeui — the same CSS/JS ships in the upstream build)
Smartphone (please complete the following information):
Device: N/A (not tested; #1890 reports a related iOS scrolling issue)
Additional context
Root cause analysis (verified against the shipped build). .chat-message ships with:
.chat-message {
contain: layout style paint;
content-visibility: auto;
contain-intrinsic-size: auto 180px;
}
Off-screen messages render as ~180px placeholders. While scrolling up, those placeholders progressively render at their real height (a user message with images is easily 1000–3000px), so content above the viewport grows by huge amounts mid-gesture:
the scroll container's near-bottom check (scrollHeight - scrollTop - clientHeight < 50px) briefly becomes true during these shifts, marking the user as "at the bottom";
on the next message-list change, the scroll effect then forces scrollTop = scrollHeight — the snap-back;
while messages stream in, the previous position is restored from a raw pixel offset (saved top), which is wrong once heights above the viewport changed — the large jumps.
Browser scroll anchoring can't compensate because the app overrides scrollTop manually on every list update. User messages are the worst case: pasted screenshots make the placeholder→real delta enormous.
Suggested fix: drop content-visibility: auto for .chat-message. The chat already renders only a window of recent messages (older history is opt-in), so the virtualization benefit is small while the scroll instability is severe. If it must stay, position restoration should use an anchor element (the "load older messages" flow already does this) instead of raw pixel offsets, and auto-scroll should only fire when the user is genuinely at the bottom.
Verified locally: removing the single content-visibility: auto; declaration from the built CSS eliminated all three symptoms, with no noticeable rendering cost on long sessions.
Related issues: #1633, #1635, #1652, #1890
- Dominant language
- TypeScript
- Stars
- 13.9k
- Forks
- 2k
- Avg merge
- 22h 45m
- Merged PRs (30d)
- 44
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from siteboon/claudecodeui
-
enhancement OSS
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
siteboon/claudecodeui#1904 ·
Maintainers usually reply within 1 day
-
[Bug]: OpenCode provider incompatible with OpenCode V2 CLI (`Unrecognized flag: --dir`)Possibly taken @blackmammoth claimed this 29 days ago. Openbug OSS
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
siteboon/claudecodeui#1707 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Slash command menu: Enter within the 150 ms filter debounce runs the most-used command instead of the typed onePossibly taken @blackmammoth claimed this 43 days ago. OpenNP
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
siteboon/claudecodeui#1560 ·
Maintainers usually reply within 1 day
-
Web push never reaches iPhones: Apple rejects the VAPID subject mailto:[email protected] (403 BadJwtToken)Possibly taken @blackmammoth claimed this 43 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
siteboon/claudecodeui#1550 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
siteboon/claudecodeui#1547 ·
Maintainers usually reply within 1 day
All issues in siteboon/claudecodeui
Similar issues
-
Media browser returns "Not found" for repositories using the SHA-256 object formatPossibly taken @adamchodera claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Follow-ups from #312Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
janhesters/remixcn#318 ·
Maintainers usually reply within 1 day
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
danielmiessler/LifeOS#3150 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Make the "%" unit spacing the same in the web and in A10Possibly taken @kragent66-glitch claimed this today. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 comment ·