Skip to content

Make CompositorScreenshot markers schema-based - #6261

Open
fatadel wants to merge 3 commits into
firefox-devtools:mainfrom
fatadel:issue-5303
Open

Make CompositorScreenshot markers schema-based#6261
fatadel wants to merge 3 commits into
firefox-devtools:mainfrom
fatadel:issue-5303

Conversation

@fatadel

@fatadel fatadel commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Main | Deploy preview

Screenshot markers had no schema and were handled by custom code in tooltip rendering, string-table lookup, marker derivation, and screenshot track creation.

They now use a marker schema. The windowWidth and windowHeight fields collapse into windowSize: { width, height }, described by the new screenshot-size format. The new screenshot-data-url format renders a string-table image URL using the aspect ratio of the sibling windowSize field. The schema also uses the new timeline-screenshots display location to drive screenshot track creation.

Screenshot markers are stored as start and end pairs named CompositorScreenshot <windowID>, allowing generic name-based pairing. CompositorScreenshotWindowDestroyed closes the last screenshot for its window.

Notes:

  • The final screenshot of a window that is never destroyed is marked incomplete. Its time range is unchanged, but tooltip duration and Marker Table duration sorting change.
  • The Marker Chart shows one row per window, with no separate CompositorScreenshotWindowDestroyed row.
  • Track ordering is unchanged: computeGlobalTracks still adds windows in first-screenshot order.

Closes #5303


Profile

@fatadel
fatadel requested review from canova and mstange August 14, 2026 12:08
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.86%. Comparing base (7abc8b8) to head (5804096).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-logic/marker-schema.ts 84.61% 2 Missing ⚠️
src/profile-logic/processed-profile-versioning.ts 95.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6261      +/-   ##
==========================================
+ Coverage   83.82%   83.86%   +0.03%     
==========================================
  Files         350      350              
  Lines       37744    37837      +93     
  Branches    10646    10661      +15     
==========================================
+ Hits        31638    31731      +93     
  Misses       5677     5677              
  Partials      429      429              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

These markers had no schema, so both the tooltip and the string table
lookup for their image special-cased this marker type. Declaring every
field is also a prerequisite for storing marker payloads without
repeating their keys.

The schema uses two new field formats: screenshot-size, whose value is
a { width, height } object, and screenshot-data-url, which renders a
string table index as an image sized from a sibling screenshot-size
field. The payload now has a single windowSize field instead of
windowWidth and windowHeight.
Screenshot markers arrived as instant markers and were turned into
intervals by a special case in the marker derivation, which also had to
track the last screenshot of every window separately in order to close
it. Putting the window ID in the marker name lets the ordinary
name-based pairing handle them, so that special case is gone. Each
window now gets its own row in the marker chart.

CompositorScreenshotWindowDestroyed is the end marker of that window's
last screenshot rather than a marker of its own. A window that is never
destroyed leaves its last screenshot open, so the derived marker is
extended to the end of the thread and marked incomplete.
The CompositorScreenshot schema now declares a timeline-screenshots
display location. computeGlobalTracks uses the combined front-end and
profile schema list to identify marker types for screenshot tracks
instead of naming the payload type directly.

Window IDs remain in first-screenshot order so global track indexes
referenced by shared URLs stay stable.
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.

Make CompositorScreenshot markers schema-based

1 participant