Skip to content

feat(website): add a slow frame log to Debug tools - #37584

Merged
bolichen97 merged 1 commit into
mainfrom
crew/kiro-crew-rust/slow-frame-log
Nov 15, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
crew/kiro-crew-rust/slow-frame-log

Conversation

@buluoray

@buluoray buluoray commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Someone who just saw the dashboard stall can open Settings > Developer > Debug tools, turn on a log, and read which interaction was slow and which script held the frame, on the machine where it happened.

The dashboard reads neither Long Animation Frames nor Event Timing. "It felt slow when I clicked" can today only be answered by attaching DevTools, or by a benchmark on another machine that may not reproduce it.

Why it matters

Slow frames depend on the machine, the session count and the transcript on screen. A report without the frame's script attribution cannot be acted on, and most people who see a stall will not record a performance profile.

Not a goal

  • Sending the readings anywhere. They stay in the tab's memory: no request, no storage write, no console output.
  • Turning it on by default. See Measurements for why.
  • A copy or export button, or an overlay over the chat. The readings show on the Debug tools tab only.
  • Interaction to Next Paint as a tracked product metric.

What changed (motivation → approach → change)

The browser already knows what held a frame; nothing in the dashboard asked it. website/src/dev/slowFrameLog.ts reads long-animation-frame and event entries through one PerformanceObserver and keeps the slowest of each.

Part What it does
The switch "Slow frame log" on Settings > Developer > Debug tools, off by default, stored under mc-slow-frame-log like the scroll inspector's flag
Long frames the 20 slowest, each with its duration, the time it blocked input, and its three longest scripts: what started the script, its function and file, and its forced layout time
Slow interactions the 20 slowest (40 ms and over), each with the event, the element's tag and accessible name, and the split into wait, handler time and time to paint. A paint time is never below zero: the browser rounds the duration to 8 ms
The tab SlowFrameLogReadings.tsx shows the first eight rows of each list, slowest first, with the count of all kept rows, while the log is on

The tab shows no single INP number. The slowest interaction leads its list, which is the page's INP while the page has had fewer than 50 interactions and the log saw them all.

Off, no observer exists and nothing is kept. Turning it on asks for the entries the browser already buffered, so the log shows what happened before the switch: every long frame, and the interactions of 104 ms and over. main.tsx imports the module, so a log left on sees the page load. A build that locks Debug tools keeps it off, as it does the scroll inspector. The lock can arrive after the page loaded (the config schema answers later): applyConfigLocks in website/src/hooks/usePreviewFlagServerSync.ts tells the log as well as the inspector, so a log that was recording stops and forgets its readings. Only a description of an interaction's target is kept, never the element.

The switch reads the log's own state through useSyncExternalStore, so it follows another tab that turns the log on or off. The scroll inspector's switch had a stale copy on main; it re-reads its key on the storage event.

The strings are in all twelve catalogs under website/src/i18n/locales/. docs/feature-map/README.md and the lock table in docs/system-specs/modules/platform-context.md name the new tool and its storage key.

Measurements

All numbers are mine, from one shared Linux host. A node server on 127.0.0.1 serves the built dashboard and answers /api from scripts/lib/stub-dashboard-api.mjs with scripts/lib/perf-fixture.mjs (222 sessions, the 100-row chat). chrome-headless-shell (Chromium 145) with no DevTools connection opens /chat?sid=perf-long cold. The page's probe observes longtask and paint only, so the one Long Animation Frame observer in the page is the log's own. Renderer CPU is read from /proc 6 s after load. Four arms interleave in each round with rotating order: main @ f5299f4, main again (A/A), this branch with the log off, this branch with the log on. 6 rounds, load 13.0-15.0. Paired per round against main, median, ms:

main (A/A) log off log on
Longest long task +2 −12 −1
Sum of long tasks +143 +70 +95
FCP +60 +36 +32
Transcript appears +107 +121 +89
Renderer CPU +150 +230 +90

Off and on are both inside the spread of main against itself. Compared directly in the same rounds, though, on is behind off on every row (transcript +218 ms, sum of long tasks +186 ms, renderer CPU +470 ms, 6 pairs). Six rounds on a busy host cannot settle whether that is the observer or noise, so this run does not show the log is free while on. That is why it stays off by default.

The run used the first revision of this branch, whose observer and kept lists are the ones in this revision. The run was not repeated.

Not measured: the log's cost during interaction and scrolling; Safari and Firefox (Firefox has no Long Animation Frames, and the tab says so).

Backwards compatibility

Compatible: one new switch, off by default; with it off the page creates no observer.

Removes nothing. One change to existing behaviour: the scroll inspector's switch follows another tab's change (on main it keeps showing the state it had when the tab mounted, while the inspector itself follows). The two tests that picked "the" switch on the tab pick the first of two.

Tests

  • website/src/test/slowFrameLog.test.ts (15 tests) with a stand-in PerformanceObserver: off creates no observer and keeps nothing; the stored flag starts ONE observer for both entry types, buffered, with the 40 ms floor; a build that locks Debug tools and a browser with blocked storage stay off; only supported entry types are registered; frames are kept slowest first with their three longest scripts; each list is capped at 20 and drops the fastest; the entries of one interaction fold into its longest, and entries with no interaction id are skipped; the target is a description, and a press on an icon is named by the button around it; a module script's URL invoker is shortened to its file; a paint time is never below zero (fails with the clamp taken out); subscribers are told per delivery and the snapshot is stable in between; turning it off disconnects and forgets; the toggle event and another tab's storage write are followed.
  • website/src/test/SlowFrameLogReadings.test.tsx (4 tests) renders the readings: nothing while off; each interaction row with its three parts and each frame with its scripts; the first eight rows of a longer list with the count of all of them; the notice for a browser with no long frames.
  • website/src/test/ltsFeaturePreviewsOff.test.tsx (1 new of 24): a log that was recording stops, and drops its readings, when the Debug tools lock arrives after the page loaded. Without the dispatch in applyConfigLocks this test fails (checked by removing the line).
  • website/src/test/DebugToolsTab.storageBlocked.test.tsx (6 tests): both switches render off under blocked storage; the new switch stores the flag, announces it both ways, and shows the readings only while on; each switch follows another tab's storage write, and one press then turns the tool off.
  • Ran: those four files (49 tests); the twelve locale style suites under website/src/i18n/style/ with I18N_BASE_REF set (126 tests); the repo's related frontend set (scripts/run_scoped_tests.py --surface frontend); npm run i18n:pseudo with no diff; npm run i18n:check; lint:i18n; tsc -p tsconfig.app.json; eslint on the changed files; the analyze build with the bundle-size and chunk-cycle gates; gen:ui --check; the theme-colour, phantom-class and restyle gates. All pass.
  • Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

In the built dashboard (stubbed API, headless Chromium 145), with a page handler that holds each press for 80 ms:

Case Rows
Log on since page load, three 80 ms presses three, 88-96 ms each, "handlers 80ms"
Three 80 ms presses, then the switch none: the browser hands back only interactions of 104 ms and over
One more 80 ms press after that the press, with "paint 0ms"

A second pass opened a chat, the session options menu and typed in the composer: the tab listed the menu press as button [Session options] with its handler time, the key presses, and the page-load frames with the React and module scripts that held them. Not verified: Safari, Firefox, a phone, a real gateway.

Screenshots / video

All from the build of 0e6126a, dark theme unless named. The one product line that differs in this revision (shortInvoker checks the URL prefix with startsWith) renders the same text.

Log turned on in the tab, then a chat, a menu and typing: the slow interactions and the long frames:

Debug tools tab with the slow frame log on

Log on since the page loaded, after three presses a page handler held for 80 ms:

Debug tools tab, log on since page load, three slow presses

Log on in a browser that reports neither entry type: the empty state and the notice (the capture overrides PerformanceObserver.supportedEntryTypes):

Debug tools tab, nothing recorded and long frames unsupported

Light theme, and the tab with the log off

Debug tools tab with the slow frame log on, light

Debug tools tab with the slow frame log off

Related Issues

N/A. From the Chrome modern-web-guidance review of the dashboard (identify-heavy-scripts, identify-inp-causes, interaction-paint-timing).

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 15, 2026 10:23
@buluoray
buluoray requested a review from bolichen97 November 15, 2026 10:23
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 9f809035b8d2ccebbd280ca65816eea71e5ab172 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. It is an opt-in, local-only instrument that is off by default. It reuses the Debug tools lock, the storage key and the event seam the scroll inspector already uses, and it can be removed cleanly. Screenshots of this revision are attached.

Notes

  • The log is always in the main bundle because main.tsx imports it. That is needed to see the page load, but its cost when off is only the module itself, and nothing measures that cost.

[DESIGN-REVIEWED] 9f80903

Description read

[DESCRIPTION-READ] 3a534bc646771097b42bfe770d4f2cb12e66acf968f9b5ba2b06d2fb19784c22

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 9f809035b8d2ccebbd280ca65816eea71e5ab172 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The log is a new Debug tools switch that is off by default, so nobody gets it without choosing it. A grep of website/src finds no other PerformanceObserver or long-animation-frame reader, so it duplicates nothing.

What this change ships

Inventory (6 items) — 6 justified

Intent: let someone who saw the dashboard stall read, on that same machine, which interaction was slow and which script held the frame. This is an ADDITION.

  1. A new "Slow frame log" switch on Settings > Developer > Debug tools, off by default — justified
  2. While the log is on, the tab lists the slowest interactions and long frames, with the scripts behind each — justified
  3. A log left on starts at page load and also shows frames and interactions from before the switch was turned on — justified
  4. A Debug tools lock that arrives after the page loaded stops the log and clears its readings — justified
  5. The scroll inspector's switch now follows a change made in another tab — justified
  6. A new browser storage key, mc-slow-frame-log, added to the lock table in platform-context.md — justified

[FIRST-PRINCIPLES-REVIEWED] 9f80903

Description read

[DESCRIPTION-READ] 1aac5a7de1d3f376b79e3d6d536c1ab9eb3ba95be3f3bd172839ff5c94f6fc7f

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 9f809035b8d2ccebbd280ca65816eea71e5ab172 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. The blind reader understood the switch, would use it, and every state the change adds appears in a screenshot.

Notes

  • When a script has no invoker or source, the row shows a bare ? (script.invoker || '?' in SlowFrameLogReadings.tsx). The reader said "no idea what the '?' stands for". Show a word such as "unknown" instead.
  • In shot-02, "52ms, input blocked for 0ms" has no script lines under it, and the reader couldn't tell whether something failed to load. When a frame has no scripts, add a muted line such as "No script attributed".
  • "This browser does not report long frames." doesn't say what to do next. Add the fix to the same line, e.g. "Long frames need a Chromium-based browser."

[UX-REVIEWED] 9f80903

Description read

[DESCRIPTION-READ] 8f6ee6a6e1a2c8a32a7821b6889fd9a67c324abc2db4a258947fb4e05bdff7a0

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 9f809035b8d2ccebbd280ca65816eea71e5ab172 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 9f80903

Verdict parsed from the review's SHA-scoped output markers for commit 9f809035b8d2ccebbd280ca65816eea71e5ab172.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 9f809035b8d2ccebbd280ca65816eea71e5ab172 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 9f809035b8d2ccebbd280ca65816eea71e5ab172 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 9f80903

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 9f809035b8d2ccebbd280ca65816eea71e5ab172 false-positive: <reason, 20 to 500 characters>

@KiroCrewCaptain

KiroCrewCaptain commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 979 lines, more than the 400 it may approve on its own.

I'd approve this. It adds an opt-in slow frame log on Settings > Developer > Debug tools, and the code does what the description says.

  • Off by default: with the flag off, no observer is created. The new log follows the same pattern as the existing scroll inspector: same read-flag check, same LTS-lock guard, same safe fallback when storage is blocked, same toggle event and same storage listener.
  • LTS lock: when the Debug tools lock arrives, applyConfigLocks now sends the log's toggle event too. The log then re-reads its gated flag, stops, and forgets what it recorded. When the lock is lifted, the same event turns it back on if its stored flag is still on. The new test in ltsFeaturePreviewsOff.test.tsx covers the late lock.
  • Memory: everything stays in memory and is bounded. Each list holds at most 20 rows, and the map from interaction id to row is trimmed once it passes 80 entries. Interaction targets are stored as a text description, never as the element itself.
  • Switch state: the switch reads the log's own state, so it follows other tabs. The scroll inspector's switch now also re-reads its key when another tab changes it.
  • Docs and strings: the lock

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 0e6126a02d · 979 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@buluoray
buluoray force-pushed the crew/kiro-crew-rust/slow-frame-log branch from b507eea to 7f9bd79 Compare November 15, 2026 11:00
@buluoray

Copy link
Copy Markdown
Contributor Author
  • The log ignores a Debug tools lock that arrives after page load span=5448ee25de90

fixed in 7f9bd79: applyConfigLocks in website/src/hooks/usePreviewFlagServerSync.ts now dispatches SLOW_FRAME_LOG_KEYS.ENABLED_EVENT beside the inspector's event when the Debug tools lock changes. The log re-reads its key, which the lock gates, so it disconnects and drops its readings.
Test: ltsFeaturePreviewsOff.test.tsx, "a slow frame log that was recording stops when the lock arrives after the page loaded". It fails with the new dispatch removed.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • Applying the Debug tools lock does not stop recording span=05c9fa3a88e6

fixed in 7f9bd79: applyConfigLocks now dispatches SLOW_FRAME_LOG_KEYS.ENABLED_EVENT when the Debug tools lock changes, so a log that was recording re-reads its key, stops and drops its readings.
Test: ltsFeaturePreviewsOff.test.tsx, "a slow frame log that was recording stops when the lock arrives after the page loaded". It fails with the new dispatch removed.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • INP substitutes an outlier when the required rank is missing span=05c9fa3a88e6

fixed in 7f9bd79: slowFrameSnapshot no longer clamps the rank to the kept list. When the picked interaction is not kept and the list is not full, the tab says "under 40ms" (inpUnderFloor). When the list is full, it shows no reading.
Tests: slowFrameLog.test.ts, "says the INP is under the floor, not the one slow outlier ..." and "gives no INP reading once the kept list is full ...".

@buluoray

Copy link
Copy Markdown
Contributor Author
  • Cross-tab changes leave the recording switch stale span=420471fdcd01

fixed in 7f9bd79: the switch in DebugToolsTab.tsx reads the log's own state through useSyncExternalStore, so another tab's change shows here and one press turns the log off. The scroll inspector's switch had the same stale copy; it now re-reads its key on the storage event.
Tests: DebugToolsTab.storageBlocked.test.tsx, "the switch follows the log when another tab turns it on ..." and "the switch follows the flag when another tab turns the inspector on".

@buluoray

Copy link
Copy Markdown
Contributor Author

Replies to the non-blocking notes on b507eea, all changed in 7f9bd79:

Lane Note What changed
UX Say that turning it off clears the log The description now ends "Turning it off clears it."
UX "stays in memory" reads like the Memory section Now "It stays in this tab and nothing is sent."
UX / Design Give INP a reference point The line now ends "200ms or less is good." The body says the readings are those of the last delivered entry
UX No screenshot of the empty state or the unsupported-browser notice Both are attached now, plus the new "under 40ms" state. All five screenshots are from this revision's build
First Principles slowFrameLogOn is exported and unused Removed

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 15, 2026
@buluoray
buluoray force-pushed the crew/kiro-crew-rust/slow-frame-log branch from 7f9bd79 to 27dffb4 Compare November 15, 2026 19:32
@buluoray

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the "under 40ms" line and the rank read from performance.interactionCount, added in 7f9bd79

  • INP is wrong when the log is switched on after the page loaded span=5448ee25de90

fixed in 27dffb4: an INP is read only when the observer started at page load with performance.interactionCount at 0 (sawAllInteractions in slowFrameLog.ts). A log turned on by its switch, turned off and on, or loaded after an interaction gives inp: null, inpUnderFloor: false, and the tab shows "no reading. The log was turned on after this page loaded."
Reproduced in Chromium 145 on 7f9bd79: three 80 ms presses, then the switch, showed "under 40ms". On 27dffb4 the same steps show the "no reading" line.
Tests: slowFrameLog.test.ts "gives no INP reading, and says the log started late ..." and four siblings; SlowFrameLogReadings.test.tsx "gives no INP number, and says why ...".

@buluoray

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the "under 40ms" line and the rank read from performance.interactionCount, added in 7f9bd79

  • Late activation falsely reports INP below 40 ms span=05c9fa3a88e6

fixed in 27dffb4: "under 40ms" and the INP number are given only when the observer started at page load with performance.interactionCount at 0 (sawAllInteractions). Any later start gives no reading, and the tab says the log was turned on after the page loaded and to reload with it on.
Reproduced in Chromium 145 on 7f9bd79 (three 80 ms presses, then the switch: "under 40ms"); on 27dffb4 the same steps show "no reading".
Tests: slowFrameLog.test.ts "gives no INP reading, and says the log started late ...", "a log turned on by its switch is late ...", "a log turned off and on again ...".

@buluoray

Copy link
Copy Markdown
Contributor Author
  • Rounded event durations produce negative paint times span=05c9fa3a88e6

fixed in 27dffb4: addInteraction clamps presentation to zero (Math.max(0, ...)). inputDelay and processing subtract two unrounded timestamps and cannot go below zero.
Reproduced in Chromium 145 on 7f9bd79: an 80 ms press showed "paint -1ms"; on 27dffb4 it shows "paint 0ms".
Test: slowFrameLog.test.ts "never reports a paint time below zero".

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 15, 2026
@buluoray
buluoray force-pushed the crew/kiro-crew-rust/slow-frame-log branch from 27dffb4 to 0e6126a Compare November 15, 2026 20:41
@buluoray

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the INP number read from performance.interactionCount, with its "under 40ms" and "no reading" lines
resolution: removed -- the INP number is past the frozen goal and each repair of it raised a new case, so the number and its three strings are gone and the two lists stay

  • Cached INP stays stale after fast interactions span=05c9fa3a88e6

removed in 0e6126a: the tab no longer shows an INP number. slowFrameSnapshot holds only enabled, framesSupported, frames and interactions, and every change to those goes through publish(), which drops the cached snapshot. Nothing reads performance.interactionCount.
This span was fixed in b507eea and 7f9bd79; this is the third round on the same number, so it is taken out instead of patched. The slowest interaction still leads its list.
The three slow_frame_log_inp* strings are gone from all twelve catalogs, which also clears the fr, ru, de, bn and hi register failures on 27dffb4.

@buluoray

Copy link
Copy Markdown
Contributor Author

Red checks on 27dffb4, read from the job logs:

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 15, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 15, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Ray. The design is sound and well bounded: one observer, off means no observer, two capped lists, nothing leaves the tab, and the lock path stops and clears the log. I read the whole diff on 0e6126a02d and ran the four touched test files locally (slowFrameLog.test.ts, SlowFrameLogReadings.test.tsx, DebugToolsTab.storageBlocked.test.tsx, ltsFeaturePreviewsOff.test.tsx): 49 passed. All checks on this head are green.

One item blocks approval.

Blocking

  1. website/src/dev/slowFrameLog.ts:139 adds a regex to product code, which the team does not accept in new code:

    return /^https?:\/\//.test(invoker) ? fileOf(invoker) : invoker
    • Cause: a new regex literal in shortInvoker.
    • Consequence: it breaks the no-new-regex rule for product code, and a plain prefix check says the same thing.
    • Suggested fix, same behaviour:
    return invoker.startsWith('http://') || invoker.startsWith('https://') ? fileOf(invoker) : invoker

Once that line changes I can approve on the new head.

AI-assisted, sent by Bolin Review bot

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 15, 2026
"It felt slow when I clicked" could not be answered on the machine where
it happened: the dashboard read neither Long Animation Frames nor Event
Timing.

Settings > Developer > Debug tools gains a "Slow frame log" switch, off
by default. While on, website/src/dev/slowFrameLog.ts reads
long-animation-frame and event entries through one PerformanceObserver
and keeps, in this tab's memory, the 20 slowest frames (each with its
three longest scripts and their forced layout time) and the 20 slowest
interactions (input delay, handler time, time to paint). The tab shows
both lists, slowest first. Nothing is sent, stored or logged.

Off, no observer exists. Turning it on asks for the entries the browser
already buffered, so the log also shows what happened before the switch:
every long frame, and the interactions of 104 ms and over. A build that
locks Debug tools keeps it off, like the scroll inspector. When that
lock arrives after the page loaded, applyConfigLocks tells the log too,
so a log that was recording stops and forgets its readings.

A paint time is never shown below zero: the browser rounds an
interaction's duration to 8 ms and not the time its handlers ended.

Both switches on the tab follow another tab's change: the new one reads
the log's own state, and the scroll inspector's re-reads its key on the
storage event.
@buluoray
buluoray force-pushed the crew/kiro-crew-rust/slow-frame-log branch from 0e6126a to 9f80903 Compare November 15, 2026 22:22
@buluoray

Copy link
Copy Markdown
Contributor Author

@bolichen97 fixed in 9f80903: shortInvoker in website/src/dev/slowFrameLog.ts uses your line, invoker.startsWith('http://') || invoker.startsWith('https://'). It was the only regex the PR added to product code; I searched the added lines for .test(, RegExp, .match(, .replace(, .split( and .search(, and the two .split calls in fileOf take plain strings.

The existing test "shortens a module script's invoker from its URL to its file name" gains an https:// invoker and one that only mentions a URL in the middle, which stays whole. The four test files pass (49), with the locale style suites (126). Rebased onto 7d8aa4e; nothing else changed.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 15, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving 9f809035b8.

  • The regex is gone: slowFrameLog.ts now uses startsWith('http://') || startsWith('https://'), same behaviour as before.
  • The new test case covers both sides: an https invoker is shortened to its file, and an invoker that only mentions a URL stays whole.
  • The rest of the PR is the same as the head I reviewed earlier (range-diff shows only these two hunks after the rebase).

AI-assisted, sent by Bolin Review bot

@bolichen97
bolichen97 enabled auto-merge (squash) November 15, 2026 22:36
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 15, 2026
@bolichen97
bolichen97 merged commit fa4e40d into main Nov 15, 2026
99 checks passed
@bolichen97
bolichen97 deleted the crew/kiro-crew-rust/slow-frame-log branch November 15, 2026 23:23
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants