chrome-devtools-frontend 1.0.1512147 → 1.0.1512349

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/front_end/Images/src/ai-explorer-badge.svg +114 -0
  2. package/front_end/Images/src/code-whisperer-badge.svg +166 -0
  3. package/front_end/Images/src/devtools-user-badge.svg +129 -0
  4. package/front_end/Images/src/dom-detective-badge.svg +136 -0
  5. package/front_end/Images/src/speedster-badge.svg +166 -0
  6. package/front_end/core/host/GdpClient.ts +38 -2
  7. package/front_end/core/i18n/NumberFormatter.ts +7 -0
  8. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -19
  9. package/front_end/models/ai_assistance/ai_assistance.ts +1 -1
  10. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +7 -6
  11. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +119 -119
  12. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +43 -52
  13. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +100 -100
  14. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +11 -17
  15. package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +151 -0
  16. package/front_end/models/badges/Badge.ts +7 -4
  17. package/front_end/models/badges/DOMDetectiveBadge.ts +20 -0
  18. package/front_end/models/badges/SpeedsterBadge.ts +4 -1
  19. package/front_end/models/badges/StarterBadge.ts +5 -1
  20. package/front_end/models/badges/UserBadges.ts +33 -7
  21. package/front_end/models/trace/ModelImpl.ts +0 -13
  22. package/front_end/panels/common/BadgeNotification.ts +119 -9
  23. package/front_end/panels/common/badgeNotification.css +4 -0
  24. package/front_end/panels/elements/ElementsTreeElement.ts +12 -0
  25. package/front_end/panels/elements/ElementsTreeOutline.ts +3 -0
  26. package/front_end/panels/elements/StylePropertiesSection.ts +3 -0
  27. package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -0
  28. package/front_end/panels/settings/SettingsScreen.ts +3 -9
  29. package/front_end/panels/settings/components/SyncSection.ts +6 -2
  30. package/front_end/panels/timeline/TimelinePanel.ts +21 -9
  31. package/front_end/panels/timeline/TimelineUIUtils.ts +4 -3
  32. package/front_end/ui/legacy/filter.css +1 -1
  33. package/front_end/ui/legacy/inspectorCommon.css +1 -1
  34. package/front_end/ui/legacy/softDropDownButton.css +1 -1
  35. package/package.json +1 -1
  36. package/front_end/models/ai_assistance/data_formatters/Types.ts +0 -9
@@ -117,7 +117,6 @@ export interface SyncSectionData {
117
117
  syncInfo: Host.InspectorFrontendHostAPI.SyncInformation;
118
118
  syncSetting: Common.Settings.Setting<boolean>;
119
119
  receiveBadgesSetting: Common.Settings.Setting<boolean>;
120
- gdpProfile?: Host.GdpClient.Profile;
121
120
  }
122
121
 
123
122
  export class SyncSection extends HTMLElement {
@@ -132,7 +131,7 @@ export class SyncSection extends HTMLElement {
132
131
  this.#syncInfo = data.syncInfo;
133
132
  this.#syncSetting = data.syncSetting;
134
133
  this.#receiveBadgesSetting = data.receiveBadgesSetting;
135
- this.#gdpProfile = data.gdpProfile;
134
+ void this.#updateGdpProfile();
136
135
  void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
137
136
  }
138
137
 
@@ -157,6 +156,11 @@ export class SyncSection extends HTMLElement {
157
156
  `, this.#shadow, {host: this});
158
157
  // clang-format on
159
158
  }
159
+
160
+ async #updateGdpProfile(): Promise<void> {
161
+ this.#gdpProfile = await Host.GdpClient.GdpClient.instance().getProfile() ?? undefined;
162
+ void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
163
+ }
160
164
  }
161
165
 
162
166
  function renderSettingCheckboxIfNeeded(
@@ -2733,14 +2733,27 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2733
2733
  async #executeNewTrace(
2734
2734
  collectedEvents: Trace.Types.Events.Event[], isFreshRecording: boolean,
2735
2735
  metadata: Trace.Types.File.MetaData|null): Promise<void> {
2736
- await this.#traceEngineModel.parse(
2737
- collectedEvents,
2738
- {
2739
- metadata: metadata ?? undefined,
2740
- isFreshRecording,
2741
- resolveSourceMap: this.#createSourceMapResolver(isFreshRecording, metadata),
2736
+ const config: Trace.Types.Configuration.ParseOptions = {
2737
+ metadata: metadata ?? undefined,
2738
+ isFreshRecording,
2739
+ resolveSourceMap: this.#createSourceMapResolver(isFreshRecording, metadata),
2740
+ };
2741
+
2742
+ if (window.location.href.includes('devtools/bundled') || window.location.search.includes('debugFrontend')) {
2743
+ // Someone is debugging DevTools, enable the logger to give timings
2744
+ // when tracing the performance panel itself.
2745
+ const times: Record<string, number> = {};
2746
+ config.logger = {
2747
+ start(id) {
2748
+ times[id] = performance.now();
2742
2749
  },
2743
- );
2750
+ end(id) {
2751
+ performance.measure(id, {start: times[id]});
2752
+ },
2753
+ };
2754
+ }
2755
+
2756
+ await this.#traceEngineModel.parse(collectedEvents, config);
2744
2757
 
2745
2758
  // Store all source maps on the trace metadata.
2746
2759
  // If not fresh, we can't validate the maps are still accurate.
@@ -3039,8 +3052,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
3039
3052
  for (const modelName in insightsForNav.model) {
3040
3053
  const model = modelName as keyof Trace.Insights.Types.InsightModelsType;
3041
3054
  const insight = insightsForNav.model[model];
3042
- const formatter = new AiAssistanceModel.PerformanceInsightFormatter(
3043
- AiAssistanceModel.PERF_AGENT_UNIT_FORMATTERS, parsedTrace, insight);
3055
+ const formatter = new AiAssistanceModel.PerformanceInsightFormatter(parsedTrace, insight);
3044
3056
  if (!formatter.insightIsSupported()) {
3045
3057
  // Not all Insights are integrated with "Ask AI" yet, let's avoid
3046
3058
  // filling up the response with those ones because there will be no
@@ -476,6 +476,9 @@ const UIStrings = {
476
476
  const str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineUIUtils.ts', UIStrings);
477
477
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
478
478
 
479
+ // Look for scheme:// plus text and exclude any punctuation at the end.
480
+ export const URL_REGEX = /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/)[^\s"]{2,}[^\s"'\)\}\],:;.!?]/u;
481
+
479
482
  let eventDispatchDesciptors: EventDispatchTypeDescriptor[];
480
483
 
481
484
  let colorGenerator: Common.Color.Generator;
@@ -897,9 +900,7 @@ export class TimelineUIUtils {
897
900
  * of the link is the URL, so the visible string to the user is unchanged.
898
901
  */
899
902
  static parseStringForLinks(rawString: string): DocumentFragment {
900
- // Look for scheme:// plus text and exclude any punctuation at the end.
901
- const urlRegex = /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/)[^\s"]{2,}[^\s"'\)\}\],:;.!?]/u;
902
- const results = TextUtils.TextUtils.Utils.splitStringByRegexes(rawString, [urlRegex]);
903
+ const results = TextUtils.TextUtils.Utils.splitStringByRegexes(rawString, [URL_REGEX]);
903
904
  const nodes = results.map(result => {
904
905
  if (result.regexIndex === -1) {
905
906
  return result.value;
@@ -171,7 +171,7 @@
171
171
  color: var(--sys-color-on-surface-subtle);
172
172
 
173
173
  .toolbar-dropdown-arrow {
174
- top: var(--sys-size-2);
174
+ top: var(--sys-size-1);
175
175
  }
176
176
 
177
177
  &:hover {
@@ -780,7 +780,7 @@ devtools-toolbar {
780
780
  .toolbar-dropdown-arrow {
781
781
  pointer-events: none;
782
782
  flex: none;
783
- top: 2px;
783
+ top: var(--sys-size-1);
784
784
  }
785
785
 
786
786
  .toolbar-button.dark-text .toolbar-dropdown-arrow {
@@ -22,7 +22,7 @@ button.soft-dropdown {
22
22
  }
23
23
 
24
24
  devtools-icon {
25
- top: var(--sys-size-2);
25
+ top: var(--sys-size-1);
26
26
  }
27
27
  }
28
28
 
package/package.json CHANGED
@@ -102,5 +102,5 @@
102
102
  "@eslint/core": "0.15.1"
103
103
  }
104
104
  },
105
- "version": "1.0.1512147"
105
+ "version": "1.0.1512349"
106
106
  }
@@ -1,9 +0,0 @@
1
- // Copyright 2025 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- export interface UnitFormatters {
6
- millis: (x: number) => string;
7
- micros: (x: number) => string;
8
- bytes: (x: number) => string;
9
- }