mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4713] [Issue]: Clicking topbar tabs rerenders the entire Roleplay transcript and causes input lag #2588
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#2588
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 @SpicyMarinara on GitHub (Aug 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4713
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Clicking Marinara Engine's topbar tabs while a Roleplay chat is open synchronously rerenders the entire visible transcript, causing a repeatable 400–600 ms interaction stall.
Expected behavior
Topbar tabs and side panels should open or close promptly. Unchanged Roleplay messages should retain their memoized render output and should not rerender because unrelated layout state changed.
Actual behavior
Four profiled topbar interactions blocked the content main thread for approximately 396 ms, 415 ms, 575 ms, and 588 ms. Each interaction rerendered all 80 visible
ChatMessagecomponents and approximately 638–652 messageActionBtncomponents.The
ChatRoleplaySurfacerender alone took approximately 252–447 ms per interaction. Around 95% of sampled work during the stalls was inside React's synchronous renderer (flushSyncWorkAcrossRoots_impl/performSyncWorkOnRoot).Steps to reproduce
Environment
Logs, screenshots, or video
Firefox performance profile:
Firefox 2026-08-07 14.12 profile.json.gz(available from the reporter).Profile measurements:
Settings serialization appeared in only one sampled millisecond. Layout work occupied only 1–6 samples per interaction, and accessibility processing occupied no sampled CPU stacks during the blocked intervals. The accessibility and CSS-transition marker bursts appear to be consequences of the large DOM update rather than the initial cause.
Additional context
The observed render chain is:
TopBarchangessidebarOpenorrightPanelOpenin the UI store.AppShellrerenders the un-memoized, no-propsChatArea.ChatRoleplaySurfacealso subscribes directly to both panel states.ChatAreamessage handlers depend on complete React Query mutation-result objects. Those objects are freshly wrapped on render, renewing callback props and defeating theReact.memoboundary aroundChatMessage.Prefer a small fix:
ChatAreaboundary so unrelated shell state does not propagate into the chat tree.ChatMessagecomponents.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Aug 7, 2026):
Work is underway in draft PR #4717, owned by @SpicyMarinara.