chrome-devtools-frontend 1.0.1726686 → 1.0.1729750

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 (387) hide show
  1. package/.agents/rules/tests/test-strict-assertions-and-literal-expectations.md +1 -1
  2. package/.agents/rules/tests/test-view-and-presenter-isolation.md +1 -1
  3. package/.agents/rules/ui-and-widgets/ui-accessibility-and-semantic-html.md +1 -1
  4. package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +2 -2
  5. package/.agents/rules/ui-and-widgets/ui-declarative-child-widget-composition.md +5 -5
  6. package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +2 -2
  7. package/.agents/rules/ui-and-widgets/ui-localization-and-uistrings-hygiene.md +2 -2
  8. package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +3 -3
  9. package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +2 -2
  10. package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +2 -2
  11. package/.agents/rules/ui-and-widgets/ui-view-output-and-callback-contracts.md +2 -2
  12. package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +2 -2
  13. package/.agents/skills/code-review/SKILL.md +63 -12
  14. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +38 -10
  15. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +1 -0
  16. package/.agents/skills/ui-widgets/SKILL.md +8 -2
  17. package/.agents/skills/write-ai-eval-test/SKILL.md +106 -0
  18. package/DIR_METADATA +1 -2
  19. package/docs/contributing/changes.md +25 -0
  20. package/docs/ui_engineering.md +13 -4
  21. package/eslint.config.mjs +411 -40
  22. package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -1
  23. package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
  24. package/front_end/core/host/UserMetrics.ts +4 -0
  25. package/front_end/core/host/UserMetricsEnums.ts +2 -1
  26. package/front_end/core/platform/StringUtilities.ts +45 -13
  27. package/front_end/core/platform/node/HostRuntime.ts +13 -7
  28. package/front_end/core/root/Runtime.ts +5 -0
  29. package/front_end/core/sdk/CPUThrottlingManager.ts +7 -0
  30. package/front_end/core/sdk/CSSMatchedStyles.ts +48 -6
  31. package/front_end/core/sdk/ServiceWorkerManager.ts +36 -10
  32. package/front_end/devtools_compatibility.js +7 -3
  33. package/front_end/entrypoints/inspector_main/InspectorMain.ts +2 -2
  34. package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +203 -115
  35. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  36. package/front_end/generated/protocol.ts +1 -0
  37. package/front_end/models/ai_assistance/AiAgent2.ts +26 -5
  38. package/front_end/models/ai_assistance/AiConversation.ts +8 -2
  39. package/front_end/models/ai_assistance/agents/AiAgent.ts +137 -62
  40. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
  41. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +44 -2
  42. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +56 -20
  43. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +2 -0
  44. package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +9 -0
  45. package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +13 -2
  46. package/front_end/models/ai_assistance/tools/RunLighthouse.ts +23 -7
  47. package/front_end/models/ai_assistance/tools/Tool.ts +7 -5
  48. package/front_end/models/comment_manager/CommentManager.ts +3 -3
  49. package/front_end/models/comment_manager/CommentThread.ts +50 -5
  50. package/front_end/models/elements/StyleChanges.ts +38 -0
  51. package/front_end/models/javascript_metadata/NativeFunctions.ts +5 -1
  52. package/front_end/models/lighthouse/RunTypes.ts +9 -1
  53. package/front_end/models/persistence/AutomaticFileSystemManager.ts +3 -0
  54. package/front_end/models/persistence/IsolatedFileSystemManager.ts +6 -0
  55. package/front_end/models/trace/LanternComputationData.ts +18 -3
  56. package/front_end/models/trace/extras/TraceTree.ts +36 -10
  57. package/front_end/models/trace/handlers/InitiatorsHandler.ts +27 -34
  58. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -6
  59. package/front_end/models/trace/handlers/SamplesHandler.ts +9 -6
  60. package/front_end/models/workspace/FileManager.ts +6 -0
  61. package/front_end/panels/accessibility/ARIAAttributesView.ts +2 -2
  62. package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +8 -1
  63. package/front_end/panels/accessibility/AccessibilityNodeView.ts +15 -17
  64. package/front_end/panels/accessibility/AccessibilitySubPane.ts +1 -1
  65. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
  66. package/front_end/panels/ai_assistance/ExternalHandler.ts +10 -1
  67. package/front_end/panels/ai_assistance/components/ChatMessage.ts +25 -16
  68. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +19 -23
  69. package/front_end/panels/ai_assistance/components/ExploreWidget.ts +2 -2
  70. package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +18 -7
  71. package/front_end/panels/ai_assistance/components/chatInput.css +1 -1
  72. package/front_end/panels/animation/AnimationTimeline.ts +37 -17
  73. package/front_end/panels/animation/animationTimeline.css +18 -2
  74. package/front_end/panels/application/AppManifestView.ts +1 -2
  75. package/front_end/panels/application/ApplicationPanelSidebar.ts +143 -128
  76. package/front_end/panels/application/DOMStorageItemsView.ts +14 -14
  77. package/front_end/panels/application/DeviceBoundSessionsView.ts +10 -13
  78. package/front_end/panels/application/ExtensionStorageItemsView.ts +3 -4
  79. package/front_end/panels/application/IndexedDBViews.ts +8 -4
  80. package/front_end/panels/application/KeyValueStorageItemsView.ts +4 -5
  81. package/front_end/panels/application/PrivateVerificationTokensView.ts +53 -0
  82. package/front_end/panels/application/ServiceWorkerCacheViews.ts +12 -8
  83. package/front_end/panels/application/ServiceWorkersView.ts +1 -2
  84. package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
  85. package/front_end/panels/application/StorageView.ts +2 -2
  86. package/front_end/panels/application/WebMCPView.ts +91 -109
  87. package/front_end/panels/application/application.ts +2 -0
  88. package/front_end/panels/application/components/StorageMetadataView.ts +6 -6
  89. package/front_end/panels/application/preloading/PreloadingView.ts +70 -37
  90. package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
  91. package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +3 -3
  92. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +12 -0
  93. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +10 -11
  94. package/front_end/panels/application/privateVerificationTokensView.css +20 -0
  95. package/front_end/panels/application/serviceWorkersView.css +1 -1
  96. package/front_end/panels/changes/ChangesSidebar.ts +2 -2
  97. package/front_end/panels/changes/ChangesView.ts +10 -11
  98. package/front_end/panels/comments/CommentsPane.ts +22 -0
  99. package/front_end/panels/comments/commentsPane.css +12 -1
  100. package/front_end/panels/common/CommentThreadWidget.ts +58 -0
  101. package/front_end/panels/common/CommentsOverlayWidget.ts +108 -29
  102. package/front_end/panels/common/CommentsStatusBarPill.ts +17 -6
  103. package/front_end/panels/common/DOMLinkifier.ts +7 -7
  104. package/front_end/panels/common/ExtensionServer.ts +9 -1
  105. package/front_end/panels/common/commentThreadWidget.css +25 -1
  106. package/front_end/panels/common/common-meta.ts +10 -0
  107. package/front_end/panels/console/ConsolePinPane.ts +9 -10
  108. package/front_end/panels/console/ConsolePrompt.ts +173 -95
  109. package/front_end/panels/console/ConsoleSidebar.ts +2 -2
  110. package/front_end/panels/console/ConsoleView.ts +75 -79
  111. package/front_end/panels/console/ConsoleViewMessage.ts +36 -4
  112. package/front_end/panels/console/SymbolizedErrorWidget.ts +8 -4
  113. package/front_end/panels/console/consolePrompt.css +1 -1
  114. package/front_end/panels/console/consoleView.css +1 -1
  115. package/front_end/panels/console_counters/WarningErrorCounter.ts +3 -4
  116. package/front_end/panels/coverage/CoverageListView.ts +2 -2
  117. package/front_end/panels/coverage/CoverageView.ts +18 -5
  118. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +4 -3
  119. package/front_end/panels/css_overview/CSSOverviewPanel.ts +2 -2
  120. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
  121. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +2 -2
  122. package/front_end/panels/css_overview/CSSOverviewStartView.ts +2 -2
  123. package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +2 -3
  124. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +2 -3
  125. package/front_end/panels/elements/AccessibilityTreeUtils.ts +6 -7
  126. package/front_end/panels/elements/CSSValueTraceView.ts +3 -3
  127. package/front_end/panels/elements/ClassesPaneWidget.ts +1 -2
  128. package/front_end/panels/elements/ComputedStyleWidget.ts +15 -14
  129. package/front_end/panels/elements/DOMTreeElementWidget.ts +5 -4
  130. package/front_end/panels/elements/DOMTreeWidget.ts +2 -1
  131. package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -2
  132. package/front_end/panels/elements/ElementsPanel.ts +1 -0
  133. package/front_end/panels/elements/EventListenersWidget.ts +2 -2
  134. package/front_end/panels/elements/LayoutPane.ts +2 -2
  135. package/front_end/panels/elements/PlatformFontsWidget.ts +3 -3
  136. package/front_end/panels/elements/PropertiesWidget.ts +9 -10
  137. package/front_end/panels/elements/PropertyRenderer.ts +72 -11
  138. package/front_end/panels/elements/StandaloneStylesContainer.ts +5 -10
  139. package/front_end/panels/elements/StyleEditorWidget.ts +30 -16
  140. package/front_end/panels/elements/StylePropertiesSection.ts +93 -44
  141. package/front_end/panels/elements/StylePropertyTreeElement.ts +231 -302
  142. package/front_end/panels/elements/StylesContainer.ts +2 -3
  143. package/front_end/panels/elements/StylesSidebarPane.ts +4 -13
  144. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +66 -37
  145. package/front_end/panels/elements/components/CSSHintDetailsView.ts +51 -41
  146. package/front_end/panels/elements/components/CSSPropertyDocsView.ts +75 -65
  147. package/front_end/panels/elements/components/CSSQuery.ts +112 -74
  148. package/front_end/panels/elements/components/CSSVariableValueView.ts +109 -68
  149. package/front_end/panels/elements/components/ComputedStyleProperty.ts +64 -45
  150. package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +35 -28
  151. package/front_end/panels/elements/components/QueryContainer.ts +104 -74
  152. package/front_end/panels/elements/components/accessibilityTreeNode.css +22 -20
  153. package/front_end/panels/elements/components/computedStyleProperty.css +2 -0
  154. package/front_end/panels/elements/components/cssHintDetailsView.css +23 -21
  155. package/front_end/panels/elements/components/cssPropertyDocsView.css +38 -36
  156. package/front_end/panels/elements/components/cssVariableValueView.css +42 -40
  157. package/front_end/panels/elements/components/elementsTreeExpandButton.css +5 -2
  158. package/front_end/panels/elements/components/queryContainer.css +23 -21
  159. package/front_end/panels/elements/stylesSidebarPane.css +3 -3
  160. package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -2
  161. package/front_end/panels/emulation/MediaQueryInspector.ts +9 -10
  162. package/front_end/panels/emulation/mediaQueryInspector.css +1 -1
  163. package/front_end/panels/event_listeners/EventListenersView.ts +2 -2
  164. package/front_end/panels/issues/AffectedCookiesView.ts +144 -101
  165. package/front_end/panels/issues/AffectedDescendantsWithinSelectElementView.ts +83 -31
  166. package/front_end/panels/issues/AffectedDirectivesView.ts +218 -135
  167. package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +84 -34
  168. package/front_end/panels/issues/AffectedElementsView.ts +49 -17
  169. package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +2 -2
  170. package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +2 -2
  171. package/front_end/panels/issues/AffectedPartitioningBlobURLView.ts +36 -11
  172. package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +135 -58
  173. package/front_end/panels/issues/AffectedSourcesView.ts +49 -28
  174. package/front_end/panels/issues/AffectedTrackingSitesView.ts +3 -4
  175. package/front_end/panels/issues/CorsIssueDetailsView.ts +487 -266
  176. package/front_end/panels/issues/IssueKindView.ts +63 -48
  177. package/front_end/panels/issues/IssueView.ts +9 -12
  178. package/front_end/panels/issues/components/ElementsPanelLink.ts +70 -34
  179. package/front_end/panels/issues/components/HideIssuesMenu.ts +56 -32
  180. package/front_end/panels/issues/components/elementsPanelLink.css +10 -6
  181. package/front_end/panels/issues/components/hideIssuesMenu.css +16 -14
  182. package/front_end/panels/issues/issues.ts +2 -0
  183. package/front_end/panels/issues/issuesTree.css +4 -3
  184. package/front_end/panels/lighthouse/LighthouseController.ts +6 -6
  185. package/front_end/panels/lighthouse/LighthouseStatusView.ts +12 -13
  186. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +8 -117
  187. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorView.ts +228 -0
  188. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +32 -41
  189. package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +2 -2
  190. package/front_end/panels/linear_memory_inspector/linear_memory_inspector.ts +2 -0
  191. package/front_end/panels/media/EventDisplayTable.ts +2 -2
  192. package/front_end/panels/media/MainView.ts +132 -66
  193. package/front_end/panels/media/PlayerDetailView.ts +32 -14
  194. package/front_end/panels/media/PlayerListView.ts +83 -23
  195. package/front_end/panels/media/PlayerPropertiesView.ts +2 -2
  196. package/front_end/panels/media/TickingFlameChart.ts +153 -63
  197. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +2 -2
  198. package/front_end/panels/network/EventSourceMessagesView.ts +3 -3
  199. package/front_end/panels/network/NetworkConfigView.ts +6 -2
  200. package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
  201. package/front_end/panels/network/NetworkOverview.ts +8 -10
  202. package/front_end/panels/network/RequestConditionsDrawer.ts +8 -4
  203. package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +2 -4
  204. package/front_end/panels/network/RequestHTMLView.ts +26 -7
  205. package/front_end/panels/network/RequestHeadersView.ts +2 -2
  206. package/front_end/panels/network/RequestInitiatorView.ts +21 -22
  207. package/front_end/panels/network/RequestPayloadView.ts +2 -2
  208. package/front_end/panels/network/RequestPreviewView.ts +5 -5
  209. package/front_end/panels/network/RequestTimingView.ts +2 -2
  210. package/front_end/panels/network/ShowMoreDetailsWidget.ts +11 -12
  211. package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
  212. package/front_end/panels/network/networkLogView.css +2 -2
  213. package/front_end/panels/network/requestInitiatorView.css +5 -3
  214. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -2
  215. package/front_end/panels/profiler/HeapDetachedElementsView.ts +1 -2
  216. package/front_end/panels/profiler/HeapTimelineOverview.ts +77 -15
  217. package/front_end/panels/profiler/IsolateSelector.ts +258 -187
  218. package/front_end/panels/profiler/ProfileLauncherView.ts +7 -29
  219. package/front_end/panels/profiler/profileLauncherView.css +6 -1
  220. package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -5
  221. package/front_end/panels/recorder/ControlButton.ts +1 -1
  222. package/front_end/panels/recorder/RecordingListView.ts +2 -4
  223. package/front_end/panels/recorder/RecordingView.ts +1 -2
  224. package/front_end/panels/recorder/SelectorPicker.ts +2 -4
  225. package/front_end/panels/recorder/StepView.ts +24 -10
  226. package/front_end/panels/recorder/TimelineSection.ts +1 -1
  227. package/front_end/panels/recorder/recordingView.css +1 -1
  228. package/front_end/panels/screencast/ScreencastApp.ts +1 -1
  229. package/front_end/panels/search/SearchResultsPane.ts +11 -12
  230. package/front_end/panels/search/SearchView.ts +8 -10
  231. package/front_end/panels/security/SecurityPanel.ts +1 -8
  232. package/front_end/panels/security/SecurityPanelSidebar.ts +2 -2
  233. package/front_end/panels/security/mainView.css +1 -1
  234. package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -2
  235. package/front_end/panels/settings/AISettingsTab.ts +1 -1
  236. package/front_end/panels/settings/BackendLinkingSettingsTab.ts +34 -20
  237. package/front_end/panels/settings/EditFileSystemView.ts +2 -2
  238. package/front_end/panels/settings/SettingsScreen.ts +4 -6
  239. package/front_end/panels/settings/WorkspaceSettingsTab.ts +2 -2
  240. package/front_end/panels/settings/aiSettingsTab.css +1 -4
  241. package/front_end/panels/settings/settingsScreen.css +0 -24
  242. package/front_end/panels/sources/BreakpointEditDialog.ts +9 -6
  243. package/front_end/panels/sources/BreakpointsView.ts +2 -2
  244. package/front_end/panels/sources/CallStackSidebarPane.ts +7 -1
  245. package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
  246. package/front_end/panels/sources/NavigatorView.ts +354 -288
  247. package/front_end/panels/sources/ProfilePlugin.ts +25 -14
  248. package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -4
  249. package/front_end/panels/sources/SourcesPanel.ts +2 -2
  250. package/front_end/panels/sources/SourcesView.ts +3 -3
  251. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
  252. package/front_end/panels/sources/components/HeadersView.ts +1 -2
  253. package/front_end/panels/timeline/EventsTimelineTreeView.ts +73 -34
  254. package/front_end/panels/timeline/IsolateSelector.ts +25 -37
  255. package/front_end/panels/timeline/StatusDialog.ts +2 -4
  256. package/front_end/panels/timeline/ThirdPartyTreeView.ts +4 -6
  257. package/front_end/panels/timeline/TimelineDetailsView.ts +15 -16
  258. package/front_end/panels/timeline/TimelineEventOverview.ts +130 -34
  259. package/front_end/panels/timeline/TimelineMiniMap.ts +255 -103
  260. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +19 -11
  261. package/front_end/panels/timeline/TimelinePanel.ts +1 -0
  262. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +2 -3
  263. package/front_end/panels/timeline/TimelineTreeView.ts +236 -117
  264. package/front_end/panels/timeline/TimelineUIUtils.ts +12 -0
  265. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +5 -4
  266. package/front_end/panels/timeline/components/DetailsView.ts +97 -65
  267. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +2 -2
  268. package/front_end/panels/timeline/components/MetricCard.ts +2 -2
  269. package/front_end/panels/timeline/components/NetworkRequestDetails.ts +11 -12
  270. package/front_end/panels/timeline/components/NetworkTrackWidget.ts +57 -50
  271. package/front_end/panels/timeline/components/RelatedInsightChips.ts +2 -2
  272. package/front_end/panels/timeline/components/Sidebar.ts +161 -109
  273. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +33 -12
  274. package/front_end/panels/timeline/components/SidebarInsightsTab.ts +3 -0
  275. package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +11 -11
  276. package/front_end/panels/timeline/components/networkTrackWidget.css +24 -22
  277. package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +15 -10
  278. package/front_end/panels/timeline/overlays/components/entryLabelOverlay.css +1 -1
  279. package/front_end/panels/timeline/timelinePanel.css +5 -0
  280. package/front_end/panels/web_audio/WebAudioView.ts +2 -2
  281. package/front_end/third_party/chromium/README.chromium +1 -1
  282. package/front_end/third_party/legacy-javascript/README.chromium +2 -2
  283. package/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +2 -2
  284. package/front_end/third_party/legacy-javascript/package.json +1 -1
  285. package/front_end/third_party/lighthouse/README.chromium +2 -2
  286. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1983 -2022
  287. package/front_end/third_party/lighthouse/locales/ar-XB.json +157 -142
  288. package/front_end/third_party/lighthouse/locales/ar.json +157 -142
  289. package/front_end/third_party/lighthouse/locales/bg.json +154 -139
  290. package/front_end/third_party/lighthouse/locales/ca.json +157 -142
  291. package/front_end/third_party/lighthouse/locales/cs.json +148 -133
  292. package/front_end/third_party/lighthouse/locales/da.json +153 -138
  293. package/front_end/third_party/lighthouse/locales/de.json +152 -137
  294. package/front_end/third_party/lighthouse/locales/el.json +153 -138
  295. package/front_end/third_party/lighthouse/locales/en-GB.json +160 -145
  296. package/front_end/third_party/lighthouse/locales/en-US.json +239 -218
  297. package/front_end/third_party/lighthouse/locales/en-XL.json +239 -218
  298. package/front_end/third_party/lighthouse/locales/es-419.json +150 -135
  299. package/front_end/third_party/lighthouse/locales/es.json +149 -134
  300. package/front_end/third_party/lighthouse/locales/fi.json +151 -136
  301. package/front_end/third_party/lighthouse/locales/fil.json +154 -139
  302. package/front_end/third_party/lighthouse/locales/fr.json +150 -135
  303. package/front_end/third_party/lighthouse/locales/he.json +160 -145
  304. package/front_end/third_party/lighthouse/locales/hi.json +156 -141
  305. package/front_end/third_party/lighthouse/locales/hr.json +154 -139
  306. package/front_end/third_party/lighthouse/locales/hu.json +111 -96
  307. package/front_end/third_party/lighthouse/locales/id.json +153 -138
  308. package/front_end/third_party/lighthouse/locales/it.json +153 -138
  309. package/front_end/third_party/lighthouse/locales/ja.json +150 -135
  310. package/front_end/third_party/lighthouse/locales/ko.json +42 -27
  311. package/front_end/third_party/lighthouse/locales/lt.json +152 -137
  312. package/front_end/third_party/lighthouse/locales/lv.json +93 -78
  313. package/front_end/third_party/lighthouse/locales/nl.json +149 -134
  314. package/front_end/third_party/lighthouse/locales/no.json +152 -137
  315. package/front_end/third_party/lighthouse/locales/pl.json +153 -138
  316. package/front_end/third_party/lighthouse/locales/pt-PT.json +152 -137
  317. package/front_end/third_party/lighthouse/locales/pt.json +157 -142
  318. package/front_end/third_party/lighthouse/locales/ro.json +149 -134
  319. package/front_end/third_party/lighthouse/locales/ru.json +76 -61
  320. package/front_end/third_party/lighthouse/locales/sk.json +153 -138
  321. package/front_end/third_party/lighthouse/locales/sl.json +149 -134
  322. package/front_end/third_party/lighthouse/locales/sr-Latn.json +151 -136
  323. package/front_end/third_party/lighthouse/locales/sr.json +151 -136
  324. package/front_end/third_party/lighthouse/locales/sv.json +152 -137
  325. package/front_end/third_party/lighthouse/locales/ta.json +156 -141
  326. package/front_end/third_party/lighthouse/locales/te.json +157 -142
  327. package/front_end/third_party/lighthouse/locales/th.json +111 -96
  328. package/front_end/third_party/lighthouse/locales/tr.json +153 -138
  329. package/front_end/third_party/lighthouse/locales/uk.json +149 -134
  330. package/front_end/third_party/lighthouse/locales/vi.json +162 -147
  331. package/front_end/third_party/lighthouse/locales/zh-HK.json +150 -135
  332. package/front_end/third_party/lighthouse/locales/zh-TW.json +154 -139
  333. package/front_end/third_party/lighthouse/locales/zh.json +152 -137
  334. package/front_end/third_party/lighthouse/report/bundle.d.ts +9 -8
  335. package/front_end/third_party/lighthouse/report/bundle.js +10 -10
  336. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -7
  337. package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +0 -2
  338. package/front_end/ui/components/dialogs/typeToAllowDialog.css +0 -4
  339. package/front_end/ui/components/icon_button/fileSourceIcon.css +1 -1
  340. package/front_end/ui/components/menus/menus.ts +0 -2
  341. package/front_end/ui/components/suggestion_input/SuggestionInput.ts +351 -138
  342. package/front_end/ui/components/survey_link/surveyLink.css +3 -3
  343. package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +2 -3
  344. package/front_end/ui/components/text_editor/TextEditor.ts +1 -1
  345. package/front_end/ui/components/tooltips/Tooltip.ts +53 -4
  346. package/front_end/ui/helpers/OpenInNewTab.ts +8 -3
  347. package/front_end/ui/legacy/EmptyWidget.ts +4 -4
  348. package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -2
  349. package/front_end/ui/legacy/TabbedPane.ts +59 -2
  350. package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
  351. package/front_end/ui/legacy/UIUtils.ts +71 -68
  352. package/front_end/ui/legacy/View.ts +4 -3
  353. package/front_end/ui/legacy/Widget.ts +2 -3
  354. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -3
  355. package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +1 -1
  356. package/front_end/ui/legacy/components/inline_editor/cssAngleSwatch.css +1 -1
  357. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +45 -11
  358. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +102 -29
  359. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +148 -122
  360. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +20 -14
  361. package/front_end/ui/legacy/components/source_frame/FontView.ts +29 -5
  362. package/front_end/ui/legacy/components/source_frame/ImageView.ts +70 -8
  363. package/front_end/ui/legacy/components/source_frame/JSONView.ts +20 -2
  364. package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +2 -2
  365. package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +6 -10
  366. package/front_end/ui/legacy/components/source_frame/XMLView.ts +11 -11
  367. package/front_end/ui/legacy/components/source_frame/fontView.css +7 -0
  368. package/front_end/ui/legacy/components/source_frame/imageView.css +7 -0
  369. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +2 -2
  370. package/front_end/ui/legacy/components/utils/Linkifier.ts +126 -2
  371. package/front_end/ui/legacy/emptyWidget.css +2 -1
  372. package/front_end/ui/legacy/inspectorCommon.css +3 -3
  373. package/front_end/ui/legacy/tabbedPane.css +6 -0
  374. package/front_end/ui/lit/Directives.ts +35 -18
  375. package/front_end/ui/lit/lit.ts +0 -2
  376. package/front_end/ui/lit/render.ts +0 -7
  377. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  378. package/package.json +1 -1
  379. package/vpython.toml +8 -0
  380. package/vpython.toml.uv.lock +3 -0
  381. package/.agents/skills/review-models-core/SKILL.md +0 -73
  382. package/.agents/skills/review-tests/SKILL.md +0 -67
  383. package/.agents/skills/review-ui-widgets/SKILL.md +0 -115
  384. package/front_end/ui/components/menus/README.md +0 -119
  385. package/front_end/ui/components/menus/SelectMenu.ts +0 -473
  386. package/front_end/ui/components/menus/selectMenu.css +0 -54
  387. package/front_end/ui/components/menus/selectMenuButton.css +0 -108
@@ -5,7 +5,7 @@ severity: blocking
5
5
  ---
6
6
 
7
7
  **Rule.** Use strict Chai and Sinon assertions against literal expected values rather than assert.isNotNull on undefined-unions or conditional guards
8
- - **Look for**: `assert.isNotNull(...)` on `container?.querySelector` / `Map.get` / `Array.find` / optional properties, `if (el) { assert... }` blocks, `assert.isTrue(spy.called)` instead of `sinon.assert.calledWith`, or assertions comparing output against production formatting helpers.
8
+ - **Look for**: `assert.isNotNull(...)` on `container?.querySelector` / `Map.get` / `Array.find` / optional properties, `if (el) { assert... }` blocks, `assert.isTrue(spy.called)` instead of `sinon.assert.calledWith`, assertions comparing output against production formatting helpers, or case-insensitive sorting tests whose inputs already sort identically under case-sensitive ASCII comparison (e.g. `['Alpha', 'beta']` where `'A' < 'b'` in ASCII; require inputs like `['zebra', 'alpha', 'Beta']` where ASCII and case-insensitive orders differ).
9
9
  - **Do not flag**: Variables whose static return type is strictly `T | null` (and never `undefined`).
10
10
 
11
11
  **Why.** Calling `assert.isNotNull(x)` on a value typed as `T | undefined` passes when `x` is `undefined`, silently skipping assertions. Similarly, wrapping assertions inside `if (el)` or computing expected values by calling the same production helper under test allows broken code to pass.
@@ -6,7 +6,7 @@ severity: should_fix
6
6
 
7
7
  **Rule.** Test presenters via createViewFunctionStub and test pure view functions directly without piercing internal DOM structures
8
8
  - **Look for**: Presenter tests instantiating full DOM trees and querying shadow/child DOM selectors to simulate clicks when the widget accepts a `view` function, or view tests instantiating full presenters just to test template markup.
9
- - **Do not flag**: Legacy widgets that have not yet separated their template rendering into a standalone `DEFAULT_VIEW` function.
9
+ - **Do not flag**: Legacy widgets that have not yet separated their template rendering into a standalone `DEFAULT_VIEW` function. Pre-existing mounted widget tests in `*.test.ts` when migrating a widget to `DEFAULT_VIEW` (keep existing end-to-end presenter + `DEFAULT_VIEW` + child-widget wiring tests intact; `createViewFunctionStub` tests may be added for new presenter logic, not used to delete existing DOM wiring coverage).
10
10
 
11
11
  **Why.** In DevTools' MVP (`UI.Widget` + `DEFAULT_VIEW`) architecture, presenter tests should follow the view stubbing conventions documented in [`docs/ui_engineering.md`](../../../docs/ui_engineering.md) by stubbing the view function with `createViewFunctionStub(Presenter)` and asserting on `await view.nextInput`, while view rendering tests should invoke `DEFAULT_VIEW(input, output, target)` directly or use screenshot assertions.
12
12
 
@@ -6,7 +6,7 @@ severity: should_fix
6
6
 
7
7
  **Rule.** Use native semantic HTML controls with accurate ARIA attributes, keyboard handlers, and !event.isComposing guards
8
8
  - **Look for**: `@click` on `<div>`/`<span>` without button semantics, `<button>` nested inside `<button>`/`<x-link>`, `Enter` keydown handlers missing `!event.isComposing`, or `aria-describedby` pointing to interactive `<devtools-tooltip>` elements.
9
- - **Do not flag**: Delegating click listeners on container elements that handle bubbled events from child buttons.
9
+ - **Do not flag**: Delegating click listeners on container elements that handle bubbled events from child buttons. Rendering `<tr>` rows directly into `this.affectedResources` (`<table class="affected-resource-list">`) in `AffectedResourcesView` subclasses without a `<tbody>` wrapper (`AffectedResourcesView` creates the `<table>` container without a `<tbody>` and subclasses render `<tr>` rows directly into `this.affectedResources`).
10
10
 
11
11
  **Why.** Clickable `<div>`/`<span>` elements and nested interactive controls (`<button>` inside `<a>` or `<button>`) break keyboard navigation and screen readers. Interactive elements require semantic tags (`<button>`, `<details>`/`<summary>`, `<thead>`/`<tbody>`), synchronized ARIA state (`aria-expanded`, `aria-details` for rich tooltips vs `aria-describedby` for plain text), and `!event.isComposing` checks on `Enter` keydown handlers.
12
12
 
@@ -5,8 +5,8 @@ severity: nit
5
5
  ---
6
6
 
7
7
  **Rule.** Scope light-DOM stylesheets and align elements using flexbox or grid rather than competing margin and position offsets
8
- - **Look for**: Unscoped generic selectors in light-DOM `.css` files (or `:host` inside `@scope` blocks instead of `:scope`), or CSS rules combining `vertical-align`, negative `margin-top`, and pixel offsets to center icons and buttons.
9
- - **Do not flag**: Shadow DOM component stylesheets where `:host` scoping is native.
8
+ - **Look for**: Unscoped generic selectors in light-DOM `.css` files (or `:host` inside `@scope` blocks instead of `:scope`), redundant `@scope to (devtools-widget > *)` wrappers on shadow-DOM (`useShadowDom: 'pure'` or `useShadowDom: true`) widgets that have no child `<devtools-widget>` elements, or CSS rules combining `vertical-align`, negative `margin-top`, and pixel offsets to center icons and buttons.
9
+ - **Do not flag**: Shadow DOM component stylesheets where `:host` scoping is native. `<style>${styles}</style>` interpolations of `*.css.js` default imports in Lit templates (generated `.css.js` files export plain CSS strings, not `CSSStyleSheet` objects, and `<style>${...}</style>` is the standard replacement for deprecated `registerRequiredCSS`).
10
10
 
11
11
  **Why.** Unscoped class or tag selectors in light-DOM widget stylesheets leak across the DevTools document, while combining `vertical-align`, negative margins, and `position: relative` offsets creates brittle layouts that break under font scaling or zoom.
12
12
 
@@ -4,11 +4,11 @@ rubric: design
4
4
  severity: should_fix
5
5
  ---
6
6
 
7
- **Rule.** Compose child UI.Widget instances declaratively in Lit templates using the widget() directive instead of imperative show() calls
8
- - **Look for**: `new ChildWidget()` followed by `.show(...)` or `.appendChild(child.element)` inside Lit view functions or migrated `performUpdate()` methods instead of `<devtools-widget ${widget(ChildWidget, {...})}></devtools-widget>` (or `${widget(ChildWidget, {...})}`).
9
- - **Do not flag**: Top-level legacy split widgets or tabbed panes that have not migrated to Lit views.
7
+ **Rule.** Compose child UI.Widget instances declaratively in Lit templates using ${widget(ChildWidget, {...})} or declarative container elements instead of imperative show() calls, WrapperWidget, single-argument factory callbacks, or bare <devtools-widget> tags
8
+ - **Look for**: `new ChildWidget()` followed by `.show(...)` or `.appendChild(child.element)` inside Lit view functions or migrated `performUpdate()` methods, `UI.Widget.WrapperWidget` wrapping a child widget or layout container owned by the presenter (such as `new ChildWidget()`, `FlameChart`, `UI.TabbedPane.TabbedPane` / `tabbedLocation.tabbedPane()`, `StackLocation.widget()`, or `UI.ListWidget.ListWidget`) instead of `${widget(ChildWidget, {...})}`, `<devtools-list>`, `<devtools-tabbed-pane>`, `<devtools-stack-pane>`, or `<devtools-split-view>`, `ViewInput` properties typed as `UI.Widget` subclasses (recommend creating the widget or `<devtools-tabbed-pane>` / `<devtools-stack-pane>` declaratively in the view instead), sizing/border/background classes placed directly on a `<devtools-widget>` hosting `WrapperWidget` (which sets `display: contents`), `widget(element => ...)` factory callbacks configuring child widget properties imperatively instead of `${widget(ChildWidget, {...})}`, `<devtools-widget ${widget(ChildWidget, {...})}></devtools-widget>` tags that have no other attributes, directives, or child nodes, or `@SomeEvent` on `<devtools-widget>` when the child class does not use `eventMixin` on `UI.Widget` (no `dispatchDOMEvent`), when the listener is placed on an ancestor element (the `CustomEvent` does not bubble), or when the handler reads `event.data` instead of `event.detail`.
9
+ - **Do not flag**: Top-level legacy split widgets or tabbed panes that have not migrated to Lit views, `<devtools-widget>` tags that set other attributes, use additional directives (e.g. `widgetRef`), or contain child nodes, `UI.Widget.WrapperWidget` wrapping an externally owned shared stateful singleton reparented across multiple containers (such as `ConsoleView.instance()` or `SourcesView`) or an opaque widget returned by an external factory, or `@SomeEvent=${handler}` on a `<devtools-widget>` whose class uses `Common.ObjectWrapper.eventMixin` on `UI.Widget` (`eventMixin` dispatches `new CustomEvent(type, {detail: data})` on `widget.element`, and Lit preserves the case of `@SomeEvent` from the template string).
10
10
 
11
- **Why.** Imperatively instantiating child widgets and calling `child.show(container)` inside presenters or views bypasses Lit reconciliation, complicates lifecycle management, and recreates widgets unnecessarily across renders.
11
+ **Why.** Imperatively instantiating child widgets and calling `child.show(container)` inside presenters or views bypasses Lit reconciliation, complicates lifecycle management, and recreates widgets unnecessarily across renders. Passing widget instances (`new ChildWidget()`, `UI.TabbedPane.TabbedPane` / `tabbedLocation.tabbedPane()`, `StackLocation.widget()`, `UI.ListWidget.ListWidget`, etc.) via `ViewInput` and wrapping them in `UI.Widget.WrapperWidget` leaks view widgets into presenter state, bypasses declarative lifecycle management, and breaks container box styling and `@scope to (devtools-widget > *)` boundaries because `WrapperWidget` sets `display: contents` on its host element. Child widgets and layout containers (`<devtools-tabbed-pane>`, `<devtools-stack-pane>`, `<devtools-split-view>`, `<devtools-list>`, `${widget(ChildWidget, {...})}`) must be created declaratively in the view instead. Similarly, single-argument factory callbacks `widget(element => ...)` only run on initial creation and fail to propagate updated properties on subsequent re-renders; strongly prefer the two-argument `widget(ChildWidget, {...})` form (updating the child widget's constructor to accept `element?: HTMLElement` and converting `setFoo()` methods into `set foo()` setters if needed). Prefer `${widget(ChildWidget, {...})}` directly as a child expression over `<devtools-widget ${widget(ChildWidget, {...})}></devtools-widget>`.
12
12
 
13
13
  ## Examples
14
14
 
@@ -24,6 +24,6 @@ Good:
24
24
 
25
25
  ```ts
26
26
  Lit.render(html`
27
- <devtools-widget ${UI.Widget.widget(DetailsWidget, {data: input.data})}></devtools-widget>
27
+ ${UI.Widget.widget(DetailsWidget, {data: input.data})}
28
28
  `, target);
29
29
  ```
@@ -5,8 +5,8 @@ severity: should_fix
5
5
  ---
6
6
 
7
7
  **Rule.** Use Lit.nothing, repeat with keys, classMap/styleMap, and ifDefined in single-pass declarative templates instead of imperative DOM mutations
8
- - **Look for**: Ternary branches returning `''` or `undefined` in `html` templates instead of `Lit.nothing`, unkeyed `.map()` on dynamic stateful lists instead of `repeat()`, `ifDefined` omissions on optional attributes, or multiple `Lit.render()` calls mutating the same container.
9
- - **Do not flag**: Static arrays of primitive labels where item identity never reorders.
8
+ - **Look for**: Ternary branches returning `''` or `undefined` in `html` templates instead of `Lit.nothing`, unkeyed `.map()` on dynamic stateful lists instead of `repeat()`, `ifDefined` omissions on optional attributes, multiple `Lit.render()` calls mutating the same container, `Lit.*` namespace calls instead of direct `{Directives, html, nothing, render}` imports from `ui/lit/lit.js`, `useShadowDom: true` in new or migrated `UI.Widget` constructors instead of `useShadowDom: 'pure'` (which makes `this.contentElement` the `ShadowRoot` directly without an extra inner `<div class="widget">` wrapper), `super(..., {classes: [...]})` / `super(..., {jslog: ...})` in `UI.Widget` constructors instead of passing `{container: {classes: [...], attributes: {jslog: ...}}}` as the third argument to every `render(template, target, {container: {classes: [...]}})` branch in the view function (with `useShadowDom: 'pure'` when shadow DOM is used), imperative `element.classList.add(...)`, `element.setAttribute(...)`, or `UI.ARIAUtils.*(element)` calls on a container element (`this.contentElement`, `this.element`, or a detached `HTMLDivElement`) that is rendered via `render(template, element)` instead of passing `{container: {classes: [...], attributes: {...}}}` as the third argument to `render(...)`, or `@SomeEvent` on `<devtools-widget>` when the child class does not use `eventMixin` on `UI.Widget` (no `dispatchDOMEvent`), when the listener is placed on an ancestor element (the `CustomEvent` does not bubble), or when the handler reads `event.data` instead of `event.detail`.
9
+ - **Do not flag**: Static arrays of primitive labels where item identity never reorders. Omitting Lit's `live()` directive on `<devtools-checkbox>` (`UI.UIUtils.CheckboxLabel`) `.checked` bindings (`live()` breaks `CheckboxLabel`'s host `checked` attribute synchronization when toggled externally), listening to `ObjectWrapper` events via Lit `@SomeEvent=${handler}` bindings on a `<devtools-widget>` whose class uses `Common.ObjectWrapper.eventMixin` on `UI.Widget` (`eventMixin` dispatches `new CustomEvent(type, {detail: data})` on `widget.element`, and Lit preserves the case of `@SomeEvent` from the template string), or interpolating boolean values directly inside Lit text/`<td>` positions (Lit renders booleans as `'true'`/`'false'`). Newlines and indentation spaces between expressions and child elements in multi-line `html` templates (DevTools' custom `html` tag in `front_end/ui/lit/strip-whitespace.ts` strips `\n\s*` outside of `<...>` tags at runtime, so multi-line formatting does not introduce whitespace text nodes).
10
10
 
11
11
  **Why.** Mutating DOM elements via `appendChild`, `classList.toggle`, or `innerHTML` alongside Lit templates, or returning `''`/`null` instead of `Lit.nothing` in conditional branches, corrupts Lit's part tracking and creates unnecessary text nodes or wrapper `<div>`s.
12
12
 
@@ -5,8 +5,8 @@ severity: should_fix
5
5
  ---
6
6
 
7
7
  **Rule.** Define user-facing strings in sentence-case UIStrings using complete sentences and i18nTemplate for embedded elements, and prune unused entries
8
- - **Look for**: String concatenation around `i18nString(...)`, HTML/DOM elements interpolated without `i18nTemplate`, Title Case labels in `UIStrings`, unlocalized English literals in templates, or unused keys in `UIStrings`.
9
- - **Do not flag**: Technical protocol identifiers, MIME types, or strings in `UIStringsNotTranslate` / `i18n.i18n.lockedString(...)`.
8
+ - **Look for**: String concatenation around `i18nString(...)`, HTML/DOM elements interpolated without `i18nTemplate` (prefer `i18nTemplate(str_, UIStrings.foo, {PH1: html`...`})` from `ui/lit/lit.js` and declarative `<devtools-link>` inside Lit view functions over `uiI18n.getFormatLocalizedStringTemplate` and imperative `Link.create`), Title Case labels in `UIStrings`, unlocalized English literals in templates, or unused keys in `UIStrings`.
9
+ - **Do not flag**: Technical protocol identifiers, MIME types, or strings in `UIStringsNotTranslate` / `i18n.i18n.lockedString(...)`. Pre-existing `UIStrings` entries (such as legacy Title Case strings) or pre-existing unlocalized string literals that are moved verbatim from imperative DOM creation into a Lit template during a refactoring CL.
10
10
 
11
11
  **Why.** Concatenating translated fragments breaks word order in non-English locales, title-Cased strings violate Chromium UX standards, translating English-only experimental strings wastes localization quota, and unused `UIStrings` entries bloat locale bundles.
12
12
 
@@ -4,11 +4,11 @@ rubric: design
4
4
  severity: should_fix
5
5
  ---
6
6
 
7
- **Rule.** Use modern DevTools UI primitives (`devtools-button`, `devtools-data-grid`, `devtools-icon`), #private fields, and module entrypoint imports
8
- - **Look for**: `UI.Fragment.build`, legacy `DataGridImpl`, `extends LitElement`, `private ` keyword instead of `#` in new UI classes, or `<devtools-*>` tags in Lit templates without importing the corresponding component module entrypoint (e.g. `import * as Buttons from '../../ui/components/buttons/buttons.js'`).
7
+ **Rule.** Use modern DevTools UI primitives (`devtools-button`, `devtools-data-grid`, `devtools-icon`, `devtools-link`, `devtools-list`, `devtools-tabbed-pane`, `devtools-stack-pane`), #private fields, and module entrypoint imports
8
+ - **Look for**: `UI.Fragment.build`, legacy `DataGridImpl`, `extends LitElement`, `Link.create(...)` or `UI.XLink.XLink.create(...)` inside Lit view functions (use `<devtools-link>` instead), `UI.ListWidget.ListWidget` / `UI.ListWidget.Delegate` in newly migrated views or passed via `ViewInput` to `WrapperWidget` with `DocumentFragment` item/editor adapters (prefer `<devtools-list>` with `<devtools-prompt>`, an inline editor row, or `UI.Dialog.Dialog`, or encapsulate `ListWidget` inside the view layer behind pure `ViewInput` data and callbacks), imperative `UI.TabbedPane.TabbedPane` or `StackLocation` passed via `ViewInput` instead of declarative `<devtools-tabbed-pane>` / `<devtools-stack-pane>` in the view, `private ` keyword instead of `#` in new UI classes, `<devtools-*>` tags in Lit templates without importing the corresponding component module entrypoint (e.g. `import * as Buttons from '../../ui/components/buttons/buttons.js'`), or formatting dates or timestamps with `toLocaleString()` inside sortable `<devtools-data-grid>` cells without a numeric/ISO sort value (sorts alphabetically instead of chronologically; use `toISOString()` or a numeric sort value).
9
9
  - **Do not flag**: Overriding inherited `protected` lifecycle methods on framework base classes (e.g. extending `UI.Widget.Widget`).
10
10
 
11
- **Why.** Legacy `UI.Fragment`, `DataGridImpl`, `LitElement`, `new Icon()`, and TypeScript `private` fields are superseded by standard `<devtools-*>` custom elements (imported via module entrypoints such as `import * as Buttons from '../../ui/components/buttons/buttons.js'` so custom tags register at runtime) and ECMAScript `#private` fields.
11
+ **Why.** Legacy `UI.Fragment`, `DataGridImpl`, `LitElement`, `new Icon()`, `Link.create()`, `UI.XLink.XLink.create()`, `UI.ListWidget.ListWidget`, imperative `UI.TabbedPane.TabbedPane` / `StackLocation`, and TypeScript `private` fields are superseded by standard `<devtools-*>` custom elements (imported via module entrypoints such as `import * as Buttons from '../../ui/components/buttons/buttons.js'` so custom tags register at runtime) and ECMAScript `#private` fields. In particular, keeping `this.list = new UI.ListWidget.ListWidget(this)` and `implements UI.ListWidget.Delegate` on a migrated presenter (imperatively calling `this.list.clear()`, `this.list.appendItem()`, `this.list.addNewItem()`, using `DocumentFragment` adapters in `renderItem`/`beginEdit`, and passing `list` in `ViewInput` to `WrapperWidget`) leaks view widgets into presenter state; replace `ListWidget` + `ListWidget.Delegate` with `<devtools-list>` (or, if preserving legacy `ListWidget.Editor` screenshot goldens temporarily, move `ListWidget` and `ListWidget.Delegate` ownership into the view layer and pass only pure data and callbacks in `ViewInput`).
12
12
 
13
13
  ## Examples
14
14
 
@@ -5,8 +5,8 @@ severity: should_fix
5
5
  ---
6
6
 
7
7
  **Rule.** Keep UI.Widget view functions pure and stateless by computing presentation data in presenters and passing decoupled ViewInput data structures
8
- - **Look for**: `DEFAULT_VIEW` or view helper functions calling `Common.Settings.Settings.instance()`, `SDK.*`, `Host.*`, mutating `input.*` arrays in place, or accepting raw `SDK`/`Protocol` domain objects instead of decoupled presentation interfaces on `ViewInput`.
9
- - **Do not flag**: Legacy `UI.Widget` subclasses that have not yet migrated to a `DEFAULT_VIEW` function.
8
+ - **Look for**: `DEFAULT_VIEW` or view helper functions calling `Common.Settings.Settings.instance()`, `UI.Context.Context.instance()`, `SDK.TargetManager.TargetManager.instance()`, `Host.*`, or mutating model or `input.*` state in place; `ViewInput` interfaces carrying pre-created DOM `Element`/`HTMLElement` nodes or `UI.Widget` instances (`ListWidget`, `TabbedPane`, `Linkifier` elements); presenters calling `DEFAULT_VIEW(...)` or auxiliary `*_VIEW(...)` constants directly instead of injecting `view: View = DEFAULT_VIEW` via the constructor (`this.#view(...)`) and exporting `ViewInput` and `View`; or Lit migrations that delete existing standalone/class DOM helper functions and inline their logic into `performUpdate()` or `DEFAULT_VIEW` instead of converting them in place to return `LitTemplate` (or `Promise<LitTemplate|null>`).
9
+ - **Do not flag**: Legacy `UI.Widget` subclasses that have not yet migrated to a `DEFAULT_VIEW` function, or passing read-only `Protocol.*`, `SDK.*`, or `Models.*` objects in `ViewInput` when the view only reads properties/getters from them or forwards them to child widgets/linkifiers without mutating model state or calling side-effecting `SDK` methods.
10
10
 
11
11
  **Why.** In DevTools' MVP architecture, `DEFAULT_VIEW` functions must be pure projections of `ViewInput` to Lit templates. Querying SDK models, reading global settings, mutating presenter state, or calling host/clipboard APIs inside the view couples rendering to global state and breaks isolated view testing.
12
12
 
@@ -5,8 +5,8 @@ severity: should_fix
5
5
  ---
6
6
 
7
7
  **Rule.** Schedule widget re-renders asynchronously via this.requestUpdate() and guard property setters with equality checks
8
- - **Look for**: Widget property setters calling `this.performUpdate()` or `this.#view(...)` directly, or setters calling `this.requestUpdate()` without checking `if (this.#prop === value) return;`.
9
- - **Do not flag**: Internal test helpers or synchronous initialization paths explicitly documented as requiring immediate flush.
8
+ - **Look for**: Widget property setters calling `this.performUpdate()` or `this.#view(...)` directly, setters calling `this.requestUpdate()` without checking `if (this.#prop === value) return;`, monolithic `set data(...)` object setters on `UI.Widget` subclasses instead of individual property setters, or synchronous `this.performUpdate()` calls inside a `UI.Widget` `constructor()` (creates DOM and reads `UI.Context` before the widget is attached or visible; use `this.requestUpdate()` or `wasShown()` instead).
9
+ - **Do not flag**: Internal test helpers or synchronous initialization paths explicitly documented as requiring immediate flush. Synchronous `this.performUpdate()` calls in a constructor when the constructor or methods callable before `wasShown()` depend on `ViewOutput`, `widgetRef`, or `ref` fields populated by the initial render.
10
10
 
11
11
  **Why.** Calling `this.performUpdate()` or invoking `this.#view(...)` synchronously inside property setters causes redundant synchronous DOM renders when multiple properties change in the same tick. Setters should short-circuit if the value is unchanged and call `this.requestUpdate()`.
12
12
 
@@ -5,8 +5,8 @@ severity: should_fix
5
5
  ---
6
6
 
7
7
  **Rule.** Encapsulate imperative DOM actions in ViewOutput callbacks and pass user actions via semantic ViewInput callbacks instead of raw DOM references
8
- - **Look for**: `ViewOutput` interfaces containing `HTMLElement` or `Element` properties, or `ViewInput` callbacks typed as `(event: Event) => void` instead of semantic domain values.
9
- - **Do not flag**: Third-party editor or canvas host containers that require a raw mount `HTMLElement`.
8
+ - **Look for**: `ViewOutput` interfaces containing `HTMLElement` or `Element` properties, `ViewInput` callbacks typed as `(event: Event) => void` instead of semantic domain values, or view functions with no outputs that type `output` as `object` or `{}` instead of `undefined` (and view calls such as `this.#view(...)` in `performUpdate()` passing `{}` instead of `undefined`, or dangling `type ViewOutput = undefined` aliases).
9
+ - **Do not flag**: Third-party editor hosts, `<canvas>` (`HTMLCanvasElement`) and canvas sizing/resizer containers, or elements returned by existing public cross-widget APIs (such as `UI.ListDelegate.createElementForItem` or `ConsolePrompt.belowEditorElement`).
10
10
 
11
11
  **Why.** Exposing raw `HTMLElement` references on `ViewOutput` or passing raw `MouseEvent`/`KeyboardEvent` objects to presenter callbacks leaks DOM details into presenters. Views should populate narrow functional closures on `ViewOutput` (e.g. `output.focusInput = () => ...`) and unpack event values before calling `input.onSelect(value)`.
12
12
 
@@ -5,8 +5,8 @@ severity: blocking
5
5
  ---
6
6
 
7
7
  **Rule.** Attach listeners to external models and managers in wasShown and detach them symmetrically in willHide
8
- - **Look for**: `addEventListener`, `addModelListener`, or `addChangeListener` on singletons, models, or settings inside `UI.Widget` constructors or `wasShown()` without a matching `remove*` call in `willHide()` using the same function reference.
9
- - **Do not flag**: Listeners attached to the widget's own internal DOM elements (`this.contentElement`), which are garbage-collected together with the widget.
8
+ - **Look for**: `addEventListener`, `addModelListener`, or `addChangeListener` on singletons, models, or settings inside `UI.Widget` constructors or `wasShown()` without a matching `remove*` call in `willHide()` using the same function reference, scheduled or asynchronous `performUpdate()` methods on `SDKModelObserver` widgets that access or re-register a model without checking that `this.#model` is still active after `modelRemoved()` has run, or calling `removeChildren()` on a DOM or `TreeOutline` container that hosts imperatively mounted `UI.Widget` children without first detaching them (`this.detachChildWidgets()` or `UI.Widget.Widget.get(el)?.detach()`).
9
+ - **Do not flag**: Listeners attached to the widget's own internal DOM elements (`this.contentElement`), which are garbage-collected together with the widget. Model or target listeners on background recording/overview widgets (such as `NetworkOverview`) that must continuously record events while the widget is hidden or collapsed (especially when rendering is already gated on `this.isShowing()`), or pre-existing constructor listeners untouched by a DOM-to-Lit view migration.
10
10
 
11
11
  **Why.** Subscribing to long-lived SDK `TargetManager`, `Settings`, or model events in a widget's constructor without unsubscribing in `willHide()` (or `onDetach()` / `onunbind()`) causes hidden panels to process background updates and leaks detached widget instances.
12
12
 
@@ -26,31 +26,82 @@ Use it for self-review before upload and for reviewing other people's CLs.
26
26
  - Read the CL description first. Then check that the diff does what the
27
27
  description says, and nothing else.
28
28
 
29
- ## 2. Consult the specialized skills
29
+ ## 2. Consult the specialized skills and rules
30
30
 
31
- Load the skill that matches what the diff touches, and apply its rules:
31
+ Load the skill or `.agents/rules/` files that match what the diff touches, and apply their rules:
32
32
 
33
- | If the diff touches… | Use skill |
33
+ | If the diff touches… | Load skill or rules |
34
34
  | :--- | :--- |
35
35
  | Any `import` statement, or a new cross-module dependency | `devtools-imports` |
36
36
  | `UI.Widget`, lit-html views, components, CSS | `ui-widgets` |
37
- | Reviewing UI and widgets (`front_end/(panels|ui)/**/*.{ts,css}`) | `review-ui-widgets` |
37
+ | Reviewing UI and widgets (`front_end/(panels|ui)/**/*.{ts,css}`) | `.agents/rules/ui-and-widgets/*.md` |
38
38
  | Migration of legacy imperative DOM to widgets or Lit | `ui-eng-vision-orchestrator` (and its sub-skills) |
39
39
  | New or changed tests: choosing unit, API, or E2E | `devtools-testing-guidance` |
40
- | Reviewing tests (`*.test.ts`, `test/**`, `front_end/testing/**`) | `review-tests` |
40
+ | Reviewing tests (`*.test.ts`, `test/**`, `front_end/testing/**`) | `.agents/rules/tests/*.md` |
41
41
  | Tests that use `describeWithEnvironment` or `describeWithMockConnection`, or foundation modules | `foundation-test-migration` |
42
42
  | Ported Chromium web tests (`web_tests/http/tests/devtools`) | `migrate-chromium-test` |
43
43
  | Flaky or disabled tests, or `it.skip` / `it.skipOnPlatforms` | `fix-tests` |
44
- | `UIStrings` / user-facing text | `devtools-ux-writing-refactor` |
45
44
  | Rendering user-controlled strings (URLs, names, console text) | `devtools-unicode-escaping` |
46
45
  | `front_end/models/*`, `BUILD.gn`, `devtools_grd_files.gni`, entrypoints | `devtools-model-management` |
47
- | Reviewing foundation, models, and build configs (`front_end/(core|models|entrypoints|generated)/**`, `BUILD.gn`, `*.gni`) | `review-models-core` |
46
+ | Reviewing foundation, models, and build configs (`front_end/(core|models|entrypoints|generated)/**`, `BUILD.gn`, `*.gni`) | `.agents/rules/models-and-core/*.md` |
48
47
  | Merging modules or consolidating `BUILD.gn` | `merging-devtools-module` |
49
48
  | `Settings` registrations and descriptors | `devtools-setting-migration` |
50
49
  | Stack traces, source maps, `DebuggerWorkspaceBinding` | `devtools-source-maps` |
51
50
  | Building, running tests, or lint | `devtools-verification` |
52
51
 
53
- ## 3. Test correctness (the most common review feedback)
52
+ ## 3. Boundaries vs. Interiors
53
+
54
+ - **Enforce module boundaries strictly:** Prioritize boundary invariants—module
55
+ entrypoints (`foo.ts`, `foo-meta.ts`), GN `visibility` and dependency edges,
56
+ strict `core -> models -> ui -> panels` layering, `SettingDescriptor`
57
+ placement in the lowest layer where used, public widget/component APIs
58
+ (`DEFAULT_VIEW` input/output contracts), CDP protocol contracts, and test
59
+ validity.
60
+ - **Avoid uncodified interior style nits:** Do not flag subjective stylistic
61
+ preferences inside module interiors unless backed by a lint rule or an
62
+ explicit rule under `.agents/rules/`.
63
+
64
+ ## 4. Shared False-Positive Guards
65
+
66
+ Check these guards before reporting any finding (including general review
67
+ findings):
68
+
69
+ - **Lit `@SomeEvent=${handler}` bindings on `<devtools-widget>` (or a
70
+ widget's `element`):**
71
+ - **Do not flag** `@SomeEvent=${handler}` as "never fires" or "lowercased
72
+ by the HTML parser" when the child widget class is built with
73
+ `Common.ObjectWrapper.eventMixin(...)` on top of `UI.Widget.Widget` /
74
+ `UI.Widget.VBox` / `UI.Widget.HBox`:
75
+ 1. `eventMixin.dispatchEventToListeners` (`front_end/core/common/Object.ts`)
76
+ also calls `this.dispatchDOMEvent(new CustomEvent(eventType, {detail: eventData[0]}))`,
77
+ and `Widget.dispatchDOMEvent` dispatches it on `widget.element` (which
78
+ is the `<devtools-widget>` host element when instantiated with `widget()`).
79
+ 2. Lit preserves the exact case of `@`, `.`, and `?` binding names by
80
+ reading the original template strings (`attrNames[]` in
81
+ `front_end/third_party/lit/lib/lit.js`), not the lowercased attribute
82
+ names from the HTML parser. So `@PaintProfilerRequested` registers
83
+ `addEventListener('PaintProfilerRequested', ...)`, and `event.detail`
84
+ carries the first payload argument.
85
+ - **Do flag** it when:
86
+ 1. The event source extends `Common.ObjectWrapper.ObjectWrapper` directly
87
+ or holds one by composition instead of `eventMixin` on `UI.Widget` (it
88
+ has no `dispatchDOMEvent`, so no DOM `CustomEvent` is fired).
89
+ 2. The listener is attached on an ancestor element above the widget's
90
+ host element (`new CustomEvent(...)` in `Object.ts` does not set
91
+ `bubbles: true`).
92
+ 3. The `@SomeEvent` handler reads `(event as any).data` instead of
93
+ `(event as CustomEvent<T>).detail`.
94
+ - **Multi-line `html` template whitespace (`front_end/ui/lit/strip-whitespace.ts`):**
95
+ - **Do not flag** newlines and indentation spaces between expressions and
96
+ inline elements in multi-line `html` templates from `ui/lit/lit.js`.
97
+ DevTools' custom `html` tag strips `\n\s*` outside `<...>` tags at
98
+ runtime.
99
+ - **Generated `.css.js` imports in `<style>${styles}</style>`:**
100
+ - **Do not flag** interpolating `*.css.js` default imports into `<style>`
101
+ in Lit templates. Generated `.css.js` files export plain CSS strings, not
102
+ `CSSStyleSheet` objects.
103
+
104
+ ## 5. Test correctness (the most common review feedback)
54
105
 
55
106
  - **Tautological tests:** A test must exercise real production code. If a
56
107
  mock does the thing the test asserts (for example, a mocked `DOM.undo` that
@@ -79,7 +130,7 @@ Load the skill that matches what the diff touches, and apply its rules:
79
130
  - **Fail fast:** Throw or assert when a required value is missing. Don't let
80
131
  the test time out later.
81
132
 
82
- ## 4. Test hygiene and cleanup
133
+ ## 6. Test hygiene and cleanup
83
134
 
84
135
  - Pair every `beforeEach` singleton creation with a cleanup in `afterEach`
85
136
  (for example, `CSSWorkspaceBinding.removeInstance()` or
@@ -93,7 +144,7 @@ Load the skill that matches what the diff touches, and apply its rules:
93
144
  - Remove guards that were copied from helpers for no reason (for example,
94
145
  `if (!stub.called) …` in a test that stubs the method only once).
95
146
 
96
- ## 5. Code clarity
147
+ ## 7. Code clarity
97
148
 
98
149
  - Don't take detours to reach a value. If a module is imported, call
99
150
  `TextUtils.TextRange.TextRange.fromObject(...)` directly instead of going
@@ -106,7 +157,7 @@ Load the skill that matches what the diff touches, and apply its rules:
106
157
  without being removed, and async work that continues after a widget is
107
158
  detached.
108
159
 
109
- ## 6. CL hygiene
160
+ ## 8. CL hygiene
110
161
 
111
162
  - The description explains *why*, including external dependencies (for
112
163
  example, "V8 will stop emitting X; this must land first").
@@ -117,7 +168,7 @@ Load the skill that matches what the diff touches, and apply its rules:
117
168
  - Disabled tests reference a bug.
118
169
  - Presubmit, lint, and format pass. See `devtools-verification`.
119
170
 
120
- ## 7. Writing review comments
171
+ ## 9. Writing review comments
121
172
 
122
173
  - Be specific: cite file and line, explain the concrete failure mode (such as
123
174
  a leak, a hang, or "passes vacuously"), and suggest a fix. Include a code
@@ -148,15 +148,44 @@ existing element containers.
148
148
  configuration through setters on the child widget, or if imperative
149
149
  actions are strictly required, expose individual functions on `ViewOutput`
150
150
  (e.g., `output.doLayout = () => w.doLayout()`).
151
- * **Pre-Existing Widget Instances (`UI.Widget.WrapperWidget`)**: Use
152
- `${widget(UI.Widget.WrapperWidget, {widget: input.childWidget})}` when
153
- embedding widgets owned by `UI.ViewManager`
154
- (`TabbedViewLocation.tabbedPane()`, `StackLocation.widget()`) or when
155
- conditionally moving a shared widget instance between containers
156
- (`{widget: shouldShow ? this.#sharedWidget : null}`).
157
- * `WrapperWidget` automatically handles showing and detaching the inner
158
- widget and forwards calculateConstraints without requiring custom wrapper
159
- classes.
151
+ * **Avoid `UI.Widget.WrapperWidget`**: Do **NOT** instantiate child widgets
152
+ or layout containers (`new ChildWidget()`, `UI.TabbedPane.TabbedPane` /
153
+ `tabbedLocation.tabbedPane()`, `StackLocation.widget()`,
154
+ `UI.ListWidget.ListWidget`, `UI.SplitWidget.SplitWidget`) in the
155
+ constructor/presenter and pass them via `ViewInput` to
156
+ `UI.Widget.WrapperWidget`.
157
+ * **Child widgets**: Refactor the child widget to accept
158
+ `element?: HTMLElement` in its constructor and setters for its state,
159
+ and instantiate it declaratively with `${widget(ChildWidget, {...})}`.
160
+ * **`TabbedPane` and `StackLocation`**: Create tabbed panes and stack
161
+ panes declaratively in the view using `<devtools-tabbed-pane>` (or
162
+ `${widget(UI.TabbedPane.TabbedPane, ...)}`) and
163
+ `<devtools-stack-pane>` instead of wrapping a `TabbedPane` or
164
+ `StackLocation.widget()` in `WrapperWidget`.
165
+ * **Migrating `UI.ListWidget.ListWidget` + `UI.ListWidget.Delegate`**: Do
166
+ NOT keep `this.list = new UI.ListWidget.ListWidget(this)` and `implements
167
+ UI.ListWidget.Delegate` on the presenter, convert `renderItem` /
168
+ `beginEdit` to render into a `DocumentFragment`, and pass `list` via
169
+ `ViewInput` to `WrapperWidget`. Instead:
170
+ 1. **Recommended**: Replace `ListWidget` + `ListWidget.Delegate` with
171
+ `<devtools-list>` (`ui/components/lists/lists.js`), passing pure data
172
+ (`items`, `editingIndex`, `validationError`) and callbacks in
173
+ `ViewInput`, and handling editing via `<devtools-prompt>`, an inline
174
+ editor row, or `UI.Dialog.Dialog`.
175
+ 2. **Incremental fallback (if preserving `ListWidget.Editor` screenshot
176
+ goldens temporarily)**: Move `ListWidget` + `ListWidget.Delegate`
177
+ ownership out of the presenter into a view-layer child class
178
+ extending `UI.ListWidget.ListWidget` directly and instantiated via
179
+ `${widget(...)}` in `DEFAULT_VIEW` (with an imperative trigger on
180
+ `ViewOutput` if needed, and without `WrapperWidget`), keeping
181
+ `ViewInput` pure data and callbacks.
182
+ * `WrapperWidget` is only justified when reparenting a shared stateful
183
+ singleton across multiple containers (such as `ConsoleView.instance()`
184
+ or `SourcesView`) or bridging an opaque `UI.Widget` returned by an
185
+ external factory. Note that `WrapperWidget` sets `display: contents` on
186
+ its `<devtools-widget>` host, so never put sizing, border, or background
187
+ classes on the `<devtools-widget>` hosting `WrapperWidget` (wrap it in a
188
+ `<div>` instead).
160
189
 
161
190
  13. **Declarative `<devtools-split-view>` Guidelines**:
162
191
 
@@ -210,4 +239,3 @@ existing element containers.
210
239
  6. ❓ **String Audit**: Did I verify that any removed `UIStrings` weren't from accidentally dropped UI branches?
211
240
  7. ❓ **Build**: Does the code compile and do visual tests pass with 0% diff?
212
241
 
213
-
@@ -73,6 +73,7 @@ clean `UI.Widget` classes that use native update rendering delegates.
73
73
  ```
74
74
 
75
75
  * **Strongly prefer the two-argument `widget(MyWidgetClass, {params})` form** over the single-argument factory callback `widget(element => new MyWidgetClass(element, ...))`. The single-argument factory only runs on initial creation and does not update properties on subsequent re-renders. If the child widget only exposes `setFoo(...)` methods, convert them into `set foo(...)` setters so they can be passed via the second argument of `widget()`.
76
+ * **Do NOT Use `UI.Widget.WrapperWidget` for Child Widgets or Layout Containers**: Never instantiate a child widget or layout container in the presenter (`this.#child = new ChildWidget()`, `UI.TabbedPane.TabbedPane` / `tabbedLocation.tabbedPane()`, `StackLocation.widget()`, `UI.ListWidget.ListWidget`) and pass it via `ViewInput` to `UI.Widget.WrapperWidget`. Child widgets and containers must be created declaratively in the view (`${widget(ChildWidget, {...})}`, `<devtools-tabbed-pane>`, `<devtools-stack-pane>`, `<devtools-list>`). `WrapperWidget` is only justified when reparenting a shared stateful singleton across multiple containers (such as `ConsoleView.instance()` or `SourcesView`) or bridging an opaque `UI.Widget` returned by an external factory. In particular, when migrating classes that use `UI.ListWidget.ListWidget` and `UI.ListWidget.Delegate`, do not keep `this.list` and `ListWidget.Delegate` on the presenter with `DocumentFragment` adapters and `WrapperWidget`; either replace `ListWidget` with `<devtools-list>` (recommended) or move `ListWidget` + `ListWidget.Delegate` ownership into the view layer (extending `UI.ListWidget.ListWidget` directly rather than `WrapperWidget`) behind pure `ViewInput` data and callbacks.
76
77
  * **No Widget References on `ViewOutput`**: Keeping child `UI.Widget` instances on `ViewOutput` (e.g., `output.childWidget = w`) is not a good practice and must not remain in the final result (it is only acceptable temporarily in intermediate CLs). Either supply all configuration through setters on the child widget, or if imperative action calls are strictly needed, expose individual functions on `ViewOutput` (such as `output.doLayout = () => w.doLayout()` or `output.scrollWidgetToSomething = () => w.scrollToSomething()`). Remove legacy `get*ForTest()` methods that were only used to grab child widgets from `ViewOutput` and update tests to query the DOM (`view.contentElement.querySelector(...)?.getWidget()`) or inspect `ViewInput`.
77
78
  * Inspect instantiator files (e.g., `ApplicationPanelSidebar.ts`) and
78
79
  decouple any direct accesses to `.element`.
@@ -18,7 +18,7 @@ Adhere strictly to the Model-View-Presenter (MVP) architecture.
18
18
  * Location: Co-located in the same file as its View.
19
19
  * MUST extend a base `UI.Widget` class (e.g., `UI.Widget.Widget`). Note that `UI.Widget.Widget` is not an `HTMLElement` and must be appended via `.show()` or `UI.Widget.widget`
20
20
  * Constructor MUST assign the injected view function to a private `#view` field.
21
- * Constructor MUST call `super()`. If taking `element?: HTMLElement`, pass it to `super(element)`. `super(true)` is forbidden.
21
+ * Constructor MUST call `super()`. If taking `element?: HTMLElement`, pass it to `super(element)`. `super(true)` is forbidden. Do not pass `classes` or `jslog` in `WidgetOptions` (`super(..., {classes: [...], jslog: ...})`); instead, pass container CSS classes and `jslog` via the third parameter of `render(template, target, {container: {classes: [...], attributes: {jslog: ...}}})` in the view function (and if the widget uses shadow DOM, pass `useShadowDom: 'pure'` and extend `Widget<ShadowRoot>` / `VBox<ShadowRoot>` with `target: HTMLElement|DocumentFragment` so `render()` applies `container.classes` and `container.attributes` to the shadow host `this.element`).
22
22
  * Dependencies from `Universe` SHOULD be requested via static `INJECT`: `static override readonly INJECT = [...] as const;` and received as constructor parameter #2 (`[dep1, dep2]: UI.Widget.WidgetDependencies<typeof MyWidget>`).
23
23
  * Styling MUST be handled within the View. `this.registerCSSFiles()` is forbidden.
24
24
  * Initial render MUST be triggered in `override wasShown(): void` by calling `this.requestUpdate()`.
@@ -34,6 +34,7 @@ Adhere strictly to the Model-View-Presenter (MVP) architecture.
34
34
  * `target`: The HTML element to render into.
35
35
  * The `input` parameter MUST NOT be destructured. Always use `input.propertyName`.
36
36
  * Responsibility: Render a `lit-html` template into `target`.
37
+ * **Template Formatting & Whitespace:** The custom `html` tag from `ui/lit/lit.js` (`front_end/ui/lit/strip-whitespace.ts`) automatically strips `\n\s*` outside of `<...>` tags at runtime, so multi-line formatting between text interpolations and inline elements (`<span>`, etc.) does not introduce whitespace text nodes.
37
38
  * MUST NOT hold state, fetch data, or perform business logic.
38
39
 
39
40
  #### Helper Functions in Views
@@ -65,7 +66,12 @@ const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLElement)
65
66
  * Configuration is passed via the parameters.
66
67
  * Properties passed from a parent MUST be declared as public fields or setters on the child presenter class.
67
68
  * The framework automatically updates these properties and calls `requestUpdate()` on the child when the parent re-renders.
68
- * **Pre-existing Widget Instances (`WrapperWidget`):** To render an existing `UI.Widget` instance (such as locations created by `UI.ViewManager`: `TabbedViewLocation.tabbedPane()`, `StackLocation.widget()`) declaratively without creating a custom wrapper class, use `${widget(UI.Widget.WrapperWidget, {widget: myWidgetInstance})}`. `WrapperWidget` automatically forwards constraints, handles attach/detach lifecycle, and supports dynamic widget replacement.
69
+ * **Avoid `UI.Widget.WrapperWidget`:** Do **NOT** pass `UI.Widget` instances (such as `new ChildWidget()`, `UI.TabbedPane.TabbedPane` / `tabbedLocation.tabbedPane()`, `StackLocation.widget()`, `UI.ListWidget.ListWidget`, or `UI.SplitWidget.SplitWidget`) via `ViewInput` to wrap in `UI.Widget.WrapperWidget`.
70
+ * **Child widgets:** Refactor the child widget to accept `element?: HTMLElement` in its constructor and setters for its state, and instantiate it declaratively in the view with `${widget(ChildWidget, {...})}`.
71
+ * **`TabbedPane` and `StackLocation`:** Create tabbed panes and stack panes declaratively in the view using `<devtools-tabbed-pane>` (or `${widget(UI.TabbedPane.TabbedPane, ...)}`) and `<devtools-stack-pane>` rather than passing a `TabbedPane` or `StackLocation.widget()` instance through `ViewInput` to `WrapperWidget`.
72
+ * **`UI.ListWidget.ListWidget` and `UI.ListWidget.Delegate`:** Do NOT keep `this.list` and `UI.ListWidget.Delegate` on the presenter (calling `this.list.clear()`, `this.list.appendItem()`, `this.list.addNewItem()`, rendering `renderItem`/`beginEdit` into a `DocumentFragment`, and mounting `this.list` via `WrapperWidget`). Replace `ListWidget` + `ListWidget.Delegate` with `<devtools-list>` (`ui/components/lists/lists.js`) driven by pure `ViewInput` data and callbacks (using `<devtools-prompt>`, an inline editor row, or `UI.Dialog.Dialog` for editing). If legacy `ListWidget.Editor` DOM/screenshot goldens must be preserved temporarily in an incremental CL, move `ListWidget` + `ListWidget.Delegate` ownership into the view layer (e.g. a small view-layer child class extending `UI.ListWidget.ListWidget` directly and instantiated via `${widget(...)}` in `DEFAULT_VIEW`, without `WrapperWidget`) so the presenter only passes pure data and callbacks in `ViewInput`.
73
+ * `WrapperWidget` is only justified when reparenting a shared stateful singleton across multiple containers (such as `ConsoleView.instance()` or `SourcesView`) or bridging an opaque `UI.Widget` returned by an external factory. Remember that `WrapperWidget` sets `display: contents` on its `<devtools-widget>` host element, so never put sizing, border, or background classes on that `<devtools-widget>` host (wrap it in a `<div>` instead).
74
+ * **Listening to Child Widget Events (`eventMixin`):** When a child `UI.Widget` uses `Common.ObjectWrapper.eventMixin(UI.Widget.Widget)`, calling `this.dispatchEventToListeners(Events.FOO, payload)` also dispatches a non-bubbling `new CustomEvent(Events.FOO, {detail: payload})` on the widget's host `<devtools-widget>` element. Parent Lit templates can listen declaratively with `<devtools-widget ${widget(ChildWidget, {...})} @Foo=${(e: CustomEvent<Payload>) => input.onFoo(e.detail)}></devtools-widget>` (Lit preserves the case of `@Foo` from the template string). This only works on the `<devtools-widget>` element itself (the `CustomEvent` does not bubble) and only for `UI.Widget` classes using `eventMixin` (plain `ObjectWrapper` subclasses do not have `dispatchDOMEvent`).
69
75
 
70
76
  ## Refactoring Legacy Components
71
77
 
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: write-ai-eval-test
3
+ description: Use when asked to write or create an ai_eval test under test/ai_evals/ for an evaluation use case in test/ai_evals/eval_data/evals/. Works across all DevTools domains (performance, network, elements, sources, console, accessibility, storage). To minimize latency, in your FIRST turn call view_file in parallel on SKILL.md, task.textproto + agent_prompt.md for <eval-id>, and test/ai_evals/BUILD.gn (plus test/ai_evals/<domain>/BUILD.gn if <domain> is known).
4
+ ---
5
+
6
+ # Writing AI Eval Tests (`test/ai_evals/`)
7
+
8
+ ## Guardrails & Forbidden Actions
9
+
10
+ > [!CAUTION]
11
+ > 1. **CRITICAL RULE — SINGLE V2 TEST ONLY:** Always write **only one V2 evaluation test** per eval (`enabledFeatures: ['DevToolsAiV2Architecture']`) using the canonical template below. **NEVER** create V1 tests or V1+V2 pairs.
12
+ > 2. **CRITICAL RULE — NEVER SET OR PASS CONTEXT:** **NEVER** call `findAndSetContext` (or any panel/UI context-selection helper) and **NEVER** pass `context` to `evalTask.executePrompt(...)`, even when `initial_context` is present in `task.textproto`.
13
+ > 3. **CRITICAL RULE — MINIMAL FILE READS & NO UNREQUESTED COMMANDS:**
14
+ > - **Only read `task.textproto`, `agent_prompt.md`, and `BUILD.gn` files.** Do **NOT** read `ai_eval-helpers.ts`, `ai-eval-state-provider.ts`, `base-apps/`, `front_end/`, or legacy tests that use `findAndSetContext`.
15
+ > - Do **NOT** run `git`, `autoninja`, `./dt lint`, or `./dt test` unless the user explicitly asks to build or run the test.
16
+
17
+ ## Fast 2-Step Workflow (All Domains)
18
+
19
+ ### Step 1: Read Only Required Metadata & `BUILD.gn` in One Parallel Turn
20
+ Call `view_file` in parallel on:
21
+ 1. **`task.textproto` and `agent_prompt.md`** for `<eval-id>`:
22
+ - Check flat path `test/ai_evals/eval_data/evals/<eval-id>/` (`evalFolder` = `''`) or nested path `test/ai_evals/eval_data/evals/<eval-folder>/<eval-id>/` (`evalFolder` = `'<eval-folder>'`, e.g. `'network'`).
23
+ - From `agent_prompt.md`: extract the trimmed prompt string `<agent_prompt>`.
24
+ - From `task.textproto`: infer `<domain>` in priority order:
25
+ 1. Explicit user instruction or `<eval-folder>` subfolder name.
26
+ 2. Domain tag in `tags`: `"performance"`, `"network"`, `"elements"`, `"sources"`, `"console"`, `"accessibility"`, `"storage"` (ignore generic tags like `"cd4h"` or `"bugfix"`, and prefer panel domain tags over sub-topic tags like `"cls"`).
27
+ 3. `initial_context.panel` fallback *(for folder naming only — never set context in code)*:
28
+ - `NETWORK_REQUEST` $\rightarrow$ `network`
29
+ - `PERFORMANCE` $\rightarrow$ `performance`
30
+ - `DOM_NODE` / `ELEMENTS` $\rightarrow$ `elements`
31
+ - `SOURCE_FILE` / `SOURCES` $\rightarrow$ `sources`
32
+ - `CONSOLE` $\rightarrow$ `console`
33
+ - `ACCESSIBILITY` $\rightarrow$ `accessibility`
34
+ - `STORAGE` / `APPLICATION` $\rightarrow$ `storage`
35
+ - *Note:* `setupAndRunEvalApp` parses `base_app` and `initial_url` from `task.textproto` automatically at runtime—do not hardcode them.
36
+ 2. **`test/ai_evals/BUILD.gn`** (and **`test/ai_evals/<domain>/BUILD.gn`** if `<domain>` is already known).
37
+
38
+ ### Step 2: Write Test and Update `BUILD.gn` in One Parallel Turn
39
+ In a single parallel tool-call turn:
40
+ 1. Create `test/ai_evals/<domain>/<eval-id>.test.ts` (`write_to_file`) using this exact domain-agnostic V2 template (`<Domain>` is capitalized `<domain>`, e.g. `Performance`, `Network`, `Elements`, `Sources`, `Console`, `Accessibility`, `Storage`):
41
+ ```typescript
42
+ // Copyright 2026 The Chromium Authors
43
+ // Use of this source code is governed by a BSD-style license that can be
44
+ // found in the LICENSE file.
45
+
46
+ import {assert} from 'chai';
47
+
48
+ import {
49
+ setupAndRunEvalApp,
50
+ stopEvalApp,
51
+ } from '../helpers/ai_eval-helpers.js';
52
+ import {describe, it, setup} from '../mocha-interface.js';
53
+
54
+ describe('<Domain> AI Eval: <eval-id>', function() {
55
+ this.timeout(180_000);
56
+
57
+ setup({
58
+ dockingMode: 'undocked',
59
+ enabledFeatures: ['DevToolsAiV2Architecture'],
60
+ devToolsSettings: {
61
+ 'ai-assistance-enabled': true,
62
+ 'ai-assistance-v2-opt-in-change-dialog-seen': true,
63
+ },
64
+ evalConfig: {
65
+ type: '<domain>',
66
+ label: '<eval-id>',
67
+ taskId: '<eval-id>',
68
+ },
69
+ });
70
+
71
+ it('launches app, navigates to initial URL, and executes prompt', async ({inspectedPage, evalTask}) => {
72
+ const app = await setupAndRunEvalApp('<evalFolder>', '<eval-id>');
73
+ try {
74
+ assert.isDefined(app.config.initialUrl, 'Expected initial_url to be defined in task.textproto');
75
+
76
+ await inspectedPage.page.goto(app.config.initialUrl, {waitUntil: 'networkidle0'});
77
+
78
+ await evalTask.executePrompt({
79
+ prompts: ['<agent_prompt>'],
80
+ });
81
+ } finally {
82
+ await stopEvalApp(app);
83
+ }
84
+ });
85
+ });
86
+ ```
87
+ 2. Update `BUILD.gn`:
88
+ - **If `test/ai_evals/<domain>/BUILD.gn` exists:** Add `"<eval-id>.test.ts"` in alphabetical order to `sources` (`replace_file_content`).
89
+ - **If `<domain>` is a new domain folder:** Create `test/ai_evals/<domain>/BUILD.gn` (`write_to_file`) and add `"<domain>"` to `deps` in both `group("ai_evals")` and `generated_file("test_inputs")` in `test/ai_evals/BUILD.gn` (`replace_file_content`):
90
+ ```gn
91
+ # Copyright 2026 The Chromium Authors
92
+ # Use of this source code is governed by a BSD-style license that can be
93
+ # found in the LICENSE file.
94
+
95
+ import("../../../scripts/build/typescript/typescript.gni")
96
+
97
+ node_ts_library("<domain>") {
98
+ sources = [ "<eval-id>.test.ts" ]
99
+
100
+ ts_deps = [
101
+ "..:harness_library",
102
+ "../../e2e/helpers",
103
+ "../helpers",
104
+ ]
105
+ }
106
+ ```
package/DIR_METADATA CHANGED
@@ -13,8 +13,7 @@ agentic_review: {
13
13
  ".agents/skills/devtools-imports/SKILL.md",
14
14
  ".agents/skills/devtools-model-management/SKILL.md",
15
15
  ".agents/skills/devtools-setting-migration/SKILL.md",
16
- ".agents/skills/devtools-unicode-escaping/SKILL.md",
17
- ".agents/skills/devtools-ux-writing-refactor/SKILL.md"
16
+ ".agents/skills/devtools-unicode-escaping/SKILL.md"
18
17
  ]
19
18
  }
20
19
  capability_groups: {
@@ -121,6 +121,31 @@ See the section about [Creating demos for crbugs](https://github.com/ChromeDevTo
121
121
  and check out the [README](https://github.com/ChromeDevTools/devtools-dbg-stories#readme) for more information about non-trivial test
122
122
  cases and the like.
123
123
 
124
+ ## Code review
125
+
126
+ - **AI pre-review (`ChromiumCodeReviewAgent`)**: Run `Commit-Queue+1`
127
+ (`git cl upload --cq-dry-run`) before adding human reviewers to the attention
128
+ set, and address or reply to `ERROR`/`WARNING` findings in the Gerrit Checks
129
+ tab. (Googlers: link `@chromium.org` and `@google.com` at
130
+ <https://chromium-review.googlesource.com/settings/#Identities>.)
131
+ - **Strict at module boundaries, relaxed inside module interiors**: Human and
132
+ automated reviews strictly enforce module boundaries: entrypoint exports,
133
+ cross-module imports and GN `visibility`, `core -> models -> ui -> panels`
134
+ layering, `SettingDescriptor` placement (lowest-layer rule), public
135
+ widget/component APIs, and CDP contracts. Implementation details behind a
136
+ module entrypoint are governed by tests and lint rules rather than subjective
137
+ style preferences.
138
+ - **Block-and-codify**: If a reviewer blocks a CL on an uncodified pattern,
139
+ that pattern should be codified within a week as an ESLint/Stylelint rule, a
140
+ GN visibility check, a test, or an in-tree review rule under
141
+ `.agents/rules/`.
142
+ - **Large-scale migrations**: Repo-wide migrations require an owner-approved
143
+ goal and mechanical verification (lint/typecheck/tests proving the target
144
+ state). Mechanical or test-only migration CLs that pass presubmit, tryjobs,
145
+ and `ChromiumCodeReviewAgent` with zero `ERROR`/`WARNING` findings may be
146
+ sent to any `COMMON_OWNERS` reviewer for a quick stamp rather than routing
147
+ exclusively to a single domain lead.
148
+
124
149
  ## Merges and cherry-picks
125
150
 
126
151
  _Merge request/approval is handled by Chromium Release Managers. DevTools follows [Chromium's merge criteria](https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/docs/process/merge_request.md#merge-criteria-phases). In exceptional cases please get in touch with hablich@chromium.org._