Skip to content

Add and export resetCLS to reset CLS metric - #778

Closed
srubin wants to merge 8 commits into
GoogleChrome:mainfrom
descriptinc:steve/reset-cls
Closed

Add and export resetCLS to reset CLS metric#778
srubin wants to merge 8 commits into
GoogleChrome:mainfrom
descriptinc:steve/reset-cls

Conversation

@srubin

@srubin srubin commented Aug 6, 2026

Copy link
Copy Markdown

Mirrors the resetINP change (#1, #2) for CLS: dispatching a reset-web-vitals-cls event re-initializes the CLS metric and its session-window state while keeping existing callbacks, so consumers can report CLS in fixed intervals (Descript reports the worst session burst per 5-minute window, like INP).

Exported from both the standard and attribution builds, and bumps the version to 3.5.2-descript.3.

Includes an e2e test mirroring 'resets INP metric'; I authored it to match the existing suite but have not run the test suite locally. After merge this needs an npm publish of 3.5.2-descript.3 so the monorepo can pick it up (BIX-8613).

🤖 Generated with Claude Code

srubin and others added 8 commits April 15, 2024 12:58
Adds and exports resetINP to reset INP metric
Export resetINP from attribution build
Mirrors resetINP: dispatches a reset-web-vitals-cls event that
re-initializes the CLS metric (and session window state) while keeping
existing callbacks, so consumers can report CLS in fixed intervals.
Bumps version to 3.5.2-descript.3.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@srubin

srubin commented Aug 6, 2026

Copy link
Copy Markdown
Author

Apologies — opened against upstream by mistake; this is intended for Descript's fork.

@srubin srubin closed this Aug 6, 2026
@google-cla

google-cla Bot commented Aug 6, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@tunetheweb

Copy link
Copy Markdown
Member

Interesting! Have you considered the soft nav support added in v6?

Though that would be Chromium-only whereas INP is available in Safari and Firefox so the manual reset would alow them to be supported for INP (they don't support CLS).

@srubin

srubin commented Aug 6, 2026

Copy link
Copy Markdown
Author

Oh, TIL. But no, I don't think soft navs are sufficient for our use case, because the URL isn't changing. In our case, we are tracking these metrics for each 5 minute segment of an hours-long audio/video editing session.

@tunetheweb

Copy link
Copy Markdown
Member

Oh gotcha. Yeah that is a different use case.

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