From 74b2e0a7f169e7f221576b2c492288014f4c951d Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Mon, 3 Aug 2026 15:04:49 +0300 Subject: [PATCH] perf(tooling): add scenario controls to the idle profiler Idle cost depends on which surfaces are mounted, so the profiler needs to reach those states without a human driving the UI. `--panel ` opens the context panel by seeding the persisted store the app reads on boot, using the same tab identity rules as `useUIStore`. `--then-tab ` navigates through the router after settling, which leaves already-mounted surfaces mounted and measures what a screen keeps doing once the user has moved on. Both drive real application state instead of synthesising clicks, so the recorded window stays free of input-driven work. --- scripts/profile-idle.mjs | 109 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/scripts/profile-idle.mjs b/scripts/profile-idle.mjs index 435c346c..e0634c3f 100644 --- a/scripts/profile-idle.mjs +++ b/scripts/profile-idle.mjs @@ -38,6 +38,13 @@ Options: --url OpenChamber URL (default: http://localhost:3000) --session Open this session before recording (deep link) --tab Open this main tab before recording + --then-tab After settling, navigate to this tab without a + reload, then record. Use it to measure what a + surface keeps doing after the user leaves it. + --panel Open the context panel on this surface before + recording (chat, preview, terminal, git, pr, notes, + file, diff, plan, context, browser, walkthrough). + Repeatable; the first entry becomes the active tab. --duration Idle recording window (default: 30) --settle Wait after load before recording (default: 15) --output Artifact directory (default: artifacts/idle-profile-