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
@@ -85,7 +85,7 @@ export function expandWindowByPercentOrToOneMillisecond(
85
85
  return expandedWindow;
86
86
  }
87
87
 
88
- export interface EventTimingsData<ValueType extends Types.Timing.Micro|Types.Timing.Milli|Types.Timing.Seconds, > {
88
+ export interface EventTimingsData<ValueType extends Types.Timing.Micro|Types.Timing.Milli|Types.Timing.Seconds> {
89
89
  startTime: ValueType;
90
90
  endTime: ValueType;
91
91
  duration: ValueType;
@@ -175,7 +175,7 @@ export function getFieldMetricsForInsightSet(
175
175
  loadDelay: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_resource_load_delay', scope),
176
176
  loadDuration: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_resource_load_duration', scope),
177
177
  renderDelay: getMetricTimingResult(pageResult, 'largest_contentful_paint_image_element_render_delay', scope),
178
- }
178
+ },
179
179
  };
180
180
  }
181
181
 
@@ -242,18 +242,18 @@ export function generateInsight(
242
242
  PH1: documentRequest.args.data.redirects.length,
243
243
  PH2: millisToString(redirectDuration),
244
244
  }),
245
- value: noRedirects
245
+ value: noRedirects,
246
246
  },
247
247
  serverResponseIsFast: {
248
248
  label: serverResponseIsFast ?
249
249
  i18nString(UIStrings.passingServerResponseTime, {PH1: millisToString(serverResponseTime)}) :
250
250
  i18nString(UIStrings.failedServerResponseTime, {PH1: millisToString(serverResponseTime)}),
251
- value: serverResponseIsFast
251
+ value: serverResponseIsFast,
252
252
  },
253
253
  usesCompression: {
254
254
  label: usesCompression ? i18nString(UIStrings.passingTextCompression) :
255
255
  i18nString(UIStrings.failedTextCompression),
256
- value: usesCompression
256
+ value: usesCompression,
257
257
  },
258
258
  },
259
259
  },
@@ -156,7 +156,7 @@ export function generateInsight(
156
156
  checklist: {
157
157
  priorityHinted: {
158
158
  label: priorityHintFound ? i18nString(UIStrings.fetchPriorityApplied) : missingPriorityHintLabel,
159
- value: priorityHintFound
159
+ value: priorityHintFound,
160
160
  },
161
161
  requestDiscoverable: {label: i18nString(UIStrings.requestDiscoverable), value: imgPreloadedOrFoundInHTML},
162
162
  eagerlyLoaded: {label: i18nString(UIStrings.lazyLoadNotApplied), value: lcpNotLazyLoaded},
@@ -40,7 +40,7 @@ export const UIStrings = {
40
40
  * @description Text explaining that there were not requests that were slowed down by using HTTP/1.1. "HTTP/1.1" should not be translated.
41
41
  */
42
42
  noOldProtocolRequests:
43
- 'No requests used HTTP/1.1, or its current use of HTTP/1.1 does not present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they are not served from a local development environment or a third-party source.'
43
+ 'No requests used HTTP/1.1, or its current use of HTTP/1.1 does not present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they are not served from a local development environment or a third-party source.',
44
44
  } as const;
45
45
 
46
46
  const str_ = i18n.i18n.registerUIStrings('models/trace/insights/ModernHTTP.ts', UIStrings);
@@ -216,8 +216,8 @@ export class SourceMapsResolver extends EventTarget {
216
216
  continue;
217
217
  }
218
218
  for (const node of nodes) {
219
- const resolvedFunctionName =
220
- await SourceMapScopes.NamesResolver.resolveProfileFrameFunctionName(node.callFrame, target);
219
+ const resolvedFunctionName = await SourceMapScopes.NamesResolver.resolveProfileFrameFunctionName(
220
+ node.callFrame, target, this.#debuggerWorkspaceBinding);
221
221
  updatedMappings ||= Boolean(resolvedFunctionName);
222
222
  node.setOriginalFunctionName(resolvedFunctionName);
223
223
 
@@ -28,10 +28,9 @@ export class WorkspaceDiffImpl extends Common.ObjectWrapper.ObjectWrapper<EventT
28
28
 
29
29
  constructor(
30
30
  workspace: Workspace.Workspace.WorkspaceImpl,
31
- persistence: Persistence.Persistence.PersistenceImpl = Persistence.Persistence.PersistenceImpl.instance(),
32
- networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager =
33
- Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance(),
34
- settings: Common.Settings.Settings = Common.Settings.Settings.instance(),
31
+ persistence: Persistence.Persistence.PersistenceImpl,
32
+ networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager,
33
+ settings: Common.Settings.Settings,
35
34
  ) {
36
35
  super();
37
36
  this.#persistence = persistence;
@@ -156,8 +155,8 @@ export class WorkspaceDiffImpl extends Common.ObjectWrapper.ObjectWrapper<EventT
156
155
 
157
156
  const contentsPromise = Promise.all([
158
157
  this.requestOriginalContentForUISourceCode(uiSourceCode),
159
- uiSourceCode.requestContentData().then(
160
- contentDataOrError => TextUtils.ContentData.ContentData.textOr(contentDataOrError, null))
158
+ uiSourceCode.requestContentData().then(contentDataOrError =>
159
+ TextUtils.ContentData.ContentData.textOr(contentDataOrError, null)),
161
160
  ]);
162
161
 
163
162
  this.loadingUISourceCodes.set(uiSourceCode, contentsPromise);
@@ -215,7 +214,7 @@ export class UISourceCodeDiff extends Common.ObjectWrapper.ObjectWrapper<UISourc
215
214
  constructor(
216
215
  uiSourceCode: Workspace.UISourceCode.UISourceCode,
217
216
  networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager,
218
- settings: Common.Settings.Settings = Common.Settings.Settings.instance(),
217
+ settings: Common.Settings.Settings,
219
218
  ) {
220
219
  super();
221
220
  this.#uiSourceCode = uiSourceCode;
@@ -325,8 +324,14 @@ export interface UISourceCodeDiffEventTypes {
325
324
 
326
325
  export function workspaceDiff({forceNew}: {forceNew?: boolean} = {}): WorkspaceDiffImpl {
327
326
  if (!Root.DevToolsContext.globalInstance().has(WorkspaceDiffImpl) || forceNew) {
328
- Root.DevToolsContext.globalInstance().set(WorkspaceDiffImpl,
329
- new WorkspaceDiffImpl(Workspace.Workspace.WorkspaceImpl.instance()));
327
+ Root.DevToolsContext.globalInstance().set(
328
+ WorkspaceDiffImpl,
329
+ new WorkspaceDiffImpl(
330
+ Workspace.Workspace.WorkspaceImpl.instance(),
331
+ Persistence.Persistence.PersistenceImpl.instance(),
332
+ Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance(),
333
+ Common.Settings.Settings.instance(),
334
+ ));
330
335
  }
331
336
  return Root.DevToolsContext.globalInstance().get(WorkspaceDiffImpl);
332
337
  }
@@ -53,7 +53,6 @@ import {
53
53
  WalkthroughView,
54
54
  } from './components/WalkthroughView.js';
55
55
  import {saveToDisk} from './ExportConversation.js';
56
- import {isAiAssistancePatchingEnabled} from './PatchWidget.js';
57
56
 
58
57
  const {html} = Lit;
59
58
  const {widget} = UI.Widget;
@@ -422,7 +421,7 @@ interface ToolbarViewInput {
422
421
  export const enum ViewState {
423
422
  DISABLED_VIEW = 'disabled-view',
424
423
  CHAT_VIEW = 'chat-view',
425
- EXPLORE_VIEW = 'explore-view'
424
+ EXPLORE_VIEW = 'explore-view',
426
425
  }
427
426
 
428
427
  type PanelViewInput = {
@@ -788,7 +787,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
788
787
  isContextSelected: Boolean(this.#conversation.selectedContext),
789
788
  conversationType: this.#conversation.type,
790
789
  isReadOnly: this.#conversation.isReadOnly ?? false,
791
- changeSummary: this.#getChangeSummary(),
792
790
  inspectElementToggled: this.#toggleSearchElementAction?.toggled() ?? false,
793
791
  canShowFeedbackForm: this.#serverSideLoggingEnabled,
794
792
  multimodalInputEnabled: isAiAssistanceMultimodalInputEnabled() &&
@@ -798,7 +796,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
798
796
  inputPlaceholder: this.#getChatInputPlaceholder(),
799
797
  disclaimerText: this.#getDisclaimerText(),
800
798
  onExportConversation: this.#onExportConversationClick.bind(this),
801
- changeManager: this.#changeManager,
802
799
  uploadImageInputEnabled: isAiAssistanceMultimodalUploadInputEnabled() &&
803
800
  this.#conversation.type === AiAssistanceModel.AiHistoryStorage.ConversationType.STYLING,
804
801
  markdownRenderer,
@@ -855,7 +852,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
855
852
  activeSidebarMessage: this.#walkthrough.activeSidebarMessage,
856
853
  inlineExpandedMessages: this.#walkthrough.inlineExpandedMessages,
857
854
  },
858
- }
855
+ },
859
856
  };
860
857
  }
861
858
 
@@ -1313,16 +1310,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1313
1310
  this.#selectedAccessibility = createAccessibilityContext(newReport);
1314
1311
  this.#updateConversationState(this.#conversation);
1315
1312
  };
1316
-
1317
- #getChangeSummary(): string|undefined {
1318
- if (!isAiAssistancePatchingEnabled() || !this.#conversation || this.#conversation?.isReadOnly) {
1319
- return;
1320
- }
1321
-
1322
- const hasAiV2 = Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceV2?.enabled);
1323
- return this.#changeManager.formatChangesForPatching(this.#conversation.id, /* includeMetadata= */ !hasAiV2);
1324
- }
1325
-
1326
1313
  override async performUpdate(): Promise<void> {
1327
1314
  const viewInput: ViewInput = {
1328
1315
  ...this.#getToolbarInput(),
@@ -8,13 +8,12 @@ export * from './components/AccessibilityAgentMarkdownRenderer.js';
8
8
  export * from './components/AIv2MarkdownRenderer.js';
9
9
  export * as ChatInput from './components/ChatInput.js';
10
10
  export * from './components/MarkdownRendererWithCodeBlock.js';
11
- export * from './SelectWorkspaceDialog.js';
12
11
  export * as ChatMessage from './components/ChatMessage.js';
13
12
  export * as ExploreWidget from './components/ExploreWidget.js';
14
13
  export * as ExportForAgentsDialog from './components/ExportForAgentsDialog.js';
15
14
  export * as OptInChangeDialog from './components/OptInChangeDialog.js';
16
- export * as PatchWidget from './PatchWidget.js';
17
15
  export * as DisabledWidget from './components/DisabledWidget.js';
18
16
  export * as WalkthroughUtils from './components/WalkthroughUtils.js';
19
17
  export * as WalkthroughView from './components/WalkthroughView.js';
20
18
  export * as ExportConversation from './ExportConversation.js';
19
+ export * as ImageResize from './components/ImageResize.js';
@@ -20,6 +20,7 @@ import * as Lit from '../../../ui/lit/lit.js';
20
20
  import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
21
21
 
22
22
  import chatInputStyles from './chatInput.css.js';
23
+ import * as ImageResize from './ImageResize.js';
23
24
 
24
25
  const {html, Directives: {createRef, ref}} = Lit;
25
26
  const {widget} = UI.Widget;
@@ -83,6 +84,10 @@ const UIStringsNotTranslate = {
83
84
  * @description Message displayed in toast in case of any failures while uploading an image file as input.
84
85
  */
85
86
  uploadImageFailureMessage: 'Failed to upload image. Please try again.',
87
+ /**
88
+ * @description Message displayed in toast in case of uploaded image being too large.
89
+ */
90
+ fileTooLargeMessage: 'File is too large. Please select an image under 10MB.',
86
91
  /**
87
92
  * @description Label added to the button that add selected context from the current panel in AI Assistance panel.
88
93
  */
@@ -121,6 +126,11 @@ const SCREENSHOT_QUALITY = 80;
121
126
  const JPEG_MIME_TYPE = 'image/jpeg';
122
127
  const SHOW_LOADING_STATE_TIMEOUT = 100;
123
128
 
129
+ /**
130
+ * Maximum allowed size for raw images uploaded by the user to prevent browser tab out-of-memory crashes.
131
+ */
132
+ export const MAX_IMAGE_FILE_SIZE_BYTES = 10 * 1024 * 1024; // 10MB
133
+
124
134
  const RELEVANT_DATA_LINK_CHAT_ID = 'relevant-data-link-chat';
125
135
  const RELEVANT_DATA_LINK_FOOTER_ID = 'relevant-data-link-footer';
126
136
 
@@ -493,7 +503,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
493
503
  >
494
504
  ${renderRelevantDataDisclaimer(RELEVANT_DATA_LINK_FOOTER_ID)}
495
505
  </footer>
496
- `, target,);
506
+ `, target);
497
507
  // clang-format on
498
508
  };
499
509
 
@@ -516,6 +526,7 @@ export class ChatInput extends UI.Widget.Widget implements SDK.TargetManager.Obs
516
526
 
517
527
  #textAreaRef = createRef<HTMLTextAreaElement>();
518
528
  #imageInput?: ImageInputData;
529
+
519
530
  /**
520
531
  * Tracks the user's position when navigating through prompt history.
521
532
  * -1 means the user is at the newest "uncommitted" position (the current input).
@@ -606,7 +617,7 @@ export class ChatInput extends UI.Widget.Widget implements SDK.TargetManager.Obs
606
617
  isLoading: false,
607
618
  data: bytes,
608
619
  mimeType: JPEG_MIME_TYPE,
609
- inputType: AiAssistanceModel.AiAgent.MultimodalInputType.SCREENSHOT
620
+ inputType: AiAssistanceModel.AiAgent.MultimodalInputType.SCREENSHOT,
610
621
  };
611
622
  this.performUpdate();
612
623
  void this.updateComplete.then(() => {
@@ -668,31 +679,24 @@ export class ChatInput extends UI.Widget.Widget implements SDK.TargetManager.Obs
668
679
  };
669
680
 
670
681
  async #handleLoadImage(file: File): Promise<void> {
682
+ if (file.size > MAX_IMAGE_FILE_SIZE_BYTES) {
683
+ Snackbars.Snackbar.Snackbar.show({message: lockedString(UIStringsNotTranslate.fileTooLargeMessage)});
684
+ return;
685
+ }
671
686
  const showLoadingTimeout = setTimeout(() => {
672
687
  this.#imageInput = {isLoading: true};
673
688
  this.performUpdate();
674
689
  }, SHOW_LOADING_STATE_TIMEOUT);
675
690
  try {
676
- const reader = new FileReader();
677
- const dataUrl = await new Promise<string>((resolve, reject) => {
678
- reader.onload = () => {
679
- if (typeof reader.result === 'string') {
680
- resolve(reader.result);
681
- } else {
682
- reject(new Error('FileReader result was not a string.'));
683
- }
684
- };
685
- reader.readAsDataURL(file);
686
- });
687
- const commaIndex = dataUrl.indexOf(',');
688
- const bytes = dataUrl.substring(commaIndex + 1);
691
+ const compressed = await ImageResize.compress(file);
689
692
  this.#imageInput = {
690
693
  isLoading: false,
691
- data: bytes,
692
- mimeType: file.type,
693
- inputType: AiAssistanceModel.AiAgent.MultimodalInputType.UPLOADED_IMAGE
694
+ data: compressed.data,
695
+ mimeType: compressed.mimeType,
696
+ inputType: AiAssistanceModel.AiAgent.MultimodalInputType.UPLOADED_IMAGE,
694
697
  };
695
- } catch {
698
+ } catch (err) {
699
+ console.error('Failed to compress image:', err);
696
700
  this.#imageInput = undefined;
697
701
  Snackbars.Snackbar.Snackbar.show({message: lockedString(UIStringsNotTranslate.uploadImageFailureMessage)});
698
702
  }
@@ -56,7 +56,6 @@ const {widget} = UI.Widget;
56
56
 
57
57
  const REPORT_URL = 'https://crbug.com/508304827' as Platform.DevToolsPath.UrlString;
58
58
  const SCROLL_ROUNDING_OFFSET = 1;
59
- const MAX_NUM_LINES_IN_CODEBLOCK = 11;
60
59
 
61
60
  /*
62
61
  * Strings that don't need to be translated at this time.
@@ -127,6 +126,10 @@ const UIStringsNotTranslate = {
127
126
  * @description The error message when the LLM selects context from a different origin.
128
127
  */
129
128
  crossOriginError: 'I have selected the new context but you will have to start a new chat.',
129
+ /**
130
+ * @description The error message when the request payload is too large.
131
+ */
132
+ payloadTooLargeError: 'The request payload is too large. Please try a smaller image or a screenshot.',
130
133
  /**
131
134
  * @description Displayed when the user stop the response
132
135
  */
@@ -541,14 +544,12 @@ export interface MessageInput {
541
544
  isLastMessage: boolean;
542
545
  isFirstMessage: boolean;
543
546
  prompt: string;
544
- shouldShowCSSChangeSummary: boolean;
545
547
  canShowFeedbackForm: boolean;
546
548
  markdownRenderer: MarkdownLitRenderer;
547
549
  onSuggestionClick: (suggestion: string) => void;
548
550
  onFeedbackSubmit: (rpcId: Host.AidaClient.RpcGlobalId, rate: Host.AidaClient.Rating, feedback?: string) => void;
549
551
  onCopyResponseClick: (message: ModelChatMessage) => void;
550
552
  onExportClick?: () => void;
551
- changeSummary?: string;
552
553
  walkthrough: {
553
554
  onOpen: (message: ModelChatMessage) => void,
554
555
  isExpanded: boolean,
@@ -579,7 +580,7 @@ export const DEFAULT_VIEW = (input: ChatMessageViewInput, output: ViewOutput, ta
579
580
  const userQueryWrapperClasses = Lit.Directives.classMap({
580
581
  // Don't need to style at all unless we are on the V2 flag.
581
582
  // Once we ship this can be removed entirely.
582
- 'user-query-wrapper': hasAiV2
583
+ 'user-query-wrapper': hasAiV2,
583
584
  });
584
585
  // clang-format off
585
586
  Lit.render(html`
@@ -643,15 +644,6 @@ export const DEFAULT_VIEW = (input: ChatMessageViewInput, output: ViewOutput, ta
643
644
  },
644
645
  )}
645
646
  ${renderError(message)}
646
- ${input.shouldShowCSSChangeSummary && hasAiV2 && input.changeSummary ? html`
647
- <devtools-code-block
648
- .code=${input.changeSummary}
649
- .codeLang=${'css'}
650
- .displayLimit=${MAX_NUM_LINES_IN_CODEBLOCK}
651
- .displayNotice=${true}
652
- class="ai-css-change"
653
- ></devtools-code-block>
654
- ` : Lit.nothing}
655
647
  ${input.showActions ? renderActions(input, output) : Lit.nothing}
656
648
  </div>
657
649
  ${hasAiV2 ? renderSideEffectStepsUI(input, steps) : Lit.nothing}
@@ -905,7 +897,7 @@ function renderSideEffectStepsUI(input: ChatMessageViewInput, steps: Step[]): Li
905
897
  step,
906
898
  isLoading: input.isLoading,
907
899
  markdownRenderer: input.markdownRenderer,
908
- isLast: true
900
+ isLast: true,
909
901
  })}
910
902
  </div> `)}
911
903
  `;
@@ -1856,6 +1848,9 @@ function renderError(message: ModelChatMessage): Lit.LitTemplate {
1856
1848
  case AiAssistanceModel.AiAgent.ErrorType.CROSS_ORIGIN:
1857
1849
  errorMessage = UIStringsNotTranslate.crossOriginError;
1858
1850
  break;
1851
+ case AiAssistanceModel.AiAgent.ErrorType.PAYLOAD_TOO_LARGE:
1852
+ errorMessage = UIStringsNotTranslate.payloadTooLargeError;
1853
+ break;
1859
1854
  case AiAssistanceModel.AiAgent.ErrorType.ABORT:
1860
1855
  return html`<p class="aborted" jslog=${VisualLogging.section('aborted')}>${
1861
1856
  lockedString(UIStringsNotTranslate.stoppedResponse)}</p>`;
@@ -2066,14 +2061,12 @@ export class ChatMessage extends UI.Widget.Widget {
2066
2061
  canShowFeedbackForm = false;
2067
2062
  isLastMessage = false;
2068
2063
  isFirstMessage = false;
2069
- shouldShowCSSChangeSummary = false;
2070
2064
  markdownRenderer!: MarkdownLitRenderer;
2071
2065
  onSuggestionClick: (suggestion: string) => void = () => {};
2072
2066
  onFeedbackSubmit:
2073
2067
  (rpcId: Host.AidaClient.RpcGlobalId, rate: Host.AidaClient.Rating, feedback?: string) => void = () => {};
2074
2068
  onCopyResponseClick: (message: ModelChatMessage) => void = () => {};
2075
2069
  onExportClick: () => void = () => {};
2076
- changeSummary?: string;
2077
2070
  walkthrough: MessageInput['walkthrough'] = {
2078
2071
  onOpen: () => {},
2079
2072
  onToggle: () => {},
@@ -2120,7 +2113,6 @@ export class ChatMessage extends UI.Widget.Widget {
2120
2113
  isLastMessage: this.isLastMessage,
2121
2114
  isFirstMessage: this.isFirstMessage,
2122
2115
  prompt: this.prompt,
2123
- shouldShowCSSChangeSummary: this.shouldShowCSSChangeSummary,
2124
2116
  onSuggestionClick: this.onSuggestionClick,
2125
2117
  onRatingClick: this.#handleRateClick.bind(this),
2126
2118
  onReportClick: () => UIHelpers.openInNewTab(REPORT_URL),
@@ -2146,7 +2138,6 @@ export class ChatMessage extends UI.Widget.Widget {
2146
2138
  currentRating: this.#currentRating,
2147
2139
  isShowingFeedbackForm: this.#isShowingFeedbackForm,
2148
2140
  onFeedbackSubmit: this.onFeedbackSubmit,
2149
- changeSummary: this.changeSummary,
2150
2141
  walkthrough: this.walkthrough,
2151
2142
  },
2152
2143
  this.#viewOutput, this.contentElement);
@@ -12,8 +12,7 @@ import * as AiAssistanceModel from '../../../models/ai_assistance/ai_assistance.
12
12
  import * as Buttons from '../../../ui/components/buttons/buttons.js';
13
13
  import type {MarkdownLitRenderer} from '../../../ui/components/markdown_view/MarkdownView.js';
14
14
  import * as UI from '../../../ui/legacy/legacy.js';
15
- import {Directives, html, nothing, render} from '../../../ui/lit/lit.js';
16
- import {PatchWidget} from '../PatchWidget.js';
15
+ import {Directives, html, render} from '../../../ui/lit/lit.js';
17
16
 
18
17
  import {ChatInput} from './ChatInput.js';
19
18
  import {ChatMessage, ChatMessageEntity, type Message, type ModelChatMessage} from './ChatMessage.js';
@@ -54,26 +53,6 @@ const SCROLL_ROUNDING_OFFSET = 1;
54
53
  * last completed model response. Otherwise, it's anchored to the latest model
55
54
  * message.
56
55
  */
57
- export function getCSSChangeSummaryMessage(messages: Message[], isLoading: boolean): Message|undefined {
58
- const modelMessages = messages.filter(m => m.entity === ChatMessageEntity.MODEL);
59
- const lastModelMessage = modelMessages.at(-1);
60
-
61
- if (!lastModelMessage) {
62
- return undefined;
63
- }
64
-
65
- // If we are loading and the last message in the list is the one being loaded,
66
- // we anchor the summary to the previous model message.
67
- // If the last message is NOT a model message (e.g. it's the user's follow-up),
68
- // we keep the summary on the current last model message until the new response
69
- // starts appearing.
70
- if (isLoading && messages.at(-1) === lastModelMessage) {
71
- return modelMessages.at(-2);
72
- }
73
-
74
- return lastModelMessage;
75
- }
76
-
77
56
  interface ViewOutput {
78
57
  mainElement?: HTMLElement;
79
58
  input?: UI.Widget.WidgetElement<ChatInput>;
@@ -94,7 +73,6 @@ export interface Props {
94
73
  onContextAdd: (() => void)|null;
95
74
  conversationMarkdown: string;
96
75
  onExportConversation: (() => void)|null;
97
- changeManager: AiAssistanceModel.ChangeManager.ChangeManager;
98
76
  inspectElementToggled: boolean;
99
77
  messages: Message[];
100
78
  context: AiAssistanceModel.AiAgent.ConversationContext<unknown>|null;
@@ -104,7 +82,6 @@ export interface Props {
104
82
  conversationType: AiAssistanceModel.AiHistoryStorage.ConversationType;
105
83
  isReadOnly: boolean;
106
84
  blockedByCrossOrigin: boolean;
107
- changeSummary?: string;
108
85
  multimodalInputEnabled?: boolean;
109
86
  isTextInputDisabled: boolean;
110
87
  emptyStateSuggestions: AiAssistanceModel.AiAgent.ConversationSuggestion[];
@@ -144,10 +121,6 @@ const DEFAULT_VIEW: View = (input, output, target) => {
144
121
  sticky: !input.isReadOnly,
145
122
  });
146
123
 
147
- const shouldShowPatchWidget = !hasAiV2 && !input.isLoading;
148
-
149
- const cssChangeSummaryMessage = getCSSChangeSummaryMessage(input.messages, input.isLoading);
150
-
151
124
  // clang-format off
152
125
  render(html`
153
126
  <style>${chatViewStyles}</style>
@@ -169,21 +142,15 @@ const DEFAULT_VIEW: View = (input, output, target) => {
169
142
  isLastMessage: index === input.messages.length - 1,
170
143
  isFirstMessage: index === 0,
171
144
  prompt,
172
- shouldShowCSSChangeSummary: message.id === cssChangeSummaryMessage?.id,
173
145
  onSuggestionClick: input.handleSuggestionClick,
174
146
  onFeedbackSubmit: input.onFeedbackSubmit,
175
147
  onCopyResponseClick: input.onCopyResponseClick,
176
148
  onExportClick: input.exportForAgentsClick,
177
- changeSummary: input.changeSummary,
178
149
  walkthrough: {
179
150
  ...input.walkthrough,
180
- }
151
+ },
181
152
  });
182
153
  })}
183
- ${shouldShowPatchWidget ? widget(PatchWidget, {
184
- changeSummary: input.changeSummary ?? '',
185
- changeManager: input.changeManager,
186
- }) : nothing}
187
154
  </div>
188
155
  ` : html`
189
156
  <div class="empty-state-container">
@@ -134,7 +134,7 @@ export const DEFAULT_VIEW = (
134
134
  </div>
135
135
  </div>
136
136
  `,
137
- target
137
+ target,
138
138
  );
139
139
  // clang-format on
140
140
  };
@@ -136,7 +136,7 @@ export class ExploreWidget extends UI.Widget.Widget {
136
136
  );
137
137
  },
138
138
  panelName: 'Elements',
139
- text: 'to ask about CSS styles'
139
+ text: 'to ask about CSS styles',
140
140
  });
141
141
  }
142
142
  if (config.devToolsAiAssistanceNetworkAgent?.enabled && UI.ViewManager.ViewManager.instance().hasView('network')) {
@@ -150,7 +150,7 @@ export class ExploreWidget extends UI.Widget.Widget {
150
150
  );
151
151
  },
152
152
  panelName: 'Network',
153
- text: 'to ask about a request\'s details'
153
+ text: 'to ask about a request\'s details',
154
154
  });
155
155
  }
156
156
  if (config.devToolsAiAssistanceFileAgent?.enabled && UI.ViewManager.ViewManager.instance().hasView('sources')) {
@@ -164,7 +164,7 @@ export class ExploreWidget extends UI.Widget.Widget {
164
164
  );
165
165
  },
166
166
  panelName: 'Sources',
167
- text: 'to ask about a file\'s content'
167
+ text: 'to ask about a file\'s content',
168
168
  });
169
169
  }
170
170
  if (config.devToolsAiAssistancePerformanceAgent?.enabled &&
@@ -179,7 +179,7 @@ export class ExploreWidget extends UI.Widget.Widget {
179
179
  );
180
180
  },
181
181
  panelName: 'Performance',
182
- text: 'to ask about a trace item'
182
+ text: 'to ask about a trace item',
183
183
  });
184
184
  }
185
185
 
@@ -0,0 +1,74 @@
1
+ // Copyright 2026 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ const MAX_DIMENSION_PX = 1024;
6
+
7
+ let compressImplementation = realCompress;
8
+
9
+ export function setCompressImplementationForTest(impl: typeof realCompress|null): void {
10
+ compressImplementation = impl ?? realCompress;
11
+ }
12
+
13
+ /**
14
+ * Decodes and scales an image file so that its largest dimension does not exceed 1024 pixels,
15
+ * preserving the original aspect ratio. The image is then compressed to a JPEG format at 80% quality.
16
+ *
17
+ * This reduces the payload size for base64 encoding and prevents out-of-memory errors in the AIDA API.
18
+ *
19
+ * @param file The raw Image file to be resized and compressed.
20
+ * @returns A promise resolving to the base64-encoded string and MIME type.
21
+ */
22
+ export async function compress(file: File): Promise<{data: string, mimeType: string}> {
23
+ return await compressImplementation(file);
24
+ }
25
+
26
+ async function realCompress(file: File): Promise<{data: string, mimeType: string}> {
27
+ const bitmap = await createImageBitmap(file);
28
+ try {
29
+ let width = bitmap.width;
30
+ let height = bitmap.height;
31
+
32
+ if (width > MAX_DIMENSION_PX || height > MAX_DIMENSION_PX) {
33
+ if (width > height) {
34
+ height = Math.round((height * MAX_DIMENSION_PX) / width);
35
+ width = MAX_DIMENSION_PX;
36
+ } else {
37
+ width = Math.round((width * MAX_DIMENSION_PX) / height);
38
+ height = MAX_DIMENSION_PX;
39
+ }
40
+ }
41
+
42
+ const canvas = new OffscreenCanvas(width, height);
43
+ const ctx = canvas.getContext('2d');
44
+ if (!ctx) {
45
+ throw new Error('Failed to get 2d context');
46
+ }
47
+
48
+ ctx.drawImage(bitmap, 0, 0, width, height);
49
+
50
+ const blob = await canvas.convertToBlob({
51
+ type: 'image/jpeg',
52
+ quality: 0.8,
53
+ });
54
+
55
+ const base64 = await new Promise<string>((resolve, reject) => {
56
+ const reader = new FileReader();
57
+ reader.onloadend = () => {
58
+ const result = reader.result as string;
59
+ const base64Data = result.split(',')[1];
60
+ resolve(base64Data);
61
+ };
62
+ reader.onerror = () => reject(new Error('Failed to read compressed blob'));
63
+ reader.readAsDataURL(blob);
64
+ });
65
+
66
+ return {
67
+ data: base64,
68
+ mimeType: 'image/jpeg',
69
+ };
70
+ } finally {
71
+ // Explicitly close the ImageBitmap to prevent GPU/graphics memory leaks.
72
+ bitmap.close();
73
+ }
74
+ }
@@ -17,7 +17,7 @@ import {
17
17
  type ModelChatMessage,
18
18
  renderStep,
19
19
  type Step,
20
- titleForStep
20
+ titleForStep,
21
21
  } from './ChatMessage.js';
22
22
  import {getButtonLabel} from './WalkthroughUtils.js';
23
23
  import walkthroughViewStyles from './walkthroughView.css.js';
@@ -224,7 +224,7 @@ export const DEFAULT_VIEW = (
224
224
  step,
225
225
  isLoading: input.isLoading,
226
226
  markdownRenderer: input.markdownRenderer,
227
- isLast: index === renderableSteps.length - 1
227
+ isLast: index === renderableSteps.length - 1,
228
228
  })}
229
229
  </div>
230
230
  </div>