mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1931] Chat transcript should open already positioned at latest message #947
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#947
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1931
Originally assigned to: @Promansis on GitHub.
Problem
Opening an existing chat visibly opens, then scrolls down to the latest/bottom message. It should open already positioned at the bottom message, without the intermediate visible scroll.
Expected behavior
Observed behavior
messagesEndRef.Evidence from code inspection
Conversation mode:
src/features/modes/conversation/components/ConversationView.tsxscrollRefandmessagesEndRefare created around lines 495-496.useEffectaround lines 544-553:messagesEndRef.current?.scrollIntoView({ behavior: "smooth" })newestMsgId, streaming buffers, typing state, etc.useEffectaround lines 841-848 also smooth-scrolls after staggered line reveal state changes.Roleplay mode:
src/features/modes/roleplay/hooks/use-roleplay-transcript-scroll.tsuseEffectaround lines 84-91:messagesEndRef.current?.scrollIntoView({ behavior: isStreaming ? "auto" : "smooth" })Shared data loading:
src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.tsuseChatMessagesprovides paged messages, then the hook reverses pages and flattens them into chronological render order.src/features/catalog/chats/hooks/use-chats.tsfetches the latest page first vialistChatMessages(... limit pageSize ...), so the bottom target exists after the initial messages query resolves.Suspected root cause
The initial bottom positioning is implemented as a normal React effect after render/paint, not as a mount-time layout positioning step. Since the effect uses smooth scrolling while opening a non-streaming chat, the browser paints the initial transcript position first and then animates to the bottom.
Suggested fix direction
useLayoutEffect) once the first message page is available.scrollRef.current.scrollTop = scrollRef.current.scrollHeight, or usescrollIntoView({ behavior: "auto" }).scrollTopby the height delta.Acceptance criteria