mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#5802
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/3113
Author: @kolacheee
Created: 6/30/2026
Status: ✅ Merged
Merged: 7/2/2026
Merged by: @SpicyMarinara
Base:
staging← Head:chore/3104-chat-surface-section-timers📝 Commits (5)
c2a9291chore(client): add per-surface render probes for #31046340641chore(client): add re-render-reason probe for #31046347970Merge branch 'staging' into chore/3104-chat-surface-section-timersf6057c4fix(client): remove invalid chat area perf probes743e935fix(client): lazily build chat area perf snapshot📊 Changes
9 files changed (+101 additions, -2 deletions)
View changed files
📝
packages/client/src/components/chat/ChatArea.tsx(+27 -1)📝
packages/client/src/components/chat/ChatConversationSurface.tsx(+2 -0)📝
packages/client/src/components/chat/ChatRoleplaySurface.tsx(+2 -0)📝
packages/client/src/components/chat/ConversationView.tsx(+2 -0)📝
packages/client/src/components/game/GameCombatUI.tsx(+2 -0)📝
packages/client/src/components/game/GameNarration.tsx(+2 -0)📝
packages/client/src/components/game/GameSurface.tsx(+2 -0)📝
packages/client/src/components/game/GameWidgetPanel.tsx(+2 -0)📝
packages/client/src/lib/perf-diagnostics.ts(+60 -1)📄 Description
Linked issue
Relates to #3104 — this PR adds diagnostics to localize the freeze; it does not fix or close it. Builds on the merged #3111 (the opt-in render-timing tool) and is complementary to #3112 (the tracker-panel fix, which the logs show does not address #3104 — see below).
Why this change
#3111 added an opt-in render timer that proved the #3104 freeze lives in the
chat-areasubtree — but that isn't specific enough to fix against. Affected-user logs since then show two things:chat-arearender+committracker-paneltracker-panelis consistently fast (0–8 ms), so #3112's tracker fix doesn't resolve #3104.This PR adds two layers of probe so an affected user's console names both where the cost is and why the surface re-renders:
chat-areato the exact slow subtree per mode.useWhyRenderon ChatArea) — on each render, log which source input changed, and tag renders with no recent user input asIDLE(an idle re-render storm is a loop, not interaction cost). This targets the re-render storm — the repeated full-subtree renders that turn one slow render into a freeze.What changed
Reuses the existing
lib/perf-diagnostics.tstool (no new opt-in mechanism — samelocalStorage.mariPerfVerbose="1"flag, off by default).Per-surface render timers (one
useRenderTimerper component; fires once per render, never per message):game-surface,game-narration(un-virtualized VN history, prime suspect),game-hud(world-state / tracker widgets named in #3104),game-combat.rp-surface(its message map is inline JSX, so the surface root is also the list boundary).convo-surface(shell) +convo-messages(ConversationView, the heavy list).Re-render-reason probe (
useWhyRender, new inperf-diagnostics.ts, wired into ChatArea): logs… why-render #N — changed: <inputs>(orno watched input changed= re-render from the parent), with anIDLEtag when no pointer/key/wheel/touch happened in the last second. Watches ChatArea's source inputs (store slices, query results,characterMap, the presence clock, agent state).Per-message leaf components (
ChatMessage,ConversationMessage) are deliberately not probed (they'd log once per message and flood the console). Lower-suspicion game sub-sections (weather / map / party / inventory / mobile HUD) are left out to stay focused; each is a one-line follow-up.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Done by the agent (not a substitute for human verification):
pnpm check→ exit 0 (TypeScript + ESLint + client build all clean), run twice (once per commit).Still needs manual verification in a real built install:
[mari-perf]console output and no behavior change in game / roleplay / conversation chats (probes must be fully inert by default).localStorage.mariPerfVerbose = "1", reload, open a chat in each mode: confirm the surface labels appear with small ms on a normal chat, and thatchat-area why-render #N — changed: …lines appear on interaction.SLOW <label> render+commit <N>msline and thewhy-render … changed: …/IDLElines — together these name the slow subtree and its re-render trigger.Docs and release impact
UI evidence (if applicable)
No UI change — measurement only (the probes add no DOM and produce no output unless the opt-in flag is set).
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.