chrome-devtools-frontend 1.0.1514545 → 1.0.1515446

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 (77) hide show
  1. package/AUTHORS +1 -0
  2. package/docs/committers_policy.md +1 -1
  3. package/docs/contributing/infrastructure.md +101 -5
  4. package/front_end/Images/gdp-logo-dark.png +0 -0
  5. package/front_end/Images/gdp-logo-light.png +0 -0
  6. package/front_end/core/common/Settings.ts +11 -32
  7. package/front_end/global_typings/global_defs.d.ts +15 -1
  8. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +22 -23
  9. package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +6 -7
  10. package/front_end/models/ai_assistance/ai_assistance.ts +3 -0
  11. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +77 -2
  12. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +76 -10
  13. package/front_end/models/cpu_profile/ProfileTreeModel.ts +1 -1
  14. package/front_end/models/extensions/ExtensionPanel.ts +4 -0
  15. package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +5 -1
  16. package/front_end/models/trace/helpers/Trace.ts +1 -1
  17. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +6 -7
  18. package/front_end/panels/ai_assistance/components/ChatView.ts +1 -2
  19. package/front_end/panels/common/GdpSignUpDialog.ts +2 -6
  20. package/front_end/panels/common/gdpSignUpDialog.css +6 -14
  21. package/front_end/panels/console/ConsoleView.ts +4 -0
  22. package/front_end/panels/elements/ElementsPanel.ts +4 -0
  23. package/front_end/panels/elements/StylePropertiesSection.ts +4 -4
  24. package/front_end/panels/network/NetworkConfigView.ts +1 -1
  25. package/front_end/panels/network/NetworkLogView.ts +2 -2
  26. package/front_end/panels/network/components/HeaderSectionRow.ts +2 -3
  27. package/front_end/panels/profiler/HeapProfileView.ts +1 -3
  28. package/front_end/panels/profiler/HeapSnapshotView.ts +5 -1
  29. package/front_end/panels/profiler/ProfileDataGrid.ts +4 -0
  30. package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +7 -29
  31. package/front_end/panels/profiler/ProfileView.ts +4 -0
  32. package/front_end/panels/recorder/components/CreateRecordingView.ts +2 -2
  33. package/front_end/panels/search/SearchView.ts +219 -205
  34. package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
  35. package/front_end/panels/settings/SettingsScreen.ts +1 -1
  36. package/front_end/panels/settings/components/SyncSection.ts +2 -6
  37. package/front_end/panels/settings/components/syncSection.css +11 -4
  38. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +3 -3
  39. package/front_end/panels/sources/SourcesView.ts +4 -0
  40. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
  41. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +6 -3
  42. package/front_end/panels/timeline/CountersGraph.ts +5 -5
  43. package/front_end/panels/timeline/TimelineDetailsView.ts +2 -2
  44. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +4 -3
  45. package/front_end/panels/timeline/TimelineFlameChartView.ts +9 -4
  46. package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -2
  47. package/front_end/panels/timeline/TimelinePanel.ts +4 -3
  48. package/front_end/panels/timeline/TimelineTreeView.ts +6 -2
  49. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -1
  50. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -2
  51. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +6 -6
  52. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +2 -2
  53. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -3
  54. package/front_end/panels/timeline/utils/utils.ts +0 -8
  55. package/front_end/{panels/timeline/utils → services/tracing}/FreshRecording.ts +1 -1
  56. package/front_end/services/tracing/tracing.ts +2 -0
  57. package/front_end/ui/legacy/Dialog.ts +38 -13
  58. package/front_end/ui/legacy/InspectorView.ts +7 -9
  59. package/front_end/ui/legacy/SearchableView.ts +73 -55
  60. package/front_end/ui/legacy/SettingsUI.ts +5 -5
  61. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +1 -4
  62. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +5 -5
  63. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +2 -2
  64. package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +2 -2
  65. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +1 -4
  66. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
  67. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -2
  68. package/front_end/ui/legacy/components/source_frame/JSONView.ts +10 -10
  69. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -0
  70. package/front_end/ui/legacy/components/source_frame/XMLView.ts +4 -0
  71. package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -4
  72. package/front_end/ui/legacy/searchableView.css +0 -4
  73. package/package.json +1 -1
  74. package/front_end/Images/src/gdp-logo-standalone.svg +0 -9
  75. /package/front_end/{panels/timeline/utils → models/ai_assistance/performance}/AICallTree.ts +0 -0
  76. /package/front_end/{panels/timeline/utils → models/ai_assistance/performance}/AIContext.ts +0 -0
  77. /package/front_end/{panels/timeline/utils/InsightAIContext.ts → models/ai_assistance/performance/AIQueries.ts} +0 -0
@@ -208,7 +208,7 @@ export class SettingsScreen extends UI.Widget.VBox implements UI.View.ViewLocati
208
208
  Host.userMetrics.settingsPanelShown(tabId);
209
209
  }
210
210
 
211
- private onEscapeKeyPressed(event: Event): void {
211
+ private onEscapeKeyPressed(event: KeyboardEvent): void {
212
212
  if (this.tabbedLocation.tabbedPane().selectedTabId === 'keybinds' && this.keybindsTab) {
213
213
  this.keybindsTab.onEscapeKeyPressed(event);
214
214
  }
@@ -88,7 +88,6 @@ const UIStrings = {
88
88
  } as const;
89
89
  const str_ = i18n.i18n.registerUIStrings('panels/settings/components/SyncSection.ts', UIStrings);
90
90
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
91
- const lockedString = i18n.i18n.lockedString;
92
91
 
93
92
  const {html, Directives: {ref, createRef}} = Lit;
94
93
 
@@ -112,8 +111,6 @@ function getGdpSubscriptionText(profile: Host.GdpClient.Profile): Platform.UIStr
112
111
  }
113
112
  }
114
113
 
115
- const GDP_LOGO_IMAGE_URL = new URL('../../../Images/gdp-logo-standalone.svg', import.meta.url).toString();
116
-
117
114
  export interface SyncSectionData {
118
115
  syncInfo: Host.InspectorFrontendHostAPI.SyncInformation;
119
116
  syncSetting: Common.Settings.Setting<boolean>;
@@ -237,7 +234,7 @@ function renderAccountInfo(syncInfo: Host.InspectorFrontendHostAPI.SyncInformati
237
234
  // clang-format off
238
235
  return html`
239
236
  <div class="account-info">
240
- <img src="data:image/png;base64, ${syncInfo.accountImage}" alt="Account avatar" />
237
+ <img class="account-avatar" src="data:image/png;base64, ${syncInfo.accountImage}" alt="Account avatar" />
241
238
  <div class="account-email">
242
239
  <span>${i18nString(UIStrings.signedIn)}</span>
243
240
  <span>${syncInfo.accountEmail}</span>
@@ -263,8 +260,7 @@ function renderGdpSectionIfNeeded({
263
260
  function renderBrand(): Lit.LitTemplate {
264
261
  return html`
265
262
  <div class="gdp-profile-header">
266
- <img src=${GDP_LOGO_IMAGE_URL} class="gdp-logo" alt="Google Developer Program">
267
- ${lockedString('Google Developer Program')}
263
+ <div class="gdp-logo" role="img" aria-label="Google Developer Program"></div>
268
264
  </div>
269
265
  `;
270
266
  }
@@ -24,7 +24,7 @@ fieldset {
24
24
  outline-offset: 2px;
25
25
  }
26
26
 
27
- img {
27
+ .account-avatar {
28
28
  border: 0;
29
29
  border-radius: var(--sys-shape-corner-full);
30
30
  display: block;
@@ -76,9 +76,16 @@ img {
76
76
  font-size: var(--sys-typescale-body3-size);
77
77
  height: var(--sys-size-11);
78
78
 
79
- .gdp-logo {
80
- width: 34px;
81
- height: fit-content;
79
+ & .gdp-logo {
80
+ background-image: var(--image-file-gdp-logo-light);
81
+ background-size: contain;
82
+ width: 203px;
83
+ height: 18px;
84
+ background-repeat: no-repeat;
85
+ }
86
+
87
+ :host-context(.theme-with-dark-background) & .gdp-logo {
88
+ background-image: var(--image-file-gdp-logo-dark);
82
89
  }
83
90
  }
84
91
 
@@ -40,7 +40,7 @@ export class AiCodeCompletionPlugin extends Plugin {
40
40
  #aiCodeCompletionCitationsToolbarContainer = document.createElement('div');
41
41
  #aiCodeCompletionCitationsToolbarAttached = false;
42
42
 
43
- #boundEditorKeyDown: (event: Event) => Promise<void>;
43
+ #boundEditorKeyDown: (event: KeyboardEvent) => Promise<void>;
44
44
  #boundOnAiCodeCompletionSettingChanged: () => void;
45
45
 
46
46
  constructor(uiSourceCode: Workspace.UISourceCode.UISourceCode) {
@@ -167,11 +167,11 @@ export class AiCodeCompletionPlugin extends Plugin {
167
167
  ];
168
168
  }
169
169
 
170
- async #editorKeyDown(event: Event): Promise<void> {
170
+ async #editorKeyDown(event: KeyboardEvent): Promise<void> {
171
171
  if (!this.#teaser?.isShowing()) {
172
172
  return;
173
173
  }
174
- const keyboardEvent = (event as KeyboardEvent);
174
+ const keyboardEvent = event;
175
175
  if (UI.KeyboardShortcut.KeyboardShortcut.eventHasCtrlEquivalentKey(keyboardEvent)) {
176
176
  if (keyboardEvent.key === 'i') {
177
177
  keyboardEvent.consume(true);
@@ -575,6 +575,10 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
575
575
  return true;
576
576
  }
577
577
 
578
+ supportsWholeWordSearch(): boolean {
579
+ return true;
580
+ }
581
+
578
582
  supportsRegexSearch(): boolean {
579
583
  return true;
580
584
  }
@@ -536,9 +536,9 @@ export class WatchExpression extends Common.ObjectWrapper.ObjectWrapper<EventTyp
536
536
  });
537
537
  }
538
538
 
539
- private onSectionClick(event: Event): void {
539
+ private onSectionClick(event: MouseEvent): void {
540
540
  event.consume(true);
541
- const mouseEvent = (event as MouseEvent);
541
+ const mouseEvent = event;
542
542
  if (mouseEvent.detail === 1) {
543
543
  this.preventClickTimeout = window.setTimeout(handleClick.bind(this), 333);
544
544
  } else if (this.preventClickTimeout !== undefined) {
@@ -81,6 +81,10 @@ export function entryIsVisibleInTimeline(
81
81
  return (eventStyle && !eventStyle.hidden) || eventIsTiming;
82
82
  }
83
83
 
84
+ // These threads have no useful information. Omit them from the UI.
85
+ const HIDDEN_THREAD_NAMES: ReadonlySet<string> =
86
+ new Set(['Chrome_ChildIOThread', 'Compositor', 'GpuMemoryThread', 'PerfettoTrace']);
87
+
84
88
  /**
85
89
  * Track appenders add the data of each track into the timeline flame
86
90
  * chart. Each track appender also implements functions tha allow the
@@ -330,8 +334,7 @@ export class CompatibilityTracksAppender {
330
334
  this, this.#parsedTrace, pid, tid, name, Trace.Handlers.Threads.ThreadType.OTHER, entries, tree));
331
335
  continue;
332
336
  }
333
- // These threads have no useful information. Omit them
334
- if ((name === 'Chrome_ChildIOThread' || name === 'Compositor' || name === 'GpuMemoryThread') && !showAllEvents) {
337
+ if ((name && HIDDEN_THREAD_NAMES.has(name)) && !showAllEvents) {
335
338
  continue;
336
339
  }
337
340
 
@@ -604,7 +607,7 @@ export class CompatibilityTracksAppender {
604
607
 
605
608
  // Historically all tracks would have a titleForEvent() method. However a
606
609
  // lot of these were duplicated so we worked on removing them in favour of
607
- // the EntryName.nameForEntry method called below (see crbug.com/365047728).
610
+ // the Name.forEntry method called below (see crbug.com/365047728).
608
611
  // However, sometimes an appender needs to customise the titles slightly;
609
612
  // for example the LayoutShiftsTrackAppender does not show any titles as we
610
613
  // use diamonds to represent layout shifts.
@@ -196,7 +196,7 @@ export class CountersGraph extends UI.Widget.VBox {
196
196
  return counter;
197
197
  }
198
198
 
199
- resizerElement(): Element|null {
199
+ resizerElement(): Element {
200
200
  return this.header.element;
201
201
  }
202
202
 
@@ -228,8 +228,8 @@ export class CountersGraph extends UI.Widget.VBox {
228
228
  }
229
229
  }
230
230
 
231
- private onClick(event: Event): void {
232
- const x = (event as MouseEvent).x - this.canvasContainer.getBoundingClientRect().left;
231
+ private onClick(event: MouseEvent): void {
232
+ const x = event.x - this.canvasContainer.getBoundingClientRect().left;
233
233
  let minDistance = Infinity;
234
234
  let bestTime;
235
235
  for (const counterUI of this.counterUI) {
@@ -259,8 +259,8 @@ export class CountersGraph extends UI.Widget.VBox {
259
259
  }
260
260
  }
261
261
 
262
- private onMouseMove(event: Event): void {
263
- const x = (event as MouseEvent).x - this.canvasContainer.getBoundingClientRect().left;
262
+ private onMouseMove(event: MouseEvent): void {
263
+ const x = event.x - this.canvasContainer.getBoundingClientRect().left;
264
264
  this.markerXPosition = x;
265
265
  this.refreshCurrentValues();
266
266
  }
@@ -9,6 +9,7 @@ import * as Platform from '../../core/platform/platform.js';
9
9
  import * as SDK from '../../core/sdk/sdk.js';
10
10
  import * as Trace from '../../models/trace/trace.js';
11
11
  import * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';
12
+ import * as Tracing from '../../services/tracing/tracing.js';
12
13
  import * as Components from '../../ui/legacy/components/utils/utils.js';
13
14
  import * as UI from '../../ui/legacy/legacy.js';
14
15
  import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
@@ -38,7 +39,6 @@ import {
38
39
  } from './TimelineTreeView.js';
39
40
  import {TimelineUIUtils} from './TimelineUIUtils.js';
40
41
  import {TracingFrameLayerTree} from './TracingLayerTree.js';
41
- import * as Utils from './utils/utils.js';
42
42
 
43
43
  const UIStrings = {
44
44
  /**
@@ -679,7 +679,7 @@ async function renderSelectedEventDetails(
679
679
  return nothing;
680
680
  }
681
681
  const traceRecordingIsFresh =
682
- parsedTrace ? Utils.FreshRecording.Tracker.instance().recordingIsFresh(parsedTrace) : false;
682
+ parsedTrace ? Tracing.FreshRecording.Tracker.instance().recordingIsFresh(parsedTrace) : false;
683
683
 
684
684
  if (Trace.Types.Events.isSyntheticLayoutShift(selectedEvent) ||
685
685
  Trace.Types.Events.isSyntheticLayoutShiftCluster(selectedEvent)) {
@@ -6,6 +6,7 @@
6
6
  import * as Common from '../../core/common/common.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import * as Root from '../../core/root/root.js';
9
+ import * as AIAssistance from '../../models/ai_assistance/ai_assistance.js';
9
10
  import * as Trace from '../../models/trace/trace.js';
10
11
  import * as SourceMapsResolver from '../../models/trace_source_maps_resolver/trace_source_maps_resolver.js';
11
12
  import * as Workspace from '../../models/workspace/workspace.js';
@@ -247,12 +248,12 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW
247
248
 
248
249
  const contextMenu = new UI.ContextMenu.ContextMenu(mouseEvent);
249
250
  if (perfAIEntryPointEnabled && this.parsedTrace) {
250
- const aiCallTree = Utils.AICallTree.AICallTree.fromEvent(entry, this.parsedTrace);
251
+ const aiCallTree = AIAssistance.AICallTree.fromEvent(entry, this.parsedTrace);
251
252
  if (aiCallTree) {
252
253
  const action = UI.ActionRegistry.ActionRegistry.instance().getAction(PERF_AI_ACTION_ID);
253
254
  // The other side of setFlavor is handleTraceEntryNodeFlavorChange() in FreestylerPanel
254
- const context = Utils.AIContext.AgentFocus.fromCallTree(aiCallTree);
255
- UI.Context.Context.instance().setFlavor(Utils.AIContext.AgentFocus, context);
255
+ const context = AIAssistance.AgentFocus.fromCallTree(aiCallTree);
256
+ UI.Context.Context.instance().setFlavor(AIAssistance.AgentFocus, context);
256
257
 
257
258
  if (Root.Runtime.hostConfig.devToolsAiSubmenuPrompts?.enabled) {
258
259
  function appendSubmenuPromptAction(
@@ -7,6 +7,7 @@ import * as Common from '../../core/common/common.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import * as Platform from '../../core/platform/platform.js';
9
9
  import * as SDK from '../../core/sdk/sdk.js';
10
+ import * as AIAssistance from '../../models/ai_assistance/ai_assistance.js';
10
11
  import * as CrUXManager from '../../models/crux-manager/crux-manager.js';
11
12
  import * as Trace from '../../models/trace/trace.js';
12
13
  import * as Workspace from '../../models/workspace/workspace.js';
@@ -374,7 +375,7 @@ export class TimelineFlameChartView extends Common.ObjectWrapper.eventMixin<Even
374
375
  this.chartSplitWidget.setMainWidget(flameChartsContainer);
375
376
  this.chartSplitWidget.setSidebarWidget(this.countersView);
376
377
  this.chartSplitWidget.hideDefaultResizer();
377
- this.chartSplitWidget.installResizer((this.countersView.resizerElement() as Element));
378
+ this.chartSplitWidget.installResizer(this.countersView.resizerElement());
378
379
 
379
380
  // Create top level properties splitter.
380
381
  this.detailsSplitWidget = new UI.SplitWidget.SplitWidget(false, true, 'timeline-panel-details-split-view-state');
@@ -1518,10 +1519,10 @@ export class TimelineFlameChartView extends Common.ObjectWrapper.eventMixin<Even
1518
1519
  if (!this.#parsedTrace) {
1519
1520
  return;
1520
1521
  }
1521
- const aiCallTree = Utils.AICallTree.AICallTree.fromEvent(selection.event, this.#parsedTrace);
1522
+ const aiCallTree = AIAssistance.AICallTree.fromEvent(selection.event, this.#parsedTrace);
1522
1523
  if (aiCallTree) {
1523
- const context = Utils.AIContext.AgentFocus.fromCallTree(aiCallTree);
1524
- UI.Context.Context.instance().setFlavor(Utils.AIContext.AgentFocus, context);
1524
+ const context = AIAssistance.AgentFocus.fromCallTree(aiCallTree);
1525
+ UI.Context.Context.instance().setFlavor(AIAssistance.AgentFocus, context);
1525
1526
  }
1526
1527
  });
1527
1528
  }
@@ -1762,6 +1763,10 @@ export class TimelineFlameChartView extends Common.ObjectWrapper.eventMixin<Even
1762
1763
  return true;
1763
1764
  }
1764
1765
 
1766
+ supportsWholeWordSearch(): boolean {
1767
+ return true;
1768
+ }
1769
+
1765
1770
  supportsRegexSearch(): boolean {
1766
1771
  return true;
1767
1772
  }
@@ -539,8 +539,8 @@ export class DropDown implements UI.ListControl.ListDelegate<number> {
539
539
  this.close(this.listControl.selectedItem());
540
540
  }
541
541
 
542
- private onKeyDown(event: Event): void {
543
- switch ((event as KeyboardEvent).key) {
542
+ private onKeyDown(event: KeyboardEvent): void {
543
+ switch (event.key) {
544
544
  case 'Tab':
545
545
  case 'Escape':
546
546
  this.close(null);
@@ -50,6 +50,7 @@ import * as Trace from '../../models/trace/trace.js';
50
50
  import * as SourceMapsResolver from '../../models/trace_source_maps_resolver/trace_source_maps_resolver.js';
51
51
  import * as Workspace from '../../models/workspace/workspace.js';
52
52
  import * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';
53
+ import * as Tracing from '../../services/tracing/tracing.js';
53
54
  import * as Adorners from '../../ui/components/adorners/adorners.js';
54
55
  import * as Dialogs from '../../ui/components/dialogs/dialogs.js';
55
56
  import * as LegacyWrapper from '../../ui/components/legacy_wrapper/legacy_wrapper.js';
@@ -934,7 +935,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
934
935
  getOrCreateExternalAIConversationData(): AiAssistanceModel.ExternalPerformanceAIConversationData {
935
936
  if (!this.#externalAIConversationData) {
936
937
  const conversationHandler = AiAssistanceModel.ConversationHandler.instance();
937
- const focus = Utils.AIContext.getPerformanceAgentFocusFromModel(this.model);
938
+ const focus = AiAssistanceModel.getPerformanceAgentFocusFromModel(this.model);
938
939
  if (!focus) {
939
940
  throw new Error('could not create performance agent focus');
940
941
  }
@@ -2043,7 +2044,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2043
2044
  this.flameChart.getNetworkDataProvider().reset();
2044
2045
  this.flameChart.reset();
2045
2046
  this.#changeView({mode: 'LANDING_PAGE'});
2046
- UI.Context.Context.instance().setFlavor(Utils.AIContext.AgentFocus, null);
2047
+ UI.Context.Context.instance().setFlavor(AiAssistanceModel.AgentFocus, null);
2047
2048
  }
2048
2049
 
2049
2050
  #hasActiveTrace(): boolean {
@@ -2535,7 +2536,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2535
2536
  }
2536
2537
 
2537
2538
  if (recordingIsFresh) {
2538
- Utils.FreshRecording.Tracker.instance().registerFreshRecording(parsedTrace);
2539
+ Tracing.FreshRecording.Tracker.instance().registerFreshRecording(parsedTrace);
2539
2540
  }
2540
2541
 
2541
2542
  // We store the index of the active trace so we can load it back easily
@@ -9,6 +9,7 @@ import * as Common from '../../core/common/common.js';
9
9
  import * as i18n from '../../core/i18n/i18n.js';
10
10
  import * as Platform from '../../core/platform/platform.js';
11
11
  import * as Trace from '../../models/trace/trace.js';
12
+ import * as Tracing from '../../services/tracing/tracing.js';
12
13
  import * as Buttons from '../../ui/components/buttons/buttons.js';
13
14
  import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
14
15
  import * as Components from '../../ui/legacy/components/utils/utils.js';
@@ -24,7 +25,6 @@ import {TimelineRegExp} from './TimelineFilters.js';
24
25
  import {rangeForSelection, type TimelineSelection} from './TimelineSelection.js';
25
26
  import timelineTreeViewStyles from './timelineTreeView.css.js';
26
27
  import {TimelineUIUtils} from './TimelineUIUtils.js';
27
- import * as Utils from './utils/utils.js';
28
28
 
29
29
  const UIStrings = {
30
30
  /**
@@ -702,6 +702,10 @@ export class TimelineTreeView extends
702
702
  return true;
703
703
  }
704
704
 
705
+ supportsWholeWordSearch(): boolean {
706
+ return true;
707
+ }
708
+
705
709
  supportsRegexSearch(): boolean {
706
710
  return true;
707
711
  }
@@ -795,7 +799,7 @@ export class GridNode extends DataGrid.SortableDataGrid.SortableDataGridNode<Gri
795
799
  const target = parsedTrace ? targetForEvent(parsedTrace, event) : null;
796
800
  const linkifier = this.treeView.linkifier;
797
801
  const isFreshRecording =
798
- Boolean(parsedTrace && Utils.FreshRecording.Tracker.instance().recordingIsFresh(parsedTrace));
802
+ Boolean(parsedTrace && Tracing.FreshRecording.Tracker.instance().recordingIsFresh(parsedTrace));
799
803
  this.linkElement = TimelineUIUtils.linkifyTopCallFrame(event, target, linkifier, isFreshRecording);
800
804
  if (this.linkElement) {
801
805
  container.createChild('div', 'activity-link').appendChild(this.linkElement);
@@ -44,6 +44,7 @@ import * as TextUtils from '../../models/text_utils/text_utils.js';
44
44
  import * as Trace from '../../models/trace/trace.js';
45
45
  import * as SourceMapsResolver from '../../models/trace_source_maps_resolver/trace_source_maps_resolver.js';
46
46
  import * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';
47
+ import * as Tracing from '../../services/tracing/tracing.js';
47
48
  import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
48
49
  // eslint-disable-next-line rulesdir/es-modules-import
49
50
  import codeHighlighterStyles from '../../ui/components/code_highlighter/codeHighlighter.css.js';
@@ -1072,7 +1073,7 @@ export class TimelineUIUtils {
1072
1073
  }
1073
1074
 
1074
1075
  const isFreshRecording =
1075
- Boolean(parsedTrace && Utils.FreshRecording.Tracker.instance().recordingIsFresh(parsedTrace));
1076
+ Boolean(parsedTrace && Tracing.FreshRecording.Tracker.instance().recordingIsFresh(parsedTrace));
1076
1077
 
1077
1078
  switch (event.name) {
1078
1079
  case Trace.Types.Events.Name.GC:
@@ -5,13 +5,13 @@
5
5
 
6
6
  import * as i18n from '../../../core/i18n/i18n.js';
7
7
  import * as Platform from '../../../core/platform/platform.js';
8
+ import * as AIAssistance from '../../../models/ai_assistance/ai_assistance.js';
8
9
  import * as CrUXManager from '../../../models/crux-manager/crux-manager.js';
9
10
  import * as Trace from '../../../models/trace/trace.js';
10
11
  import * as Buttons from '../../../ui/components/buttons/buttons.js';
11
12
  import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
12
13
  import * as Lit from '../../../ui/lit/lit.js';
13
14
  import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
14
- import * as Utils from '../utils/utils.js';
15
15
 
16
16
  import type {BaseInsightComponent} from './insights/BaseInsightComponent.js';
17
17
  import {md, shouldRenderForCategory} from './insights/Helpers.js';
@@ -434,7 +434,7 @@ export class SidebarSingleInsightSet extends HTMLElement {
434
434
  return html``;
435
435
  }
436
436
 
437
- const agentFocus = Utils.AIContext.AgentFocus.fromInsight(this.#data.parsedTrace, model);
437
+ const agentFocus = AIAssistance.AgentFocus.fromInsight(this.#data.parsedTrace, model);
438
438
  // clang-format off
439
439
  return html`<div>
440
440
  <${componentClass.litTagName}
@@ -7,6 +7,7 @@ import '../../../../ui/components/markdown_view/markdown_view.js';
7
7
 
8
8
  import * as i18n from '../../../../core/i18n/i18n.js';
9
9
  import * as Root from '../../../../core/root/root.js';
10
+ import * as AIAssistance from '../../../../models/ai_assistance/ai_assistance.js';
10
11
  import type {InsightModel} from '../../../../models/trace/insights/types.js';
11
12
  import type * as Trace from '../../../../models/trace/trace.js';
12
13
  import * as Buttons from '../../../../ui/components/buttons/buttons.js';
@@ -15,7 +16,6 @@ import * as UI from '../../../../ui/legacy/legacy.js';
15
16
  import * as Lit from '../../../../ui/lit/lit.js';
16
17
  import * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';
17
18
  import type * as Overlays from '../../overlays/overlays.js';
18
- import * as Utils from '../../utils/utils.js';
19
19
 
20
20
  import baseInsightComponentStyles from './baseInsightComponent.css.js';
21
21
  import {md} from './Helpers.js';
@@ -86,7 +86,7 @@ export abstract class BaseInsightComponent<T extends InsightModel> extends HTMLE
86
86
 
87
87
  #selected = false;
88
88
  #model: T|null = null;
89
- #agentFocus: Utils.AIContext.AgentFocus|null = null;
89
+ #agentFocus: AIAssistance.AgentFocus|null = null;
90
90
  #fieldMetrics: Trace.Insights.Common.CrUXFieldMetricResults|null = null;
91
91
 
92
92
  get model(): T|null {
@@ -158,7 +158,7 @@ export abstract class BaseInsightComponent<T extends InsightModel> extends HTMLE
158
158
  void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
159
159
  }
160
160
 
161
- set agentFocus(agentFocus: Utils.AIContext.AgentFocus) {
161
+ set agentFocus(agentFocus: AIAssistance.AgentFocus) {
162
162
  this.#agentFocus = agentFocus;
163
163
  }
164
164
 
@@ -179,9 +179,9 @@ export abstract class BaseInsightComponent<T extends InsightModel> extends HTMLE
179
179
  this.dispatchEvent(new SidebarInsight.InsightDeactivated());
180
180
 
181
181
  // Clear agent (but only if currently focused on an insight).
182
- const focus = UI.Context.Context.instance().flavor(Utils.AIContext.AgentFocus);
182
+ const focus = UI.Context.Context.instance().flavor(AIAssistance.AgentFocus);
183
183
  if (focus && focus.data.type === 'insight') {
184
- UI.Context.Context.instance().setFlavor(Utils.AIContext.AgentFocus, null);
184
+ UI.Context.Context.instance().setFlavor(AIAssistance.AgentFocus, null);
185
185
  }
186
186
  return;
187
187
  }
@@ -359,7 +359,7 @@ export abstract class BaseInsightComponent<T extends InsightModel> extends HTMLE
359
359
  return;
360
360
  }
361
361
 
362
- UI.Context.Context.instance().setFlavor(Utils.AIContext.AgentFocus, this.#agentFocus);
362
+ UI.Context.Context.instance().setFlavor(AIAssistance.AgentFocus, this.#agentFocus);
363
363
 
364
364
  // Trigger the AI Assistance panel to open.
365
365
  const action = UI.ActionRegistry.ActionRegistry.instance().getAction(actionId);
@@ -6,10 +6,10 @@
6
6
  import * as Common from '../../../core/common/common.js';
7
7
  import * as i18n from '../../../core/i18n/i18n.js';
8
8
  import * as Platform from '../../../core/platform/platform.js';
9
+ import * as AIAssistance from '../../../models/ai_assistance/ai_assistance.js';
9
10
  import * as Trace from '../../../models/trace/trace.js';
10
11
  import type * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';
11
12
  import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
12
- import * as Utils from '../utils/utils.js';
13
13
 
14
14
  import * as Components from './components/components.js';
15
15
 
@@ -1476,7 +1476,7 @@ export class Overlays extends EventTarget {
1476
1476
  const component = new Components.EntryLabelOverlay.EntryLabelOverlay(overlay.label, shouldDrawLabelBelowEntry);
1477
1477
  // Generate the AI Call Tree for the AI Auto-Annotation feature.
1478
1478
  const parsedTrace = this.#queries.parsedTrace();
1479
- const callTree = parsedTrace ? Utils.AICallTree.AICallTree.fromEvent(overlay.entry, parsedTrace) : null;
1479
+ const callTree = parsedTrace ? AIAssistance.AICallTree.fromEvent(overlay.entry, parsedTrace) : null;
1480
1480
  component.callTree = callTree;
1481
1481
 
1482
1482
  component.addEventListener(
@@ -20,7 +20,6 @@ import * as ThemeSupport from '../../../../ui/legacy/theme_support/theme_support
20
20
  import * as Lit from '../../../../ui/lit/lit.js';
21
21
  import * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';
22
22
  import * as PanelCommon from '../../../common/common.js';
23
- import type * as Utils from '../../utils/utils.js';
24
23
 
25
24
  import entryLabelOverlayStyles from './entryLabelOverlay.css.js';
26
25
 
@@ -184,7 +183,7 @@ export class EntryLabelOverlay extends HTMLElement {
184
183
  /**
185
184
  * Required to generate a label with AI.
186
185
  */
187
- #callTree: Utils.AICallTree.AICallTree|null = null;
186
+ #callTree: AiAssistanceModels.AICallTree|null = null;
188
187
  // Creates or gets the setting if it exists.
189
188
  #aiAnnotationsEnabledSetting = Common.Settings.Settings.instance().createSetting('ai-annotations-enabled', false);
190
189
  #agent = new AiAssistanceModels.PerformanceAnnotationsAgent({
@@ -498,7 +497,7 @@ export class EntryLabelOverlay extends HTMLElement {
498
497
  selection?.addRange(range);
499
498
  }
500
499
 
501
- set callTree(callTree: Utils.AICallTree.AICallTree|null) {
500
+ set callTree(callTree: AiAssistanceModels.AICallTree|null) {
502
501
  this.#callTree = callTree;
503
502
  // If the entry has a calltree, we need to check if we need to show the 'generate label' button.
504
503
  this.#setAIButtonRenderState();
@@ -1,24 +1,16 @@
1
1
  // Copyright 2024 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- import * as AICallTree from './AICallTree.js';
5
- import * as AIContext from './AIContext.js';
6
4
  import * as EntryNodes from './EntryNodes.js';
7
- import * as FreshRecording from './FreshRecording.js';
8
5
  import * as Helpers from './Helpers.js';
9
6
  import * as IgnoreList from './IgnoreList.js';
10
7
  import * as ImageCache from './ImageCache.js';
11
- import * as InsightAIContext from './InsightAIContext.js';
12
8
  import * as Treemap from './Treemap.js';
13
9
 
14
10
  export {
15
- AICallTree,
16
- AIContext,
17
11
  EntryNodes,
18
- FreshRecording,
19
12
  Helpers,
20
13
  IgnoreList,
21
14
  ImageCache,
22
- InsightAIContext,
23
15
  Treemap,
24
16
  };
@@ -1,7 +1,7 @@
1
1
  // Copyright 2024 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- import type * as Trace from '../../../models/trace/trace.js';
4
+ import type * as Trace from '../../models/trace/trace.js';
5
5
 
6
6
  let instance: Tracker|null = null;
7
7
 
@@ -2,10 +2,12 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import * as FreshRecording from './FreshRecording.js';
5
6
  import * as PerformanceTracing from './PerformanceTracing.js';
6
7
  import * as TracingManager from './TracingManager.js';
7
8
 
8
9
  export {
10
+ FreshRecording,
9
11
  PerformanceTracing,
10
12
  TracingManager,
11
13
  };