chrome-devtools-frontend 1.0.1515796 → 1.0.1516909

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 (163) hide show
  1. package/docs/contributing/infrastructure.md +131 -82
  2. package/front_end/Tests.js +3 -29
  3. package/front_end/core/common/Progress.ts +73 -55
  4. package/front_end/core/host/GdpClient.ts +1 -1
  5. package/front_end/core/host/UserMetrics.ts +5 -2
  6. package/front_end/core/protocol_client/InspectorBackend.ts +2 -0
  7. package/front_end/core/root/Runtime.ts +0 -1
  8. package/front_end/core/sdk/CSSMatchedStyles.ts +12 -10
  9. package/front_end/core/sdk/CSSModel.ts +1 -31
  10. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +27 -7
  11. package/front_end/core/sdk/DebuggerModel.ts +1 -31
  12. package/front_end/core/sdk/EnhancedTracesParser.ts +81 -50
  13. package/front_end/core/sdk/NetworkManager.ts +1 -31
  14. package/front_end/core/sdk/NetworkRequest.ts +1 -31
  15. package/front_end/core/sdk/RehydratingConnection.snapshot.txt +1003 -0
  16. package/front_end/core/sdk/RehydratingConnection.ts +13 -18
  17. package/front_end/core/sdk/RehydratingObject.ts +8 -31
  18. package/front_end/core/sdk/RemoteObject.ts +1 -31
  19. package/front_end/core/sdk/ResourceTreeModel.ts +1 -31
  20. package/front_end/core/sdk/RuntimeModel.ts +1 -31
  21. package/front_end/core/sdk/ServiceWorkerManager.ts +1 -31
  22. package/front_end/core/sdk/SourceMap.ts +1 -31
  23. package/front_end/core/sdk/TraceObject.ts +8 -3
  24. package/front_end/entrypoints/main/MainImpl.ts +1 -3
  25. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -3
  26. package/front_end/models/ai_assistance/ConversationHandler.ts +4 -6
  27. package/front_end/models/ai_assistance/agents/AiAgent.ts +4 -1
  28. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +110 -76
  29. package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +2 -2
  30. package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -2
  31. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +178 -85
  32. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +308 -218
  33. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +100 -100
  34. package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +10 -1
  35. package/front_end/models/ai_assistance/performance/AIContext.ts +19 -21
  36. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +24 -8
  37. package/front_end/models/badges/UserBadges.ts +38 -3
  38. package/front_end/models/bindings/ContentProviderBasedProject.ts +6 -4
  39. package/front_end/models/breakpoints/BreakpointManager.ts +3 -3
  40. package/front_end/models/formatter/FormatterWorkerPool.ts +3 -3
  41. package/front_end/models/har/Writer.ts +11 -11
  42. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +3 -3
  43. package/front_end/models/persistence/IsolatedFileSystem.ts +4 -4
  44. package/front_end/models/persistence/IsolatedFileSystemManager.ts +7 -7
  45. package/front_end/models/persistence/PersistenceImpl.ts +8 -8
  46. package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
  47. package/front_end/models/trace/ModelImpl.ts +2 -16
  48. package/front_end/models/trace/Processor.ts +15 -9
  49. package/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +4 -4
  50. package/front_end/models/trace/handlers/FramesHandler.ts +2 -2
  51. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +7 -10
  52. package/front_end/models/trace/handlers/MetaHandler.ts +11 -9
  53. package/front_end/models/trace/handlers/ScreenshotsHandler.ts +1 -1
  54. package/front_end/models/trace/handlers/ScriptsHandler.ts +5 -5
  55. package/front_end/models/trace/handlers/UserInteractionsHandler.ts +2 -14
  56. package/front_end/models/trace/handlers/UserTimingsHandler.ts +3 -4
  57. package/front_end/models/trace/insights/CLSCulprits.ts +1 -1
  58. package/front_end/models/trace/insights/DocumentLatency.ts +3 -4
  59. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -1
  60. package/front_end/models/trace/insights/INPBreakdown.ts +1 -1
  61. package/front_end/models/trace/insights/ImageDelivery.ts +1 -1
  62. package/front_end/models/trace/insights/LCPBreakdown.ts +1 -1
  63. package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
  64. package/front_end/models/trace/insights/ModernHTTP.ts +1 -1
  65. package/front_end/models/trace/insights/NetworkDependencyTree.ts +1 -1
  66. package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
  67. package/front_end/models/trace/insights/types.ts +2 -0
  68. package/front_end/models/trace/types/TraceEvents.ts +41 -64
  69. package/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +1 -1
  70. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +21 -99
  71. package/front_end/panels/application/ServiceWorkersView.ts +0 -1
  72. package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +2 -3
  73. package/front_end/panels/common/BadgeNotification.ts +46 -10
  74. package/front_end/panels/common/GdpSignUpDialog.ts +6 -3
  75. package/front_end/panels/console/ConsoleView.ts +23 -28
  76. package/front_end/panels/console/ConsoleViewport.ts +2 -2
  77. package/front_end/panels/console/consoleView.css +11 -1
  78. package/front_end/panels/coverage/CoverageView.ts +2 -2
  79. package/front_end/panels/elements/ComputedStyleWidget.ts +1 -2
  80. package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
  81. package/front_end/panels/elements/LayoutPane.ts +1 -1
  82. package/front_end/panels/elements/StyleEditorWidget.ts +8 -19
  83. package/front_end/panels/elements/StylePropertyTreeElement.ts +39 -25
  84. package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
  85. package/front_end/panels/elements/stylePropertiesTreeOutline.css +4 -3
  86. package/front_end/panels/layer_viewer/Layers3DView.ts +2 -2
  87. package/front_end/panels/layers/LayerTreeModel.ts +3 -3
  88. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +4 -4
  89. package/front_end/panels/network/NetworkLogView.ts +6 -2
  90. package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
  91. package/front_end/panels/network/NetworkSearchScope.ts +6 -6
  92. package/front_end/panels/search/SearchResultsPane.ts +32 -47
  93. package/front_end/panels/search/SearchView.ts +58 -80
  94. package/front_end/panels/settings/components/SyncSection.ts +7 -2
  95. package/front_end/panels/sources/OutlineQuickOpen.ts +3 -1
  96. package/front_end/panels/sources/SourcesSearchScope.ts +4 -4
  97. package/front_end/panels/sources/TabbedEditorContainer.ts +5 -5
  98. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +10 -5
  99. package/front_end/panels/timeline/TimelineFlameChartView.ts +18 -15
  100. package/front_end/panels/timeline/TimelinePanel.ts +41 -22
  101. package/front_end/panels/timeline/TimelineUIUtils.ts +13 -8
  102. package/front_end/panels/timeline/TracingLayerTree.ts +4 -5
  103. package/front_end/panels/timeline/components/ExportTraceOptions.ts +37 -22
  104. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +17 -7
  105. package/front_end/third_party/axe-core/README.chromium +1 -0
  106. package/front_end/third_party/codemirror/README.chromium +1 -0
  107. package/front_end/third_party/codemirror.next/README.chromium +1 -0
  108. package/front_end/third_party/csp_evaluator/README.chromium +1 -0
  109. package/front_end/third_party/diff/README.chromium +1 -0
  110. package/front_end/third_party/i18n/README.chromium +1 -0
  111. package/front_end/third_party/intl-messageformat/README.chromium +1 -0
  112. package/front_end/third_party/json5/README.chromium +1 -0
  113. package/front_end/third_party/legacy-javascript/README.chromium +1 -0
  114. package/front_end/third_party/lighthouse/README.chromium +1 -0
  115. package/front_end/third_party/lit/README.chromium +1 -0
  116. package/front_end/third_party/marked/README.chromium +1 -0
  117. package/front_end/third_party/puppeteer/README.chromium +2 -2
  118. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
  119. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +0 -20
  120. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  128. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +2 -23
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +0 -20
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +1 -1
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  136. package/front_end/third_party/puppeteer/package/package.json +1 -1
  137. package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +1 -21
  138. package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
  139. package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
  140. package/front_end/third_party/puppeteer-replay/README.chromium +1 -0
  141. package/front_end/third_party/third-party-web/README.chromium +1 -0
  142. package/front_end/third_party/vscode.web-custom-data/README.chromium +1 -0
  143. package/front_end/third_party/wasmparser/README.chromium +1 -0
  144. package/front_end/third_party/web-vitals/README.chromium +1 -0
  145. package/front_end/ui/components/text_editor/config.ts +30 -1
  146. package/front_end/ui/components/tooltips/Tooltip.ts +18 -4
  147. package/front_end/ui/legacy/ContextMenu.ts +2 -2
  148. package/front_end/ui/legacy/GlassPane.ts +7 -3
  149. package/front_end/ui/legacy/ProgressIndicator.ts +29 -16
  150. package/front_end/ui/legacy/TabbedPane.ts +2 -2
  151. package/front_end/ui/legacy/Treeoutline.ts +10 -5
  152. package/front_end/ui/legacy/UIUtils.ts +42 -10
  153. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +14 -14
  154. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +6 -6
  155. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +3 -29
  156. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +14 -14
  157. package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
  158. package/inspector_overlay/highlight_common.ts +1 -27
  159. package/inspector_overlay/highlight_grid_common.ts +1 -27
  160. package/inspector_overlay/tool_highlight.ts +1 -27
  161. package/inspector_overlay/tool_persistent.ts +1 -27
  162. package/inspector_overlay/tool_source_order.ts +1 -27
  163. package/package.json +1 -1
@@ -107,6 +107,7 @@ const UIStrings = {
107
107
  const str_ = i18n.i18n.registerUIStrings('panels/search/SearchView.ts', UIStrings);
108
108
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
109
109
  const {ref} = Directives;
110
+ const {widgetConfig} = UI.Widget;
110
111
 
111
112
  interface SearchViewInput {
112
113
  query: string;
@@ -115,6 +116,8 @@ interface SearchViewInput {
115
116
  isRegex: boolean;
116
117
  searchMessage: string;
117
118
  searchResultsMessage: string;
119
+ searchResultsPane: SearchResultsPane|null;
120
+ progress: Common.Progress.Progress|null;
118
121
  onQueryChange: (query: string) => void;
119
122
  onQueryKeyDown: (evt: KeyboardEvent) => void;
120
123
  onPanelKeyDown: (evt: KeyboardEvent) => void;
@@ -125,12 +128,7 @@ interface SearchViewInput {
125
128
  onClearSearch: () => void;
126
129
  }
127
130
 
128
- interface SearchViewOutput {
129
- searchResultsElement?: HTMLElement;
130
- searchProgressPlaceholderElement?: HTMLElement;
131
- }
132
-
133
- type View = (input: SearchViewInput, output: SearchViewOutput, target: HTMLElement) => void;
131
+ type View = (input: SearchViewInput, output: object, target: HTMLElement) => void;
134
132
 
135
133
  export const DEFAULT_VIEW: View = (input, output, target) => {
136
134
  const {
@@ -139,7 +137,9 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
139
137
  matchCase,
140
138
  isRegex,
141
139
  searchMessage,
140
+ searchResultsPane,
142
141
  searchResultsMessage,
142
+ progress,
143
143
  onQueryChange,
144
144
  onQueryKeyDown,
145
145
  onPanelKeyDown,
@@ -149,6 +149,18 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
149
149
  onRefresh,
150
150
  onClearSearch,
151
151
  } = input;
152
+ let header = '', text = '';
153
+ if (!query) {
154
+ header = i18nString(UIStrings.noSearchResult);
155
+ text = i18nString(
156
+ UIStrings.typeAndPressSToSearch,
157
+ {PH1: UI.KeyboardShortcut.KeyboardShortcut.shortcutToString(UI.KeyboardShortcut.Keys.Enter)});
158
+ } else if (progress) {
159
+ header = i18nString(UIStrings.searching);
160
+ } else if (!searchResultsPane) {
161
+ header = i18nString(UIStrings.noMatchesFound);
162
+ text = i18nString(UIStrings.nothingMatchedTheQuery);
163
+ }
152
164
  // clang-format off
153
165
  render(html`
154
166
  <style>${searchViewStyles}</style>
@@ -223,12 +235,21 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
223
235
  } as Buttons.Button.ButtonData}></devtools-button>
224
236
  </devtools-toolbar>
225
237
  </div>
226
- <div class="search-results" @keydown=${onPanelKeyDown}
227
- ${ref(e => {output.searchResultsElement = e as HTMLElement;})}>
238
+ <div class="search-results" @keydown=${onPanelKeyDown}>
239
+ ${searchResultsPane
240
+ ? html`<devtools-widget .widgetConfig=${widgetConfig(UI.Widget.VBox)}>
241
+ ${searchResultsPane.element}
242
+ </devtools-widget>`
243
+ : html`<devtools-widget .widgetConfig=${widgetConfig(UI.EmptyWidget.EmptyWidget, {header, text})}>
244
+ </devtools-widget>`}
228
245
  </div>
229
246
  <div class="search-toolbar-summary" @keydown=${onPanelKeyDown}>
230
247
  <div class="search-message">${searchMessage}</div>
231
- <div class="flex-centered" ${ref(e => {output.searchProgressPlaceholderElement = e as HTMLElement;})}>
248
+ <div class="flex-centered">
249
+ ${progress ? html`
250
+ <devtools-progress .title=${progress.title ?? ''}
251
+ .worked=${progress.worked} .totalWork=${progress.totalWork}>
252
+ </devtools-progress>` : ''}
232
253
  </div>
233
254
  <div class="search-message">${searchResultsMessage}</div>
234
255
  </div>`, target);
@@ -244,18 +265,14 @@ export class SearchView extends UI.Widget.VBox {
244
265
  #searchResultsCount: number;
245
266
  #nonEmptySearchResultsCount: number;
246
267
  #searchingView: UI.Widget.Widget|null;
247
- #notFoundView: UI.Widget.Widget|null;
248
268
  #searchConfig: Workspace.SearchConfig.SearchConfig|null;
249
269
  #pendingSearchConfig: Workspace.SearchConfig.SearchConfig|null;
250
270
  #searchResultsPane: SearchResultsPane|null;
251
- #progressIndicator: UI.ProgressIndicator.ProgressIndicator|null;
252
- #visiblePane: UI.Widget.Widget|null;
253
- #searchResultsElement!: HTMLElement;
271
+ #progress: Common.Progress.Progress|null;
254
272
  #query: string;
255
273
  #matchCase = false;
256
274
  #isRegex = false;
257
275
  #searchMessage = '';
258
- #searchProgressPlaceholderElement!: HTMLElement;
259
276
  #searchResultsMessage = '';
260
277
  readonly #advancedSearchConfig: Common.Settings.Setting<{
261
278
  query: string,
@@ -268,7 +285,6 @@ export class SearchView extends UI.Widget.VBox {
268
285
  // result added.
269
286
  #throttler: Common.Throttler.Throttler;
270
287
  #pendingSearchResults: SearchResult[] = [];
271
- #emptyStartView: UI.EmptyWidget.EmptyWidget;
272
288
 
273
289
  constructor(settingKey: string, throttler: Common.Throttler.Throttler, view = DEFAULT_VIEW) {
274
290
  super({
@@ -286,12 +302,10 @@ export class SearchView extends UI.Widget.VBox {
286
302
  this.#searchResultsCount = 0;
287
303
  this.#nonEmptySearchResultsCount = 0;
288
304
  this.#searchingView = null;
289
- this.#notFoundView = null;
290
305
  this.#searchConfig = null;
291
306
  this.#pendingSearchConfig = null;
292
307
  this.#searchResultsPane = null;
293
- this.#progressIndicator = null;
294
- this.#visiblePane = null;
308
+ this.#progress = null;
295
309
  this.#throttler = throttler;
296
310
 
297
311
  this.#advancedSearchConfig = Common.Settings.Settings.instance().createLocalSetting(
@@ -301,12 +315,6 @@ export class SearchView extends UI.Widget.VBox {
301
315
  this.#load();
302
316
  this.performUpdate();
303
317
  this.#searchScope = null;
304
-
305
- this.#emptyStartView = new UI.EmptyWidget.EmptyWidget(
306
- i18nString(UIStrings.noSearchResult), i18nString(UIStrings.typeAndPressSToSearch, {
307
- PH1: UI.KeyboardShortcut.KeyboardShortcut.shortcutToString(UI.KeyboardShortcut.Keys.Enter)
308
- }));
309
- this.#showPane(this.#emptyStartView);
310
318
  }
311
319
 
312
320
  override performUpdate(): void {
@@ -316,7 +324,9 @@ export class SearchView extends UI.Widget.VBox {
316
324
  matchCase: this.#matchCase,
317
325
  isRegex: this.#isRegex,
318
326
  searchMessage: this.#searchMessage,
327
+ searchResultsPane: this.#searchResultsPane,
319
328
  searchResultsMessage: this.#searchResultsMessage,
329
+ progress: this.#progress,
320
330
  onQueryChange: (query: string) => {
321
331
  this.#query = query;
322
332
  },
@@ -328,15 +338,9 @@ export class SearchView extends UI.Widget.VBox {
328
338
  onRefresh: this.#onRefresh.bind(this),
329
339
  onClearSearch: this.#onClearSearch.bind(this),
330
340
  };
331
- const output: SearchViewOutput = {};
341
+ const output = {};
332
342
  this.#view(input, output, this.contentElement);
333
343
  this.#focusSearchInput = false;
334
- if (output.searchResultsElement) {
335
- this.#searchResultsElement = output.searchResultsElement;
336
- }
337
- if (output.searchProgressPlaceholderElement) {
338
- this.#searchProgressPlaceholderElement = output.searchProgressPlaceholderElement;
339
- }
340
344
  }
341
345
 
342
346
  #onToggleRegex(): void {
@@ -375,13 +379,12 @@ export class SearchView extends UI.Widget.VBox {
375
379
  }
376
380
 
377
381
  #onIndexingFinished(): void {
378
- if (!this.#progressIndicator) {
382
+ if (!this.#progress) {
379
383
  return;
380
384
  }
381
385
 
382
- const finished = !this.#progressIndicator.isCanceled();
383
- this.#progressIndicator.done();
384
- this.#progressIndicator = null;
386
+ const finished = !this.#progress.canceled;
387
+ this.#progress = null;
385
388
  this.#isIndexing = false;
386
389
  this.#searchMessage = finished ? '' : i18nString(UIStrings.indexingInterrupted);
387
390
  if (!finished) {
@@ -393,21 +396,20 @@ export class SearchView extends UI.Widget.VBox {
393
396
  }
394
397
  const searchConfig = this.#pendingSearchConfig;
395
398
  this.#pendingSearchConfig = null;
396
- this.#innerStartSearch(searchConfig);
399
+ this.#startSearch(searchConfig);
397
400
  }
398
401
 
399
402
  #startIndexing(): void {
400
403
  this.#isIndexing = true;
401
- if (this.#progressIndicator) {
402
- this.#progressIndicator.done();
404
+ if (this.#progress) {
405
+ this.#progress.done = true;
403
406
  }
404
- this.#progressIndicator = document.createElement('devtools-progress');
407
+ this.#progress = new Common.Progress.ProgressProxy(
408
+ new Common.Progress.Progress(), this.#onIndexingFinished.bind(this), this.requestUpdate.bind(this));
405
409
  this.#searchMessage = i18nString(UIStrings.indexing);
406
- this.#searchProgressPlaceholderElement.appendChild(this.#progressIndicator);
407
410
  this.performUpdate();
408
411
  if (this.#searchScope) {
409
- this.#searchScope.performIndexing(
410
- new Common.Progress.ProgressProxy(this.#progressIndicator, this.#onIndexingFinished.bind(this)));
412
+ this.#searchScope.performIndexing(this.#progress);
411
413
  }
412
414
  }
413
415
 
@@ -416,20 +418,18 @@ export class SearchView extends UI.Widget.VBox {
416
418
  this.requestUpdate();
417
419
  this.#save();
418
420
  this.focus();
419
- this.#showPane(this.#emptyStartView);
420
421
  }
421
422
 
422
423
  #onSearchResult(searchId: number, searchResult: SearchResult): void {
423
- if (searchId !== this.#searchId || !this.#progressIndicator) {
424
+ if (searchId !== this.#searchId || !this.#progress) {
424
425
  return;
425
426
  }
426
- if (this.#progressIndicator?.isCanceled()) {
427
+ if (this.#progress?.canceled) {
427
428
  this.#onIndexingFinished();
428
429
  return;
429
430
  }
430
431
  if (!this.#searchResultsPane) {
431
432
  this.#searchResultsPane = this.createSearchResultsPane();
432
- this.#showPane(this.#searchResultsPane);
433
433
  }
434
434
  this.#pendingSearchResults.push(searchResult);
435
435
  void this.#throttler.schedule(async () => this.#addPendingSearchResults());
@@ -450,34 +450,32 @@ export class SearchView extends UI.Widget.VBox {
450
450
  }
451
451
 
452
452
  #onSearchFinished(searchId: number, finished: boolean): void {
453
- if (searchId !== this.#searchId || !this.#progressIndicator) {
453
+ if (searchId !== this.#searchId || !this.#progress) {
454
454
  return;
455
455
  }
456
- if (!this.#searchResultsPane) {
457
- this.#nothingFound();
458
- }
456
+ this.#progress = null;
459
457
  this.#searchFinished(finished);
460
458
  this.#searchConfig = null;
461
459
  UI.ARIAUtils.LiveAnnouncer.alert(this.#searchMessage + ' ' + this.#searchResultsMessage);
462
460
  }
463
461
 
464
- #innerStartSearch(searchConfig: Workspace.SearchConfig.SearchConfig): void {
462
+ #startSearch(searchConfig: Workspace.SearchConfig.SearchConfig): void {
465
463
  this.#searchConfig = searchConfig;
466
- if (this.#progressIndicator) {
467
- this.#progressIndicator.done();
464
+ if (this.#progress) {
465
+ this.#progress.done = true;
468
466
  }
469
- this.#progressIndicator = document.createElement('devtools-progress');
470
- this.#searchStarted(this.#progressIndicator);
467
+ this.#progress =
468
+ new Common.Progress.ProgressProxy(new Common.Progress.Progress(), undefined, this.requestUpdate.bind(this));
469
+ this.#searchStarted();
471
470
  if (this.#searchScope) {
472
471
  void this.#searchScope.performSearch(
473
- searchConfig, this.#progressIndicator, this.#onSearchResult.bind(this, this.#searchId),
472
+ searchConfig, this.#progress, this.#onSearchResult.bind(this, this.#searchId),
474
473
  this.#onSearchFinished.bind(this, this.#searchId));
475
474
  }
476
475
  }
477
476
 
478
477
  #resetSearch(): void {
479
478
  this.#stopSearch();
480
- this.#showPane(null);
481
479
  this.#searchResultsPane = null;
482
480
  this.#searchMessage = '';
483
481
  this.#searchResultsMessage = '';
@@ -485,8 +483,8 @@ export class SearchView extends UI.Widget.VBox {
485
483
  }
486
484
 
487
485
  #stopSearch(): void {
488
- if (this.#progressIndicator && !this.#isIndexing) {
489
- this.#progressIndicator.cancel();
486
+ if (this.#progress && !this.#isIndexing) {
487
+ this.#progress.canceled = true;
490
488
  }
491
489
  if (this.#searchScope) {
492
490
  this.#searchScope.stopSearch();
@@ -494,17 +492,15 @@ export class SearchView extends UI.Widget.VBox {
494
492
  this.#searchConfig = null;
495
493
  }
496
494
 
497
- #searchStarted(progressIndicator: UI.ProgressIndicator.ProgressIndicator): void {
495
+ #searchStarted(): void {
498
496
  this.#searchMatchesCount = 0;
499
497
  this.#searchResultsCount = 0;
500
498
  this.#nonEmptySearchResultsCount = 0;
501
499
  if (!this.#searchingView) {
502
500
  this.#searchingView = new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.searching), '');
503
501
  }
504
- this.#showPane(this.#searchingView);
505
502
  this.#searchMessage = i18nString(UIStrings.searching);
506
503
  this.performUpdate();
507
- this.#searchProgressPlaceholderElement.appendChild(progressIndicator);
508
504
  this.#updateSearchResultsMessage();
509
505
  }
510
506
 
@@ -525,24 +521,6 @@ export class SearchView extends UI.Widget.VBox {
525
521
  this.performUpdate();
526
522
  }
527
523
 
528
- #showPane(panel: UI.Widget.Widget|null): void {
529
- if (this.#visiblePane) {
530
- this.#visiblePane.detach();
531
- }
532
- if (panel) {
533
- panel.show(this.#searchResultsElement);
534
- }
535
- this.#visiblePane = panel;
536
- }
537
-
538
- #nothingFound(): void {
539
- if (!this.#notFoundView) {
540
- this.#notFoundView = new UI.EmptyWidget.EmptyWidget(
541
- i18nString(UIStrings.noMatchesFound), i18nString(UIStrings.nothingMatchedTheQuery));
542
- }
543
- this.#showPane(this.#notFoundView);
544
- }
545
-
546
524
  #addSearchResult(searchResult: SearchResult): void {
547
525
  const matchesCount = searchResult.matchesCount();
548
526
  this.#searchMatchesCount += matchesCount;
@@ -204,6 +204,7 @@ export class SyncSection extends HTMLElement {
204
204
  receiveBadgesSettingContainerRef: this.#receiveBadgesSettingContainerRef,
205
205
  gdpProfile: this.#gdpProfile,
206
206
  isEligibleToCreateProfile: this.#isEligibleToCreateGdpProfile,
207
+ onSignUpSuccess: this.#fetchGdpDetails.bind(this),
207
208
  })}
208
209
  </fieldset>
209
210
  `, this.#shadow, {host: this});
@@ -211,7 +212,7 @@ export class SyncSection extends HTMLElement {
211
212
  }
212
213
 
213
214
  async #fetchGdpDetails(): Promise<void> {
214
- if (!Root.Runtime.hostConfig.devToolsGdpProfiles?.enabled) {
215
+ if (!Root.Runtime.hostConfig.devToolsGdpProfiles?.enabled || Root.Runtime.hostConfig.isOffTheRecord) {
215
216
  return;
216
217
  }
217
218
 
@@ -295,8 +296,10 @@ function renderGdpSectionIfNeeded({
295
296
  receiveBadgesSettingContainerRef,
296
297
  gdpProfile,
297
298
  isEligibleToCreateProfile,
299
+ onSignUpSuccess,
298
300
  }: {
299
301
  receiveBadgesSettingContainerRef: Lit.Directives.Ref<HTMLElement>,
302
+ onSignUpSuccess: () => void,
300
303
  receiveBadgesSetting?: Common.Settings.Setting<boolean>,
301
304
  gdpProfile?: Host.GdpClient.Profile,
302
305
  isEligibleToCreateProfile?: boolean,
@@ -345,7 +348,9 @@ function renderGdpSectionIfNeeded({
345
348
  <div class="gdp-profile-sign-up-content">
346
349
  ${renderBrand()}
347
350
  <devtools-button
348
- @click=${() => PanelCommon.GdpSignUpDialog.show()}
351
+ @click=${() => PanelCommon.GdpSignUpDialog.show({
352
+ onSuccess: onSignUpSuccess
353
+ })}
349
354
  .jslogContext=${'gdp.sign-up-dialog-open'}
350
355
  .variant=${Buttons.Button.Variant.OUTLINED}>
351
356
  ${i18nString(UIStrings.signUp)}
@@ -44,7 +44,9 @@ export function outline(state: CodeMirror.EditorState): OutlineItem[] {
44
44
 
45
45
  function subtitleFromParamList(): string {
46
46
  while (cursor.name !== 'ParamList') {
47
- cursor.nextSibling();
47
+ if (!cursor.nextSibling()) {
48
+ break;
49
+ }
48
50
  }
49
51
  let parameters = '';
50
52
  if (cursor.name === 'ParamList' && cursor.firstChild()) {
@@ -184,12 +184,12 @@ export class SourcesSearchScope implements Search.SearchScope.SearchScope {
184
184
 
185
185
  const files = this.searchResultCandidates;
186
186
  if (!files.length) {
187
- progress.done();
187
+ progress.done = true;
188
188
  callback();
189
189
  return;
190
190
  }
191
191
 
192
- progress.setTotalWork(files.length);
192
+ progress.totalWork = files.length;
193
193
 
194
194
  let fileIndex = 0;
195
195
  const maxFileContentRequests = 20;
@@ -213,7 +213,7 @@ export class SourcesSearchScope implements Search.SearchScope.SearchScope {
213
213
  function scheduleSearchInNextFileOrFinish(this: SourcesSearchScope): void {
214
214
  if (fileIndex >= files.length) {
215
215
  if (!callbacksLeft) {
216
- progress.done();
216
+ progress.done = true;
217
217
  callback();
218
218
  return;
219
219
  }
@@ -228,7 +228,7 @@ export class SourcesSearchScope implements Search.SearchScope.SearchScope {
228
228
  function contentLoaded(
229
229
  this: SourcesSearchScope, uiSourceCode: Workspace.UISourceCode.UISourceCode,
230
230
  content: TextUtils.Text.Text): void {
231
- progress.incrementWorked(1);
231
+ ++progress.worked;
232
232
  let matches: TextUtils.ContentProvider.SearchMatch[] = [];
233
233
  const searchConfig = (this.searchConfig as Workspace.SearchConfig.SearchConfig);
234
234
  const queries = searchConfig.queries();
@@ -196,7 +196,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
196
196
  frame?.currentUISourceCode() === uiSourceCode) {
197
197
  Common.EventTarget.fireEvent('source-file-loaded', uiSourceCode.displayName(true));
198
198
  } else {
199
- this.innerShowFile(uiSourceCode, true);
199
+ this.#showFile(uiSourceCode, true);
200
200
  }
201
201
  }
202
202
 
@@ -279,7 +279,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
279
279
  }
280
280
  }
281
281
 
282
- private innerShowFile(uiSourceCode: Workspace.UISourceCode.UISourceCode, userGesture?: boolean): void {
282
+ #showFile(uiSourceCode: Workspace.UISourceCode.UISourceCode, userGesture?: boolean): void {
283
283
  if (this.reentrantShow) {
284
284
  return;
285
285
  }
@@ -430,7 +430,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
430
430
 
431
431
  // Select tab if this file was the last to be shown.
432
432
  if (!index) {
433
- this.innerShowFile(uiSourceCode, false);
433
+ this.#showFile(uiSourceCode, false);
434
434
  return;
435
435
  }
436
436
 
@@ -441,7 +441,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
441
441
  const currentProjectIsSnippets = Snippets.ScriptSnippetFileSystem.isSnippetsUISourceCode(this.#currentFile);
442
442
  const addedProjectIsSnippets = Snippets.ScriptSnippetFileSystem.isSnippetsUISourceCode(uiSourceCode);
443
443
  if (this.history.index(historyItemKey(this.#currentFile)) && currentProjectIsSnippets && !addedProjectIsSnippets) {
444
- this.innerShowFile(uiSourceCode, false);
444
+ this.#showFile(uiSourceCode, false);
445
445
  }
446
446
  }
447
447
 
@@ -578,7 +578,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
578
578
 
579
579
  const uiSourceCode = this.files.get(tabId);
580
580
  if (uiSourceCode) {
581
- this.innerShowFile(uiSourceCode, isUserGesture);
581
+ this.#showFile(uiSourceCode, isUserGesture);
582
582
  }
583
583
  }
584
584
 
@@ -248,12 +248,17 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW
248
248
 
249
249
  const contextMenu = new UI.ContextMenu.ContextMenu(mouseEvent);
250
250
  if (perfAIEntryPointEnabled && this.parsedTrace) {
251
- const aiCallTree = AIAssistance.AICallTree.fromEvent(entry, this.parsedTrace);
252
- if (aiCallTree) {
251
+ const callTree = AIAssistance.AICallTree.fromEvent(entry, this.parsedTrace);
252
+ if (callTree) {
253
+ let focus = UI.Context.Context.instance().flavor(AIAssistance.AgentFocus);
254
+ if (focus) {
255
+ focus = focus.withCallTree(callTree);
256
+ } else {
257
+ focus = AIAssistance.AgentFocus.fromCallTree(callTree);
258
+ }
259
+ UI.Context.Context.instance().setFlavor(AIAssistance.AgentFocus, focus);
260
+
253
261
  const action = UI.ActionRegistry.ActionRegistry.instance().getAction(PERF_AI_ACTION_ID);
254
- // The other side of setFlavor is handleTraceEntryNodeFlavorChange() in FreestylerPanel
255
- const context = AIAssistance.AgentFocus.fromCallTree(aiCallTree);
256
- UI.Context.Context.instance().setFlavor(AIAssistance.AgentFocus, context);
257
262
 
258
263
  if (Root.Runtime.hostConfig.devToolsAiSubmenuPrompts?.enabled) {
259
264
  function appendSubmenuPromptAction(
@@ -1510,22 +1510,25 @@ export class TimelineFlameChartView extends Common.ObjectWrapper.eventMixin<Even
1510
1510
  // supports (currently, only main thread events), then set the context's
1511
1511
  // "flavor" to be the AI Call Tree of the active event.
1512
1512
  // This is listened to by the AI Assistance panel to update its state.
1513
- // Note that we do not change the Context back to `null` if the user picks
1514
- // an invalid event - we don't want to reset it back as it may be they are
1515
- // clicking around in order to understand something.
1516
1513
  // We also do this in a rAF to not block the UI updating to show the selected event first.
1517
- if (selectionIsEvent(selection) && this.#parsedTrace) {
1518
- requestAnimationFrame(() => {
1519
- if (!this.#parsedTrace) {
1520
- return;
1521
- }
1522
- const aiCallTree = AIAssistance.AICallTree.fromEvent(selection.event, this.#parsedTrace);
1523
- if (aiCallTree) {
1524
- const context = AIAssistance.AgentFocus.fromCallTree(aiCallTree);
1525
- UI.Context.Context.instance().setFlavor(AIAssistance.AgentFocus, context);
1526
- }
1527
- });
1528
- }
1514
+ requestAnimationFrame(() => {
1515
+ if (!this.#parsedTrace) {
1516
+ return;
1517
+ }
1518
+
1519
+ const callTree =
1520
+ selectionIsEvent(selection) ? AIAssistance.AICallTree.fromEvent(selection.event, this.#parsedTrace) : null;
1521
+ let focus = UI.Context.Context.instance().flavor(AIAssistance.AgentFocus);
1522
+ if (focus) {
1523
+ focus = focus.withCallTree(callTree);
1524
+ } else if (callTree) {
1525
+ focus = AIAssistance.AgentFocus.fromCallTree(callTree);
1526
+ } else {
1527
+ focus = null;
1528
+ }
1529
+
1530
+ UI.Context.Context.instance().setFlavor(AIAssistance.AgentFocus, focus);
1531
+ });
1529
1532
  }
1530
1533
 
1531
1534
  // Only opens the details view of a selection. This is used for Timing Markers. Timing markers replace