|
3 | 3 | // found in the LICENSE file. |
4 | 4 | import * as Common from '../../core/common/common.js'; |
5 | 5 | import * as i18n from '../../core/i18n/i18n.js'; |
6 | | -import * as Root from '../../core/root/root.js'; |
7 | 6 | import * as Trace from '../../models/trace/trace.js'; |
8 | 7 | import * as ComponentHelpers from '../../ui/components/helpers/helpers.js'; |
9 | 8 | import * as UI from '../../ui/legacy/legacy.js'; |
@@ -100,13 +99,10 @@ export class LayoutShiftsTrackAppender implements TrackAppender { |
100 | 99 | * layout shifts (the first available level to append more data). |
101 | 100 | */ |
102 | 101 | #appendLayoutShiftsAtLevel(currentLevel: number): number { |
103 | | - const allLayoutShifts = this.#parsedTrace.LayoutShifts.clusters.flatMap(cluster => cluster.events); |
104 | | - |
105 | | - if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_INSIGHTS)) { |
106 | | - const allClusters = this.#parsedTrace.LayoutShifts.clusters; |
107 | | - this.#compatibilityBuilder.appendEventsAtLevel(allClusters, currentLevel, this); |
108 | | - } |
| 102 | + const allClusters = this.#parsedTrace.LayoutShifts.clusters; |
| 103 | + this.#compatibilityBuilder.appendEventsAtLevel(allClusters, currentLevel, this); |
109 | 104 |
|
| 105 | + const allLayoutShifts = this.#parsedTrace.LayoutShifts.clusters.flatMap(cluster => cluster.events); |
110 | 106 | void this.preloadScreenshots(allLayoutShifts); |
111 | 107 | return this.#compatibilityBuilder.appendEventsAtLevel(allLayoutShifts, currentLevel, this); |
112 | 108 | } |
@@ -165,25 +161,6 @@ export class LayoutShiftsTrackAppender implements TrackAppender { |
165 | 161 | } |
166 | 162 |
|
167 | 163 | getDrawOverride(event: Trace.Types.Events.Event): DrawOverride|undefined { |
168 | | - if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.TIMELINE_INSIGHTS)) { |
169 | | - // If the new CLS experience isn't on.. Continue to present that Shifts are 5ms long. (but now via drawOverrides) |
170 | | - // TODO: Remove this when the experiment ships |
171 | | - if (Trace.Types.Events.isLayoutShift(event)) { |
172 | | - return (context, x, y, _width, levelHeight, timeToPosition, transformColor) => { |
173 | | - const fakeDurMs = Trace.Helpers.Timing.microSecondsToMilliseconds( |
174 | | - Trace.Types.Timing.MicroSeconds(event.ts + LAYOUT_SHIFT_SYNTHETIC_DURATION)); |
175 | | - const barEnd = timeToPosition(fakeDurMs); |
176 | | - const barWidth = barEnd - x; |
177 | | - context.fillStyle = transformColor(this.colorForEvent(event)); |
178 | | - context.fillRect(x, y, barWidth - 0.5, levelHeight - 1); |
179 | | - return { |
180 | | - x, |
181 | | - width: barWidth, |
182 | | - }; |
183 | | - }; |
184 | | - } |
185 | | - } |
186 | | - |
187 | 164 | if (Trace.Types.Events.isLayoutShift(event)) { |
188 | 165 | const score = event.args.data?.weighted_score_delta || 0; |
189 | 166 |
|
|
0 commit comments