chrome-devtools-frontend 1.0.1526630 → 1.0.1528866

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 (319) hide show
  1. package/docs/ui_engineering.md +159 -0
  2. package/eslint.config.mjs +6 -1
  3. package/front_end/core/i18n/i18nImpl.ts +6 -1
  4. package/front_end/core/protocol_client/protocol_client.ts +1 -1
  5. package/front_end/core/root/Runtime.ts +28 -4
  6. package/front_end/core/sdk/CSSMatchedStyles.ts +50 -7
  7. package/front_end/core/sdk/CSSRule.ts +35 -6
  8. package/front_end/core/sdk/Connections.ts +2 -1
  9. package/front_end/core/sdk/DOMModel.ts +4 -0
  10. package/front_end/core/sdk/DebuggerModel.ts +5 -1
  11. package/front_end/core/sdk/NetworkManager.ts +214 -31
  12. package/front_end/core/sdk/PreloadingModel.ts +82 -17
  13. package/front_end/core/sdk/RehydratingConnection.snapshot.txt +1 -1
  14. package/front_end/core/sdk/RehydratingConnection.ts +29 -4
  15. package/front_end/core/sdk/ScopeTreeCache.ts +8 -3
  16. package/front_end/core/sdk/SourceMap.ts +37 -11
  17. package/front_end/core/sdk/SourceMapManager.ts +13 -2
  18. package/front_end/core/sdk/SourceMapScopesInfo.ts +17 -0
  19. package/front_end/core/sdk/TargetManager.ts +0 -22
  20. package/front_end/core/sdk/TraceObject.ts +8 -7
  21. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +81 -0
  22. package/front_end/entrypoints/inspector_main/InspectorMain.ts +3 -1
  23. package/front_end/entrypoints/main/GlobalAiButton.ts +1 -0
  24. package/front_end/entrypoints/main/MainImpl.ts +20 -25
  25. package/front_end/generated/InspectorBackendCommands.js +3 -2
  26. package/front_end/generated/protocol.ts +17 -3
  27. package/front_end/models/ai_assistance/BuiltInAi.ts +111 -0
  28. package/front_end/models/ai_assistance/ai_assistance.ts +53 -24
  29. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +105 -0
  30. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +6 -1
  31. package/front_end/models/extensions/ExtensionView.ts +3 -0
  32. package/front_end/models/javascript_metadata/NativeFunctions.js +23 -27
  33. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +31 -29
  34. package/front_end/models/persistence/EditFileSystemView.ts +1 -0
  35. package/front_end/models/source_map_scopes/NamesResolver.ts +5 -11
  36. package/front_end/models/stack_trace/Trie.ts +9 -0
  37. package/front_end/models/trace/lantern/types/Lantern.ts +1 -1
  38. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -0
  39. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -0
  40. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +120 -113
  41. package/front_end/panels/ai_assistance/PatchWidget.ts +9 -8
  42. package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +2 -0
  43. package/front_end/panels/ai_assistance/components/ChatView.ts +29 -29
  44. package/front_end/panels/ai_assistance/components/UserActionRow.ts +1 -0
  45. package/front_end/panels/animation/AnimationTimeline.ts +1 -0
  46. package/front_end/panels/application/CookieItemsView.ts +1 -0
  47. package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
  48. package/front_end/panels/application/ServiceWorkerCacheViews.ts +2 -0
  49. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +11 -5
  50. package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +2 -2
  51. package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -5
  52. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +22 -10
  53. package/front_end/panels/changes/CombinedDiffView.ts +1 -0
  54. package/front_end/panels/console/ConsoleInsightTeaser.ts +106 -0
  55. package/front_end/panels/console/ConsolePanel.ts +2 -0
  56. package/front_end/panels/console/ConsolePrompt.ts +12 -2
  57. package/front_end/panels/console/ConsoleSidebar.ts +1 -1
  58. package/front_end/panels/console/ConsoleView.ts +12 -0
  59. package/front_end/panels/console/ConsoleViewMessage.ts +27 -0
  60. package/front_end/panels/{explain → console}/PromptBuilder.ts +12 -7
  61. package/front_end/panels/console/console.ts +6 -0
  62. package/front_end/panels/console/consoleInsightTeaser.css +55 -0
  63. package/front_end/panels/coverage/CoverageListView.ts +29 -11
  64. package/front_end/panels/coverage/CoverageView.ts +292 -284
  65. package/front_end/panels/coverage/coverageView.css +17 -0
  66. package/front_end/panels/elements/ComputedStyleWidget.ts +1 -0
  67. package/front_end/panels/elements/LayoutPane.ts +1 -0
  68. package/front_end/panels/elements/NodeStackTraceWidget.ts +1 -0
  69. package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -1
  70. package/front_end/panels/elements/stylePropertiesTreeOutline.css +17 -0
  71. package/front_end/panels/emulation/DeviceModeView.ts +2 -0
  72. package/front_end/panels/explain/ActionDelegate.ts +1 -2
  73. package/front_end/panels/explain/components/ConsoleInsight.ts +14 -12
  74. package/front_end/panels/explain/explain.ts +0 -1
  75. package/front_end/panels/js_timeline/js_timeline-meta.ts +1 -1
  76. package/front_end/panels/layer_viewer/Layers3DView.ts +2 -0
  77. package/front_end/panels/lighthouse/LighthouseReportSelector.ts +1 -0
  78. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -0
  79. package/front_end/panels/media/MainView.ts +1 -0
  80. package/front_end/panels/media/TickingFlameChart.ts +2 -0
  81. package/front_end/panels/network/BlockedURLsPane.ts +111 -85
  82. package/front_end/panels/network/EventSourceMessagesView.ts +1 -0
  83. package/front_end/panels/network/NetworkItemView.ts +1 -0
  84. package/front_end/panels/network/NetworkLogView.ts +9 -7
  85. package/front_end/panels/network/NetworkOverview.ts +1 -0
  86. package/front_end/panels/network/RequestCookiesView.ts +1 -0
  87. package/front_end/panels/network/RequestHTMLView.ts +1 -0
  88. package/front_end/panels/network/RequestInitiatorView.ts +1 -0
  89. package/front_end/panels/network/RequestPayloadView.ts +1 -0
  90. package/front_end/panels/network/RequestPreviewView.ts +1 -0
  91. package/front_end/panels/network/RequestResponseView.ts +1 -0
  92. package/front_end/panels/network/RequestTimingView.ts +2 -0
  93. package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -0
  94. package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -0
  95. package/front_end/panels/network/components/RequestHeadersView.ts +2 -0
  96. package/front_end/panels/network/components/RequestTrustTokensView.ts +2 -0
  97. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -0
  98. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +2 -0
  99. package/front_end/panels/profiler/HeapSnapshotView.ts +7 -0
  100. package/front_end/panels/profiler/IsolateSelector.ts +1 -0
  101. package/front_end/panels/profiler/LiveHeapProfileView.ts +1 -0
  102. package/front_end/panels/profiler/ProfileView.ts +1 -0
  103. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -0
  104. package/front_end/panels/recorder/RecorderPanel.ts +2 -0
  105. package/front_end/panels/screencast/ScreencastView.ts +1 -0
  106. package/front_end/panels/search/SearchView.ts +1 -0
  107. package/front_end/panels/settings/AISettingsTab.ts +3 -3
  108. package/front_end/panels/settings/WorkspaceSettingsTab.ts +2 -0
  109. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
  110. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +12 -0
  111. package/front_end/panels/sources/BreakpointsView.ts +1 -0
  112. package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
  113. package/front_end/panels/sources/UISourceCodeFrame.ts +17 -2
  114. package/front_end/panels/timeline/README.md +2 -2
  115. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -1
  116. package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -3
  117. package/front_end/panels/timeline/TimelineLayersView.ts +1 -0
  118. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +114 -37
  119. package/front_end/panels/timeline/TimelinePanel.ts +43 -62
  120. package/front_end/panels/timeline/TimelineTreeView.ts +1 -0
  121. package/front_end/panels/timeline/components/LiveMetricsView.ts +4 -8
  122. package/front_end/panels/timeline/components/Sidebar.ts +2 -0
  123. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
  124. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +7 -7
  125. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
  126. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -4
  127. package/front_end/panels/web_audio/WebAudioView.ts +1 -0
  128. package/front_end/third_party/chromium/README.chromium +1 -1
  129. package/front_end/third_party/lighthouse/README.chromium +2 -2
  130. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1530 -2426
  131. package/front_end/third_party/lighthouse/locales/ar-XB.json +107 -455
  132. package/front_end/third_party/lighthouse/locales/ar.json +107 -455
  133. package/front_end/third_party/lighthouse/locales/bg.json +96 -444
  134. package/front_end/third_party/lighthouse/locales/ca.json +96 -444
  135. package/front_end/third_party/lighthouse/locales/cs.json +96 -444
  136. package/front_end/third_party/lighthouse/locales/da.json +96 -444
  137. package/front_end/third_party/lighthouse/locales/de.json +96 -444
  138. package/front_end/third_party/lighthouse/locales/el.json +96 -444
  139. package/front_end/third_party/lighthouse/locales/en-GB.json +96 -444
  140. package/front_end/third_party/lighthouse/locales/en-US.json +116 -467
  141. package/front_end/third_party/lighthouse/locales/en-XA.json +93 -441
  142. package/front_end/third_party/lighthouse/locales/en-XL.json +116 -467
  143. package/front_end/third_party/lighthouse/locales/es-419.json +96 -444
  144. package/front_end/third_party/lighthouse/locales/es.json +96 -444
  145. package/front_end/third_party/lighthouse/locales/fi.json +96 -444
  146. package/front_end/third_party/lighthouse/locales/fil.json +96 -444
  147. package/front_end/third_party/lighthouse/locales/fr.json +96 -444
  148. package/front_end/third_party/lighthouse/locales/he.json +118 -466
  149. package/front_end/third_party/lighthouse/locales/hi.json +96 -444
  150. package/front_end/third_party/lighthouse/locales/hr.json +100 -448
  151. package/front_end/third_party/lighthouse/locales/hu.json +96 -444
  152. package/front_end/third_party/lighthouse/locales/id.json +96 -444
  153. package/front_end/third_party/lighthouse/locales/it.json +96 -444
  154. package/front_end/third_party/lighthouse/locales/ja.json +96 -444
  155. package/front_end/third_party/lighthouse/locales/ko.json +97 -445
  156. package/front_end/third_party/lighthouse/locales/lt.json +96 -444
  157. package/front_end/third_party/lighthouse/locales/lv.json +97 -445
  158. package/front_end/third_party/lighthouse/locales/nl.json +96 -444
  159. package/front_end/third_party/lighthouse/locales/no.json +96 -444
  160. package/front_end/third_party/lighthouse/locales/pl.json +96 -444
  161. package/front_end/third_party/lighthouse/locales/pt-PT.json +96 -444
  162. package/front_end/third_party/lighthouse/locales/pt.json +97 -445
  163. package/front_end/third_party/lighthouse/locales/ro.json +97 -445
  164. package/front_end/third_party/lighthouse/locales/ru.json +96 -444
  165. package/front_end/third_party/lighthouse/locales/sk.json +96 -444
  166. package/front_end/third_party/lighthouse/locales/sl.json +96 -444
  167. package/front_end/third_party/lighthouse/locales/sr-Latn.json +96 -444
  168. package/front_end/third_party/lighthouse/locales/sr.json +96 -444
  169. package/front_end/third_party/lighthouse/locales/sv.json +96 -444
  170. package/front_end/third_party/lighthouse/locales/ta.json +96 -444
  171. package/front_end/third_party/lighthouse/locales/te.json +97 -445
  172. package/front_end/third_party/lighthouse/locales/th.json +96 -444
  173. package/front_end/third_party/lighthouse/locales/tr.json +96 -444
  174. package/front_end/third_party/lighthouse/locales/uk.json +96 -444
  175. package/front_end/third_party/lighthouse/locales/vi.json +96 -444
  176. package/front_end/third_party/lighthouse/locales/zh-HK.json +96 -444
  177. package/front_end/third_party/lighthouse/locales/zh-TW.json +97 -445
  178. package/front_end/third_party/lighthouse/locales/zh.json +96 -444
  179. package/front_end/third_party/lighthouse/report/bundle.d.ts +8 -14
  180. package/front_end/third_party/lighthouse/report/bundle.js +10 -49
  181. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  182. package/front_end/third_party/web-vitals/README.chromium +5 -8
  183. package/front_end/third_party/web-vitals/package/README.md +191 -152
  184. package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.d.ts +0 -1
  185. package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.js +0 -1
  186. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +2 -2
  187. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.js +45 -26
  188. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +2 -2
  189. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +3 -3
  190. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +10 -10
  191. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +307 -206
  192. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +2 -2
  193. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +69 -49
  194. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +2 -2
  195. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +2 -2
  196. package/front_end/third_party/web-vitals/package/dist/modules/index.d.ts +0 -1
  197. package/front_end/third_party/web-vitals/package/dist/modules/index.js +0 -1
  198. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +33 -0
  199. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +111 -0
  200. package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +4 -0
  201. package/front_end/third_party/web-vitals/package/dist/modules/{attribution/deprecated.js → lib/LCPEntryManager.js} +6 -7
  202. package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.d.ts +6 -0
  203. package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.js +44 -0
  204. package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.js +1 -1
  205. package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
  206. package/front_end/third_party/web-vitals/package/dist/modules/lib/getActivationStart.js +1 -1
  207. package/front_end/third_party/web-vitals/package/dist/modules/lib/getNavigationEntry.js +5 -7
  208. package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.d.ts +1 -1
  209. package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +9 -12
  210. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -0
  211. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +52 -33
  212. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +0 -2
  213. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +2 -2
  214. package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.d.ts +6 -0
  215. package/front_end/third_party/web-vitals/package/dist/modules/{deprecated.js → lib/initUnique.js} +11 -4
  216. package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +3 -6
  217. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +6 -6
  218. package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.d.ts → whenIdleOrHidden.d.ts} +1 -1
  219. package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.js → whenIdleOrHidden.js} +10 -8
  220. package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +17 -35
  221. package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +3 -5
  222. package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +9 -7
  223. package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +27 -19
  224. package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +33 -26
  225. package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +2 -4
  226. package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +6 -5
  227. package/front_end/third_party/web-vitals/package/dist/modules/types/cls.d.ts +5 -3
  228. package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +80 -33
  229. package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +6 -2
  230. package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +28 -4
  231. package/front_end/third_party/web-vitals/package/dist/modules/types.js +0 -1
  232. package/front_end/third_party/web-vitals/package/package.json +4 -10
  233. package/front_end/third_party/web-vitals/package/src/attribution/index.ts +0 -1
  234. package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +58 -33
  235. package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +4 -4
  236. package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +382 -258
  237. package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +96 -69
  238. package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +3 -3
  239. package/front_end/third_party/web-vitals/package/src/index.ts +0 -1
  240. package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +146 -0
  241. package/front_end/third_party/web-vitals/package/src/{attribution/deprecated.ts → lib/LCPEntryManager.ts} +6 -9
  242. package/front_end/third_party/web-vitals/package/src/lib/LayoutShiftManager.ts +50 -0
  243. package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
  244. package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
  245. package/front_end/third_party/web-vitals/package/src/lib/getActivationStart.ts +1 -1
  246. package/front_end/third_party/web-vitals/package/src/lib/getNavigationEntry.ts +5 -8
  247. package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +12 -12
  248. package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +57 -35
  249. package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +2 -2
  250. package/front_end/third_party/web-vitals/package/src/{deprecated.ts → lib/initUnique.ts} +14 -8
  251. package/front_end/third_party/web-vitals/package/src/lib/observe.ts +3 -11
  252. package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +12 -6
  253. package/front_end/third_party/web-vitals/package/src/lib/{whenIdle.ts → whenIdleOrHidden.ts} +10 -8
  254. package/front_end/third_party/web-vitals/package/src/onCLS.ts +17 -38
  255. package/front_end/third_party/web-vitals/package/src/onFCP.ts +3 -6
  256. package/front_end/third_party/web-vitals/package/src/onINP.ts +33 -28
  257. package/front_end/third_party/web-vitals/package/src/onLCP.ts +36 -29
  258. package/front_end/third_party/web-vitals/package/src/onTTFB.ts +2 -5
  259. package/front_end/third_party/web-vitals/package/src/types/base.ts +5 -5
  260. package/front_end/third_party/web-vitals/package/src/types/cls.ts +5 -3
  261. package/front_end/third_party/web-vitals/package/src/types/inp.ts +88 -33
  262. package/front_end/third_party/web-vitals/package/src/types/lcp.ts +6 -2
  263. package/front_end/third_party/web-vitals/package/src/types.ts +47 -4
  264. package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +75 -0
  265. package/front_end/third_party/web-vitals/rebuild.sh +32 -18
  266. package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +5 -10
  267. package/front_end/third_party/web-vitals/web-vitals.ts +0 -2
  268. package/front_end/ui/components/docs/console_insight/basic.ts +3 -2
  269. package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +2 -0
  270. package/front_end/ui/components/text_editor/TextEditor.ts +0 -2
  271. package/front_end/ui/legacy/InspectorView.ts +2 -0
  272. package/front_end/ui/legacy/SplitWidget.ts +2 -0
  273. package/front_end/ui/legacy/TabbedPane.ts +1 -0
  274. package/front_end/ui/legacy/TargetCrashedScreen.ts +1 -0
  275. package/front_end/ui/legacy/UIUtils.ts +8 -19
  276. package/front_end/ui/legacy/ViewManager.ts +1 -0
  277. package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +7 -20
  278. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -0
  279. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -0
  280. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -0
  281. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +1 -0
  282. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -0
  283. package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -0
  284. package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -0
  285. package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -0
  286. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -0
  287. package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +2 -0
  288. package/front_end/ui/visual_logging/KnownContextValues.ts +17 -0
  289. package/mcp/README.md +7 -0
  290. package/mcp/mcp.ts +8 -0
  291. package/package.json +1 -1
  292. package/front_end/models/live-metrics/web-vitals-injected/OnEachInteraction.ts +0 -34
  293. package/front_end/third_party/web-vitals/package/attribution.d.ts +0 -16
  294. package/front_end/third_party/web-vitals/package/attribution.js +0 -18
  295. package/front_end/third_party/web-vitals/package/dist/modules/attribution/deprecated.d.ts +0 -7
  296. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.d.ts +0 -11
  297. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.js +0 -46
  298. package/front_end/third_party/web-vitals/package/dist/modules/deprecated.d.ts +0 -5
  299. package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.d.ts +0 -31
  300. package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.js +0 -107
  301. package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.d.ts +0 -1
  302. package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.js +0 -22
  303. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.d.ts +0 -7
  304. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.js +0 -147
  305. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.d.ts +0 -1
  306. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.js +0 -25
  307. package/front_end/third_party/web-vitals/package/dist/modules/onFID.d.ts +0 -13
  308. package/front_end/third_party/web-vitals/package/dist/modules/onFID.js +0 -70
  309. package/front_end/third_party/web-vitals/package/dist/modules/types/fid.d.ts +0 -46
  310. package/front_end/third_party/web-vitals/package/dist/modules/types/fid.js +0 -16
  311. package/front_end/third_party/web-vitals/package/src/attribution/onFID.ts +0 -62
  312. package/front_end/third_party/web-vitals/package/src/lib/interactions.ts +0 -139
  313. package/front_end/third_party/web-vitals/package/src/lib/onHidden.ts +0 -23
  314. package/front_end/third_party/web-vitals/package/src/lib/polyfills/firstInputPolyfill.ts +0 -174
  315. package/front_end/third_party/web-vitals/package/src/onFID.ts +0 -105
  316. package/front_end/third_party/web-vitals/package/src/types/fid.ts +0 -65
  317. package/front_end/ui/components/text_editor/textEditor.css +0 -18
  318. package/front_end/ui/legacy/inlineButton.css +0 -22
  319. /package/front_end/entrypoints/{rehydrated_devtools_app/rehydrated_devtools_app.ts → trace_app/trace_app.ts} +0 -0
@@ -8,11 +8,15 @@ import type * as Protocol from '../../generated/protocol.js';
8
8
  import * as Geometry from '../../models/geometry/geometry.js';
9
9
  import * as Trace from '../../models/trace/trace.js';
10
10
  import * as UI from '../../ui/legacy/legacy.js';
11
+ import * as Lit from '../../ui/lit/lit.js';
11
12
  import * as LayerViewer from '../layer_viewer/layer_viewer.js';
12
13
 
13
14
  import timelinePaintProfilerStyles from './timelinePaintProfiler.css.js';
14
15
  import {TracingFrameLayerTree} from './TracingLayerTree.js';
15
16
 
17
+ const {html, render} = Lit;
18
+ const {createRef, ref} = Lit.Directives;
19
+
16
20
  export class TimelinePaintProfilerView extends UI.SplitWidget.SplitWidget {
17
21
  private readonly logAndImageSplitWidget: UI.SplitWidget.SplitWidget;
18
22
  private readonly imageView: TimelinePaintImageView;
@@ -27,14 +31,12 @@ export class TimelinePaintProfilerView extends UI.SplitWidget.SplitWidget {
27
31
 
28
32
  constructor(parsedTrace: Trace.TraceModel.ParsedTrace) {
29
33
  super(false, false);
30
- this.element.classList.add('timeline-paint-profiler-view');
31
34
  this.setSidebarSize(60);
32
35
  this.setResizable(false);
33
36
 
34
37
  this.#parsedTrace = parsedTrace;
35
38
 
36
- this.logAndImageSplitWidget = new UI.SplitWidget.SplitWidget(true, false);
37
- this.logAndImageSplitWidget.element.classList.add('timeline-paint-profiler-log-split');
39
+ this.logAndImageSplitWidget = new UI.SplitWidget.SplitWidget(true, false, 'timeline-paint-profiler-log-split');
38
40
  this.setMainWidget(this.logAndImageSplitWidget);
39
41
  this.imageView = new TimelinePaintImageView();
40
42
  this.logAndImageSplitWidget.setMainWidget(this.imageView);
@@ -204,53 +206,112 @@ export class TimelinePaintProfilerView extends UI.SplitWidget.SplitWidget {
204
206
  }
205
207
  }
206
208
 
209
+ export interface TimelinePaintImageViewInput {
210
+ maskElementHidden: boolean;
211
+ imageContainerHidden: boolean;
212
+ imageURL: string;
213
+ imageContainerWebKitTransform: string;
214
+ maskElementStyle: {
215
+ width?: string,
216
+ height?: string,
217
+ borderLeftWidth?: string,
218
+ borderTopWidth?: string,
219
+ borderRightWidth?: string,
220
+ borderBottomWidth?: string,
221
+ };
222
+ }
223
+
224
+ export const DEFAULT_VIEW = (input: TimelinePaintImageViewInput, output: undefined, target: HTMLElement): {
225
+ imageElementNaturalHeight: number,
226
+ imageElementNaturalWidth: number,
227
+ } => {
228
+ const imageElementRef = createRef<HTMLImageElement>();
229
+ // clang-format off
230
+ render(html`
231
+ <div class="paint-profiler-image-view fill">
232
+ <div class="paint-profiler-image-container" style="-webkit-transform: ${input.imageContainerWebKitTransform}">
233
+ <img src=${input.imageURL} display=${input.imageContainerHidden ? 'none' : 'block'} ${ref(imageElementRef)}>
234
+ <div style=${Lit.Directives.styleMap({
235
+ display: input.maskElementHidden ? 'none' : 'block',
236
+ ...input.maskElementStyle,})}>
237
+ </div>
238
+ </div>
239
+ </div>`,
240
+ target);
241
+ // clang-format on
242
+
243
+ // The elements are guaranteed to exist after render completes
244
+ // because they are not conditionally rendered within the template.
245
+ const imageElement = imageElementRef.value;
246
+
247
+ if (!imageElement?.naturalHeight || !imageElement.naturalWidth) {
248
+ throw new Error('ImageElement were not found in the TimelinePaintImageView.');
249
+ }
250
+
251
+ return {imageElementNaturalHeight: imageElement.naturalHeight, imageElementNaturalWidth: imageElement.naturalWidth};
252
+ };
207
253
  export class TimelinePaintImageView extends UI.Widget.Widget {
208
- private imageContainer: HTMLElement;
209
- private imageElement: HTMLImageElement;
210
- private readonly maskElement: HTMLElement;
211
254
  private transformController: LayerViewer.TransformController.TransformController;
212
255
  private maskRectangle?: Protocol.DOM.Rect|null;
213
- constructor() {
214
- super({useShadowDom: true});
215
- this.registerRequiredCSS(timelinePaintProfilerStyles);
216
256
 
217
- this.contentElement.classList.add('fill', 'paint-profiler-image-view');
218
- this.imageContainer = this.contentElement.createChild('div', 'paint-profiler-image-container');
219
- this.imageElement = this.imageContainer.createChild('img');
220
- this.maskElement = this.imageContainer.createChild('div');
221
- this.imageElement.addEventListener('load', this.updateImagePosition.bind(this), false);
257
+ #inputData: TimelinePaintImageViewInput = {
258
+ maskElementHidden: true,
259
+ imageContainerHidden: true,
260
+ imageURL: '',
261
+ imageContainerWebKitTransform: '',
262
+ maskElementStyle: {},
263
+ };
264
+
265
+ #view: typeof DEFAULT_VIEW;
266
+ #imageElementDimensions?: {
267
+ naturalHeight: number,
268
+ naturalWidth: number,
269
+ };
270
+
271
+ constructor(view = DEFAULT_VIEW) {
272
+ super();
273
+ this.registerRequiredCSS(timelinePaintProfilerStyles);
274
+ this.#view = view;
222
275
  this.transformController = new LayerViewer.TransformController.TransformController((this.contentElement), true);
223
276
  this.transformController.addEventListener(
224
277
  LayerViewer.TransformController.Events.TRANSFORM_CHANGED, this.updateImagePosition, this);
225
278
  }
226
279
 
227
280
  override onResize(): void {
228
- if (this.imageElement.src) {
229
- this.updateImagePosition();
230
- }
281
+ this.requestUpdate();
282
+ this.updateImagePosition();
231
283
  }
232
284
 
233
285
  private updateImagePosition(): void {
234
- const width = this.imageElement.naturalWidth;
235
- const height = this.imageElement.naturalHeight;
286
+ if (!this.#imageElementDimensions) {
287
+ return;
288
+ }
289
+
290
+ const width = this.#imageElementDimensions.naturalWidth;
291
+ const height = this.#imageElementDimensions.naturalHeight;
236
292
  const clientWidth = this.contentElement.clientWidth;
237
293
  const clientHeight = this.contentElement.clientHeight;
238
294
 
239
295
  const paddingFraction = 0.1;
240
296
  const paddingX = clientWidth * paddingFraction;
241
- const paddingY = clientHeight * paddingFraction;
242
- const scaleX = (clientWidth - paddingX) / width;
243
- const scaleY = (clientHeight - paddingY) / height;
244
- const scale = Math.min(scaleX, scaleY);
297
+ const scale = clientHeight / height;
245
298
 
299
+ const oldMaskStyle = JSON.stringify(this.#inputData.maskElementStyle);
300
+ let newMaskStyle = {};
246
301
  if (this.maskRectangle) {
247
- const style = this.maskElement.style;
248
- style.width = width + 'px';
249
- style.height = height + 'px';
250
- style.borderLeftWidth = this.maskRectangle.x + 'px';
251
- style.borderTopWidth = this.maskRectangle.y + 'px';
252
- style.borderRightWidth = (width - this.maskRectangle.x - this.maskRectangle.width) + 'px';
253
- style.borderBottomWidth = (height - this.maskRectangle.y - this.maskRectangle.height) + 'px';
302
+ newMaskStyle = {
303
+ width: width + 'px',
304
+ height: height + 'px',
305
+ borderLeftWidth: this.maskRectangle.x + 'px',
306
+ borderTopWidth: this.maskRectangle.y + 'px',
307
+ borderRightWidth: (width - this.maskRectangle.x - this.maskRectangle.width) + 'px',
308
+ borderBottomWidth: (height - this.maskRectangle.y - this.maskRectangle.height) + 'px',
309
+ };
310
+ }
311
+ this.#inputData.maskElementStyle = newMaskStyle;
312
+
313
+ if (!this.transformController) {
314
+ return;
254
315
  }
255
316
  this.transformController.setScaleConstraints(0.5, 10 / scale);
256
317
  let matrix = new WebKitCSSMatrix()
@@ -259,24 +320,40 @@ export class TimelinePaintImageView extends UI.Widget.Widget {
259
320
  .scale(scale, scale)
260
321
  .translate(-width / 2, -height / 2);
261
322
  const bounds = Geometry.boundsForTransformedPoints(matrix, [0, 0, 0, width, height, 0]);
262
- this.transformController.clampOffsets(
263
- paddingX - bounds.maxX, clientWidth - paddingX - bounds.minX, paddingY - bounds.maxY,
264
- clientHeight - paddingY - bounds.minY);
323
+ this.transformController.clampOffsets(paddingX - bounds.maxX, clientWidth - paddingX - bounds.minX, 0, 0);
265
324
  matrix = new WebKitCSSMatrix()
266
325
  .translate(this.transformController.offsetX(), this.transformController.offsetY())
267
326
  .multiply(matrix);
268
- this.imageContainer.style.webkitTransform = matrix.toString();
327
+
328
+ const oldTransform = this.#inputData.imageContainerWebKitTransform;
329
+ const newTransform = matrix.toString();
330
+ this.#inputData.imageContainerWebKitTransform = newTransform;
331
+
332
+ if (oldTransform !== newTransform || oldMaskStyle !== JSON.stringify(newMaskStyle)) {
333
+ this.requestUpdate();
334
+ }
269
335
  }
270
336
 
271
337
  showImage(imageURL?: string): void {
272
- this.imageContainer.classList.toggle('hidden', !imageURL);
338
+ this.#inputData.imageContainerHidden = !imageURL;
273
339
  if (imageURL) {
274
- this.imageElement.src = imageURL;
340
+ this.#inputData.imageURL = imageURL;
275
341
  }
342
+ this.requestUpdate();
276
343
  }
277
344
 
278
345
  setMask(maskRectangle: Protocol.DOM.Rect|null): void {
279
346
  this.maskRectangle = maskRectangle;
280
- this.maskElement.classList.toggle('hidden', !maskRectangle);
347
+
348
+ this.#inputData.maskElementHidden = !maskRectangle;
349
+ this.requestUpdate();
350
+ }
351
+
352
+ override performUpdate(): void {
353
+ const {imageElementNaturalHeight, imageElementNaturalWidth} =
354
+ this.#view(this.#inputData, undefined, this.contentElement);
355
+ this.#imageElementDimensions = {naturalHeight: imageElementNaturalHeight, naturalWidth: imageElementNaturalWidth};
356
+ // Image can only be updated to correctly fit the component when the component has loaded.
357
+ this.updateImagePosition();
281
358
  }
282
359
  }
@@ -306,7 +306,6 @@ const str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelinePanel.ts', UIS
306
306
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
307
307
 
308
308
  let timelinePanelInstance: TimelinePanel|undefined;
309
- let isNode: boolean;
310
309
 
311
310
  /**
312
311
  * Represents the states that the timeline panel can be in.
@@ -350,6 +349,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
350
349
  #viewMode: ViewMode = {mode: 'LANDING_PAGE'};
351
350
  readonly #dimThirdPartiesSetting: Common.Settings.Setting<boolean>|null = null;
352
351
  #thirdPartyCheckbox: UI.Toolbar.ToolbarSettingCheckbox|null = null;
352
+ #isNode = Root.Runtime.Runtime.isNode();
353
353
 
354
354
  #onAnnotationModifiedEventBound = this.#onAnnotationModifiedEvent.bind(this);
355
355
 
@@ -395,7 +395,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
395
395
  private traceLoadStart!: Trace.Types.Timing.Milli|null;
396
396
 
397
397
  #traceEngineModel: Trace.TraceModel.Model;
398
- #externalAIConversationData: AiAssistanceModel.ExternalPerformanceAIConversationData|null = null;
398
+ #externalAIConversationData: AiAssistanceModel.ConversationHandler.ExternalPerformanceAIConversationData|null = null;
399
399
  #sourceMapsResolver: SourceMapsResolver.SourceMapsResolver|null = null;
400
400
  #entityMapper: Trace.EntityMapper.EntityMapper|null = null;
401
401
  #onSourceMapsNodeNamesResolvedBound = this.#onSourceMapsNodeNamesResolved.bind(this);
@@ -462,7 +462,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
462
462
  this.toggleRecordAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.toggle-recording');
463
463
  this.recordReloadAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.record-reload');
464
464
 
465
- this.#historyManager = new TimelineHistoryManager(this.#minimapComponent, isNode);
465
+ this.#historyManager = new TimelineHistoryManager(this.#minimapComponent, this.#isNode);
466
466
 
467
467
  this.traceLoadStart = null;
468
468
 
@@ -477,7 +477,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
477
477
  this.captureSelectorStatsSetting.setTitle(i18nString(UIStrings.enableSelectorStats));
478
478
 
479
479
  this.showScreenshotsSetting =
480
- Common.Settings.Settings.instance().createSetting('timeline-show-screenshots', isNode ? false : true);
480
+ Common.Settings.Settings.instance().createSetting('timeline-show-screenshots', !this.#isNode);
481
481
  this.showScreenshotsSetting.setTitle(i18nString(UIStrings.screenshots));
482
482
  this.showScreenshotsSetting.addChangeListener(this.updateMiniMap, this);
483
483
 
@@ -503,7 +503,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
503
503
  this.panelToolbar.wrappable = true;
504
504
  this.panelRightToolbar = timelineToolbarContainer.createChild('devtools-toolbar');
505
505
  this.panelRightToolbar.role = 'presentation';
506
- if (!isNode && this.canRecord()) {
506
+ if (!this.#isNode && this.canRecord()) {
507
507
  this.createSettingsPane();
508
508
  this.updateShowSettingsToolbarButton();
509
509
  }
@@ -698,11 +698,9 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
698
698
 
699
699
  static instance(opts: {
700
700
  forceNew: boolean|null,
701
- isNode: boolean,
702
701
  traceModel?: Trace.TraceModel.Model,
703
- }|undefined = {forceNew: null, isNode: false}): TimelinePanel {
704
- const {forceNew, isNode: isNodeMode} = opts;
705
- isNode = isNodeMode;
702
+ }|undefined = {forceNew: null}): TimelinePanel {
703
+ const {forceNew} = opts;
706
704
 
707
705
  if (!timelinePanelInstance || forceNew) {
708
706
  timelinePanelInstance = new TimelinePanel(opts.traceModel);
@@ -751,6 +749,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
751
749
  }
752
750
 
753
751
  override willHide(): void {
752
+ super.willHide();
754
753
  UI.Context.Context.instance().setFlavor(TimelinePanel, null);
755
754
  this.#historyManager.cancelIfShowing();
756
755
 
@@ -937,24 +936,24 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
937
936
  return this.#traceEngineModel;
938
937
  }
939
938
 
940
- getOrCreateExternalAIConversationData(): AiAssistanceModel.ExternalPerformanceAIConversationData {
939
+ getOrCreateExternalAIConversationData(): AiAssistanceModel.ConversationHandler.ExternalPerformanceAIConversationData {
941
940
  if (!this.#externalAIConversationData) {
942
- const conversationHandler = AiAssistanceModel.ConversationHandler.instance();
943
- const focus = AiAssistanceModel.getPerformanceAgentFocusFromModel(this.model);
941
+ const conversationHandler = AiAssistanceModel.ConversationHandler.ConversationHandler.instance();
942
+ const focus = AiAssistanceModel.AIContext.getPerformanceAgentFocusFromModel(this.model);
944
943
  if (!focus) {
945
944
  throw new Error('could not create performance agent focus');
946
945
  }
947
946
 
948
- const agent = conversationHandler.createAgent(AiAssistanceModel.ConversationType.PERFORMANCE);
949
- const conversation = new AiAssistanceModel.Conversation(
950
- AiAssistanceModel.ConversationType.PERFORMANCE,
947
+ const agent = conversationHandler.createAgent(AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE);
948
+ const conversation = new AiAssistanceModel.AiHistoryStorage.Conversation(
949
+ AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE,
951
950
  [],
952
951
  agent.id,
953
952
  /* isReadOnly */ true,
954
953
  /* isExternal */ true,
955
954
  );
956
955
 
957
- const selected = new AiAssistanceModel.PerformanceTraceContext(focus);
956
+ const selected = new AiAssistanceModel.PerformanceAgent.PerformanceTraceContext(focus);
958
957
  selected.external = true;
959
958
 
960
959
  this.#externalAIConversationData = {
@@ -1060,32 +1059,17 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
1060
1059
  }
1061
1060
 
1062
1061
  /**
1063
- * Returns false if DevTools is in a standalone context where tracing/recording are NOT available.
1064
- *
1065
- * This includes scenarios like:
1066
- * - viewing an enhanced trace
1067
- * - viewing a trace in trace.cafe
1068
- * - other devtools_app.html scenarios without valid `ws=` param.
1069
- * - See also the `isHostedMode` comment in `InspectorFrontendHost.ts`
1070
- *
1071
- * Possible signals to find a no-record (NR) context:
1072
- * - `primaryPageTarget()?.sessionId` is empty in NR, but populated when viewing an enhanced trace.
1073
- * - `primaryPageTarget.#capabilitiesMask` There's a tracing capability but the advertised capabilities are quite unreliable.
1074
- * - `primaryPageTarget.targets().length === 1` Mostly correct for NC but its 2 when viewing an enhanced trace.
1075
- * - `primaryPageTarget.router().connection()` Perhaps StubConnection or RehydratingConnection but MainConnection is incorrectly used sometimes. (eg devtools://devtools/bundled/devtools_app.html)
1076
- * - `resourceTreeModel?.mainFrame === null`. Correct for NR, HOWEVER Node.js canRecord despite no main frame.
1077
- * - `rootTarget.type !== 'tab'` Has potential but it lies. (It's "browser" for Node despite a node type)
1078
- *
1079
- * The best signal, for now, is this combo (`isNode || hasMainFrame`), which is both well-maintained and correct in all known cases:
1062
+ * Returns false if DevTools is in a standalone context where tracing/recording are
1063
+ * NOT available.
1080
1064
  */
1081
1065
  private canRecord(): boolean {
1082
- return SDK.TargetManager.TargetManager.instance().hasFakeConnection() === false;
1066
+ return !Root.Runtime.Runtime.isTraceApp();
1083
1067
  }
1084
1068
 
1085
1069
  private populateToolbar(): void {
1086
1070
  const canRecord = this.canRecord();
1087
1071
 
1088
- if (canRecord || isNode) {
1072
+ if (canRecord || this.#isNode) {
1089
1073
  this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.toggleRecordAction));
1090
1074
  }
1091
1075
  if (canRecord) {
@@ -1118,7 +1102,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
1118
1102
  if (canRecord) {
1119
1103
  this.panelToolbar.appendSeparator();
1120
1104
 
1121
- if (!isNode) {
1105
+ if (!this.#isNode) {
1122
1106
  this.homeButton = new UI.Toolbar.ToolbarButton(
1123
1107
  i18nString(UIStrings.backToLiveMetrics), 'home', undefined, 'timeline.back-to-live-metrics');
1124
1108
  this.homeButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {
@@ -1135,7 +1119,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
1135
1119
 
1136
1120
  // View
1137
1121
  this.panelToolbar.appendSeparator();
1138
- if (!isNode) {
1122
+ if (!this.#isNode) {
1139
1123
  this.showScreenshotsToolbarCheckbox =
1140
1124
  this.createSettingCheckbox(this.showScreenshotsSetting, i18nString(UIStrings.captureScreenshots));
1141
1125
  this.panelToolbar.appendToolbarItem(this.showScreenshotsToolbarCheckbox);
@@ -1163,14 +1147,14 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
1163
1147
  }
1164
1148
 
1165
1149
  // Isolate selector
1166
- if (isNode) {
1150
+ if (this.#isNode) {
1167
1151
  const isolateSelector = new IsolateSelector();
1168
1152
  this.panelToolbar.appendSeparator();
1169
1153
  this.panelToolbar.appendToolbarItem(isolateSelector);
1170
1154
  }
1171
1155
 
1172
1156
  // Settings
1173
- if (!isNode && canRecord) {
1157
+ if (!this.#isNode && canRecord) {
1174
1158
  this.panelRightToolbar.appendSeparator();
1175
1159
  this.panelRightToolbar.appendToolbarItem(this.showSettingsPaneButton);
1176
1160
  }
@@ -1653,9 +1637,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
1653
1637
  let pathToLaunch: string|null = null;
1654
1638
  const url = new URL(window.location.href);
1655
1639
  const pathToEntrypoint = url.pathname.slice(0, url.pathname.lastIndexOf('/'));
1656
- url.pathname = `${pathToEntrypoint}/rehydrated_devtools_app.html`;
1657
- // The standalone devtools shouldn't retain any existing query params.
1658
- url.search = '';
1640
+ url.pathname = `${pathToEntrypoint}/trace_app.html`;
1659
1641
  pathToLaunch = url.toString();
1660
1642
 
1661
1643
  // Clarifying the window the code is referring to
@@ -1728,7 +1710,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
1728
1710
  }
1729
1711
 
1730
1712
  private updateSettingsPaneVisibility(): void {
1731
- if (isNode || !this.canRecord()) {
1713
+ if (this.#isNode || !this.canRecord()) {
1732
1714
  return;
1733
1715
  }
1734
1716
  if (this.showSettingsPaneSetting.get()) {
@@ -1926,7 +1908,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
1926
1908
  this.setState(State.START_PENDING);
1927
1909
  this.showRecordingStarted();
1928
1910
 
1929
- if (isNode) {
1911
+ if (this.#isNode) {
1930
1912
  await this.#startCPUProfilingRecording();
1931
1913
  } else {
1932
1914
  await this.#startTraceRecording();
@@ -2033,7 +2015,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2033
2015
  return;
2034
2016
  }
2035
2017
 
2036
- this.recordReloadAction.setEnabled(isNode ? false : this.state === State.IDLE);
2018
+ this.recordReloadAction.setEnabled(this.#isNode ? false : this.state === State.IDLE);
2037
2019
  this.homeButton?.setEnabled(this.state === State.IDLE && this.#hasActiveTrace());
2038
2020
  }
2039
2021
 
@@ -2065,7 +2047,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2065
2047
  this.flameChart.getNetworkDataProvider().reset();
2066
2048
  this.flameChart.reset();
2067
2049
  this.#changeView({mode: 'LANDING_PAGE'});
2068
- UI.Context.Context.instance().setFlavor(AiAssistanceModel.AgentFocus, null);
2050
+ UI.Context.Context.instance().setFlavor(AiAssistanceModel.AIContext.AgentFocus, null);
2069
2051
  }
2070
2052
 
2071
2053
  #hasActiveTrace(): boolean {
@@ -2251,7 +2233,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2251
2233
 
2252
2234
  if (parsedTrace.metadata.dataOrigin !== Trace.Types.File.DataOrigin.CPU_PROFILE) {
2253
2235
  UI.Context.Context.instance().setFlavor(
2254
- AiAssistanceModel.AgentFocus, AiAssistanceModel.AgentFocus.fromParsedTrace(parsedTrace));
2236
+ AiAssistanceModel.AIContext.AgentFocus, AiAssistanceModel.AIContext.AgentFocus.fromParsedTrace(parsedTrace));
2255
2237
  }
2256
2238
  }
2257
2239
 
@@ -2428,7 +2410,6 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2428
2410
  }
2429
2411
 
2430
2412
  const liveMetrics = new TimelineComponents.LiveMetricsView.LiveMetricsView();
2431
- liveMetrics.isNode = isNode;
2432
2413
  this.landingPage = LegacyWrapper.LegacyWrapper.legacyWrapper(UI.Widget.Widget, liveMetrics);
2433
2414
  this.landingPage.element.classList.add('timeline-landing-page', 'fill');
2434
2415
  this.landingPage.contentElement.classList.add('fill');
@@ -3032,10 +3013,10 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
3032
3013
  }
3033
3014
 
3034
3015
  static async *
3035
- handleExternalRecordRequest():
3036
- AsyncGenerator<AiAssistanceModel.ExternalRequestResponse, AiAssistanceModel.ExternalRequestResponse> {
3016
+ handleExternalRecordRequest(): AsyncGenerator<
3017
+ AiAssistanceModel.AiAgent.ExternalRequestResponse, AiAssistanceModel.AiAgent.ExternalRequestResponse> {
3037
3018
  yield {
3038
- type: AiAssistanceModel.ExternalRequestResponseType.NOTIFICATION,
3019
+ type: AiAssistanceModel.AiAgent.ExternalRequestResponseType.NOTIFICATION,
3039
3020
  message: 'Recording performance trace',
3040
3021
  };
3041
3022
  TimelinePanel.instance().invalidateExternalAIConversationData();
@@ -3048,10 +3029,10 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
3048
3029
  await UI.ViewManager.ViewManager.instance().showView('timeline');
3049
3030
 
3050
3031
  function onRecordingCompleted(eventData: EventTypes[Events.RECORDING_COMPLETED]):
3051
- AiAssistanceModel.ExternalRequestResponse {
3032
+ AiAssistanceModel.AiAgent.ExternalRequestResponse {
3052
3033
  if ('errorText' in eventData) {
3053
3034
  return {
3054
- type: AiAssistanceModel.ExternalRequestResponseType.ERROR,
3035
+ type: AiAssistanceModel.AiAgent.ExternalRequestResponseType.ERROR,
3055
3036
  message: `Error running the trace: ${eventData.errorText}`,
3056
3037
  };
3057
3038
  }
@@ -3059,7 +3040,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
3059
3040
  const parsedTrace = panelInstance.model.parsedTrace(eventData.traceIndex);
3060
3041
  if (!parsedTrace || !parsedTrace.insights || parsedTrace.insights.size === 0) {
3061
3042
  return {
3062
- type: AiAssistanceModel.ExternalRequestResponseType.ERROR,
3043
+ type: AiAssistanceModel.AiAgent.ExternalRequestResponseType.ERROR,
3063
3044
  message: 'The trace was loaded successfully but no Insights were detected.',
3064
3045
  };
3065
3046
  }
@@ -3067,7 +3048,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
3067
3048
  const navigationId = Array.from(parsedTrace.insights.keys()).find(k => k !== 'NO_NAVIGATION');
3068
3049
  if (!navigationId) {
3069
3050
  return {
3070
- type: AiAssistanceModel.ExternalRequestResponseType.ERROR,
3051
+ type: AiAssistanceModel.AiAgent.ExternalRequestResponseType.ERROR,
3071
3052
  message: 'The trace was loaded successfully but no navigation was detected.',
3072
3053
  };
3073
3054
  }
@@ -3075,7 +3056,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
3075
3056
  const insightsForNav = parsedTrace.insights.get(navigationId);
3076
3057
  if (!insightsForNav) {
3077
3058
  return {
3078
- type: AiAssistanceModel.ExternalRequestResponseType.ERROR,
3059
+ type: AiAssistanceModel.AiAgent.ExternalRequestResponseType.ERROR,
3079
3060
  message: 'The trace was loaded successfully but no Insights were detected.',
3080
3061
  };
3081
3062
  }
@@ -3089,8 +3070,8 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
3089
3070
  for (const modelName in insightsForNav.model) {
3090
3071
  const model = modelName as keyof Trace.Insights.Types.InsightModelsType;
3091
3072
  const insight = insightsForNav.model[model];
3092
- const focus = AiAssistanceModel.AgentFocus.fromParsedTrace(parsedTrace);
3093
- const formatter = new AiAssistanceModel.PerformanceInsightFormatter(focus, insight);
3073
+ const focus = AiAssistanceModel.AIContext.AgentFocus.fromParsedTrace(parsedTrace);
3074
+ const formatter = new AiAssistanceModel.PerformanceInsightFormatter.PerformanceInsightFormatter(focus, insight);
3094
3075
  if (!formatter.insightIsSupported()) {
3095
3076
  // Not all Insights are integrated with "Ask AI" yet, let's avoid
3096
3077
  // filling up the response with those ones because there will be no
@@ -3121,7 +3102,7 @@ These insights are passing, which means they are not considered to highlight con
3121
3102
  ${responseTextForPassedInsights}`;
3122
3103
 
3123
3104
  return {
3124
- type: AiAssistanceModel.ExternalRequestResponseType.ANSWER,
3105
+ type: AiAssistanceModel.AiAgent.ExternalRequestResponseType.ANSWER,
3125
3106
  message: finalText,
3126
3107
  devToolsLogs: [],
3127
3108
  };
@@ -3138,11 +3119,11 @@ ${responseTextForPassedInsights}`;
3138
3119
  });
3139
3120
  }
3140
3121
 
3141
- static async handleExternalAnalyzeRequest(prompt: string):
3142
- Promise<AsyncGenerator<AiAssistanceModel.ExternalRequestResponse, AiAssistanceModel.ExternalRequestResponse>> {
3122
+ static async handleExternalAnalyzeRequest(prompt: string): Promise<AsyncGenerator<
3123
+ AiAssistanceModel.AiAgent.ExternalRequestResponse, AiAssistanceModel.AiAgent.ExternalRequestResponse>> {
3143
3124
  const data = TimelinePanel.instance().getOrCreateExternalAIConversationData();
3144
3125
  return await data.conversationHandler.handleExternalRequest({
3145
- conversationType: AiAssistanceModel.ConversationType.PERFORMANCE,
3126
+ conversationType: AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE,
3146
3127
  prompt,
3147
3128
  data,
3148
3129
  });
@@ -601,6 +601,7 @@ export class TimelineTreeView extends
601
601
  }
602
602
 
603
603
  override wasShown(): void {
604
+ super.wasShown();
604
605
  this.dataGrid.addEventListener(DataGrid.DataGrid.Events.SELECTED_NODE, this.#onDataGridSelectionChange, this);
605
606
  this.dataGrid.addEventListener(DataGrid.DataGrid.Events.DESELECTED_NODE, this.#onDataGridDeselection, this);
606
607
  }
@@ -13,6 +13,7 @@ import './MetricCard.js';
13
13
  import * as Common from '../../../core/common/common.js';
14
14
  import * as i18n from '../../../core/i18n/i18n.js';
15
15
  import type * as Platform from '../../../core/platform/platform.js';
16
+ import * as Root from '../../../core/root/root.js';
16
17
  import * as SDK from '../../../core/sdk/sdk.js';
17
18
  import * as CrUXManager from '../../../models/crux-manager/crux-manager.js';
18
19
  import * as EmulationModel from '../../../models/emulation/emulation.js';
@@ -296,7 +297,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
296
297
  export class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableComponent {
297
298
  readonly #shadow = this.attachShadow({mode: 'open'});
298
299
 
299
- #isNode = false;
300
+ isNode = Root.Runtime.Runtime.isNode();
300
301
 
301
302
  #lcpValue?: LiveMetrics.LcpValue;
302
303
  #clsValue?: LiveMetrics.ClsValue;
@@ -323,11 +324,6 @@ export class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableCompon
323
324
  this.#recordReloadAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.record-reload');
324
325
  }
325
326
 
326
- set isNode(isNode: boolean) {
327
- this.#isNode = isNode;
328
- void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
329
- }
330
-
331
327
  #onMetricStatus(event: {data: LiveMetrics.StatusEvent}): void {
332
328
  this.#lcpValue = event.data.lcp;
333
329
  this.#clsValue = event.data.cls;
@@ -385,7 +381,7 @@ export class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableCompon
385
381
  }
386
382
 
387
383
  async #refreshFieldDataForCurrentPage(): Promise<void> {
388
- if (!this.#isNode) {
384
+ if (!this.isNode) {
389
385
  await this.#cruxManager.refresh();
390
386
  }
391
387
  void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
@@ -1082,7 +1078,7 @@ export class LiveMetricsView extends LegacyWrapper.LegacyWrapper.WrappableCompon
1082
1078
  }
1083
1079
 
1084
1080
  #render = (): void => {
1085
- if (this.#isNode) {
1081
+ if (this.isNode) {
1086
1082
  Lit.render(this.#renderNodeView(), this.#shadow, {host: this});
1087
1083
  return;
1088
1084
  }
@@ -93,6 +93,7 @@ export class SidebarWidget extends UI.Widget.VBox {
93
93
  }
94
94
 
95
95
  override wasShown(): void {
96
+ super.wasShown();
96
97
  this.#tabbedPane.show(this.element);
97
98
  this.#updateAnnotationsCountBadge();
98
99
 
@@ -114,6 +115,7 @@ export class SidebarWidget extends UI.Widget.VBox {
114
115
  }
115
116
 
116
117
  override willHide(): void {
118
+ super.willHide();
117
119
  const currentlyActiveInsight = this.#insightsView.getActiveInsight();
118
120
  this.#insightToRestoreOnOpen = currentlyActiveInsight;
119
121
 
@@ -434,7 +434,7 @@ export class SidebarSingleInsightSet extends HTMLElement {
434
434
  return html``;
435
435
  }
436
436
 
437
- const agentFocus = AIAssistance.AgentFocus.fromInsight(this.#data.parsedTrace, model);
437
+ const agentFocus = AIAssistance.AIContext.AgentFocus.fromInsight(this.#data.parsedTrace, model);
438
438
  // clang-format off
439
439
  return html`<div>
440
440
  <${componentClass.litTagName}