chrome-devtools-frontend 1.0.1732418 → 1.0.1733843

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 (146) hide show
  1. package/docs/get_the_code.md +1 -73
  2. package/front_end/Tests.js +0 -5
  3. package/front_end/core/host/AidaClientTypes.ts +24 -3
  4. package/front_end/core/host/AidaGcaTranslation.ts +29 -1
  5. package/front_end/core/platform/browser/HostRuntime.ts +5 -1
  6. package/front_end/core/sdk/DOMModel.ts +8 -3
  7. package/front_end/design_system_tokens.css +5 -0
  8. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +2 -2
  9. package/front_end/generated/InspectorBackendCommands.ts +5 -5
  10. package/front_end/generated/SupportedCSSProperties.ts +8 -2
  11. package/front_end/generated/protocol.ts +29 -7
  12. package/front_end/models/ai-utils/debug.ts +127 -22
  13. package/front_end/models/ai_assistance/AiConversation.ts +1 -0
  14. package/front_end/models/ai_assistance/README.md +1 -1
  15. package/front_end/models/ai_assistance/agents/AiAgent.ts +69 -11
  16. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -1
  17. package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +4 -3
  18. package/front_end/models/ai_assistance/contexts/LighthouseContext.snapshot.txt +4 -2
  19. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +6 -0
  20. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +2 -0
  21. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +1 -1
  22. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +26 -26
  23. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -1
  24. package/front_end/models/ai_code_completion/ai_code_completion.ts +11 -2
  25. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -1
  26. package/front_end/models/ai_code_generation/ai_code_generation.ts +11 -2
  27. package/front_end/models/trace/LanternComputationData.ts +4 -0
  28. package/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +126 -1
  29. package/front_end/models/trace/lantern/types/Lantern.ts +3 -0
  30. package/front_end/models/web_mcp/WebMCPModel.ts +1 -1
  31. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +65 -15
  32. package/front_end/panels/ai_assistance/ExternalHandler.ts +1 -1
  33. package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +4 -4
  34. package/front_end/panels/ai_assistance/components/chatMessage.css +4 -5
  35. package/front_end/panels/ai_assistance/components/exploreWidget.css +3 -3
  36. package/front_end/panels/application/backgroundServiceView.css +2 -2
  37. package/front_end/panels/application/components/reportsGrid.css +1 -1
  38. package/front_end/panels/application/components/serviceWorkerRouterView.css +2 -2
  39. package/front_end/panels/application/components/trustTokensView.css +1 -1
  40. package/front_end/panels/application/deviceBoundSessionsView.css +1 -1
  41. package/front_end/panels/application/frameDetailsReportView.css +0 -4
  42. package/front_end/panels/application/indexedDBViews.css +0 -4
  43. package/front_end/panels/application/resourcesPanel.css +0 -13
  44. package/front_end/panels/application/serviceWorkerUpdateCycleView.css +3 -3
  45. package/front_end/panels/application/serviceWorkersView.css +3 -2
  46. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +346 -286
  47. package/front_end/panels/comments/CommentsPane.ts +2 -11
  48. package/front_end/panels/common/CommentThreadWidget.ts +11 -3
  49. package/front_end/panels/common/CommentsOverlayWidget.ts +3 -2
  50. package/front_end/panels/console/consoleContextSelector.css +1 -1
  51. package/front_end/panels/console/consolePinPane.css +1 -1
  52. package/front_end/panels/console/consolePrompt.css +4 -2
  53. package/front_end/panels/console/consoleView.css +1 -1
  54. package/front_end/panels/elements/ComputedStyleWidget.ts +8 -19
  55. package/front_end/panels/elements/PropertyRenderer.ts +7 -27
  56. package/front_end/panels/elements/StylePropertyTreeElement.ts +61 -72
  57. package/front_end/panels/elements/components/cssPropertyDocsView.css +1 -1
  58. package/front_end/panels/elements/components/elementsBreadcrumbs.css +1 -1
  59. package/front_end/panels/elements/components/stylePropertyEditor.css +1 -5
  60. package/front_end/panels/elements/layoutPane.css +1 -1
  61. package/front_end/panels/elements/metricsSidebarPane.css +2 -2
  62. package/front_end/panels/elements/propertiesWidget.css +0 -5
  63. package/front_end/panels/elements/stylesSidebarPane.css +3 -2
  64. package/front_end/panels/emulation/deviceModeView.css +3 -3
  65. package/front_end/panels/event_listeners/eventListenersView.css +1 -1
  66. package/front_end/panels/explain/components/consoleInsight.css +2 -2
  67. package/front_end/panels/issues/issuesTree.css +10 -7
  68. package/front_end/panels/layer_viewer/layerTreeOutline.css +1 -1
  69. package/front_end/panels/lighthouse/LighthousePanel.ts +16 -1
  70. package/front_end/panels/lighthouse/lighthousePanel.css +1 -1
  71. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +10 -6
  72. package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +1 -26
  73. package/front_end/panels/linear_memory_inspector/components/valueInterpreterDisplay.css +1 -1
  74. package/front_end/panels/media/playerListView.css +11 -8
  75. package/front_end/panels/media/playerMessagesView.css +9 -5
  76. package/front_end/panels/network/NetworkWaterfallColumn.ts +92 -55
  77. package/front_end/panels/network/networkConfigView.css +3 -3
  78. package/front_end/panels/network/networkLogView.css +5 -4
  79. package/front_end/panels/network/networkManageCustomHeadersView.css +1 -1
  80. package/front_end/panels/network/networkTimingTable.css +4 -8
  81. package/front_end/panels/network/requestPayloadView.css +1 -1
  82. package/front_end/panels/performance_monitor/performanceMonitor.css +1 -1
  83. package/front_end/panels/profiler/ModuleUIStrings.ts +12 -0
  84. package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +114 -18
  85. package/front_end/panels/protocol_monitor/JSONEditor.css +4 -3
  86. package/front_end/panels/recorder/createRecordingView.css +2 -2
  87. package/front_end/panels/recorder/stepEditor.css +1 -1
  88. package/front_end/panels/recorder/stepView.css +0 -7
  89. package/front_end/panels/recorder/timelineSection.css +1 -1
  90. package/front_end/panels/screencast/screencastView.css +1 -1
  91. package/front_end/panels/search/searchResultsPane.css +1 -1
  92. package/front_end/panels/security/mainView.css +2 -2
  93. package/front_end/panels/security/originView.css +1 -1
  94. package/front_end/panels/settings/AISettingsTab.ts +1 -0
  95. package/front_end/panels/sources/NavigatorView.ts +120 -49
  96. package/front_end/panels/sources/breakpointsView.css +3 -3
  97. package/front_end/panels/sources/components/HeadersView.css +2 -2
  98. package/front_end/panels/sources/watchExpressionsSidebarPane.css +2 -1
  99. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +30 -10
  100. package/front_end/panels/timeline/TimelinePanel.ts +24 -3
  101. package/front_end/panels/timeline/components/metricCard.css +1 -1
  102. package/front_end/panels/timeline/components/networkRequestTooltip.css +2 -2
  103. package/front_end/panels/timeline/components/relatedInsightChips.css +1 -1
  104. package/front_end/panels/timeline/timelineFlameChartView.css +4 -4
  105. package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -2
  106. package/front_end/panels/timeline/timelineMiniMap.css +3 -2
  107. package/front_end/panels/web_audio/WebAudioModel.ts +14 -5
  108. package/front_end/panels/web_audio/WebAudioView.ts +34 -1
  109. package/front_end/panels/web_audio/webAudio.css +17 -3
  110. package/front_end/panels/webauthn/webauthnPane.css +2 -4
  111. package/front_end/panels/whats_new/ReleaseNoteText.ts +19 -1
  112. package/front_end/panels/whats_new/ReleaseNoteView.ts +15 -1
  113. package/front_end/panels/whats_new/releaseNoteView.css +49 -0
  114. package/front_end/third_party/chromium/README.chromium +1 -1
  115. package/front_end/third_party/puppeteer-replay/README.chromium +9 -1
  116. package/front_end/third_party/puppeteer-replay/package/lib/main.d.ts +2 -2
  117. package/front_end/ui/components/buttons/button.css +0 -1
  118. package/front_end/ui/components/diff_view/diffView.css +1 -1
  119. package/front_end/ui/components/markdown_view/codeBlock.css +4 -4
  120. package/front_end/ui/components/markdown_view/markdownView.css +3 -7
  121. package/front_end/ui/components/panel_feedback/panelFeedback.css +3 -2
  122. package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +1 -1
  123. package/front_end/ui/components/suggestion_input/suggestionInput.css +2 -2
  124. package/front_end/ui/components/switch/switch.css +2 -1
  125. package/front_end/ui/legacy/TabbedPane.ts +1 -1
  126. package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +10 -3
  127. package/front_end/ui/legacy/components/inline_editor/colorSwatch.css +1 -2
  128. package/front_end/ui/legacy/components/perf_ui/chartViewport.css +1 -1
  129. package/front_end/ui/legacy/components/perf_ui/filmStripView.css +1 -1
  130. package/front_end/ui/legacy/components/perf_ui/flameChart.css +5 -3
  131. package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +7 -4
  132. package/front_end/ui/legacy/components/perf_ui/pieChart.css +0 -1
  133. package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
  134. package/front_end/ui/legacy/inspectorCommon.css +11 -27
  135. package/front_end/ui/legacy/listWidget.css +1 -1
  136. package/front_end/ui/legacy/progressIndicator.css +1 -2
  137. package/front_end/ui/legacy/reportView.css +5 -2
  138. package/front_end/ui/legacy/searchableView.css +3 -2
  139. package/front_end/ui/legacy/suggestBox.css +2 -1
  140. package/front_end/ui/legacy/tabbedPane.css +8 -5
  141. package/front_end/ui/legacy/treeoutline.css +1 -1
  142. package/front_end/ui/legacy/viewContainers.css +1 -1
  143. package/front_end/ui/visual_logging/KnownContextValues.ts +11 -0
  144. package/package.json +1 -1
  145. package/front_end/models/ai_code_completion/debug.ts +0 -33
  146. package/front_end/models/ai_code_generation/debug.ts +0 -33
@@ -1,8 +1,6 @@
1
1
  // Copyright 2014 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
- /* eslint-disable @devtools/no-imperative-dom-api */
5
-
6
4
  import * as Common from '../../core/common/common.js';
7
5
  import * as i18n from '../../core/i18n/i18n.js';
8
6
  import * as Platform from '../../core/platform/platform.js';
@@ -10,7 +8,7 @@ import type * as CPUProfile from '../../models/cpu_profile/cpu_profile.js';
10
8
  import type * as NetworkTimeCalculator from '../../models/network_time_calculator/network_time_calculator.js';
11
9
  import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
12
10
  import * as UI from '../../ui/legacy/legacy.js';
13
- import type {TemplateResult} from '../../ui/lit/lit.js';
11
+ import {Directives, html, render, type TemplateResult} from '../../ui/lit/lit.js';
14
12
 
15
13
  let colorGeneratorInstance: Common.Color.Generator|null = null;
16
14
 
@@ -131,6 +129,22 @@ export class ProfileFlameChartDataProvider implements PerfUI.FlameChart.FlameCha
131
129
  }
132
130
  }
133
131
 
132
+ export interface ProfileFlameChartViewInput {
133
+ overviewPane: OverviewPane;
134
+ mainPane: PerfUI.FlameChart.FlameChart;
135
+ }
136
+
137
+ export type ProfileFlameChartView = (input: ProfileFlameChartViewInput, output: undefined, target: HTMLElement) => void;
138
+
139
+ // clang-format off
140
+ export const DEFAULT_VIEW: ProfileFlameChartView = (input, _output, target) => {
141
+ render(html`
142
+ <devtools-widget class="cpu-profile-flame-chart-overview-pane">${input.overviewPane.element}</devtools-widget>
143
+ <devtools-widget class="vbox flex-auto">${input.mainPane.element}</devtools-widget>
144
+ `, target, {container: {attributes: {id: 'cpu-flame-chart'}}});
145
+ };
146
+ // clang-format on
147
+
134
148
  const ProfileFlameChartBase: Common.ObjectWrapper.EventMixin<PerfUI.FlameChart.EventTypes, typeof UI.Widget.VBox> =
135
149
  Common.ObjectWrapper.eventMixin(
136
150
  UI.Widget.VBox,
@@ -144,21 +158,24 @@ export class ProfileFlameChart extends ProfileFlameChartBase implements UI.Searc
144
158
  readonly dataProvider: ProfileFlameChartDataProvider;
145
159
  searchResults: number[];
146
160
  searchResultIndex = -1;
147
-
148
- constructor(searchableView: UI.SearchableView.SearchableView, dataProvider: ProfileFlameChartDataProvider,
149
- element?: HTMLElement) {
161
+ readonly #view: ProfileFlameChartView;
162
+
163
+ constructor(
164
+ searchableView: UI.SearchableView.SearchableView,
165
+ dataProvider: ProfileFlameChartDataProvider,
166
+ element?: HTMLElement,
167
+ view: ProfileFlameChartView = DEFAULT_VIEW,
168
+ ) {
150
169
  super(element);
151
- this.element.id = 'cpu-flame-chart';
170
+ this.#view = view;
152
171
 
153
172
  this.searchableView = searchableView;
154
173
  this.overviewPane = new OverviewPane(dataProvider);
155
- this.overviewPane.show(this.element);
156
174
 
157
175
  this.mainPane = new PerfUI.FlameChart.FlameChart(dataProvider, this.overviewPane);
158
176
  this.mainPane.setBarHeight(15);
159
177
  this.mainPane.setTextBaseline(4);
160
178
  this.mainPane.setTextPadding(2);
161
- this.mainPane.show(this.element);
162
179
  this.mainPane.addEventListener(PerfUI.FlameChart.Events.ENTRY_SELECTED, this.onEntrySelected, this);
163
180
  this.mainPane.addEventListener(PerfUI.FlameChart.Events.ENTRY_INVOKED, this.onEntryInvoked, this);
164
181
  this.entrySelected = false;
@@ -168,6 +185,22 @@ export class ProfileFlameChart extends ProfileFlameChartBase implements UI.Searc
168
185
  this.searchResults = [];
169
186
  }
170
187
 
188
+ override wasShown(): void {
189
+ super.wasShown();
190
+ this.requestUpdate();
191
+ }
192
+
193
+ override performUpdate(): void {
194
+ this.#view(
195
+ {
196
+ overviewPane: this.overviewPane,
197
+ mainPane: this.mainPane,
198
+ },
199
+ undefined,
200
+ this.contentElement,
201
+ );
202
+ }
203
+
171
204
  override focus(): void {
172
205
  this.mainPane.focus();
173
206
  }
@@ -314,35 +347,92 @@ export class OverviewCalculator implements NetworkTimeCalculator.Calculator {
314
347
  }
315
348
  }
316
349
 
350
+ export interface OverviewPaneViewInput {
351
+ overviewGridElement: HTMLElement;
352
+ }
353
+
354
+ export interface OverviewPaneViewOutput {
355
+ canvas?: HTMLCanvasElement;
356
+ container?: HTMLElement;
357
+ }
358
+
359
+ export type OverviewPaneView = (input: OverviewPaneViewInput, output: OverviewPaneViewOutput, target: HTMLElement) =>
360
+ void;
361
+
362
+ // clang-format off
363
+ export const DEFAULT_OVERVIEW_PANE_VIEW: OverviewPaneView = (input, output, target) => {
364
+ render(html`
365
+ <div class="cpu-profile-flame-chart-overview-container" ${Directives.ref(el => {
366
+ output.container = el as HTMLElement | undefined;
367
+ })}>
368
+ <canvas class="cpu-profile-flame-chart-overview-canvas" ${Directives.ref(el => {
369
+ output.canvas = el as HTMLCanvasElement | undefined;
370
+ })}></canvas>
371
+ ${input.overviewGridElement}
372
+ </div>
373
+ `, target, {container: {classes: ['cpu-profile-flame-chart-overview-pane']}});
374
+ };
375
+ // clang-format on
376
+
317
377
  const OverviewPaneBase: Common.ObjectWrapper.EventMixin<OverviewPaneEventTypes, typeof UI.Widget.VBox> =
318
378
  Common.ObjectWrapper.eventMixin(
319
379
  UI.Widget.VBox,
320
380
  );
321
381
 
322
382
  export class OverviewPane extends OverviewPaneBase implements PerfUI.FlameChart.FlameChartDelegate {
323
- overviewContainer: HTMLElement;
383
+ readonly #view: OverviewPaneView;
384
+ readonly #viewOutput: OverviewPaneViewOutput = {};
324
385
  readonly overviewCalculator: OverviewCalculator;
325
386
  readonly overviewGrid: PerfUI.OverviewGrid.OverviewGrid;
326
- overviewCanvas: HTMLCanvasElement;
327
387
  dataProvider: PerfUI.FlameChart.FlameChartDataProvider;
328
388
  windowTimeLeft?: number;
329
389
  windowTimeRight?: number;
330
390
  updateTimerId?: number;
331
391
 
332
- constructor(dataProvider: PerfUI.FlameChart.FlameChartDataProvider) {
333
- super();
334
- this.element.classList.add('cpu-profile-flame-chart-overview-pane');
335
- this.overviewContainer = this.element.createChild('div', 'cpu-profile-flame-chart-overview-container');
392
+ constructor(
393
+ dataProvider: PerfUI.FlameChart.FlameChartDataProvider,
394
+ element?: HTMLElement,
395
+ view: OverviewPaneView = DEFAULT_OVERVIEW_PANE_VIEW,
396
+ ) {
397
+ super(element);
398
+ this.#view = view;
336
399
  this.overviewCalculator = new OverviewCalculator(dataProvider.formatValue);
337
400
  this.overviewGrid = new PerfUI.OverviewGrid.OverviewGrid('cpu-profile-flame-chart', this.overviewCalculator);
338
401
  this.overviewGrid.element.classList.add('fill');
339
- this.overviewCanvas = this.overviewContainer.createChild('canvas', 'cpu-profile-flame-chart-overview-canvas');
340
- this.overviewContainer.appendChild(this.overviewGrid.element);
341
402
  this.dataProvider = dataProvider;
342
403
  this.overviewGrid.addEventListener(
343
404
  PerfUI.OverviewGrid.Events.WINDOW_CHANGED_WITH_POSITION, this.onWindowChanged, this);
344
405
  }
345
406
 
407
+ get overviewContainer(): HTMLElement {
408
+ if (!this.#viewOutput.container) {
409
+ this.performUpdate();
410
+ }
411
+ return this.#viewOutput.container ?? this.contentElement;
412
+ }
413
+
414
+ get overviewCanvas(): HTMLCanvasElement|undefined {
415
+ if (!this.#viewOutput.canvas) {
416
+ this.performUpdate();
417
+ }
418
+ return this.#viewOutput.canvas;
419
+ }
420
+
421
+ override wasShown(): void {
422
+ super.wasShown();
423
+ this.requestUpdate();
424
+ }
425
+
426
+ override performUpdate(): void {
427
+ this.#view(
428
+ {
429
+ overviewGridElement: this.overviewGrid.element,
430
+ },
431
+ this.#viewOutput,
432
+ this.contentElement,
433
+ );
434
+ }
435
+
346
436
  windowChanged(windowStartTime: number, windowEndTime: number): void {
347
437
  this.selectRange(windowStartTime, windowEndTime);
348
438
  }
@@ -386,7 +476,7 @@ export class OverviewPane extends OverviewPaneBase implements PerfUI.FlameChart.
386
476
  update(): void {
387
477
  this.updateTimerId = 0;
388
478
  const timelineData = this.timelineData();
389
- if (!timelineData) {
479
+ if (!timelineData || !this.overviewCanvas) {
390
480
  return;
391
481
  }
392
482
  this.resetCanvas(
@@ -397,6 +487,9 @@ export class OverviewPane extends OverviewPaneBase implements PerfUI.FlameChart.
397
487
  }
398
488
 
399
489
  drawOverviewCanvas(): void {
490
+ if (!this.overviewCanvas) {
491
+ return;
492
+ }
400
493
  const canvasWidth = this.overviewCanvas.width;
401
494
  const canvasHeight = this.overviewCanvas.height;
402
495
  const drawData = this.calculateDrawData(canvasWidth);
@@ -450,6 +543,9 @@ export class OverviewPane extends OverviewPaneBase implements PerfUI.FlameChart.
450
543
  }
451
544
 
452
545
  resetCanvas(width: number, height: number): void {
546
+ if (!this.overviewCanvas) {
547
+ return;
548
+ }
453
549
  const ratio = window.devicePixelRatio;
454
550
  this.overviewCanvas.width = width * ratio;
455
551
  this.overviewCanvas.height = height * ratio;
@@ -22,7 +22,8 @@
22
22
  }
23
23
 
24
24
  .warning-icon {
25
- margin-left: -18px;
25
+ /* -18px: shift left by the 14px small icon (--sys-size-7) plus its 4px right margin (--sys-size-3). */
26
+ margin-left: calc(-1 * (var(--sys-size-7) + var(--sys-size-3)));
26
27
  margin-right: var(--sys-size-3);
27
28
  }
28
29
 
@@ -38,8 +39,8 @@
38
39
  font-family: var(--monospace-font-family);
39
40
  font-size: var(--monospace-font-size);
40
41
  align-items: center;
41
- line-height: 18px;
42
- margin-top: 3px;
42
+ line-height: var(--sys-typescale-body4-line-height);
43
+ margin-top: var(--sys-size-2);
43
44
  }
44
45
 
45
46
  .separator {
@@ -30,14 +30,14 @@ h1 {
30
30
  font-weight: 500;
31
31
  font-size: var(--sys-typescale-body5-size);
32
32
  line-height: var(--sys-typescale-body5-line-height);
33
- letter-spacing: 0.8px;
33
+ letter-spacing: 0.07em;
34
34
  text-transform: uppercase;
35
35
  color: var(--sys-color-secondary);
36
36
  margin-bottom: var(--sys-size-5);
37
37
  margin-top: var(--sys-size-13);
38
38
  display: flex;
39
39
  align-items: center;
40
- gap: 3px;
40
+ gap: var(--sys-size-3);
41
41
  }
42
42
 
43
43
  .footer {
@@ -64,7 +64,7 @@
64
64
  }
65
65
 
66
66
  .gap.row {
67
- gap: 5px;
67
+ gap: var(--sys-size-3);
68
68
  }
69
69
 
70
70
  .gap.row devtools-button {
@@ -62,13 +62,6 @@
62
62
  cy: var(--sys-size-5);
63
63
  }
64
64
 
65
- .is-start-of-group:not(:first-of-type) .circle-icon {
66
- r: 7px;
67
- fill: var(--sys-color-cdt-base-container);
68
- stroke: var(--sys-color-primary);
69
- stroke-width: var(--sys-size-2);
70
- }
71
-
72
65
  .step.is-success .circle-icon {
73
66
  fill: var(--sys-color-primary);
74
67
  stroke: var(--sys-color-primary);
@@ -72,7 +72,7 @@
72
72
  left: var(--sys-size-3);
73
73
  display: block;
74
74
  transform: translateX(-50%);
75
- top: 18px;
75
+ top: var(--sys-size-8);
76
76
  height: 100%;
77
77
  z-index: 1; /* We want this to be below of `.overlay` for stopped case */
78
78
  }
@@ -29,7 +29,7 @@
29
29
  .screencast-navigation input {
30
30
  flex: 1;
31
31
  margin: var(--sys-size-2);
32
- max-height: 19px;
32
+ max-height: var(--sys-size-9);
33
33
  }
34
34
 
35
35
  .screencast-navigation .progress {
@@ -91,7 +91,7 @@ li.search-match .search-match-line-number {
91
91
  vertical-align: top;
92
92
  word-break: normal;
93
93
  padding: var(--sys-size-2) var(--sys-size-3) var(--sys-size-2) var(--sys-size-4);
94
- margin-right: 5px;
94
+ margin-right: var(--sys-size-3);
95
95
  }
96
96
 
97
97
  .tree-outline .devtools-link {
@@ -18,7 +18,7 @@
18
18
  }
19
19
 
20
20
  .security-summary-section-title {
21
- font-size: 15px;
21
+ font-size: var(--sys-typescale-headline4-size);
22
22
  margin: var(--sys-size-6) var(--sys-size-8);
23
23
  user-select: text;
24
24
  }
@@ -154,7 +154,7 @@
154
154
  .security-explanation-text {
155
155
  flex: auto;
156
156
  white-space: normal;
157
- max-width: 400px;
157
+ max-width: var(--sys-size-33);
158
158
  }
159
159
 
160
160
  .origin-button {
@@ -77,7 +77,7 @@
77
77
 
78
78
  .security-origin-view .details-table-row > td:first-child {
79
79
  color: var(--sys-color-token-subtle);
80
- width: calc(120px + 1em);
80
+ width: calc(var(--sys-size-21) + 1em); /* 128px label column + 1em right padding */
81
81
  text-align: right;
82
82
  padding-right: 1em;
83
83
  }
@@ -609,6 +609,7 @@ export class AISettingsTab extends UI.Widget.VBox {
609
609
 
610
610
  #removeAllowedTool(name: AiAssistanceModel.Tool.ToolName): void {
611
611
  this.#alwaysAllowedTools.remove(name);
612
+ void VisualLogging.logFunctionCall('ai-permission-revoked', Platform.StringUtilities.toKebabCase(name));
612
613
  }
613
614
 
614
615
  /**
@@ -318,6 +318,25 @@ export function renderGroupTrailingIcons(project: Workspace.Workspace.Project|nu
318
318
  return [];
319
319
  }
320
320
 
321
+ export interface SourceTitleViewInput {
322
+ title: string;
323
+ editing: boolean;
324
+ onCommit: (newTitle: string) => void;
325
+ onCancel: () => void;
326
+ }
327
+
328
+ export const renderSourceTitle = (input: SourceTitleViewInput, _output: undefined, target: HTMLElement): void => {
329
+ // clang-format off
330
+ render(html`
331
+ <devtools-prompt
332
+ value=${input.title}
333
+ ?editing=${input.editing}
334
+ @commit=${(event: UI.TextPrompt.TextPromptElement.CommitEvent) => input.onCommit(event.detail)}
335
+ @cancel=${input.onCancel}
336
+ >${input.title}</devtools-prompt>`, target);
337
+ // clang-format on
338
+ };
339
+
321
340
  export const enum Events {
322
341
  UI_SOURCE_CODE_ADDED = 'ui-source-code-added',
323
342
  SOURCE_SELECTED = 'source-selected',
@@ -363,6 +382,7 @@ export class NavigatorView extends NavigatorViewBase implements SDK.TargetManage
363
382
  private selectedNode: NavigatorTreeNode|null = null;
364
383
  private expandedNodes = new WeakSet<NavigatorTreeNode>();
365
384
  private readonly treeElementNodes = new WeakMap<UI.TreeOutline.TreeElement, NavigatorTreeNode>();
385
+ #renamingNode: NavigatorUISourceCodeTreeNode|null = null;
366
386
  #view: View;
367
387
 
368
388
  constructor(
@@ -1101,11 +1121,11 @@ export class NavigatorView extends NavigatorViewBase implements SDK.TargetManage
1101
1121
  return null;
1102
1122
  }
1103
1123
  if (this.selectedNode) {
1104
- // If the tree outline is being marked as "being edited" (i.e. we're renaming a file
1105
- // or choosing the name for a new snippet), we shall not proceed with revealing here,
1106
- // as that will steal focus from the input widget and thus cancel editing. The
1107
- // test/e2e/snippets/breakpoint.test.ts exercises this.
1108
- if (UI.UIUtils.isBeingEdited(this.scriptsTree.element)) {
1124
+ // If a file is currently being renamed (or choosing the name for a new snippet),
1125
+ // we shall not proceed with revealing here, as that will steal focus from the
1126
+ // input widget and thus cancel editing. The test/e2e/snippets/breakpoint.test.ts
1127
+ // exercises this.
1128
+ if (this.isRenaming()) {
1109
1129
  return null;
1110
1130
  }
1111
1131
  this.selectedNode.treeNode().deselect();
@@ -1215,6 +1235,7 @@ export class NavigatorView extends NavigatorViewBase implements SDK.TargetManage
1215
1235
  this.scriptsTree.removeChildren();
1216
1236
  this.scriptsTree.setFocusable(false);
1217
1237
  this.selectedNode = null;
1238
+ this.#renamingNode = null;
1218
1239
  this.expandedNodes = new WeakSet();
1219
1240
  this.uiSourceCodeNodes.clear();
1220
1241
  this.subfolderNodes.clear();
@@ -1286,8 +1307,21 @@ export class NavigatorView extends NavigatorViewBase implements SDK.TargetManage
1286
1307
  if (!node.uiSourceCode().canRename() || !node.treeElement) {
1287
1308
  return false;
1288
1309
  }
1289
- return this.selectedNode === node && this.scriptsTree.element.hasFocus() &&
1290
- !UI.UIUtils.isBeingEdited(this.scriptsTree.element);
1310
+ return this.selectedNode === node && this.scriptsTree.element.hasFocus() && !this.isRenaming();
1311
+ }
1312
+
1313
+ startRenamingNode(node: NavigatorUISourceCodeTreeNode): void {
1314
+ this.#renamingNode = node;
1315
+ }
1316
+
1317
+ stopRenamingNode(node: NavigatorUISourceCodeTreeNode): void {
1318
+ if (this.#renamingNode === node) {
1319
+ this.#renamingNode = null;
1320
+ }
1321
+ }
1322
+
1323
+ isRenaming(): boolean {
1324
+ return this.#renamingNode !== null;
1291
1325
  }
1292
1326
 
1293
1327
  handleFileContextMenu(event: Event, node: NavigatorUISourceCodeTreeNode): void {
@@ -1838,6 +1872,9 @@ export class NavigatorRootTreeNode extends NavigatorTreeNode {
1838
1872
  export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
1839
1873
  #uiSourceCode: Workspace.UISourceCode.UISourceCode;
1840
1874
  treeElement: UI.TreeOutline.TreeElement|null;
1875
+ isEditing = false;
1876
+ #renameCallback?: ((committed: boolean) => void);
1877
+ #disposed = false;
1841
1878
  private eventListeners: Common.EventTarget.EventDescriptor[];
1842
1879
  readonly #frame: SDK.ResourceTreeModel.ResourceTreeFrame|null;
1843
1880
  constructor(
@@ -1901,6 +1938,7 @@ export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
1901
1938
  }
1902
1939
 
1903
1940
  this.treeElement = new UI.TreeOutline.TreeElement('', false, this.#uiSourceCode.contentType().name());
1941
+ this.treeElement.title = this.treeElement.titleElement;
1904
1942
  this.treeElement.listItemElement.classList.add(
1905
1943
  'navigator-' + this.#uiSourceCode.contentType().name() + '-tree-item', 'navigator-file-tree-item');
1906
1944
  this.treeElement.listItemElement.draggable = true;
@@ -1970,7 +2008,13 @@ export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
1970
2008
  return;
1971
2009
  }
1972
2010
 
1973
- this.treeElement.title = this.title;
2011
+ renderSourceTitle({
2012
+ title: this.title,
2013
+ editing: this.isEditing,
2014
+ onCommit: this.#handlePromptCommit.bind(this),
2015
+ onCancel: this.#handlePromptCancel.bind(this),
2016
+ },
2017
+ undefined, this.treeElement.titleElement as HTMLElement);
1974
2018
  this.updateIcon();
1975
2019
  this.updateTrailingIcons();
1976
2020
 
@@ -2013,6 +2057,16 @@ export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
2013
2057
 
2014
2058
  override dispose(): void {
2015
2059
  Common.EventTarget.removeEventListeners(this.eventListeners);
2060
+ if (this.isEditing) {
2061
+ this.isEditing = false;
2062
+ this.navigatorView.stopRenamingNode(this);
2063
+ }
2064
+ const callback = this.#renameCallback;
2065
+ this.#renameCallback = undefined;
2066
+ if (callback) {
2067
+ callback(false);
2068
+ }
2069
+ this.#disposed = true;
2016
2070
  }
2017
2071
 
2018
2072
  reveal(select?: boolean): void {
@@ -2029,7 +2083,7 @@ export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
2029
2083
  }
2030
2084
 
2031
2085
  rename(callback?: ((committed: boolean) => void)): void {
2032
- if (!this.treeElement) {
2086
+ if (this.#disposed || !this.treeElement) {
2033
2087
  return;
2034
2088
  }
2035
2089
 
@@ -2039,51 +2093,68 @@ export class NavigatorUISourceCodeTreeNode extends NavigatorTreeNode {
2039
2093
  return;
2040
2094
  }
2041
2095
 
2042
- // Tree outline should be marked as edited as well as the tree element to prevent search from starting.
2043
- const treeOutlineElement = this.treeElement.treeOutline.element;
2044
- UI.UIUtils.markBeingEdited(treeOutlineElement, true);
2045
-
2046
- const commitHandler = (_element: Element, newTitle: string, oldTitle: string|null): void => {
2047
- if (newTitle !== oldTitle) {
2048
- if (this.treeElement) {
2049
- this.treeElement.title = newTitle;
2050
- }
2051
- // necessary cast to RawPathString as alternative would be altering type of Config<T>
2052
- void this.#uiSourceCode.rename(newTitle as Platform.DevToolsPath.RawPathString).then(renameCallback);
2053
- return;
2054
- }
2055
- afterEditing(true);
2056
- };
2096
+ this.#renameCallback = callback;
2097
+ this.navigatorView.startRenamingNode(this);
2098
+ this.isEditing = true;
2099
+ this.updateTitle(true);
2100
+ }
2057
2101
 
2058
- const renameCallback = (success: boolean): void => {
2059
- if (!success) {
2060
- UI.UIUtils.markBeingEdited(treeOutlineElement, false);
2061
- this.updateTitle();
2062
- this.rename(callback);
2063
- return;
2064
- }
2065
- if (this.treeElement) {
2066
- const {parent} = this.treeElement;
2067
- if (parent) {
2068
- parent.removeChild(this.treeElement);
2069
- parent.appendChild(this.treeElement);
2070
- this.navigatorView.selectNode(this);
2071
- }
2072
- }
2073
- afterEditing(true);
2074
- };
2102
+ #handlePromptCommit(newTitle: string): void {
2103
+ if (this.#disposed || !this.treeElement?.treeOutline) {
2104
+ return;
2105
+ }
2106
+ const oldTitle = this.title;
2107
+ if (newTitle !== oldTitle) {
2108
+ this.isEditing = false;
2109
+ this.title = newTitle;
2110
+ this.navigatorView.stopRenamingNode(this);
2111
+ this.updateTreeElement();
2112
+ // necessary cast to RawPathString as alternative would be altering type of Config<T>
2113
+ void this.#uiSourceCode.rename(newTitle as Platform.DevToolsPath.RawPathString)
2114
+ .then(this.#handleRenameCallback.bind(this));
2115
+ return;
2116
+ }
2117
+ this.#afterEditing(true);
2118
+ }
2075
2119
 
2076
- const afterEditing = (committed: boolean): void => {
2077
- UI.UIUtils.markBeingEdited(treeOutlineElement, false);
2120
+ #handleRenameCallback(success: boolean): void {
2121
+ if (this.#disposed) {
2122
+ return;
2123
+ }
2124
+ if (!success) {
2125
+ this.isEditing = false;
2126
+ this.navigatorView.stopRenamingNode(this);
2078
2127
  this.updateTitle();
2079
- if (callback) {
2080
- callback(committed);
2128
+ this.rename(this.#renameCallback);
2129
+ return;
2130
+ }
2131
+ if (this.treeElement) {
2132
+ const {parent} = this.treeElement;
2133
+ if (parent) {
2134
+ parent.removeChild(this.treeElement);
2135
+ parent.appendChild(this.treeElement);
2136
+ this.navigatorView.selectNode(this);
2081
2137
  }
2082
- };
2138
+ }
2139
+ this.#afterEditing(true);
2140
+ }
2083
2141
 
2084
- this.updateTitle(true);
2085
- this.treeElement.startEditingTitle(
2086
- new UI.InplaceEditor.Config(commitHandler, () => afterEditing(false), undefined));
2142
+ #handlePromptCancel(): void {
2143
+ if (this.#disposed) {
2144
+ return;
2145
+ }
2146
+ this.#afterEditing(false);
2147
+ }
2148
+
2149
+ #afterEditing(committed: boolean): void {
2150
+ this.isEditing = false;
2151
+ this.navigatorView.stopRenamingNode(this);
2152
+ this.updateTitle();
2153
+ const callback = this.#renameCallback;
2154
+ this.#renameCallback = undefined;
2155
+ if (callback) {
2156
+ callback(committed);
2157
+ }
2087
2158
  }
2088
2159
  }
2089
2160
 
@@ -120,8 +120,8 @@
120
120
 
121
121
  button {
122
122
  cursor: pointer;
123
- width: 13px;
124
- height: 13px;
123
+ width: var(--sys-size-7);
124
+ height: var(--sys-size-7);
125
125
  border: none;
126
126
  background-color: transparent;
127
127
  display: none;
@@ -230,7 +230,7 @@
230
230
  }
231
231
 
232
232
  .pause-on-uncaught-exceptions {
233
- margin-top: 3px;
233
+ margin-top: var(--sys-size-2);
234
234
  }
235
235
 
236
236
  .pause-on-caught-exceptions {
@@ -41,8 +41,8 @@
41
41
  cursor: text;
42
42
  color: var(--sys-color-on-surface);
43
43
  overflow-wrap: break-word;
44
- min-height: 18px;
45
- line-height: 18px;
44
+ min-height: var(--sys-size-8);
45
+ line-height: var(--sys-size-8);
46
46
  min-width: 0.5em;
47
47
  background: transparent;
48
48
  border: none;
@@ -109,7 +109,8 @@ li.watch-expression-tree-item > span.tree-element-title {
109
109
  .watch-expression-header {
110
110
  flex: auto;
111
111
  margin-left: calc(-1 * var(--sys-size-8));
112
- padding-left: 15px;
112
+ /* 16px (--sys-size-8) negative margin offset minus 1px (--sys-size-1) object header title margin */
113
+ padding-left: calc(var(--sys-size-8) - var(--sys-size-1));
113
114
  }
114
115
 
115
116
  li.watch-expression-tree-item {