chrome-devtools-frontend 1.0.1598808 → 1.0.1601661

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 (161) hide show
  1. package/.agents/README.md +13 -0
  2. package/{agents/prompts/creating-a-model.md → .agents/skills/creating-a-model/SKILL.md} +7 -1
  3. package/{agents/prompts/devtools-imports.md → .agents/skills/devtools-imports/SKILL.md} +10 -5
  4. package/{agents/prompts/merging-devtools-module.md → .agents/skills/merging-devtools-module/SKILL.md} +5 -0
  5. package/{agents/prompts/ui-widgets.md → .agents/skills/ui-widgets/SKILL.md} +5 -0
  6. package/{agents/prompts/verification.md → .agents/skills/verification/SKILL.md} +5 -0
  7. package/front_end/core/common/Settings.ts +24 -1
  8. package/front_end/core/dom_extension/DOMExtension.ts +1 -0
  9. package/front_end/core/host/AidaClient.ts +5 -2
  10. package/front_end/core/host/AidaGcaTranslation.ts +377 -0
  11. package/front_end/core/host/GcaTypes.ts +520 -0
  12. package/front_end/core/host/UserMetrics.ts +0 -3
  13. package/front_end/core/host/host.ts +4 -0
  14. package/front_end/core/root/ExperimentNames.ts +0 -3
  15. package/front_end/core/sdk/CPUThrottlingManager.ts +12 -9
  16. package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
  17. package/front_end/core/sdk/SourceMap.ts +4 -2
  18. package/front_end/entrypoints/main/MainImpl.ts +1 -12
  19. package/front_end/generated/Deprecation.ts +16 -0
  20. package/front_end/generated/InspectorBackendCommands.ts +4 -6
  21. package/front_end/generated/protocol.ts +46 -77
  22. package/front_end/models/ai_assistance/AiConversation.ts +49 -22
  23. package/front_end/models/ai_assistance/AiHistoryStorage.snapshot.txt +1 -1
  24. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -0
  25. package/front_end/models/ai_assistance/ConversationHandler.ts +16 -11
  26. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +76 -36
  27. package/front_end/models/ai_assistance/agents/AiAgent.ts +26 -2
  28. package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +0 -1
  29. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +11 -0
  30. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +39 -0
  31. package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +53 -12
  32. package/front_end/models/ai_assistance/agents/FileAgent.ts +0 -15
  33. package/front_end/models/ai_assistance/agents/NetworkAgent.ts +0 -5
  34. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +57 -0
  35. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +87 -15
  36. package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +0 -10
  37. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -6
  38. package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -5
  39. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  40. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +84 -0
  41. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +172 -0
  42. package/front_end/models/breakpoints/BreakpointManager.ts +20 -12
  43. package/front_end/models/emulation/DeviceModeModel.ts +5 -1
  44. package/front_end/models/emulation/EmulatedDevices.ts +3 -2
  45. package/front_end/models/javascript_metadata/NativeFunctions.js +60 -0
  46. package/front_end/models/lighthouse/LighthouseReporterTypes.ts +104 -10
  47. package/front_end/models/lighthouse/RunTypes.ts +42 -0
  48. package/front_end/models/lighthouse/lighthouse.ts +2 -0
  49. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +59 -35
  50. package/front_end/models/stack_trace/StackTrace.ts +5 -0
  51. package/front_end/models/stack_trace/StackTraceImpl.ts +7 -1
  52. package/front_end/models/stack_trace/StackTraceModel.ts +2 -1
  53. package/front_end/models/stack_trace/stack_trace.ts +4 -0
  54. package/front_end/models/trace/ModelImpl.ts +4 -0
  55. package/front_end/models/trace/helpers/SamplesIntegrator.ts +1 -8
  56. package/front_end/models/trace/types/Configuration.ts +0 -5
  57. package/front_end/panels/accessibility/AccessibilityNodeView.ts +7 -3
  58. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +163 -74
  59. package/front_end/panels/ai_assistance/ExportConversation.ts +25 -0
  60. package/front_end/panels/ai_assistance/ai_assistance.ts +2 -0
  61. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -0
  62. package/front_end/panels/ai_assistance/components/ChatMessage.ts +120 -32
  63. package/front_end/panels/ai_assistance/components/ChatView.ts +44 -0
  64. package/front_end/panels/ai_assistance/components/ExportForAgentsDialog.ts +240 -0
  65. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +4 -12
  66. package/front_end/panels/ai_assistance/components/StylingAgentMarkdownRenderer.ts +5 -27
  67. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +115 -17
  68. package/front_end/panels/ai_assistance/components/chatMessage.css +65 -1
  69. package/front_end/panels/ai_assistance/components/chatView.css +8 -0
  70. package/front_end/panels/ai_assistance/components/exportForAgentsDialog.css +82 -0
  71. package/front_end/panels/ai_assistance/components/walkthroughView.css +9 -1
  72. package/front_end/panels/animation/AnimationTimeline.ts +5 -5
  73. package/front_end/panels/application/AppManifestView.ts +13 -7
  74. package/front_end/panels/application/FrameDetailsView.ts +4 -4
  75. package/front_end/panels/application/preloading/PreloadingView.ts +2 -4
  76. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +6 -3
  77. package/front_end/panels/application/preloading/components/PreloadingString.ts +15 -2
  78. package/front_end/panels/application/preloading/helper/PreloadingForward.ts +31 -2
  79. package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +3 -2
  80. package/front_end/panels/common/DOMLinkifier.ts +10 -8
  81. package/front_end/panels/console/ConsoleView.ts +24 -2
  82. package/front_end/panels/console/ConsoleViewMessage.ts +22 -23
  83. package/front_end/panels/console/console.ts +0 -2
  84. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +5 -5
  85. package/front_end/panels/elements/ElementsTreeElement.ts +2 -3
  86. package/front_end/panels/elements/PropertiesWidget.ts +5 -3
  87. package/front_end/panels/elements/StandaloneStylesContainer.ts +21 -9
  88. package/front_end/panels/elements/StylePropertiesSection.ts +98 -50
  89. package/front_end/panels/elements/StylePropertyTreeElement.ts +38 -4
  90. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +43 -35
  91. package/front_end/panels/elements/StylesSidebarPane.ts +154 -24
  92. package/front_end/panels/elements/components/ComputedStyleTrace.ts +3 -2
  93. package/front_end/panels/event_listeners/EventListenersView.ts +16 -4
  94. package/front_end/panels/explain/components/ConsoleInsight.ts +6 -9
  95. package/front_end/panels/explain/explain-meta.ts +5 -0
  96. package/front_end/panels/issues/AffectedResourcesView.ts +5 -9
  97. package/front_end/panels/issues/AffectedSelectivePermissionsInterventionView.ts +1 -1
  98. package/front_end/panels/lighthouse/LighthouseController.ts +154 -164
  99. package/front_end/panels/lighthouse/LighthousePanel.ts +5 -9
  100. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +1 -0
  101. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +9 -6
  102. package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -6
  103. package/front_end/panels/lighthouse/LighthouseStatusView.ts +32 -8
  104. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +7 -3
  105. package/front_end/panels/network/NetworkDataGridNode.ts +34 -0
  106. package/front_end/panels/network/NetworkLogViewColumns.ts +10 -0
  107. package/front_end/panels/network/RequestPayloadView.ts +4 -1
  108. package/front_end/panels/network/RequestTimingView.ts +8 -2
  109. package/front_end/panels/performance_monitor/performanceMonitor.css +6 -4
  110. package/front_end/panels/recorder/RecorderController.ts +52 -14
  111. package/front_end/panels/recorder/components/RecordingView.ts +2 -1
  112. package/front_end/panels/recorder/models/RecordingStorage.ts +15 -20
  113. package/front_end/panels/sensors/SensorsView.ts +333 -157
  114. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +18 -4
  115. package/front_end/panels/sources/DebuggerPausedMessage.ts +6 -6
  116. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -3
  117. package/front_end/panels/sources/NavigatorView.ts +11 -7
  118. package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
  119. package/front_end/panels/sources/SourcesPanel.ts +12 -34
  120. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +5 -1
  121. package/front_end/panels/sources/sources-meta.ts +6 -0
  122. package/front_end/panels/timeline/StatusDialog.ts +159 -83
  123. package/front_end/panels/timeline/ThirdPartyTreeView.ts +6 -2
  124. package/front_end/panels/timeline/TimelineController.ts +0 -4
  125. package/front_end/panels/timeline/TimelineDetailsView.ts +35 -3
  126. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +6 -1
  127. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +9 -4
  128. package/front_end/panels/timeline/TimelinePanel.ts +36 -11
  129. package/front_end/panels/timeline/TimelineTreeView.ts +14 -3
  130. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -57
  131. package/front_end/panels/timeline/components/InteractionBreakdown.ts +2 -1
  132. package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -2
  133. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +3 -7
  134. package/front_end/panels/timeline/components/Sidebar.ts +11 -19
  135. package/front_end/panels/timeline/components/SidebarInsightsTab.ts +2 -1
  136. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +60 -27
  137. package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +66 -0
  138. package/front_end/panels/timeline/components/TimelineSummary.ts +7 -19
  139. package/front_end/panels/timeline/components/components.ts +2 -0
  140. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +55 -28
  141. package/front_end/panels/timeline/components/insights/NodeLink.ts +3 -3
  142. package/front_end/panels/timeline/components/insights/baseInsightComponent.css +7 -0
  143. package/front_end/panels/timeline/components/insights/insights.ts +0 -2
  144. package/front_end/panels/timeline/components/timelineRangeSummaryView.css +20 -0
  145. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +7 -7
  146. package/front_end/panels/timeline/timeline-meta.ts +11 -0
  147. package/front_end/panels/timeline/timelineDetailsView.css +0 -9
  148. package/front_end/third_party/chromium/README.chromium +1 -1
  149. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +11 -2
  150. package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +11 -2
  151. package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +65 -4
  152. package/front_end/ui/kit/link/link.css +2 -2
  153. package/front_end/ui/legacy/Widget.ts +5 -3
  154. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +7 -2
  155. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +57 -35
  156. package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +1 -0
  157. package/front_end/ui/visual_logging/KnownContextValues.ts +6 -1
  158. package/package.json +1 -1
  159. package/agents/prompts/README.md +0 -18
  160. package/front_end/panels/timeline/components/insights/InsightRenderer.ts +0 -93
  161. /package/front_end/{panels/console → models/stack_trace}/ErrorStackParser.ts +0 -0
@@ -8,7 +8,6 @@ import * as SDK from '../../core/sdk/sdk.js';
8
8
  import * as Protocol from '../../generated/protocol.js';
9
9
  import type * as Bindings from '../../models/bindings/bindings.js';
10
10
  import type * as BreakpointManager from '../../models/breakpoints/breakpoints.js';
11
- import * as uiI18n from '../../ui/i18n/i18n.js';
12
11
  import * as UI from '../../ui/legacy/legacy.js';
13
12
  import * as Lit from '../../ui/lit/lit.js';
14
13
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
@@ -117,6 +116,7 @@ const UIStrings = {
117
116
  const str_ = i18n.i18n.registerUIStrings('panels/sources/DebuggerPausedMessage.ts', UIStrings);
118
117
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
119
118
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
119
+ const i18nTemplate = Lit.i18nTemplate.bind(undefined, str_);
120
120
 
121
121
  interface DOMBreakpointData {
122
122
  type: Protocol.DOMDebugger.DOMBreakpointType;
@@ -134,22 +134,22 @@ interface ViewInput {
134
134
  }
135
135
 
136
136
  function domBreakpointSubtext(data: DOMBreakpointData): Lit.LitTemplate {
137
- let messageElement: HTMLElement|undefined;
137
+ let message: Lit.LitTemplate = Lit.nothing;
138
138
  if (data.targetNode) {
139
139
  const targetNodeLink = PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(data.targetNode);
140
140
  if (data.insertion) {
141
141
  if (data.targetNode === data.node) {
142
- messageElement = uiI18n.getFormatLocalizedString(str_, UIStrings.childSAdded, {PH1: targetNodeLink});
142
+ message = i18nTemplate(UIStrings.childSAdded, {PH1: html`${targetNodeLink}`});
143
143
  } else {
144
- messageElement = uiI18n.getFormatLocalizedString(str_, UIStrings.descendantSAdded, {PH1: targetNodeLink});
144
+ message = i18nTemplate(UIStrings.descendantSAdded, {PH1: html`${targetNodeLink}`});
145
145
  }
146
146
  } else {
147
- messageElement = uiI18n.getFormatLocalizedString(str_, UIStrings.descendantSRemoved, {PH1: targetNodeLink});
147
+ message = i18nTemplate(UIStrings.descendantSRemoved, {PH1: html`${targetNodeLink}`});
148
148
  }
149
149
  }
150
150
  return html`
151
151
  ${PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(data.node)}
152
- ${data.targetNode ? html`<br/>${messageElement}` : nothing}
152
+ ${data.targetNode ? html`<br/>${message}` : nothing}
153
153
  `;
154
154
  }
155
155
 
@@ -4,9 +4,8 @@
4
4
 
5
5
  import '../../ui/components/highlighting/highlighting.js';
6
6
 
7
- import type * as Common from '../../core/common/common.js';
7
+ import * as Common from '../../core/common/common.js';
8
8
  import * as i18n from '../../core/i18n/i18n.js';
9
- import * as Root from '../../core/root/root.js';
10
9
  import * as Persistence from '../../models/persistence/persistence.js';
11
10
  import * as Workspace from '../../models/workspace/workspace.js';
12
11
  import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';
@@ -74,7 +73,7 @@ export class FilteredUISourceCodeListProvider extends QuickOpen.FilteredListWidg
74
73
  if (this.uiSourceCodeIds.has(uiSourceCode.canonicalScriptId())) {
75
74
  return false;
76
75
  }
77
- if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.JUST_MY_CODE) &&
76
+ if (Common.Settings.Settings.instance().moduleSetting('navigator-just-my-code').get() &&
78
77
  Workspace.IgnoreListManager.IgnoreListManager.instance().isUserOrSourceMapIgnoreListedUISourceCode(
79
78
  uiSourceCode)) {
80
79
  return false;
@@ -8,7 +8,6 @@ import * as Common from '../../core/common/common.js';
8
8
  import * as Host from '../../core/host/host.js';
9
9
  import * as i18n from '../../core/i18n/i18n.js';
10
10
  import * as Platform from '../../core/platform/platform.js';
11
- import * as Root from '../../core/root/root.js';
12
11
  import * as SDK from '../../core/sdk/sdk.js';
13
12
  import * as AiAssistance from '../../models/ai_assistance/ai_assistance.js';
14
13
  import * as Bindings from '../../models/bindings/bindings.js';
@@ -180,7 +179,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
180
179
  private authoredNode?: NavigatorGroupTreeNode;
181
180
  private deployedNode?: NavigatorGroupTreeNode;
182
181
  private navigatorGroupByFolderSetting: Common.Settings.Setting<boolean>;
183
- private navigatorGroupByAuthoredExperiment?: Root.ExperimentNames.ExperimentName;
182
+ private navigatorJustMyCodeSetting: Common.Settings.Setting<boolean>;
183
+ private navigatorGroupByAuthoredSetting?: Common.Settings.Setting<boolean>;
184
184
  #workspace!: Workspace.Workspace.WorkspaceImpl;
185
185
  private groupByFrame?: boolean;
186
186
  private groupByAuthored?: boolean;
@@ -217,8 +217,12 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
217
217
 
218
218
  this.navigatorGroupByFolderSetting = Common.Settings.Settings.instance().moduleSetting('navigator-group-by-folder');
219
219
  this.navigatorGroupByFolderSetting.addChangeListener(this.groupingChanged.bind(this));
220
+ this.navigatorJustMyCodeSetting = Common.Settings.Settings.instance().moduleSetting('navigator-just-my-code');
221
+ this.navigatorJustMyCodeSetting.addChangeListener(this.groupingChanged.bind(this));
220
222
  if (enableAuthoredGrouping) {
221
- this.navigatorGroupByAuthoredExperiment = Root.ExperimentNames.ExperimentName.AUTHORED_DEPLOYED_GROUPING;
223
+ this.navigatorGroupByAuthoredSetting =
224
+ Common.Settings.Settings.instance().moduleSetting('navigator-group-by-authored');
225
+ this.navigatorGroupByAuthoredSetting.addChangeListener(this.groupingChanged.bind(this));
222
226
  }
223
227
 
224
228
  Workspace.IgnoreListManager.IgnoreListManager.instance().addChangeListener(this.ignoreListChanged.bind(this));
@@ -458,7 +462,7 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
458
462
  }
459
463
 
460
464
  private addUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): void {
461
- if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.JUST_MY_CODE) &&
465
+ if (this.navigatorJustMyCodeSetting.get() &&
462
466
  Workspace.IgnoreListManager.IgnoreListManager.instance().isUserOrSourceMapIgnoreListedUISourceCode(
463
467
  uiSourceCode)) {
464
468
  return;
@@ -1189,7 +1193,7 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
1189
1193
  }
1190
1194
 
1191
1195
  private ignoreListChanged(): void {
1192
- if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.JUST_MY_CODE)) {
1196
+ if (this.navigatorJustMyCodeSetting.get()) {
1193
1197
  this.groupingChanged();
1194
1198
  } else {
1195
1199
  this.rootNode.updateTitleRecursive();
@@ -1200,8 +1204,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
1200
1204
  this.groupByFrame = true;
1201
1205
  this.groupByDomain = this.navigatorGroupByFolderSetting.get();
1202
1206
  this.groupByFolder = this.groupByDomain;
1203
- if (this.navigatorGroupByAuthoredExperiment) {
1204
- this.groupByAuthored = Root.Runtime.experiments.isEnabled(this.navigatorGroupByAuthoredExperiment);
1207
+ if (this.navigatorGroupByAuthoredSetting) {
1208
+ this.groupByAuthored = this.navigatorGroupByAuthoredSetting.get();
1205
1209
  } else {
1206
1210
  this.groupByAuthored = false;
1207
1211
  }
@@ -199,7 +199,7 @@ export class ScopeChainSidebarPane extends UI.Widget.VBox implements UI.ContextF
199
199
  titleElement.createChild('div', 'scope-chain-sidebar-pane-section-title').textContent = title;
200
200
 
201
201
  const root = new ObjectUI.ObjectPropertiesSection.ObjectTree(
202
- scope.object(), ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.ALL);
202
+ scope.object(), {propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.ALL, readOnly: false});
203
203
  root.addExtraProperties(...scope.extraProperties());
204
204
  const section = new ObjectUI.ObjectPropertiesSection.RootElement(root, this.linkifier, emptyPlaceholder);
205
205
  section.title = titleElement;
@@ -637,43 +637,21 @@ export class SourcesPanel extends UI.Panel.Panel implements
637
637
  }
638
638
  }
639
639
 
640
- private addExperimentMenuItem(
641
- menuSection: UI.ContextMenu.Section, experiment: Root.ExperimentNames.ExperimentName,
642
- menuItem: Common.UIString.LocalizedString): void {
643
- /** menu handler **/
644
- function toggleExperiment(): void {
645
- const checked = Root.Runtime.experiments.isEnabled(experiment);
646
- Root.Runtime.experiments.setEnabled(experiment, !checked);
647
- Host.userMetrics.experimentChanged(experiment, checked);
648
- // Need to signal to the NavigatorView that grouping has changed. Unfortunately,
649
- // it can't listen to an experiment, and this class doesn't directly interact
650
- // with it, so we will convince it a different grouping setting changed. When we switch
651
- // from using an experiment to a setting, it will listen to that setting and we
652
- // won't need to do this.
653
- const groupByFolderSetting = Common.Settings.Settings.instance().moduleSetting('navigator-group-by-folder');
654
- groupByFolderSetting.set(groupByFolderSetting.get());
655
- }
656
-
657
- menuSection.appendCheckboxItem(menuItem, toggleExperiment, {
658
- checked: Root.Runtime.experiments.isEnabled(experiment),
659
- experimental: true,
660
- jslogContext: Platform.StringUtilities.toKebabCase(experiment),
661
- });
640
+ private addSettingMenuItem(
641
+ contextMenu: UI.ContextMenu.Section, settingName: string, menuText: Common.UIString.LocalizedString): void {
642
+ const setting = Common.Settings.Settings.instance().moduleSetting(settingName);
643
+ contextMenu.appendCheckboxItem(
644
+ menuText, () => setting.set(!setting.get()), {checked: setting.get(), jslogContext: setting.name});
662
645
  }
663
646
 
664
647
  private populateNavigatorMenu(contextMenu: UI.ContextMenu.ContextMenu): void {
665
- const groupByFolderSetting = Common.Settings.Settings.instance().moduleSetting('navigator-group-by-folder');
666
648
  contextMenu.appendItemsAtLocation('navigatorMenu');
667
- contextMenu.viewSection().appendCheckboxItem(
668
- i18nString(UIStrings.groupByFolder), () => groupByFolderSetting.set(!groupByFolderSetting.get()),
669
- {checked: groupByFolderSetting.get(), jslogContext: groupByFolderSetting.name});
670
-
671
- this.addExperimentMenuItem(
672
- contextMenu.viewSection(), Root.ExperimentNames.ExperimentName.AUTHORED_DEPLOYED_GROUPING,
673
- i18nString(UIStrings.groupByAuthored));
674
- this.addExperimentMenuItem(
675
- contextMenu.viewSection(), Root.ExperimentNames.ExperimentName.JUST_MY_CODE,
676
- i18nString(UIStrings.hideIgnoreListed));
649
+ this.addSettingMenuItem(
650
+ contextMenu.viewSection(), 'navigator-group-by-folder', i18nString(UIStrings.groupByFolder));
651
+ this.addSettingMenuItem(
652
+ contextMenu.viewSection(), 'navigator-group-by-authored', i18nString(UIStrings.groupByAuthored));
653
+ this.addSettingMenuItem(
654
+ contextMenu.viewSection(), 'navigator-just-my-code', i18nString(UIStrings.hideIgnoreListed));
677
655
  }
678
656
 
679
657
  updateLastModificationTime(): void {
@@ -954,7 +932,7 @@ export class SourcesPanel extends UI.Panel.Panel implements
954
932
  const eventTarget = (event.target as Node);
955
933
  if (!uiSourceCode.project().isServiceProject() &&
956
934
  !eventTarget.isSelfOrDescendant(this.navigatorTabbedLocation.widget().element) &&
957
- !(Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.JUST_MY_CODE) &&
935
+ !(Common.Settings.Settings.instance().moduleSetting('navigator-just-my-code').get() &&
958
936
  Workspace.IgnoreListManager.IgnoreListManager.instance().isUserOrSourceMapIgnoreListedUISourceCode(
959
937
  uiSourceCode))) {
960
938
  contextMenu.revealSection().appendItem(
@@ -525,7 +525,11 @@ export class WatchExpression extends Common.ObjectWrapper.ObjectWrapper<EventTyp
525
525
  if (!exceptionDetails && expressionValue && expressionValue.hasChildren && !expressionValue.customPreview()) {
526
526
  headerElement.classList.add('watch-expression-object-header');
527
527
  this.#treeElement = new ObjectUI.ObjectPropertiesSection.RootElement(
528
- new ObjectUI.ObjectPropertiesSection.ObjectTree(expressionValue), this.linkifier);
528
+ new ObjectUI.ObjectPropertiesSection.ObjectTree(expressionValue, {
529
+ readOnly: true,
530
+ propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
531
+ }),
532
+ this.linkifier);
529
533
  this.expandController.watchSection(
530
534
  (this.#expression as string), (this.#treeElement as ObjectUI.ObjectPropertiesSection.RootElement));
531
535
  this.#treeElement.toggleOnClick = false;
@@ -1499,6 +1499,12 @@ Common.Settings.registerSettingExtension({
1499
1499
  defaultValue: false,
1500
1500
  });
1501
1501
 
1502
+ Common.Settings.registerSettingExtension({
1503
+ settingName: 'navigator-just-my-code',
1504
+ settingType: Common.Settings.SettingType.BOOLEAN,
1505
+ defaultValue: false,
1506
+ });
1507
+
1502
1508
  Common.Settings.registerSettingExtension({
1503
1509
  category: Common.Settings.SettingCategory.SOURCES,
1504
1510
  storageType: Common.Settings.SettingStorageType.SYNCED,
@@ -2,8 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- /* eslint-disable @devtools/no-imperative-dom-api */
6
-
7
5
  import '../../ui/legacy/legacy.js';
8
6
 
9
7
  import * as i18n from '../../core/i18n/i18n.js';
@@ -11,8 +9,9 @@ import * as Platform from '../../core/platform/platform.js';
11
9
  import * as TextUtils from '../../models/text_utils/text_utils.js';
12
10
  import type * as Trace from '../../models/trace/trace.js';
13
11
  import * as Workspace from '../../models/workspace/workspace.js';
14
- import type * as Buttons from '../../ui/components/buttons/buttons.js';
12
+ import * as Buttons from '../../ui/components/buttons/buttons.js';
15
13
  import * as UI from '../../ui/legacy/legacy.js';
14
+ import {html, nothing, render} from '../../ui/lit/lit.js';
16
15
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
17
16
 
18
17
  import {traceJsonGenerator} from './SaveFileFormatter.js';
@@ -44,19 +43,105 @@ const UIStrings = {
44
43
  const str_ = i18n.i18n.registerUIStrings('panels/timeline/StatusDialog.ts', UIStrings);
45
44
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
46
45
 
46
+ export interface ViewInput {
47
+ statusText: string;
48
+ showTimer: boolean;
49
+ timeText: string;
50
+ showProgress: boolean;
51
+ progressActivity: string;
52
+ progressPercent: number;
53
+ descriptionText: string|undefined;
54
+ buttonText: string;
55
+ hideStopButton: boolean;
56
+ focusStopButton: boolean;
57
+ showDownloadButton: boolean;
58
+ downloadButtonDisabled: boolean;
59
+ onStopClick: () => void;
60
+ onDownloadClick: () => void;
61
+ }
62
+
63
+ export type ViewOutput = Record<string, never>;
64
+
65
+ export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
66
+
67
+ // clang-format off
68
+ export const DEFAULT_VIEW: View = (input, output, target) => {
69
+ render(html`
70
+ <style>${timelineStatusDialogStyles}</style>
71
+ <div class="timeline-status-dialog">
72
+ <div class="status-dialog-line status">
73
+ <div class="label">${i18nString(UIStrings.status)}</div>
74
+ <div class="content" role="status">${input.statusText}</div>
75
+ </div>
76
+ ${input.showTimer ? html`
77
+ <div class="status-dialog-line time">
78
+ <div class="label">${i18nString(UIStrings.time)}</div>
79
+ <div class="content">${input.timeText}</div>
80
+ </div>
81
+ ` : nothing}
82
+ ${input.showProgress ? html`
83
+ <div class="status-dialog-line progress">
84
+ <div class="label">${input.progressActivity}</div>
85
+ <div class="indicator-container">
86
+ <div class="indicator"
87
+ style="width: ${input.progressPercent.toFixed(1)}%"
88
+ role="progressbar"
89
+ aria-valuemin="0"
90
+ aria-valuemax="100"
91
+ aria-valuenow=${input.progressPercent}>
92
+ </div>
93
+ </div>
94
+ </div>
95
+ ` : nothing}
96
+ ${input.descriptionText !== undefined ? html`
97
+ <div class="status-dialog-line description">
98
+ <div class="label">${i18nString(UIStrings.description)}</div>
99
+ <div class="content">${input.descriptionText}</div>
100
+ </div>
101
+ ` : nothing}
102
+ <div class="stop-button">
103
+ ${input.showDownloadButton ? html`
104
+ <devtools-button
105
+ .variant=${Buttons.Button.Variant.OUTLINED}
106
+ .disabled=${input.downloadButtonDisabled}
107
+ @click=${input.onDownloadClick}
108
+ .jslogContext=${'timeline.download-after-error'}
109
+ >${i18nString(UIStrings.downloadAfterError)}</devtools-button>
110
+ ` : nothing}
111
+ ${!input.hideStopButton ? html`
112
+ <devtools-button
113
+ .variant=${Buttons.Button.Variant.PRIMARY}
114
+ @click=${input.onStopClick}
115
+ .jslogContext=${'timeline.stop-recording'}
116
+ ?autofocus=${input.focusStopButton}
117
+ >${input.buttonText}</devtools-button>
118
+ ` : nothing}
119
+ </div>
120
+ </div>
121
+ `, target);
122
+ };
123
+ // clang-format on
124
+
47
125
  /**
48
126
  * This is the dialog shown whilst a trace is being recorded/imported.
49
127
  */
50
128
  export class StatusDialog extends UI.Widget.VBox {
51
- private status: HTMLElement;
52
- private time: Element|undefined;
53
- private progressLabel?: HTMLElement;
54
- private progressBar?: HTMLElement;
55
- private readonly description: HTMLElement|undefined;
56
- private button: Buttons.Button.Button;
57
- private downloadTraceButton: Buttons.Button.Button;
58
- private startTime!: number;
59
- private timeUpdateTimer?: number;
129
+ readonly #view: View;
130
+ #statusText = '';
131
+ readonly #showTimer: boolean;
132
+ #timeText = '';
133
+ readonly #showProgress: boolean;
134
+ #progressActivity = '';
135
+ #progressPercent = 0;
136
+ readonly #descriptionText: string|undefined;
137
+ readonly #buttonText: string;
138
+ #hideStopButton: boolean;
139
+ #focusStopButton = false;
140
+ #showDownloadButton = false;
141
+ #downloadButtonDisabled = true;
142
+ readonly #onButtonClickCallback: () => (Promise<void>| void);
143
+ #startTime!: number;
144
+ #timeUpdateTimer?: number;
60
145
  #rawEvents?: Trace.Types.Events.Event[];
61
146
 
62
147
  constructor(
@@ -67,61 +152,25 @@ export class StatusDialog extends UI.Widget.VBox {
67
152
  description?: string,
68
153
  buttonText?: string,
69
154
  },
70
- onButtonClickCallback: () => (Promise<void>| void)) {
155
+ onButtonClickCallback: () => (Promise<void>| void), view: View = DEFAULT_VIEW) {
71
156
  super({
72
157
  jslog: `${VisualLogging.dialog('timeline-status').track({resize: true})}`,
73
158
  useShadowDom: true,
74
159
  });
75
160
 
76
- this.contentElement.classList.add('timeline-status-dialog');
77
-
78
- const statusLine = this.contentElement.createChild('div', 'status-dialog-line status');
79
- statusLine.createChild('div', 'label').textContent = i18nString(UIStrings.status);
80
- this.status = statusLine.createChild('div', 'content');
81
- UI.ARIAUtils.markAsStatus(this.status);
82
-
83
- if (options.showTimer) {
84
- const timeLine = this.contentElement.createChild('div', 'status-dialog-line time');
85
- timeLine.createChild('div', 'label').textContent = i18nString(UIStrings.time);
86
- this.time = timeLine.createChild('div', 'content');
87
- }
88
-
89
- if (options.showProgress) {
90
- const progressBarContainer = this.contentElement.createChild('div', 'status-dialog-line progress');
91
- this.progressLabel = progressBarContainer.createChild('div', 'label');
92
- this.progressBar = progressBarContainer.createChild('div', 'indicator-container').createChild('div', 'indicator');
93
- UI.ARIAUtils.markAsProgressBar(this.progressBar);
94
- }
95
-
96
- if (typeof options.description === 'string') {
97
- const descriptionLine = this.contentElement.createChild('div', 'status-dialog-line description');
98
- descriptionLine.createChild('div', 'label').textContent = i18nString(UIStrings.description);
99
- this.description = descriptionLine.createChild('div', 'content');
100
- this.description.innerText = options.description;
101
- }
102
-
103
- const buttonContainer = this.contentElement.createChild('div', 'stop-button');
104
- this.downloadTraceButton = UI.UIUtils.createTextButton(i18nString(UIStrings.downloadAfterError), () => {
105
- void this.#downloadRawTraceAfterError();
106
- }, {jslogContext: 'timeline.download-after-error'});
107
-
108
- this.downloadTraceButton.disabled = true;
109
- this.downloadTraceButton.classList.add('hidden');
110
-
111
- const buttonText = options.buttonText || i18nString(UIStrings.stop);
112
- this.button = UI.UIUtils.createTextButton(buttonText, onButtonClickCallback, {
113
- jslogContext: 'timeline.stop-recording',
114
- });
115
- // Profiling can't be stopped during initialization.
116
- this.button.classList.toggle('hidden', options.hideStopButton);
117
-
118
- buttonContainer.append(this.downloadTraceButton);
119
- buttonContainer.append(this.button);
161
+ this.#view = view;
162
+ this.#showTimer = Boolean(options.showTimer);
163
+ this.#showProgress = Boolean(options.showProgress);
164
+ this.#descriptionText = options.description;
165
+ this.#buttonText = options.buttonText || i18nString(UIStrings.stop);
166
+ this.#hideStopButton = options.hideStopButton;
167
+ this.#onButtonClickCallback = onButtonClickCallback;
120
168
  }
121
169
 
122
170
  finish(): void {
123
171
  this.stopTimer();
124
- this.button.classList.add('hidden');
172
+ this.#hideStopButton = true;
173
+ this.requestUpdate();
125
174
  }
126
175
 
127
176
  async #downloadRawTraceAfterError(): Promise<void> {
@@ -140,8 +189,9 @@ export class StatusDialog extends UI.Widget.VBox {
140
189
 
141
190
  enableDownloadOfEvents(rawEvents: Trace.Types.Events.Event[]): void {
142
191
  this.#rawEvents = rawEvents;
143
- this.downloadTraceButton.disabled = false;
144
- this.downloadTraceButton.classList.remove('hidden');
192
+ this.#showDownloadButton = true;
193
+ this.#downloadButtonDisabled = false;
194
+ this.requestUpdate();
145
195
  }
146
196
 
147
197
  remove(): void {
@@ -157,51 +207,77 @@ export class StatusDialog extends UI.Widget.VBox {
157
207
  }
158
208
 
159
209
  enableAndFocusButton(): void {
160
- this.button.classList.remove('hidden');
161
- this.button.focus();
210
+ this.#hideStopButton = false;
211
+ this.#focusStopButton = true;
212
+ this.requestUpdate();
162
213
  }
163
214
 
164
215
  updateStatus(text: string): void {
165
- this.status.textContent = text;
216
+ this.#statusText = text;
217
+ this.requestUpdate();
166
218
  }
167
219
 
168
220
  updateProgressBar(activity: string, percent: number): void {
169
- if (this.progressLabel) {
170
- this.progressLabel.textContent = activity;
171
- }
172
- if (this.progressBar) {
173
- this.progressBar.style.width = percent.toFixed(1) + '%';
174
- UI.ARIAUtils.setValueNow(this.progressBar, percent);
175
- }
176
- this.updateTimer();
221
+ this.#progressActivity = activity;
222
+ this.#progressPercent = percent;
223
+ this.#updateTimerTick();
224
+ this.requestUpdate();
177
225
  }
178
226
 
179
227
  startTimer(): void {
180
- this.startTime = Date.now();
181
- this.timeUpdateTimer = window.setInterval(this.updateTimer.bind(this), 100);
182
- this.updateTimer();
228
+ this.#startTime = Date.now();
229
+ this.#timeUpdateTimer = window.setInterval(this.#updateTimerTick.bind(this), 100);
230
+ this.#updateTimerTick();
183
231
  }
184
232
 
185
233
  private stopTimer(): void {
186
- if (!this.timeUpdateTimer) {
234
+ if (!this.#timeUpdateTimer) {
187
235
  return;
188
236
  }
189
- clearInterval(this.timeUpdateTimer);
190
- this.updateTimer();
191
- delete this.timeUpdateTimer;
237
+ clearInterval(this.#timeUpdateTimer);
238
+ this.#updateTimerTick();
239
+ this.#timeUpdateTimer = undefined;
192
240
  }
193
241
 
194
- private updateTimer(): void {
195
- if (!this.timeUpdateTimer || !this.time) {
242
+ #updateTimerTick(): void {
243
+ if (!this.#timeUpdateTimer || !this.#showTimer) {
196
244
  return;
197
245
  }
246
+ const seconds = (Date.now() - this.#startTime) / 1000;
247
+ this.#timeText = i18n.TimeUtilities.preciseSecondsToString(seconds, 1);
248
+ this.requestUpdate();
249
+ }
198
250
 
199
- const seconds = (Date.now() - this.startTime) / 1000;
200
- this.time.textContent = i18n.TimeUtilities.preciseSecondsToString(seconds, 1);
251
+ override performUpdate(): void {
252
+ this.#view(
253
+ {
254
+ statusText: this.#statusText,
255
+ showTimer: this.#showTimer,
256
+ timeText: this.#timeText,
257
+ showProgress: this.#showProgress,
258
+ progressActivity: this.#progressActivity,
259
+ progressPercent: this.#progressPercent,
260
+ descriptionText: this.#descriptionText,
261
+ buttonText: this.#buttonText,
262
+ hideStopButton: this.#hideStopButton,
263
+ focusStopButton: this.#focusStopButton,
264
+ showDownloadButton: this.#showDownloadButton,
265
+ downloadButtonDisabled: this.#downloadButtonDisabled,
266
+ onStopClick: () => {
267
+ void this.#onButtonClickCallback();
268
+ },
269
+ onDownloadClick: () => {
270
+ void this.#downloadRawTraceAfterError();
271
+ },
272
+ },
273
+ {},
274
+ this.contentElement,
275
+ );
276
+ this.#focusStopButton = false;
201
277
  }
202
278
 
203
279
  override wasShown(): void {
204
280
  super.wasShown();
205
- this.registerRequiredCSS(timelineStatusDialogStyles);
281
+ this.requestUpdate();
206
282
  }
207
283
  }
@@ -52,6 +52,10 @@ export class ThirdPartyTreeViewWidget extends TimelineTreeView.TimelineTreeView
52
52
  this.dataGrid.expandNodesWhenArrowing = false;
53
53
  }
54
54
 
55
+ override isThirdPartyTreeView(): boolean {
56
+ return true;
57
+ }
58
+
55
59
  override wasShown(): void {
56
60
  super.wasShown();
57
61
  this.registerRequiredCSS(thirdPartyTreeViewStyles);
@@ -231,7 +235,7 @@ export class ThirdPartyTreeViewWidget extends TimelineTreeView.TimelineTreeView
231
235
  };
232
236
  }
233
237
 
234
- nodeIsFirstParty(node: Trace.Extras.TraceTree.Node): boolean {
238
+ override nodeIsFirstParty(node: Trace.Extras.TraceTree.Node): boolean {
235
239
  const mapper = this.entityMapper();
236
240
  if (!mapper) {
237
241
  return false;
@@ -240,7 +244,7 @@ export class ThirdPartyTreeViewWidget extends TimelineTreeView.TimelineTreeView
240
244
  return firstParty === mapper.entityForEvent(node.event);
241
245
  }
242
246
 
243
- nodeIsExtension(node: Trace.Extras.TraceTree.Node): boolean {
247
+ override nodeIsExtension(node: Trace.Extras.TraceTree.Node): boolean {
244
248
  const mapper = this.entityMapper();
245
249
  if (!mapper) {
246
250
  return false;
@@ -251,10 +251,6 @@ export class TimelineController implements Tracing.TracingManager.TracingManager
251
251
  'navigation,rail',
252
252
  ];
253
253
 
254
- if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.TIMELINE_V8_RUNTIME_CALL_STATS) &&
255
- options.enableJSSampling) {
256
- categoriesArray.push(disabledByDefault('v8.runtime_stats_sampling'));
257
- }
258
254
  if (options.enableJSSampling) {
259
255
  categoriesArray.push(disabledByDefault('v8.cpu_profiler'));
260
256
  }
@@ -668,9 +668,41 @@ function generateRangeSummaryDetails(input: SummaryViewInput): LitTemplate {
668
668
  const aggregatedStats = TimelineUIUtils.statsForTimeRange(events, startTime, endTime);
669
669
  const startOffset = startTime - minBoundsMilli;
670
670
  const endOffset = endTime - minBoundsMilli;
671
- const summaryDetailElem =
672
- TimelineUIUtils.generateSummaryDetails(aggregatedStats, startOffset, endOffset, events, thirdPartyTree);
673
- return html`${summaryDetailElem}`;
671
+
672
+ let total = 0;
673
+ for (const categoryName in aggregatedStats) {
674
+ total += aggregatedStats[categoryName];
675
+ }
676
+
677
+ const categories: TimelineComponents.TimelineSummary.CategoryData[] = [];
678
+ for (const categoryName in Trace.Styles.getCategoryStyles()) {
679
+ const category = Trace.Styles.getCategoryStyles()[categoryName as keyof Trace.Styles.CategoryPalette];
680
+ if (category.name === Trace.Styles.EventCategory.IDLE) {
681
+ continue;
682
+ }
683
+ const value = aggregatedStats[category.name];
684
+ if (!value) {
685
+ continue;
686
+ }
687
+ categories.push({value, color: category.getCSSValue(), title: category.title});
688
+ }
689
+ categories.sort((a, b) => b.value - a.value);
690
+
691
+ // clang-format off
692
+ return html`
693
+ <devtools-widget
694
+ ${widget(TimelineComponents.TimelineRangeSummaryView.TimelineRangeSummaryView, {
695
+ data: {
696
+ rangeStart: startOffset,
697
+ rangeEnd: endOffset,
698
+ total,
699
+ categories,
700
+ thirdPartyTreeTemplate: html`<devtools-performance-third-party-tree-view
701
+ .treeView=${thirdPartyTree}></devtools-performance-third-party-tree-view>`,
702
+ } as TimelineComponents.TimelineRangeSummaryView.TimelineRangeSummaryViewData,
703
+ })}
704
+ ></devtools-widget>`;
705
+ // clang-format on
674
706
  }
675
707
 
676
708
  async function renderSelectedEventDetails(
@@ -882,7 +882,12 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW
882
882
  popoverContents.appendChild(warningElement);
883
883
  }
884
884
  for (const elem of additionalContent) {
885
- popoverContents.appendChild(elem);
885
+ const widget = UI.Widget.Widget.get(elem);
886
+ if (widget) {
887
+ widget.show(popoverContents, undefined, /* suppressOprhanWidgetError= */ true);
888
+ } else {
889
+ popoverContents.appendChild(elem);
890
+ }
886
891
  }
887
892
  return popoverElement;
888
893
  }