chrome-devtools-frontend 1.0.1664496 → 1.0.1665921

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 (407) hide show
  1. package/.agents/skills/devtools-testing-guidance/SKILL.md +48 -0
  2. package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +3 -3
  3. package/.agents/skills/repro-flaky-tests/SKILL.md +2 -2
  4. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +7 -1
  5. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +2 -0
  6. package/.agents/skills/version-control/SKILL.md +4 -3
  7. package/docs/ui_engineering.md +89 -0
  8. package/eslint.config.mjs +9 -2
  9. package/front_end/Images/rollup.config.mjs +1 -1
  10. package/front_end/Tests.js +15 -16
  11. package/front_end/core/common/Gzip.ts +2 -2
  12. package/front_end/core/common/Settings.ts +4 -20
  13. package/front_end/core/common/Srcset.ts +1 -1
  14. package/front_end/core/common/VersionController.ts +1 -1
  15. package/front_end/core/host/AidaClient.ts +19 -4
  16. package/front_end/core/host/AidaGcaTranslation.ts +2 -2
  17. package/front_end/core/host/GcaClient.ts +2 -2
  18. package/front_end/core/host/GdpClient.ts +3 -3
  19. package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
  20. package/front_end/core/host/ResourceLoader.ts +15 -15
  21. package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -2
  22. package/front_end/core/protocol_client/InspectorBackend.ts +1 -1
  23. package/front_end/core/root/Runtime.ts +0 -1
  24. package/front_end/core/sdk/CSSMatchedStyles.ts +78 -3
  25. package/front_end/core/sdk/CSSMetadata.ts +17 -12
  26. package/front_end/core/sdk/CSSProperty.ts +1 -1
  27. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +2 -2
  28. package/front_end/core/sdk/CSSRule.ts +3 -3
  29. package/front_end/core/sdk/CSSStyleSheetHeader.ts +3 -3
  30. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +1 -1
  31. package/front_end/core/sdk/Connections.ts +1 -1
  32. package/front_end/core/sdk/DebuggerModel.ts +13 -13
  33. package/front_end/core/sdk/NetworkManager.ts +19 -19
  34. package/front_end/core/sdk/NetworkRequest.ts +57 -57
  35. package/front_end/core/sdk/OverlayModel.ts +1 -1
  36. package/front_end/core/sdk/PageResourceLoader.ts +2 -2
  37. package/front_end/core/sdk/RehydratingConnection.ts +5 -5
  38. package/front_end/core/sdk/ScreenCaptureModel.ts +1 -1
  39. package/front_end/core/sdk/Script.ts +2 -2
  40. package/front_end/core/sdk/ServerTiming.ts +7 -7
  41. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +1 -1
  42. package/front_end/core/sdk/ServiceWorkerManager.ts +11 -11
  43. package/front_end/core/sdk/SourceMapScopeChainEntry.ts +2 -2
  44. package/front_end/core/sdk/SourceMapScopesInfo.ts +1 -1
  45. package/front_end/core/sdk/StorageKeyManager.ts +1 -1
  46. package/front_end/core/sdk/sdk-meta.ts +98 -98
  47. package/front_end/devtools_compatibility.js +15 -13
  48. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +4 -8
  49. package/front_end/entrypoints/main/MainImpl.ts +2 -3
  50. package/front_end/entrypoints/main/main-meta.ts +1 -16
  51. package/front_end/entrypoints/shell/shell.ts +1 -0
  52. package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
  53. package/front_end/foundation/README.md +1 -1
  54. package/front_end/foundation/Universe.test.api.ts +73 -0
  55. package/front_end/foundation/Universe.ts +22 -0
  56. package/front_end/generated/InspectorBackendCommands.ts +2 -2
  57. package/front_end/generated/SupportedCSSProperties.js +1 -1
  58. package/front_end/generated/protocol.ts +19 -0
  59. package/front_end/models/ai_assistance/AiAgent2.ts +1 -1
  60. package/front_end/models/ai_assistance/AiConversation.ts +1 -1
  61. package/front_end/models/ai_assistance/BuiltInAi.ts +1 -1
  62. package/front_end/models/ai_assistance/ChangeManager.ts +0 -70
  63. package/front_end/models/ai_assistance/ExtensionScope.ts +2 -36
  64. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +9 -9
  65. package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -2
  66. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +4 -4
  67. package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +1 -1
  68. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +21 -21
  69. package/front_end/models/ai_assistance/agents/StorageAgent.ts +4 -4
  70. package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
  71. package/front_end/models/ai_assistance/ai_assistance.ts +0 -5
  72. package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +11 -4
  73. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +8 -2
  74. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +14 -11
  75. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +2 -2
  76. package/front_end/models/ai_assistance/performance/AICallTree.ts +2 -2
  77. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +1 -1
  78. package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +9 -2
  79. package/front_end/models/ai_assistance/tools/GetStyles.ts +4 -4
  80. package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +2 -5
  81. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -2
  82. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -2
  83. package/front_end/models/badges/badges-meta.ts +27 -0
  84. package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -3
  85. package/front_end/models/bindings/ContentProviderBasedProject.ts +1 -1
  86. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +6 -7
  87. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +5 -4
  88. package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +72 -29
  89. package/front_end/models/bindings/ResourceMapping.ts +38 -32
  90. package/front_end/models/bindings/ResourceScriptMapping.ts +5 -7
  91. package/front_end/models/breakpoints/BreakpointManager.ts +2 -1
  92. package/front_end/models/har/Writer.ts +2 -2
  93. package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +1 -1
  94. package/front_end/models/issues_manager/GenericIssue.ts +1 -1
  95. package/front_end/models/issues_manager/IssuesManager.ts +14 -5
  96. package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +1 -1
  97. package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +2 -2
  98. package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +13 -2
  99. package/front_end/models/issues_manager/issues_manager.ts +0 -2
  100. package/front_end/models/live-metrics/LiveMetrics.ts +22 -5
  101. package/front_end/models/live-metrics/web-vitals-injected/rollup.config.mjs +1 -1
  102. package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +10 -4
  103. package/front_end/models/logs/logs-meta.ts +23 -16
  104. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +2 -2
  105. package/front_end/models/persistence/IsolatedFileSystem.ts +1 -1
  106. package/front_end/models/persistence/IsolatedFileSystemManager.ts +1 -1
  107. package/front_end/models/source_map_scopes/NamesResolver.ts +104 -86
  108. package/front_end/models/source_map_scopes/ScopeChainModel.ts +6 -2
  109. package/front_end/models/stack_trace/StackTraceModel.ts +1 -1
  110. package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +1 -1
  111. package/front_end/models/trace/handlers/UserTimingsHandler.ts +17 -6
  112. package/front_end/models/trace/helpers/SamplesIntegrator.ts +1 -1
  113. package/front_end/models/trace/helpers/Timing.ts +1 -1
  114. package/front_end/models/trace/insights/Common.ts +1 -1
  115. package/front_end/models/trace/insights/DocumentLatency.ts +3 -3
  116. package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
  117. package/front_end/models/trace/insights/ModernHTTP.ts +1 -1
  118. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +2 -2
  119. package/front_end/models/workspace_diff/WorkspaceDiff.ts +14 -9
  120. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +2 -15
  121. package/front_end/panels/ai_assistance/ai_assistance.ts +1 -2
  122. package/front_end/panels/ai_assistance/components/ChatInput.ts +23 -19
  123. package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -18
  124. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -35
  125. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
  126. package/front_end/panels/ai_assistance/components/ExploreWidget.ts +4 -4
  127. package/front_end/panels/ai_assistance/components/ImageResize.ts +74 -0
  128. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +2 -2
  129. package/front_end/panels/animation/AnimationGroupPreviewUI.ts +28 -29
  130. package/front_end/panels/animation/AnimationTimeline.ts +3 -3
  131. package/front_end/panels/animation/animationTimeline.css +0 -2
  132. package/front_end/panels/application/AppManifestView.ts +1 -1
  133. package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -1
  134. package/front_end/panels/application/CookieItemsView.ts +1 -1
  135. package/front_end/panels/application/CrashReportContextView.ts +3 -3
  136. package/front_end/panels/application/DeviceBoundSessionsModel.ts +1 -1
  137. package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +1 -1
  138. package/front_end/panels/application/DeviceBoundSessionsView.ts +1 -1
  139. package/front_end/panels/application/IndexedDBViews.ts +1 -1
  140. package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -1
  141. package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
  142. package/front_end/panels/application/ServiceWorkersView.ts +6 -6
  143. package/front_end/panels/application/StorageBucketsTreeElement.ts +1 -1
  144. package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
  145. package/front_end/panels/application/WebMCPView.ts +7 -5
  146. package/front_end/panels/application/components/AdsView.ts +21 -6
  147. package/front_end/panels/application/components/BackForwardCacheView.ts +2 -2
  148. package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
  149. package/front_end/panels/application/components/StorageMetadataView.ts +1 -1
  150. package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
  151. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +2 -1
  152. package/front_end/panels/application/preloading/components/PreloadingString.ts +3 -3
  153. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -1
  154. package/front_end/panels/autofill/AutofillView.ts +1 -1
  155. package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +1 -1
  156. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +2 -2
  157. package/front_end/panels/changes/ChangesSidebar.ts +2 -2
  158. package/front_end/panels/changes/ChangesView.ts +4 -5
  159. package/front_end/panels/changes/CombinedDiffView.ts +3 -3
  160. package/front_end/panels/changes/changes-meta.ts +2 -2
  161. package/front_end/panels/common/AiCodeCompletionTeaser.ts +1 -1
  162. package/front_end/panels/common/AiCodeGenerationTeaser.ts +3 -3
  163. package/front_end/panels/common/BadgeNotification.ts +8 -8
  164. package/front_end/panels/common/DOMLinkifier.ts +1 -1
  165. package/front_end/panels/common/GdpSignUpDialog.ts +2 -2
  166. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
  167. package/front_end/panels/common/aiCodeCompletionDisclaimer.css +0 -1
  168. package/front_end/panels/console/ConsoleInsightTeaser.ts +1 -1
  169. package/front_end/panels/console/ConsolePinPane.ts +3 -3
  170. package/front_end/panels/console/ConsolePrompt.ts +6 -4
  171. package/front_end/panels/console/ConsoleSidebar.ts +8 -10
  172. package/front_end/panels/console_counters/WarningErrorCounter.ts +10 -11
  173. package/front_end/panels/coverage/CoverageView.ts +2 -2
  174. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
  175. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +1 -1
  176. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
  177. package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
  178. package/front_end/panels/elements/ComputedStyleWidget.ts +3 -2
  179. package/front_end/panels/elements/ElementsTreeElement.ts +3 -3
  180. package/front_end/panels/elements/EventListenersWidget.ts +1 -3
  181. package/front_end/panels/elements/LayoutPane.ts +23 -13
  182. package/front_end/panels/elements/StandaloneStylesContainer.ts +7 -7
  183. package/front_end/panels/elements/StylePropertiesSection.ts +33 -5
  184. package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -5
  185. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +6 -6
  186. package/front_end/panels/elements/StylesSidebarPane.ts +4 -3
  187. package/front_end/panels/elements/elements-meta.ts +18 -2
  188. package/front_end/panels/emulation/DeviceModeToolbar.ts +100 -40
  189. package/front_end/panels/emulation/DeviceModeView.ts +5 -4
  190. package/front_end/panels/emulation/MediaQueryInspector.ts +35 -19
  191. package/front_end/panels/event_listeners/EventListenersView.ts +4 -4
  192. package/front_end/panels/explain/components/ConsoleInsight.ts +8 -9
  193. package/front_end/panels/explain/explain-meta.ts +3 -3
  194. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +135 -167
  195. package/front_end/panels/layer_viewer/Layers3DView.ts +10 -23
  196. package/front_end/panels/layer_viewer/layer_viewer-meta.ts +27 -0
  197. package/front_end/panels/lighthouse/LighthouseController.ts +44 -55
  198. package/front_end/panels/lighthouse/LighthousePanel.ts +9 -9
  199. package/front_end/panels/lighthouse/LighthouseReportSelector.ts +2 -2
  200. package/front_end/panels/lighthouse/LighthouseStartView.ts +9 -12
  201. package/front_end/panels/lighthouse/LighthouseStatusView.ts +33 -33
  202. package/front_end/panels/lighthouse/RadioSetting.ts +1 -1
  203. package/front_end/panels/lighthouse/lighthouse-meta.ts +131 -1
  204. package/front_end/panels/media/EventDisplayTable.ts +67 -94
  205. package/front_end/panels/media/PlayerListView.ts +1 -1
  206. package/front_end/panels/media/eventDisplayTable.css +9 -4
  207. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +5 -5
  208. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
  209. package/front_end/panels/network/EventSourceMessagesView.ts +98 -107
  210. package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
  211. package/front_end/panels/network/NetworkWaterfallColumn.ts +1 -1
  212. package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
  213. package/front_end/panels/network/RequestCookiesView.ts +2 -2
  214. package/front_end/panels/network/RequestHeadersView.ts +5 -5
  215. package/front_end/panels/network/RequestPayloadView.ts +4 -4
  216. package/front_end/panels/network/RequestTimingView.ts +2 -2
  217. package/front_end/panels/network/components/DirectSocketConnectionView.ts +1 -1
  218. package/front_end/panels/network/eventSourceMessagesView.css +12 -3
  219. package/front_end/panels/network/networkTimingTable.css +2 -2
  220. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
  221. package/front_end/panels/profiler/BottomUpProfileDataGrid.ts +25 -29
  222. package/front_end/panels/profiler/HeapProfileView.ts +308 -247
  223. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +13 -3
  224. package/front_end/panels/profiler/HeapSnapshotView.ts +30 -10
  225. package/front_end/panels/profiler/HeapTimelineOverview.ts +5 -2
  226. package/front_end/panels/profiler/ProfileDataGrid.ts +128 -157
  227. package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +17 -5
  228. package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
  229. package/front_end/panels/profiler/TopDownProfileDataGrid.ts +17 -21
  230. package/front_end/panels/profiler/profilesPanel.css +9 -13
  231. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
  232. package/front_end/panels/recorder/CreateRecordingView.ts +4 -4
  233. package/front_end/panels/recorder/RecorderPanel.ts +6 -6
  234. package/front_end/panels/recorder/RecordingView.ts +1 -1
  235. package/front_end/panels/recorder/ReplaySection.ts +1 -1
  236. package/front_end/panels/recorder/StepView.ts +1 -1
  237. package/front_end/panels/recorder/injected/rollup.config.mjs +1 -1
  238. package/front_end/panels/search/SearchView.ts +1 -1
  239. package/front_end/panels/security/SecurityPanel.ts +54 -41
  240. package/front_end/panels/sensors/LocationsSettingsTab.ts +246 -233
  241. package/front_end/panels/sensors/SensorsView.ts +1 -1
  242. package/front_end/panels/settings/AISettingsTab.ts +11 -10
  243. package/front_end/panels/settings/SettingsScreen.ts +29 -24
  244. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
  245. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +5 -5
  246. package/front_end/panels/sources/BreakpointEditDialog.ts +2 -2
  247. package/front_end/panels/sources/BreakpointsView.ts +1 -1
  248. package/front_end/panels/sources/CallStackSidebarPane.ts +2 -2
  249. package/front_end/panels/sources/DebuggerPausedMessage.ts +2 -2
  250. package/front_end/panels/sources/DebuggerPlugin.ts +25 -22
  251. package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -1
  252. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +7 -5
  253. package/front_end/panels/sources/sources-meta.ts +1 -1
  254. package/front_end/panels/timeline/CountersGraph.ts +1 -2
  255. package/front_end/panels/timeline/ExtensionTrackAppender.ts +1 -1
  256. package/front_end/panels/timeline/TimelineDetailsView.ts +2 -2
  257. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -2
  258. package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -4
  259. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +1 -1
  260. package/front_end/panels/timeline/TimelinePanel.ts +53 -81
  261. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +10 -3
  262. package/front_end/panels/timeline/TimelineUIUtils.ts +18 -4
  263. package/front_end/panels/timeline/TrackConfigBanner.ts +1 -1
  264. package/front_end/panels/timeline/components/ExportTraceOptions.ts +1 -1
  265. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +8 -9
  266. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
  267. package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +1 -1
  268. package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +2 -2
  269. package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +1 -1
  270. package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +1 -1
  271. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
  272. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +5 -0
  273. package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +13 -8
  274. package/front_end/panels/timeline/overlays/components/timespanBreakdownOverlay.css +1 -0
  275. package/front_end/panels/timeline/timeline-meta.ts +169 -0
  276. package/front_end/panels/timeline/timelineFlameChartView.css +5 -0
  277. package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
  278. package/front_end/panels/whats_new/ReleaseNoteText.ts +9 -9
  279. package/front_end/panels/whats_new/resources/WNDT.md +7 -8
  280. package/front_end/third_party/chromium/README.chromium +1 -1
  281. package/front_end/third_party/web-vitals/README.chromium +2 -2
  282. package/front_end/third_party/web-vitals/package/README.md +120 -19
  283. package/front_end/third_party/web-vitals/package/attribution.d.ts +16 -0
  284. package/front_end/third_party/web-vitals/package/attribution.js +18 -0
  285. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +1 -1
  286. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +1 -7
  287. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +53 -32
  288. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +2 -2
  289. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +43 -12
  290. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +1 -1
  291. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +21 -3
  292. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +1 -1
  293. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +30 -24
  294. package/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.d.ts +3 -0
  295. package/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.js +18 -0
  296. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +2 -1
  297. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +18 -2
  298. package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +1 -0
  299. package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.js +1 -0
  300. package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.d.ts +1 -1
  301. package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
  302. package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.d.ts +1 -1
  303. package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.js +7 -7
  304. package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +1 -1
  305. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -1
  306. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +4 -1
  307. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +7 -3
  308. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +20 -11
  309. package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.js +8 -3
  310. package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.d.ts +3 -1
  311. package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +19 -4
  312. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +1 -1
  313. package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.d.ts +3 -0
  314. package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js +38 -0
  315. package/front_end/third_party/web-vitals/package/dist/modules/lib/whenIdleOrHidden.js +5 -1
  316. package/front_end/third_party/web-vitals/package/dist/modules/onCLS.d.ts +1 -1
  317. package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +30 -11
  318. package/front_end/third_party/web-vitals/package/dist/modules/onFCP.d.ts +1 -1
  319. package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +36 -4
  320. package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +1 -1
  321. package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +42 -22
  322. package/front_end/third_party/web-vitals/package/dist/modules/onLCP.d.ts +1 -1
  323. package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +109 -30
  324. package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.d.ts +1 -1
  325. package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +25 -7
  326. package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +24 -1
  327. package/front_end/third_party/web-vitals/package/dist/modules/types/fcp.d.ts +1 -1
  328. package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +14 -6
  329. package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +1 -1
  330. package/front_end/third_party/web-vitals/package/dist/modules/types/ttfb.d.ts +2 -2
  331. package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +26 -4
  332. package/front_end/third_party/web-vitals/package/package.json +21 -22
  333. package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +1 -1
  334. package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +62 -39
  335. package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +52 -15
  336. package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +25 -7
  337. package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +43 -37
  338. package/front_end/third_party/web-vitals/package/src/lib/{polyfills/getFirstHiddenTimePolyfill.ts → FCPEntryManager.ts} +4 -14
  339. package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +22 -2
  340. package/front_end/third_party/web-vitals/package/src/lib/LCPEntryManager.ts +1 -0
  341. package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
  342. package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
  343. package/front_end/third_party/web-vitals/package/src/lib/getLoadState.ts +11 -12
  344. package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +1 -1
  345. package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +4 -1
  346. package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +24 -11
  347. package/front_end/third_party/web-vitals/package/src/lib/initUnique.ts +12 -4
  348. package/front_end/third_party/web-vitals/package/src/lib/observe.ts +26 -5
  349. package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +1 -1
  350. package/front_end/third_party/web-vitals/package/src/lib/softNavs.ts +48 -0
  351. package/front_end/third_party/web-vitals/package/src/lib/whenIdleOrHidden.ts +12 -4
  352. package/front_end/third_party/web-vitals/package/src/onCLS.ts +75 -18
  353. package/front_end/third_party/web-vitals/package/src/onFCP.ts +66 -7
  354. package/front_end/third_party/web-vitals/package/src/onINP.ts +100 -39
  355. package/front_end/third_party/web-vitals/package/src/onLCP.ts +169 -34
  356. package/front_end/third_party/web-vitals/package/src/onTTFB.ts +50 -13
  357. package/front_end/third_party/web-vitals/package/src/types/base.ts +31 -10
  358. package/front_end/third_party/web-vitals/package/src/types/fcp.ts +1 -1
  359. package/front_end/third_party/web-vitals/package/src/types/inp.ts +14 -6
  360. package/front_end/third_party/web-vitals/package/src/types/lcp.ts +1 -1
  361. package/front_end/third_party/web-vitals/package/src/types/ttfb.ts +2 -2
  362. package/front_end/third_party/web-vitals/package/src/types.ts +32 -9
  363. package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +11 -11
  364. package/front_end/third_party/web-vitals/rebuild.sh +2 -2
  365. package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +2 -0
  366. package/front_end/ui/components/buttons/Button.ts +16 -0
  367. package/front_end/ui/components/dialogs/Dialog.ts +1 -1
  368. package/front_end/ui/components/highlighting/HighlightManager.ts +6 -1
  369. package/front_end/ui/components/highlighting/highlighting.ts +1 -1
  370. package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
  371. package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
  372. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +2 -2
  373. package/front_end/ui/components/settings/SettingCheckbox.ts +12 -7
  374. package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +2 -2
  375. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +6 -6
  376. package/front_end/ui/components/text_editor/javascript.ts +3 -1
  377. package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
  378. package/front_end/ui/legacy/ContextMenu.ts +12 -2
  379. package/front_end/ui/legacy/ListControl.ts +1 -1
  380. package/front_end/ui/legacy/SelectMenu.docs.ts +17 -19
  381. package/front_end/ui/legacy/Toolbar.ts +4 -1
  382. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  383. package/front_end/ui/legacy/components/color_picker/spectrum.css +1 -2
  384. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
  385. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +50 -4
  386. package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +3 -1
  387. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +4 -4
  388. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +8 -7
  389. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +14 -11
  390. package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +1 -1
  391. package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +15 -5
  392. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -4
  393. package/front_end/ui/legacy/components/utils/Linkifier.ts +5 -1
  394. package/front_end/ui/lit/render.ts +1 -1
  395. package/front_end/ui/settings/SettingUIRegistration.ts +8 -3
  396. package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
  397. package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
  398. package/inspector_overlay/main.ts +1 -1
  399. package/mcp/mcp.ts +5 -4
  400. package/package.json +13 -13
  401. package/front_end/models/ai_assistance/AgentProject.ts +0 -261
  402. package/front_end/models/ai_assistance/agents/PatchAgent.ts +0 -306
  403. package/front_end/models/issues_manager/CheckFormsIssuesTrigger.ts +0 -45
  404. package/front_end/models/text_utils/text_utils.ts +0 -5
  405. package/front_end/panels/ai_assistance/PatchWidget.ts +0 -867
  406. package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +0 -368
  407. package/front_end/panels/ai_assistance/selectWorkspaceDialog.css +0 -92
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: devtools-testing-guidance
3
+ description: Guidance on selecting the appropriate test suite (Unit, API, or E2E tests) when writing new tests in Chrome DevTools. MUST be used when writing new tests.
4
+ ---
5
+
6
+ # Testing Guidance
7
+
8
+ This guide outlines when and how to select the appropriate test suite when writing new tests in Chrome DevTools.
9
+
10
+ > [!NOTE]
11
+ > This skill provides guidance on **which** test suite to choose when writing tests. To learn **how** to run tests, build targets, or execute linters, refer to the `devtools-verification` skill.
12
+
13
+ ## Choosing a Test Suite
14
+
15
+ ### 1. Unit Tests
16
+
17
+ **Default choice:** The vast majority of tests in DevTools should be unit tests.
18
+
19
+ Use unit tests for isolated testing of individual functions, classes, models, helpers, and UI components.
20
+
21
+ - **Utilities & Framework:**
22
+ - Use `TestUniverse` (and foundation test helpers) for easy, isolated setup of required dependencies and models.
23
+ - For testing UI widgets, use stubbed view functions and screenshot assertions rather than spinning up heavy DOM/browser infrastructure.
24
+ - **Location:** Co-located next to their implementation files (e.g. `TimelinePanel.ts` and `TimelinePanel.test.ts`).
25
+
26
+ ---
27
+
28
+ ### 2. API Tests
29
+
30
+ Use API tests for integration tests that verify business logic requiring more complex setups or extensive CDP (Chrome DevTools Protocol) traffic, without needing the full DevTools frontend UI.
31
+
32
+ - **When to use:**
33
+ - Evaluating JavaScript expressions in the target page (e.g. via `Runtime.evaluate`).
34
+ - Complex source map setups and symbolization.
35
+ - Multi-context or target setups (workers, iframes, OOPIFs).
36
+ - Verifying the "foundational layer" of DevTools models against a real browser/web page.
37
+ - **Location:** Defined in `front_end/` with `.test.api.ts` extension (e.g. `Universe.test.api.ts`).
38
+
39
+ ---
40
+
41
+ ### 3. End-to-End (E2E) Tests
42
+
43
+ Use E2E tests to verify real end-to-end user stories and user journeys.
44
+
45
+ - **When to use:**
46
+ - Verifying full user journeys across DevTools panels and drawers.
47
+ - Complex UI behaviors that require extensive user interaction setup and benefit from a complete DevTools frontend page connected to an inspected target page over CDP.
48
+ - **Location:** Defined in `test/e2e/` (e.g. `test/e2e/console/console-log.test.ts`).
@@ -52,7 +52,7 @@ Locate all TypeScript files in the target folder that define `const UIStrings =
52
52
  * *Check sibling references:* If you change a setting name or label (for example, changing “Preserve log” to “Keep log”), search sibling files in the folder for explanatory text or status strings that reference the old name in quotes (for example, “console.clear() was prevented due to ‘Preserve log’”), and update them to match.
53
53
  2. **Cut unnecessary words:** Eliminate politeness (`please`, `sorry`), filler (`very`, `strongly`, `there is` or `there are`), and marketing fluff (`seamless`, `awesome`, `fast`, `quick`).
54
54
  3. **Contractions:** Use contractions (`don’t`, `can’t`, `isn’t`, `won’t`) instead of formal spellings (`do not`, `cannot`, `is not`, `will not`).
55
- 4. **Curly apostrophes, quotation marks, and ellipses:** Use curly apostrophes (`’`) in user-facing `UIStrings` values for contractions and possessives, and quotation marks (`“ ”`) for improved readability. Use the ellipsis character (`…`) instead of three periods (`...`). Use prime (`′`) and double prime (`″`) symbols as needed for measurements like length or coordinates.
55
+ 4. **Curly apostrophes, quotation marks, and ellipses:** Use curly apostrophes (`’`) in user-facing `UIStrings` values for contractions and possessives. Double quotes should be straight (`"`) to avoid usability issues when users want to copy string literals, though consider not using double quotes at all where not necessary. Note that using both double quotes and backticks (for example, `"`Permissions-Policy`"`) is valid and useful when a fixed term needs to be visually enclosed in quotes in the UI, as backticks are used for localization locking and are often not rendered visually. Use the ellipsis character (`…`) instead of three periods (`...`). Use prime (`′`) and double prime (`″`) symbols as needed for measurements like length or coordinates.
56
56
  5. **Sentence case and capitalization:** Use sentence case for headings, labels, and UI element names. Capitalize only the first word, proper nouns, product names (`Chrome DevTools`), and web APIs (`Background Fetch API`).
57
57
  * Don’t capitalize feature names (for example, `conditional breakpoint` or `command menu`).
58
58
  * Capitalize panel names and UX elements that are named after panels (for example, `Show Application`, `Toggle Console`, `Console sidebar`, or `Styles`).
@@ -112,9 +112,9 @@ When all tests and presubmit checks pass, commit your changes and upload the CL
112
112
  *(If you update an existing commit on this branch, use `git commit --amend`).*
113
113
 
114
114
  2. **Upload the CL to Gerrit**
115
- Upload the CL using `git cl upload`. Provide a dynamic summary of changes (depending on the actual content of the change) and the bug trailer:
115
+ Upload the CL using `git cl upload -f`. Always pass `-f` (`--force`) to prevent `git cl upload` from prompting or opening an interactive text editor in background agent shells:
116
116
  ```bash
117
- git cl upload -d --commit-description="Ensure consistent UI Strings in <folder_path>
117
+ git cl upload -f -d --commit-description="Ensure consistent UI Strings in <folder_path>
118
118
 
119
119
  Summary of changes:
120
120
  - <dynamically list specific words replaced, contractions adopted, or sentence case fixes>
@@ -43,7 +43,7 @@ The second bot should do the following:
43
43
  - Ensure you use the instructions from the `devtools-version-control` skill to create and switch branches appropriately.
44
44
  - Make a minor, harmless modification directly to the test file being investigated (e.g., adding a comment `// Trigger stressor bot`) to ensure the commit is not empty.
45
45
  - Add this file (with `git add`) and commit it using a meaningful commit message (e.g., `git commit -m "Deflake <test name>"`). Ask the user which bug number to use for the changelist description.
46
- - Upload this change using `git cl upload`. This creates a debugging CL that all agents (like the fix agent) will continue to work on.
46
+ - Upload this change using `git cl upload -f`. Always use `-f` (`--force`) so the upload runs non-interactively without opening a text editor or prompt. This creates a debugging CL that all agents (like the fix agent) will continue to work on.
47
47
  - Note the <issue number> created during upload.
48
48
  - To start the stressor bot, run this command (substituting `<test file>:exact_test_id` with the actual file and exact test ID):
49
49
  `git cl try -B devtools-frontend/try -b e2e_stressor_linux -b e2e_stressor_win64 -b e2e_stressor_mac -p runner_args='<test file>:exact_test_id --repeat=100'`
@@ -81,7 +81,7 @@ The test fixing sub-agent should do the following:
81
81
  - Compile and run the test locally, to make sure there are no obvious errors introduced.
82
82
  - Commit the changes (to the branch created earlier). Make sure to list (in the changelist description) the test name, the fix, reasoning for why the test failed, why the fix fixes the issue and the failure rate (if non-zero). If you were not able to reproduce the error, state that the fix is speculative. Ask the user to provide the bug number to use in the changelist description.
83
83
  - CRITICAL: Iff the 'local-repro' bot does not reproduce the error, the 'fix-test' agent MUST wait until the stressor bot finishes its run before uploading the fix to the server (so that the stressor try run isn't aborted prematurely). If the error reproduces locally, you can upload immediately.
84
- - Once it is safe to do so, upload the change with `git cl upload`.
84
+ - Once it is safe to do so, upload the change with `git cl upload -f`.
85
85
 
86
86
  ## Results
87
87
 
@@ -47,6 +47,10 @@ existing element containers.
47
47
  * Refer to [ui_engineering.md](../../../docs/ui_engineering.md) for
48
48
  specific migration examples.
49
49
  * If unsure, also consult the [automatic migration code](../../../scripts/eslint_rules/lib/no-imperative-dom-api.ts)
50
+ * **Prefer Component Built-Ins Over Legacy Boilerplate**: Before porting
51
+ legacy event handlers, comparators, or state variables, check if the
52
+ modern component handles them natively. Drop host-level workarounds in
53
+ favor of declarative component attributes.
50
54
 
51
55
  5. **Local Modular Renders**:
52
56
 
@@ -70,6 +74,7 @@ existing element containers.
70
74
  * Do not attempt to rewrite complex historical subsystems (like Linkifiers
71
75
  or specialized UI utilities) to be "pure Lit" during this pass.
72
76
  * Capitalize on Lit's ability to interpolate standard `HTMLElement` or `Element` instances directly. Treat unmigrated utilities as "black boxes" that generate DOM, and embed their output in standard template expressions: `html`<div>${this.legacyElement}</div>``.
77
+ * **CRITICAL:** Before treating any component as "unmigrated," you MUST follow steps in Section 4. You are only allowed to use this escape hatch if no declarative migration instructions exist.
73
78
 
74
79
  8. **Handle Asynchronous DOM Updates**:
75
80
 
@@ -87,9 +92,10 @@ existing element containers.
87
92
  functions inside the class scope returning `LitTemplate`. This avoids
88
93
  monoliths, preserves readability, and reuses template cache strategies.
89
94
 
90
- 10. **Visual Parity and Accessibility**:
95
+ 10. **Visual Parity, CSS Adaptation, and Accessibility**:
91
96
 
92
97
  * **Zero-Tolerance Regression**: Screenshot tests are the ground truth for this phase. Any visual diff (above 0%) in the generated screenshots is unacceptable and must be resolved before proceeding.
98
+ * **CSS Selector Migration**: When replacing legacy imperative components/widgets with modern web components (e.g., replacing legacy `DataGrid` with `<devtools-data-grid>`), inspect and update the associated `.css` file. Replace legacy class selectors (`.data-grid`) with tag selectors (`devtools-data-grid`).
93
99
  * **Strict Tag/Class Parity**: Do not change tag types (e.g., `span` to
94
100
  `div`) or drop class names during template translation, as CSS may
95
101
  depend on them.
@@ -14,6 +14,8 @@ clean `UI.Widget` classes that use native update rendering delegates.
14
14
 
15
15
  ## 1. Widget Promotion Guidelines
16
16
 
17
+ * **Widget Framework Rules**: Follow the rules defined in [`devtools-ui-widgets`](../ui-widgets/SKILL.md).
18
+
17
19
  1. **Change Class Inheritance**:
18
20
 
19
21
  * Rewrite class declarations to extend `UI.Widget` (or specialized
@@ -60,8 +60,9 @@ git rebase-update
60
60
  ### Initial upload
61
61
  When a CL is ready, upload it with:
62
62
  ```bash
63
- git cl upload -d --commit-description="<description>"
63
+ git cl upload -f -d --commit-description="<description>"
64
64
  ```
65
+ * Always include `-f` (`--force`) so that `git cl upload` runs non-interactively without opening a text editor or prompting.
65
66
  * Use the same writing style as the current committer
66
67
  * Keep line length below 72
67
68
  * Add a "Bug: <issue number>" or "Bug: None" trailer on a separate line.
@@ -70,7 +71,7 @@ git cl upload -d --commit-description="<description>"
70
71
  ### Subsequent upload
71
72
  To upload an updated CL:
72
73
  ```bash
73
- git cl upload -d -t "<one sentence patch set description>"
74
+ git cl upload -f -d -t "<one sentence patch set description>"
74
75
  ```
75
76
 
76
77
  ## Release and Roll Status
@@ -86,7 +87,7 @@ To check whether a DevTools commit (`devtools/devtools-frontend`) has rolled int
86
87
  | Create new CL from main | `git new-branch <name>` |
87
88
  | Create stacked CL | `git new-branch --upstream_current <name>` |
88
89
  | Update current CL | `git commit --amend` |
89
- | Upload to Gerrit | `git cl upload` |
90
+ | Upload to Gerrit | `git cl upload -f` |
90
91
  | Change branch parent | `git reparent-branch <new-parent>` |
91
92
  | Sync all branches | `git rebase-update` |
92
93
  | Check release & roll status | Query `https://chromiumdash.appspot.com/fetch_commit?commit=<sha>` |
@@ -1515,3 +1515,92 @@ The component will automatically sort and merge the ranges provided.
1515
1515
 
1516
1516
  In this example, the ranges `1,3` and `2,3` will be merged into `1,4`. The
1517
1517
  ranges `10,2` and the current range `5,3` will also be highlighted.
1518
+
1519
+ ## Migrating `UI.ListWidget.ListWidget`
1520
+
1521
+ Replace the legacy imperative `UI.ListWidget.ListWidget` (which rendered inline editing controls and required custom delegates) with the modern `<devtools-list>` component.
1522
+
1523
+ ### Guidelines
1524
+ 1. **Dialogue Modals for Complex Editors:** If the editor contains multiple input fields (e.g., location details, headers), show the editor in a modal card dialog powered by `UI.Dialog.Dialog`.
1525
+ 2. **Inline Prompts for Trivial Editors:** If the editor is trivial (i.e., a single text input, such as URL pattern blocking rules), handle editing inline using a `<devtools-prompt>` component. In this case, clicking the item focuses the prompt and toggles `editing` mode inline, dispatching `@commit` and `@cancel` events to update the state. See `RequestConditionsDrawer` for a reference implementation.
1526
+ 3. **Conditionally render list:** Use `<devtools-list>` and conditionally render it inside the card only if the list has elements (`input.locations.length > 0`). This ensures empty state layout rules are correctly applied and prevents extra spacing/gaps.
1527
+ 4. **Declarative dialog views:** Define the edit/add modal content in a separate, customizable view function (e.g. `DEFAULT_DIALOG_VIEW`). Instantiating `UI.Dialog.Dialog` in the class is fine, but its content rendering should be driven declaratively by the dialog view function.
1528
+ 5. **Common styles integration:** Ensure `{includeCommonStyles: true}` is passed when rendering elements into the DOM inside test setups to import proper layout variables and global typography styles (e.g. Roboto).
1529
+
1530
+ **Before:**
1531
+ ```typescript
1532
+ class SettingsTab extends UI.Widget.VBox implements UI.ListWidget.Delegate<Location> {
1533
+ private readonly listWidget: UI.ListWidget.ListWidget<Location>;
1534
+ constructor() {
1535
+ super();
1536
+ this.listWidget = new UI.ListWidget.ListWidget(this);
1537
+ this.listWidget.show(this.element);
1538
+ }
1539
+
1540
+ renderItem(item: Location, editable: boolean): Element {
1541
+ const element = document.createElement('div');
1542
+ element.createChild('span').textContent = item.title;
1543
+ return element;
1544
+ }
1545
+
1546
+ beginEdit(item: Location): UI.ListWidget.Editor<Location> {
1547
+ const editor = new UI.ListWidget.Editor<Location>();
1548
+ editor.createInput('title', 'text', 'Title', titleValidator);
1549
+ return editor;
1550
+ }
1551
+
1552
+ commitEdit(item: Location, editor: UI.ListWidget.Editor<Location>, isNew: boolean): void {
1553
+ item.title = editor.control('title').value;
1554
+ this.update();
1555
+ }
1556
+ }
1557
+ ```
1558
+
1559
+ **After:**
1560
+ ```typescript
1561
+ export interface SettingsTabInput {
1562
+ items: Location[];
1563
+ onAddClicked: () => void;
1564
+ onEdit: (index: number) => void;
1565
+ onDelete: (index: number) => void;
1566
+ }
1567
+
1568
+ export const DEFAULT_VIEW: View = (input, _output, target) => {
1569
+ render(html`
1570
+ <devtools-card heading="Locations">
1571
+ ${input.items.length > 0 ? html`
1572
+ <devtools-list
1573
+ .editable=${true}
1574
+ .deletable=${true}
1575
+ @edit=${(e: Lists.List.ItemEditEvent) => input.onEdit(e.detail.index)}
1576
+ @delete=${(e: Lists.List.ItemRemoveEvent) => input.onDelete(e.detail.index)}>
1577
+ ${input.items.map((item, index) => html`
1578
+ <div slot="slot-${index}">
1579
+ <span>${item.title}</span>
1580
+ </div>
1581
+ `)}
1582
+ </devtools-list>
1583
+ ` : nothing}
1584
+ <devtools-button @click=${input.onAddClicked}>Add location</devtools-button>
1585
+ </devtools-card>
1586
+ `, target);
1587
+ };
1588
+
1589
+ export interface SettingsTabDialogInput {
1590
+ editingValues: {title: string};
1591
+ validationErrors: {title: string | null};
1592
+ onTitleInput: (val: string) => void;
1593
+ onCancel: () => void;
1594
+ onSave: () => void;
1595
+ }
1596
+
1597
+ export const DEFAULT_DIALOG_VIEW = (input: SettingsTabDialogInput, target: HTMLElement) => {
1598
+ render(html`
1599
+ <div class="editor-container">
1600
+ <input type="text" .value=${input.editingValues.title} @input=${(e: Event) => input.onTitleInput((e.target as HTMLInputElement).value)}>
1601
+ <devtools-button @click=${input.onCancel}>Cancel</devtools-button>
1602
+ <devtools-button @click=${input.onSave}>Save</devtools-button>
1603
+ </div>
1604
+ `, target);
1605
+ };
1606
+ ```
package/eslint.config.mjs CHANGED
@@ -103,6 +103,7 @@ export default defineConfig([
103
103
  '@stylistic/semi': 'error',
104
104
  '@stylistic/no-extra-semi': 'error',
105
105
  '@stylistic/comma-style': ['error', 'last'],
106
+ '@stylistic/comma-dangle': ['error', 'always-multiline'],
106
107
  '@stylistic/wrap-iife': ['error', 'inside'],
107
108
 
108
109
  '@stylistic/spaced-comment': [
@@ -621,10 +622,9 @@ export default defineConfig([
621
622
  ],
622
623
  '@devtools/l10n-i18nString-call-only-with-uistrings': 'error',
623
624
  '@devtools/l10n-no-i18nString-calls-module-instantiation': 'error',
624
- '@devtools/l10n-no-locked-or-placeholder-only-phrase': 'error',
625
625
  '@devtools/l10n-no-uistrings-export': 'error',
626
626
  '@devtools/l10n-no-unused-message': 'error',
627
- '@devtools/l10n-use-curly-apostrophes': 'error',
627
+ '@devtools/l10n-uistrings-text-style': 'error',
628
628
  },
629
629
  },
630
630
  {
@@ -720,6 +720,13 @@ export default defineConfig([
720
720
  'no-console': 'off',
721
721
  },
722
722
  },
723
+ {
724
+ name: 'API test files',
725
+ files: ['**/*.test.api.ts'],
726
+ rules: {
727
+ '@devtools/no-api-test-unit-helpers': 'error',
728
+ },
729
+ },
723
730
  {
724
731
  name: 'TypeScript test files',
725
732
  files: [
@@ -30,7 +30,7 @@ export default {
30
30
  return data;
31
31
  }
32
32
  return null;
33
- }
33
+ },
34
34
  }),
35
35
  ],
36
36
  };
@@ -850,7 +850,7 @@
850
850
  'LenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7' +
851
851
  '9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmg' +
852
852
  'QWpzU/qlULRuJQ/7TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq' +
853
- '/H5COEBkEveegeGTLg=='
853
+ '/H5COEBkEveegeGTLg==',
854
854
  ]);
855
855
  };
856
856
 
@@ -901,22 +901,21 @@
901
901
  step1();
902
902
 
903
903
  function step1() {
904
- testPreset(
905
- MobileThrottling.networkPresets[3],
906
- [
907
- 'offline event: online = false', 'connection change event: type = none; downlinkMax = 0; effectiveType = 4g'
908
- ],
909
- step2);
904
+ testPreset(MobileThrottling.networkPresets[3],
905
+ [
906
+ 'offline event: online = false',
907
+ 'connection change event: type = none; downlinkMax = 0; effectiveType = 4g',
908
+ ],
909
+ step2);
910
910
  }
911
911
 
912
912
  function step2() {
913
- testPreset(
914
- MobileThrottling.networkPresets[2],
915
- [
916
- 'online event: online = true',
917
- 'connection change event: type = cellular; downlinkMax = 0.3814697265625; effectiveType = 2g'
918
- ],
919
- step3);
913
+ testPreset(MobileThrottling.networkPresets[2],
914
+ [
915
+ 'online event: online = true',
916
+ 'connection change event: type = cellular; downlinkMax = 0.3814697265625; effectiveType = 2g',
917
+ ],
918
+ step3);
920
919
  }
921
920
 
922
921
  function step3() {
@@ -1311,14 +1310,14 @@
1311
1310
  await SDK.TargetManager.TargetManager.instance().primaryPageTarget()?.runtimeAgent().invoke_evaluate({
1312
1311
  expression: `fetch("/set-cookie?devtools-test-cookie=Bar",
1313
1312
  {credentials: 'include'})`,
1314
- awaitPromise: true
1313
+ awaitPromise: true,
1315
1314
  });
1316
1315
  await testCase(baseURL + 'echoheader?Cookie', undefined, 200, ['cache-control'], 'devtools-test-cookie=Bar');
1317
1316
 
1318
1317
  await SDK.TargetManager.TargetManager.instance().primaryPageTarget()?.runtimeAgent().invoke_evaluate({
1319
1318
  expression: `fetch("/set-cookie?devtools-test-cookie=same-site-cookie;SameSite=Lax",
1320
1319
  {credentials: 'include'})`,
1321
- awaitPromise: true
1320
+ awaitPromise: true,
1322
1321
  });
1323
1322
  await testCase(
1324
1323
  baseURL + 'echoheader?Cookie', undefined, 200, ['cache-control'], 'devtools-test-cookie=same-site-cookie');
@@ -78,7 +78,7 @@ async function gzipCodec(
78
78
  start(controller) {
79
79
  controller.enqueue(buffer instanceof ArrayBuffer ? new Uint8Array(buffer) : buffer);
80
80
  controller.close();
81
- }
81
+ },
82
82
  });
83
83
  const codecReadable = readable.pipeThrough(codecStream);
84
84
  // A response is a convenient way to get an ArrayBuffer from a ReadableStream.
@@ -104,7 +104,7 @@ export function createMonitoredStream(stream: ReadableStream, onProgress: (bytes
104
104
  bytesRead += chunk.byteLength;
105
105
  onProgress(bytesRead);
106
106
  controller.enqueue(chunk);
107
- }
107
+ },
108
108
  });
109
109
 
110
110
  return stream.pipeThrough(progressTransformer);
@@ -126,7 +126,7 @@ export class Settings {
126
126
  settingRegistrations,
127
127
  logSettingAccess,
128
128
  runSettingsMigration,
129
- console
129
+ console,
130
130
  }: SettingsCreationOptions) {
131
131
  this.#console = console;
132
132
  this.syncedStorage = syncedStorage;
@@ -145,7 +145,6 @@ export class Settings {
145
145
  this.createRegExpSetting(settingName, evaluatedDefaultValue, undefined, storageType) :
146
146
  this.createSetting(settingName, evaluatedDefaultValue, storageType);
147
147
 
148
- setting.setTitleFunction(registration.title);
149
148
  setting.setRegistration(registration);
150
149
 
151
150
  this.registerModuleSetting(setting);
@@ -179,7 +178,7 @@ export class Settings {
179
178
  globalStorage: null,
180
179
  localStorage: null,
181
180
  settingRegistrations: null,
182
- console: null
181
+ console: null,
183
182
  }): Settings {
184
183
  const {
185
184
  forceNew,
@@ -511,8 +510,6 @@ export class Deprecation {
511
510
  }
512
511
 
513
512
  export class Setting<V> {
514
- #titleFunction?: () => Platform.UIString.LocalizedString;
515
- #title!: Platform.UIString.LocalizedString;
516
513
  #registration: SettingRegistration|null = null;
517
514
  #requiresUserAction?: boolean;
518
515
  #value?: V;
@@ -555,25 +552,12 @@ export class Setting<V> {
555
552
  }
556
553
 
557
554
  title(): Platform.UIString.LocalizedString {
558
- if (this.#title) {
559
- return this.#title;
560
- }
561
- if (this.#titleFunction) {
562
- return this.#titleFunction();
555
+ if (this.#registration?.title) {
556
+ return this.#registration.title();
563
557
  }
564
558
  return '' as Platform.UIString.LocalizedString;
565
559
  }
566
560
 
567
- setTitleFunction(titleFunction?: (() => Platform.UIString.LocalizedString)): void {
568
- if (titleFunction) {
569
- this.#titleFunction = titleFunction;
570
- }
571
- }
572
-
573
- setTitle(title: Platform.UIString.LocalizedString): void {
574
- this.#title = title;
575
- }
576
-
577
561
  setRequiresUserAction(requiresUserAction: boolean): void {
578
562
  this.#requiresUserAction = requiresUserAction;
579
563
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  export const enum TokenType {
6
6
  LITERAL = 0,
7
- URL = 1
7
+ URL = 1,
8
8
  }
9
9
 
10
10
  export interface Token {
@@ -759,7 +759,7 @@ export class VersionController {
759
759
  'Slow 4G': 'SPEED_SLOW_4G',
760
760
  '3G': 'SPEED_3G',
761
761
  'No throttling': 'NO_THROTTLING',
762
- Offline: 'OFFLINE'
762
+ Offline: 'OFFLINE',
763
763
  };
764
764
  try {
765
765
  const networkSetting = JSON.parse(setting) as unknown as {
@@ -64,6 +64,7 @@ const AidaLanguageToMarkdown: Record<AidaInferenceLanguage, string> = {
64
64
  export class AidaAbortError extends Error {}
65
65
  export class AidaBlockError extends Error {}
66
66
  export class AidaQuotaError extends Error {}
67
+ export class AidaPayloadTooLargeError extends Error {}
67
68
 
68
69
  interface AiStream {
69
70
  write: (data: string) => Promise<void>;
@@ -195,13 +196,16 @@ export class AidaClient {
195
196
  return;
196
197
  }
197
198
  if ('error' in result && result.error) {
198
- const errorStr = typeof result.error === 'string' ? result.error : '';
199
- const detailStr = typeof result.detail === 'string' ? result.detail : '';
200
- if (errorStr.toLowerCase().includes('quota') || detailStr.toLowerCase().includes('quota')) {
199
+ if (isQuotaError(result.error, result.detail)) {
201
200
  stream.fail(new AidaQuotaError(
202
201
  `Cannot send request: ${result.error}${result.detail ? ` ${result.detail}` : ''}`));
203
202
  return;
204
203
  }
204
+ if (isPayloadTooLargeError(result.error, result.detail)) {
205
+ stream.fail(new AidaPayloadTooLargeError(
206
+ `Cannot send request: ${result.error}${result.detail ? ` ${result.detail}` : ''}`));
207
+ return;
208
+ }
205
209
  stream.fail(new Error(`Cannot send request: ${result.error}${result.detail ? ` ${result.detail}` : ''}`));
206
210
  return;
207
211
  }
@@ -261,9 +265,12 @@ export class AidaClient {
261
265
  thoughtSignature: result.functionCallChunk.functionCall.thoughtSignature,
262
266
  });
263
267
  } else if ('error' in result) {
264
- if (typeof result.error === 'string' && result.error.toLowerCase().includes('quota')) {
268
+ if (isQuotaError(result.error)) {
265
269
  throw new AidaQuotaError(`Server responded: ${JSON.stringify(result)}`);
266
270
  }
271
+ if (isPayloadTooLargeError(result.error)) {
272
+ throw new AidaPayloadTooLargeError(`Server responded: ${JSON.stringify(result)}`);
273
+ }
267
274
  throw new Error(`Server responded: ${JSON.stringify(result)}`);
268
275
  } else {
269
276
  throw new Error(`Unknown chunk result ${JSON.stringify(result)}`);
@@ -519,3 +526,11 @@ export const enum Events {
519
526
  export interface EventTypes {
520
527
  [Events.AIDA_AVAILABILITY_CHANGED]: void;
521
528
  }
529
+
530
+ function isQuotaError(...inputs: Array<string|undefined>): boolean {
531
+ return inputs.some(input => input?.toLowerCase().includes('quota'));
532
+ }
533
+
534
+ function isPayloadTooLargeError(...inputs: Array<string|undefined>): boolean {
535
+ return inputs.some(input => input?.toLowerCase().includes('payload size exceeds the limit'));
536
+ }
@@ -219,7 +219,7 @@ function inFileEditRequestToSourceFile(request: AIDA.CompletionRequest): GCA.Sou
219
219
  {
220
220
  content: '',
221
221
  isSelected: true, // Cursor position
222
- }
222
+ },
223
223
  ],
224
224
  };
225
225
  if (request.suffix) {
@@ -481,7 +481,7 @@ export function gcaChunkResponseToAidaChunkResponse(response: GCA.GenerateConten
481
481
  const parts = candidate?.content?.parts || [];
482
482
  const metadata: AIDA.ResponseMetadata = {
483
483
  rpcGlobalId: response.responseId,
484
- inferenceOptionMetadata: {modelId: response.modelVersion}
484
+ inferenceOptionMetadata: {modelId: response.modelVersion},
485
485
  };
486
486
 
487
487
  if (candidate?.citationMetadata?.citations) {
@@ -11,7 +11,7 @@ import {
11
11
  debugLog,
12
12
  type DoConversationRequest,
13
13
  type GenerateCodeRequest,
14
- type GenerateCodeResponse
14
+ type GenerateCodeResponse,
15
15
  } from './AidaClientTypes.js';
16
16
  import {
17
17
  aidaCompletionRequestToGcaRequest,
@@ -19,7 +19,7 @@ import {
19
19
  aidaEventToGcaTelemetryRequest,
20
20
  aidaGenerateCodeRequestToGcaRequest,
21
21
  gcaResponseToAidaCompletionResponse,
22
- gcaResponseToAidaGenerateCodeResponse
22
+ gcaResponseToAidaGenerateCodeResponse,
23
23
  } from './AidaGcaTranslation.js';
24
24
  import * as DispatchHttpRequestClient from './DispatchHttpRequestClient.js';
25
25
  import type {GenerateContentRequest, GenerateContentResponse} from './GcaTypes.js';
@@ -193,7 +193,7 @@ export class GdpClient {
193
193
  queryParams: {
194
194
  allowMissing: 'true',
195
195
  names,
196
- }
196
+ },
197
197
  });
198
198
 
199
199
  return new Set(response.awards?.map(award => normalizeBadgeName(award.name)) ?? []);
@@ -214,7 +214,7 @@ export class GdpClient {
214
214
  newsletter_email: emailPreference,
215
215
  creation_origin: {
216
216
  origin_application: ORIGIN_APPLICATION_NAME,
217
- }
217
+ },
218
218
  }),
219
219
  });
220
220
  this.#clearCache();
@@ -238,7 +238,7 @@ export class GdpClient {
238
238
  body: JSON.stringify({
239
239
  awardingUri: 'devtools://devtools',
240
240
  name,
241
- })
241
+ }),
242
242
  });
243
243
  return response;
244
244
  } catch {
@@ -37,7 +37,7 @@ import {streamWrite as resourceLoaderStreamWrite} from './ResourceLoader.js';
37
37
 
38
38
  const UIStrings = {
39
39
  /**
40
- * @description Document title in Inspector Frontend Host of the DevTools window
40
+ * @description Document title in Inspector Frontend Host of the DevTools window.
41
41
  * @example {example.com} PH1
42
42
  */
43
43
  devtoolsS: 'DevTools - {PH1}',