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#5803
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/3111
Author: @kolacheee
Created: 6/30/2026
Status: ✅ Merged
Merged: 6/30/2026
Merged by: @SpicyMarinara
Base:
staging← Head:chore/3104-tracker-perf-diagnostics📝 Commits (5)
7f0594cchore(client): add temporary render-timing diagnostics for #310459e02d4chore(client): make #3104 render diagnostics verifiable without lag3b9abb3chore(client): keep render diagnostics as a permanent opt-in tool41fd2e0chore(client): make render diagnostics fully opt-in (off by default)f5986ceMerge branch 'staging' into chore/3104-tracker-perf-diagnostics📊 Changes
4 files changed (+96 additions, -0 deletions)
View changed files
📝
packages/client/src/App.tsx(+6 -0)📝
packages/client/src/components/chat/ChatArea.tsx(+2 -0)📝
packages/client/src/features/tracker-panel/components/TrackerDataSidebar.tsx(+2 -0)➕
packages/client/src/lib/perf-diagnostics.ts(+86 -0)📄 Description
Adds a small, fully opt-in render-timing diagnostic to localize client main-thread freezes — motivated by #3104, but designed to stay as a permanent troubleshooting tool for future "the app froze/lagged" reports.
Why
The #3104 freeze (INP ~188s, ~46s synchronous processing, GPU spikes) is a client main-thread block that only manifests on affected users' real chats. It can't be pinned by code reading or local reproduction:
So instead of guessing at a fix, this lets an affected user surface the exact culprit by enabling a flag and reading one console line — and it generalizes to any future client-perf report.
What it does
lib/perf-diagnostics.ts(new) + 3 two-line wire-ins (App.tsx,ChatArea.tsx,TrackerDataSidebar.tsx):useRenderTimer(label)— warns with a component's render+commit duration (ChatArea→"chat-area",TrackerDataSidebar→"tracker-panel").installLongTaskWarner()— warns on main-thread long tasks.Off by default — completely inert unless enabled. The enable flag is read once at module load, so when it's off there are zero clock reads, zero warnings, no PerformanceObserver, and no console output — it cannot be a source of overhead or lag itself.
localStorage.mariPerfVerbose = "1"in the console, then reload.localStorage.mariPerfVerbose = "0"(or remove the key), then reload.When enabled it logs every render + long task; anything ≥250ms is tagged
SLOWso the culprit stands out.console.warnis used deliberately (notconsole.log): production builds stripconsole.logbut keepconsole.warn, so this surfaces in built installs. Zero behavior change — it only measures and reports.How to use it (for #3104 and future perf reports)
Tell the affected user: open the laggy chat, open DevTools → Console, run
localStorage.mariPerfVerbose = "1", reload, reproduce the freeze, and send the[mari-perf] SLOW …line(s):That names the slow subtree — exactly the info needed to write the targeted fix.
Notes
longtaskPerformanceObserver entry type isn't supported in every browser (guarded; degrades to no-op)."0"/reload turns it back off.Test plan (to verify manually)
pnpm checkpasses.[mari-perf]console output at all.localStorage.mariPerfVerbose = "1"+ reload → one-time[mari-perf] render diagnostics ON …line, then per-render logs (e.g.[mari-perf] chat-area render+commit 7ms).localStorage.mariPerfVerbose = "0"+ reload → output stops completely.[mari-perf] SLOW … <N>msline naming the slow subtree (or a long task).Docs touched
None (internal diagnostic, no user-facing UI/behavior).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.