mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5794] [MERGED] fix(chat): honor Messages per page in the transcript render window #6938
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#6938
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5794
Author: @Romuromylus
Created: 9/2/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @Romuromylus
Base:
staging← Head:fix/messages-per-page-render-window📝 Commits (4)
ca910ecfix(chat): honor Messages per page in the transcript render window7f89376fix(chat): re-anchor the transcript window when its size changes3042587Merge remote-tracking branch 'pasta/staging' into fix/messages-per-page-render-window756ff7cfix(chat): keep the open-at-bottom deferral retryable on a failed jump📊 Changes
5 files changed (+145 additions, -11 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/client/src/components/chat/ChatRoleplaySurface.tsx(+16 -3)📝
packages/client/src/components/chat/ConversationView.tsx(+33 -4)📝
packages/client/src/lib/transcript-render-window.ts(+28 -4)➕
scripts/regressions/transcript-render-window.regression.ts(+67 -0)📄 Description
Linked issue
Closes #5789
Why this change
The "Messages per page" setting (Settings > General > Responses) promises to control how many messages load at once, with
0meaning "load all messages at once". Since #3114 the chat transcript also runs a render window that keeps at most 80 loaded messages mounted, and that window never consulted the setting. So a Roleplay (or Conversation) chat with more than 80 messages always showed at most 80 on screen: at 100 the newest 100 were fetched but only 80 rendered, and at 0 the whole history was fetched but everything older than the last 80 sat behind the "Show older" controls. From the user's side the setting looked ignored, which is exactly what the reporter saw.What changed
packages/client/src/lib/transcript-render-window.ts: newresolveTranscriptRenderWindowSize(messagesPerPage). A page size above the default 80 widens the window to match,0(or an invalid/negative value) returnsnullmeaning unbounded, and anything at or below 80 keeps the existing 80-message window.getTranscriptRenderWindownow acceptsmaxMountedMessages: nulland mounts every loaded message in that case. The previous constant is exported asDEFAULT_MAX_MOUNTED_TRANSCRIPT_MESSAGES.ChatRoleplaySurface.tsxandConversationView.tsx: readmessagesPerPagefrom the UI store and pass the resolved window size intogetTranscriptRenderWindow. The step size for "Show older" / "Show newer" and the goto-message reveal are unchanged.scripts/regressions/transcript-render-window.regression.ts: covers the size resolution (20, 80, 100, 500, 0, negative, NaN, undefined) and the window output for 80 / 100 / unbounded, including goto-request clamping and empty input.Scope note: this only touches how many loaded messages get mounted. Fetch pagination (
useChatMessageslimit + Load More) already honored the setting and is unchanged. Users on the default of 20 keep the same 80-message render window, so the long-chat render-cost bound from #3114 is preserved for them; only users who explicitly raise the setting above 80 or set it to 0 opt into mounting more.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm checkgreen on the branch;node ./scripts/run-regressions.mjs --filter transcript-render-windowpasses.Follow-ups (pre-existing, reproduced on staging, not changed here)
/gotodoes not scroll in Conversation mode (neither pages older messages in nor scrolls to a mounted target). Found while trying to exercise the jump-to-message deferral; the path is broken before this PR, so the deferral is verified by code review only.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
Not a visual change; the transcript simply stops hiding messages the setting asked for.
Summary by CodeRabbit
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.