Skip to content

Pause frame metrics while previews are hidden - #157

Merged
mattcosta7 merged 5 commits into
mainfrom
v1.2/02-frame-lifecycle
Aug 3, 2026
Merged

Pause frame metrics while previews are hidden#157
mattcosta7 merged 5 commits into
mainfrom
v1.2/02-frame-lifecycle

Conversation

@mattcosta7

@mattcosta7 mattcosta7 commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

Make frame timing lifecycle-aware so inactive previews do not create false performance regressions.

  • use the first RAF callback only to establish a baseline
  • avoid recording a synthetic near-zero startup frame
  • pause RAF collection while the preview document is hidden
  • resume with a fresh baseline instead of counting the hidden interval as dropped frames
  • make repeated collector start/stop calls idempotent

Stack

  1. Scope buffered performance metrics to each story #156: story-scoped buffered metrics
  2. This PR: frame lifecycle and hidden-preview handling
  3. Pause performance work while the panel is hidden #158: visibility-driven collection and live-update lifecycle

Validation

  • 54 test files / 762 tests across Chromium, Firefox, and WebKit
  • npm run tsc
  • npm run lint (one pre-existing unused suppression warning)

Copilot AI review requested due to automatic review settings August 3, 2026 00:26
@mattcosta7
mattcosta7 requested a review from a team as a code owner August 3, 2026 00:26
@mattcosta7
mattcosta7 temporarily deployed to github-pages-preview August 3, 2026 00:26 — with GitHub Actions Inactive

Copilot AI 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.

Pull request overview

Makes frame timing lifecycle-aware, preventing hidden previews and startup baselines from producing false regressions.

Changes:

  • Establishes fresh RAF baselines on start, reset, and visibility restoration.
  • Pauses collection while hidden and makes lifecycle calls idempotent.
  • Updates browser tests and release metadata.
Show a summary per file
File Description
frame-timing-collector.ts Adds visibility-aware RAF lifecycle handling.
frame-timing-collector.browser.test.ts Tests baseline and visibility behavior.
collector-manager.browser.test.ts Adapts frame collection test to baseline seeding.
.changeset/frame-lifecycle.md Documents the patch release.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@mattcosta7
mattcosta7 marked this pull request as draft August 3, 2026 00:31
@mattcosta7
mattcosta7 force-pushed the v1.2/02-frame-lifecycle branch from 7a2fd92 to 0bd63b9 Compare August 3, 2026 02:14
@mattcosta7
mattcosta7 temporarily deployed to github-pages-preview August 3, 2026 02:15 — with GitHub Actions Inactive
@mattcosta7
mattcosta7 temporarily deployed to github-pages-preview August 3, 2026 12:23 — with GitHub Actions Inactive
@mattcosta7
mattcosta7 temporarily deployed to github-pages-preview August 3, 2026 12:39 — with GitHub Actions Inactive
Base automatically changed from v1.2/01-story-scoped-metrics to main August 3, 2026 12:47
@mattcosta7 mattcosta7 self-assigned this Aug 3, 2026
@mattcosta7
mattcosta7 marked this pull request as ready for review August 3, 2026 12:47

Copilot AI 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.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@mattcosta7
mattcosta7 merged commit 1330851 into main Aug 3, 2026
17 checks passed
@mattcosta7
mattcosta7 deleted the v1.2/02-frame-lifecycle branch August 3, 2026 12:51
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.

2 participants