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.
- package/docs/contributing/infrastructure.md +131 -82
- package/front_end/Tests.js +3 -29
- package/front_end/core/common/Progress.ts +73 -55
- package/front_end/core/host/GdpClient.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +5 -2
- package/front_end/core/protocol_client/InspectorBackend.ts +2 -0
- package/front_end/core/root/Runtime.ts +0 -1
- package/front_end/core/sdk/CSSMatchedStyles.ts +12 -10
- package/front_end/core/sdk/CSSModel.ts +1 -31
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +27 -7
- package/front_end/core/sdk/DebuggerModel.ts +1 -31
- package/front_end/core/sdk/EnhancedTracesParser.ts +81 -50
- package/front_end/core/sdk/NetworkManager.ts +1 -31
- package/front_end/core/sdk/NetworkRequest.ts +1 -31
- package/front_end/core/sdk/RehydratingConnection.snapshot.txt +1003 -0
- package/front_end/core/sdk/RehydratingConnection.ts +13 -18
- package/front_end/core/sdk/RehydratingObject.ts +8 -31
- package/front_end/core/sdk/RemoteObject.ts +1 -31
- package/front_end/core/sdk/ResourceTreeModel.ts +1 -31
- package/front_end/core/sdk/RuntimeModel.ts +1 -31
- package/front_end/core/sdk/ServiceWorkerManager.ts +1 -31
- package/front_end/core/sdk/SourceMap.ts +1 -31
- package/front_end/core/sdk/TraceObject.ts +8 -3
- package/front_end/entrypoints/main/MainImpl.ts +1 -3
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -3
- package/front_end/models/ai_assistance/ConversationHandler.ts +4 -6
- package/front_end/models/ai_assistance/agents/AiAgent.ts +4 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +110 -76
- package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +178 -85
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +308 -218
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +100 -100
- package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +10 -1
- package/front_end/models/ai_assistance/performance/AIContext.ts +19 -21
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +24 -8
- package/front_end/models/badges/UserBadges.ts +38 -3
- package/front_end/models/bindings/ContentProviderBasedProject.ts +6 -4
- package/front_end/models/breakpoints/BreakpointManager.ts +3 -3
- package/front_end/models/formatter/FormatterWorkerPool.ts +3 -3
- package/front_end/models/har/Writer.ts +11 -11
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +3 -3
- package/front_end/models/persistence/IsolatedFileSystem.ts +4 -4
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +7 -7
- package/front_end/models/persistence/PersistenceImpl.ts +8 -8
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/trace/ModelImpl.ts +2 -16
- package/front_end/models/trace/Processor.ts +15 -9
- package/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +4 -4
- package/front_end/models/trace/handlers/FramesHandler.ts +2 -2
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +7 -10
- package/front_end/models/trace/handlers/MetaHandler.ts +11 -9
- package/front_end/models/trace/handlers/ScreenshotsHandler.ts +1 -1
- package/front_end/models/trace/handlers/ScriptsHandler.ts +5 -5
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +2 -14
- package/front_end/models/trace/handlers/UserTimingsHandler.ts +3 -4
- package/front_end/models/trace/insights/CLSCulprits.ts +1 -1
- package/front_end/models/trace/insights/DocumentLatency.ts +3 -4
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -1
- package/front_end/models/trace/insights/INPBreakdown.ts +1 -1
- package/front_end/models/trace/insights/ImageDelivery.ts +1 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +1 -1
- package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +1 -1
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
- package/front_end/models/trace/insights/types.ts +2 -0
- package/front_end/models/trace/types/TraceEvents.ts +41 -64
- package/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +21 -99
- package/front_end/panels/application/ServiceWorkersView.ts +0 -1
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +2 -3
- package/front_end/panels/common/BadgeNotification.ts +46 -10
- package/front_end/panels/common/GdpSignUpDialog.ts +6 -3
- package/front_end/panels/console/ConsoleView.ts +23 -28
- package/front_end/panels/console/ConsoleViewport.ts +2 -2
- package/front_end/panels/console/consoleView.css +11 -1
- package/front_end/panels/coverage/CoverageView.ts +2 -2
- package/front_end/panels/elements/ComputedStyleWidget.ts +1 -2
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
- package/front_end/panels/elements/LayoutPane.ts +1 -1
- package/front_end/panels/elements/StyleEditorWidget.ts +8 -19
- package/front_end/panels/elements/StylePropertyTreeElement.ts +39 -25
- package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +4 -3
- package/front_end/panels/layer_viewer/Layers3DView.ts +2 -2
- package/front_end/panels/layers/LayerTreeModel.ts +3 -3
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +4 -4
- package/front_end/panels/network/NetworkLogView.ts +6 -2
- package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
- package/front_end/panels/network/NetworkSearchScope.ts +6 -6
- package/front_end/panels/search/SearchResultsPane.ts +32 -47
- package/front_end/panels/search/SearchView.ts +58 -80
- package/front_end/panels/settings/components/SyncSection.ts +7 -2
- package/front_end/panels/sources/OutlineQuickOpen.ts +3 -1
- package/front_end/panels/sources/SourcesSearchScope.ts +4 -4
- package/front_end/panels/sources/TabbedEditorContainer.ts +5 -5
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +10 -5
- package/front_end/panels/timeline/TimelineFlameChartView.ts +18 -15
- package/front_end/panels/timeline/TimelinePanel.ts +41 -22
- package/front_end/panels/timeline/TimelineUIUtils.ts +13 -8
- package/front_end/panels/timeline/TracingLayerTree.ts +4 -5
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +37 -22
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +17 -7
- package/front_end/third_party/axe-core/README.chromium +1 -0
- package/front_end/third_party/codemirror/README.chromium +1 -0
- package/front_end/third_party/codemirror.next/README.chromium +1 -0
- package/front_end/third_party/csp_evaluator/README.chromium +1 -0
- package/front_end/third_party/diff/README.chromium +1 -0
- package/front_end/third_party/i18n/README.chromium +1 -0
- package/front_end/third_party/intl-messageformat/README.chromium +1 -0
- package/front_end/third_party/json5/README.chromium +1 -0
- package/front_end/third_party/legacy-javascript/README.chromium +1 -0
- package/front_end/third_party/lighthouse/README.chromium +1 -0
- package/front_end/third_party/lit/README.chromium +1 -0
- package/front_end/third_party/marked/README.chromium +1 -0
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +2 -23
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +1 -21
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
- package/front_end/third_party/puppeteer-replay/README.chromium +1 -0
- package/front_end/third_party/third-party-web/README.chromium +1 -0
- package/front_end/third_party/vscode.web-custom-data/README.chromium +1 -0
- package/front_end/third_party/wasmparser/README.chromium +1 -0
- package/front_end/third_party/web-vitals/README.chromium +1 -0
- package/front_end/ui/components/text_editor/config.ts +30 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +18 -4
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/GlassPane.ts +7 -3
- package/front_end/ui/legacy/ProgressIndicator.ts +29 -16
- package/front_end/ui/legacy/TabbedPane.ts +2 -2
- package/front_end/ui/legacy/Treeoutline.ts +10 -5
- package/front_end/ui/legacy/UIUtils.ts +42 -10
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +14 -14
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +6 -6
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +3 -29
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +14 -14
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/inspector_overlay/highlight_common.ts +1 -27
- package/inspector_overlay/highlight_grid_common.ts +1 -27
- package/inspector_overlay/tool_highlight.ts +1 -27
- package/inspector_overlay/tool_persistent.ts +1 -27
- package/inspector_overlay/tool_source_order.ts +1 -27
- 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
|
-
|
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
|
-
|
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"
|
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
|
-
#
|
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.#
|
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
|
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.#
|
382
|
+
if (!this.#progress) {
|
379
383
|
return;
|
380
384
|
}
|
381
385
|
|
382
|
-
const finished = !this.#
|
383
|
-
this.#
|
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.#
|
399
|
+
this.#startSearch(searchConfig);
|
397
400
|
}
|
398
401
|
|
399
402
|
#startIndexing(): void {
|
400
403
|
this.#isIndexing = true;
|
401
|
-
if (this.#
|
402
|
-
this.#
|
404
|
+
if (this.#progress) {
|
405
|
+
this.#progress.done = true;
|
403
406
|
}
|
404
|
-
this.#
|
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.#
|
424
|
+
if (searchId !== this.#searchId || !this.#progress) {
|
424
425
|
return;
|
425
426
|
}
|
426
|
-
if (this.#
|
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.#
|
453
|
+
if (searchId !== this.#searchId || !this.#progress) {
|
454
454
|
return;
|
455
455
|
}
|
456
|
-
|
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
|
-
#
|
462
|
+
#startSearch(searchConfig: Workspace.SearchConfig.SearchConfig): void {
|
465
463
|
this.#searchConfig = searchConfig;
|
466
|
-
if (this.#
|
467
|
-
this.#
|
464
|
+
if (this.#progress) {
|
465
|
+
this.#progress.done = true;
|
468
466
|
}
|
469
|
-
this.#
|
470
|
-
|
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.#
|
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.#
|
489
|
-
this.#
|
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(
|
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.
|
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.
|
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
|
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
|
-
|
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
|
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
|
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
|
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
|
252
|
-
if (
|
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
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
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
|