镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Move timeline marker styles into marker schemas - #6293

Open
fatadel wants to merge 2 commits into
firefox-devtools:mainfrom
fatadel:issue-6292
Open

fatadel wants to merge 2 commits into
firefox-devtools:mainfrom
fatadel:issue-6292

Conversation

@fatadel

@fatadel fatadel commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Main | Deploy preview

Timeline marker styles are currently selected from a hardcoded table keyed by marker data.type. The style objects also contain methods, so they cannot be stored as marker schema metadata.

This PR makes marker styles serializable and stores them in marker schemas. Timeline rendering now reads styles from the schemas, while preserving marker-name overrides.

Profile processing and the processed-profile upgrader derive the existing styles for schemas without this metadata. A follow-up Gecko change will populate the style field in Gecko marker schemas.

Closes #6292


Profile

@fatadel
fatadel requested review from canova and mstange September 1, 2026 15:25
@codecov

codecov Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.46%. Comparing base (f6be374) to head (c93d11b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/components/timeline/Markers.tsx 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6293      +/-   ##
==========================================
+ Coverage   84.45%   84.46%   +0.01%     
==========================================
  Files         357      357              
  Lines       38652    38653       +1     
  Branches    10948    10936      -12     
==========================================
+ Hits        32643    32649       +6     
+ Misses       5579     5574       -5     
  Partials      430      430              

☔ 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.

@fatadel

fatadel commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Bug for the Gecko side - https://bugzilla.mozilla.org/show_bug.cgi?id=2068137.

@canova
canova removed their request for review September 3, 2026 14:36
@fatadel

fatadel commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@mstange A kind reminder for review 😌

Marker styles use methods to resolve theme-dependent colors, which
cannot be serialized as marker schema metadata. Store only color data
in each style and resolve it when drawing timeline markers.
Timeline rendering selects styles from a hardcoded table keyed by
marker `data.type`. Putting the style in each schema removes that
type-specific lookup and lets producers define marker appearance.

@mstange mstange 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.

Sorry about the somewhat non-actionable feedback here - I'm curious if you have ideas or opinions.

Comment thread src/types/markers.ts
Comment on lines +146 to +151
top: CssPixels;
height: CssPixels;
background: MarkerSchemaStyleColor;
squareCorners: boolean;
borderLeft: MarkerSchemaStyleColor | null;
borderRight: MarkerSchemaStyleColor | null;

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.

I think the color is worth having. I'm not sure what to do about the other properties. Putting them all in here feels like we're giving profiles too much control over our UI. Also, the existing code is a bit of a mess - nobody has looked at it in a long time and it hasn't been updated as the markers that Firefox emitted changed. For example, I think the RefreshDriverTick doesn't actually apply anymore - either it doesn't match the marker, or the markers ask to not be shown in the timeline (because they're Text markers? not sure) so I think nothing actually uses squareCorners:false.

Maybe as a first pass we should remove marker styles which aren't matching any markers in profiles from modern Firefox anymore? And then we can remove unused marker style properties. And then we can think about whether we want top and height in there.

@canova
canova removed their request for review October 21, 2026 09:42
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.

Drive marker styling from marker schemas

2 participants