chrome-devtools-frontend 1.0.1536371 → 1.0.1537860

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 (231) hide show
  1. package/.env.template +9 -0
  2. package/docs/get_the_code.md +27 -0
  3. package/front_end/core/common/SettingRegistration.ts +10 -7
  4. package/front_end/core/common/Settings.ts +3 -0
  5. package/front_end/core/host/AidaClient.ts +64 -5
  6. package/front_end/core/host/DispatchHttpRequestClient.ts +62 -0
  7. package/front_end/core/host/GdpClient.ts +8 -57
  8. package/front_end/core/host/host.ts +2 -0
  9. package/front_end/core/protocol_client/CDPConnection.ts +10 -8
  10. package/front_end/core/protocol_client/InspectorBackend.ts +36 -42
  11. package/front_end/core/sdk/EnhancedTracesParser.ts +20 -5
  12. package/front_end/core/sdk/RehydratingConnection.ts +112 -4
  13. package/front_end/core/sdk/RehydratingObject.ts +8 -0
  14. package/front_end/core/sdk/TraceObject.ts +5 -1
  15. package/front_end/core/sdk/sdk-meta.ts +8 -2
  16. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +4 -3
  17. package/front_end/generated/SupportedCSSProperties.js +1 -0
  18. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +23 -7
  19. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +110 -5
  20. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +50 -45
  21. package/front_end/models/cpu_profile/ProfileTreeModel.ts +7 -7
  22. package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
  23. package/front_end/models/trace/types/File.ts +9 -0
  24. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +1 -1
  25. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -9
  26. package/front_end/panels/ai_assistance/components/ChatView.ts +58 -70
  27. package/front_end/panels/application/BackForwardCacheTreeElement.ts +2 -6
  28. package/front_end/panels/application/StorageView.ts +3 -2
  29. package/front_end/panels/application/components/BackForwardCacheView.ts +96 -108
  30. package/front_end/panels/application/components/FrameDetailsView.ts +8 -11
  31. package/front_end/panels/application/components/OriginTrialTreeView.ts +136 -137
  32. package/front_end/panels/application/components/backForwardCacheView.css +8 -0
  33. package/front_end/panels/application/components/badge.css +9 -1
  34. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +2 -2
  35. package/front_end/panels/application/preloading/components/PreloadingString.ts +27 -0
  36. package/front_end/panels/autofill/AutofillView.ts +1 -1
  37. package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +44 -53
  38. package/front_end/panels/console/ConsoleView.ts +11 -9
  39. package/front_end/panels/coverage/CoverageView.ts +1 -2
  40. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +1 -1
  41. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
  42. package/front_end/panels/elements/ElementStatePaneWidget.ts +1 -1
  43. package/front_end/panels/elements/EventListenersWidget.ts +1 -2
  44. package/front_end/panels/elements/PropertiesWidget.ts +1 -1
  45. package/front_end/panels/network/NetworkConfigView.ts +2 -1
  46. package/front_end/panels/network/NetworkPanel.ts +5 -4
  47. package/front_end/panels/network/RequestCookiesView.ts +2 -1
  48. package/front_end/panels/profiler/HeapSnapshotView.ts +3 -2
  49. package/front_end/panels/recorder/RecorderController.ts +1 -2
  50. package/front_end/panels/recorder/components/CreateRecordingView.ts +153 -129
  51. package/front_end/panels/sensors/SensorsView.ts +4 -3
  52. package/front_end/panels/settings/AISettingsTab.ts +162 -171
  53. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +8 -6
  54. package/front_end/panels/settings/KeybindsSettingsTab.ts +3 -2
  55. package/front_end/panels/settings/SettingsScreen.ts +5 -8
  56. package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
  57. package/front_end/panels/settings/aiSettingsTab.css +151 -148
  58. package/front_end/panels/settings/settings-meta.ts +1 -2
  59. package/front_end/panels/sources/AddSourceMapURLDialog.ts +23 -26
  60. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -1
  61. package/front_end/panels/sources/SourcesPanel.ts +2 -1
  62. package/front_end/panels/sources/sources-meta.ts +8 -1
  63. package/front_end/panels/timeline/TimelinePanel.ts +64 -14
  64. package/front_end/panels/timeline/TimelineUIUtils.ts +4 -20
  65. package/front_end/panels/timeline/components/ExportTraceOptions.ts +33 -34
  66. package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -0
  67. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +2 -0
  68. package/front_end/third_party/chromium/README.chromium +2 -2
  69. package/front_end/third_party/puppeteer/README.chromium +2 -2
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +9 -1
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +2 -2
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +13 -1
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +2 -2
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +5 -2
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +2 -2
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +3 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +1 -12
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +6 -0
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +1 -0
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +2 -2
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +6 -1
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +2 -1
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +2 -2
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +2 -2
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +3 -1
  104. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  107. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  108. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/disposable.d.ts +2 -2
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/disposable.d.ts.map +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/disposable.js +3 -1
  113. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/disposable.js.map +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/util.d.ts +1 -0
  115. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/util.d.ts.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/util.js +1 -0
  117. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/util.js.map +1 -1
  118. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +28 -3
  121. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +21 -10
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +9 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +2 -2
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +13 -1
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +2 -2
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +5 -2
  136. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +2 -2
  138. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  139. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +3 -1
  140. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Realm.d.ts +1 -12
  142. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Realm.d.ts.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts +6 -0
  144. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +1 -0
  146. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +2 -2
  148. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +6 -1
  150. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +2 -1
  152. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  153. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +2 -2
  154. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +2 -2
  156. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +3 -1
  158. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  160. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  161. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  162. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/disposable.d.ts +2 -2
  163. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/disposable.d.ts.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/disposable.js +2 -2
  165. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/disposable.js.map +1 -1
  166. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/util.d.ts +1 -0
  167. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/util.d.ts.map +1 -1
  168. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/util.js +1 -0
  169. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/util.js.map +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/types.d.ts +28 -3
  173. package/front_end/third_party/puppeteer/package/package.json +2 -2
  174. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
  175. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +7 -2
  176. package/front_end/third_party/puppeteer/package/src/api/Page.ts +14 -1
  177. package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +8 -5
  178. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +5 -2
  179. package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +8 -0
  180. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +11 -2
  181. package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +3 -2
  182. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +5 -5
  183. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  184. package/front_end/third_party/puppeteer/package/src/util/disposable.ts +2 -2
  185. package/front_end/third_party/puppeteer/package/src/util/util.ts +1 -0
  186. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  187. package/front_end/ui/components/adorners/Adorner.ts +2 -1
  188. package/front_end/ui/components/buttons/Button.docs.ts +195 -0
  189. package/front_end/ui/components/settings/SettingCheckbox.ts +49 -14
  190. package/front_end/ui/components/settings/settingCheckbox.css +6 -1
  191. package/front_end/ui/components/spinners/Spinners.docs.ts +13 -0
  192. package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +280 -0
  193. package/front_end/ui/components/text_editor/text_editor.ts +1 -0
  194. package/front_end/ui/components/tooltips/Tooltip.docs.ts +76 -0
  195. package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
  196. package/front_end/ui/legacy/Dialog.ts +0 -1
  197. package/front_end/ui/legacy/FilterBar.ts +1 -2
  198. package/front_end/ui/legacy/RadioButton.docs.ts +41 -0
  199. package/front_end/ui/legacy/SelectMenu.docs.ts +98 -0
  200. package/front_end/ui/legacy/Toolbar.ts +4 -6
  201. package/front_end/ui/legacy/UIUtils.ts +114 -1
  202. package/front_end/ui/legacy/Widget.ts +62 -34
  203. package/front_end/ui/legacy/XLink.ts +0 -3
  204. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +9 -0
  205. package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +125 -0
  206. package/front_end/ui/legacy/components/settings_ui/settings_ui.ts +8 -0
  207. package/front_end/ui/legacy/components/utils/Linkifier.ts +9 -3
  208. package/front_end/ui/legacy/legacy.ts +0 -2
  209. package/front_end/ui/visual_logging/KnownContextValues.ts +4 -1
  210. package/mcp/mcp.ts +5 -0
  211. package/package.json +1 -1
  212. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatterBounds.snapshot.txt +0 -4
  213. package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +0 -62
  214. package/front_end/models/trace/lantern/testing/testing.ts +0 -5
  215. package/front_end/ui/components/docs/breadcrumbs_perf/initial-breadcrumb-perf.html +0 -20
  216. package/front_end/ui/components/docs/breadcrumbs_perf/initial-breadcrumb-perf.ts +0 -25
  217. package/front_end/ui/components/docs/breadcrumbs_perf/nested-breadcrumbs-perf.html +0 -20
  218. package/front_end/ui/components/docs/breadcrumbs_perf/nested-breadcrumbs-perf.ts +0 -36
  219. package/front_end/ui/components/docs/button/basic.html +0 -44
  220. package/front_end/ui/components/docs/button/basic.ts +0 -175
  221. package/front_end/ui/components/docs/radio_button/basic.html +0 -23
  222. package/front_end/ui/components/docs/radio_button/basic.ts +0 -50
  223. package/front_end/ui/components/docs/select_menu/basic.html +0 -19
  224. package/front_end/ui/components/docs/select_menu/basic.ts +0 -95
  225. package/front_end/ui/components/docs/select_menu/wide-option.html +0 -38
  226. package/front_end/ui/components/docs/select_menu/wide-option.ts +0 -43
  227. package/front_end/ui/components/docs/spinners/basic.html +0 -17
  228. package/front_end/ui/components/docs/spinners/basic.ts +0 -22
  229. package/front_end/ui/components/docs/tooltip/basic.html +0 -20
  230. package/front_end/ui/components/docs/tooltip/basic.ts +0 -82
  231. package/front_end/ui/legacy/SettingsUI.ts +0 -254
@@ -1,7 +1,6 @@
1
1
  // Copyright 2024 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- /* eslint-disable @devtools/no-lit-render-outside-of-view */
5
4
 
6
5
  import * as Common from '../../core/common/common.js';
7
6
  import * as Host from '../../core/host/host.js';
@@ -11,7 +10,6 @@ import * as Root from '../../core/root/root.js';
11
10
  import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
12
11
  import * as Buttons from '../../ui/components/buttons/buttons.js';
13
12
  import * as Input from '../../ui/components/input/input.js';
14
- import * as LegacyWrapper from '../../ui/components/legacy_wrapper/legacy_wrapper.js';
15
13
  import * as Switch from '../../ui/components/switch/switch.js';
16
14
  import * as uiI18n from '../../ui/i18n/i18n.js';
17
15
  import * as UI from '../../ui/legacy/legacy.js';
@@ -20,7 +18,7 @@ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
20
18
 
21
19
  import aiSettingsTabStyles from './aiSettingsTab.css.js';
22
20
 
23
- const {html, Directives: {ifDefined, classMap}} = Lit;
21
+ const {html, nothing, render, Directives: {ifDefined, classMap}} = Lit;
24
22
 
25
23
  const UIStrings = {
26
24
  /**
@@ -231,8 +229,143 @@ interface AiSettingParams {
231
229
  };
232
230
  }
233
231
 
234
- export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponent {
235
- readonly #shadow = this.attachShadow({mode: 'open'});
232
+ interface ViewInput {
233
+ disabledReasons: string[];
234
+ sharedDisclaimerBulletPoints: Array<{icon: string, text: Common.UIString.LocalizedString|Lit.TemplateResult}>;
235
+ settingToParams: Map<Common.Settings.Setting<boolean>, AiSettingParams>;
236
+ expandSetting(setting: Common.Settings.Setting<boolean>): void;
237
+ toggleSetting(setting: Common.Settings.Setting<boolean>, ev: Event): void;
238
+ }
239
+
240
+ type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
241
+
242
+ export const AI_SETTINGS_TAB_DEFAULT_VIEW: View = (input, _output, target): void => {
243
+ // Disabled until https://crbug.com/1079231 is fixed.
244
+ // clang-format off
245
+ const disabledReasonsExplainer = input.disabledReasons.length ? html`
246
+ <div class="disabled-explainer">
247
+ ${input.disabledReasons.map(reason => html`
248
+ <div class="disabled-explainer-row">
249
+ <devtools-icon name="warning" class="medium" style="color: var(--icon-warning);">
250
+ </devtools-icon>
251
+ ${reason}
252
+ </div>
253
+ `)}
254
+ </div>
255
+ ` : nothing;
256
+
257
+ const sharedDisclaimer = html`
258
+ <div class="shared-disclaimer">
259
+ <h2>${i18nString(UIStrings.boostYourProductivity)}</h2>
260
+ <h3 class="disclaimer-list-header">${i18nString(UIStrings.thingsToConsider)}</h3>
261
+ <div class="disclaimer-list">
262
+ ${input.sharedDisclaimerBulletPoints.map(item =>
263
+ html`<div><devtools-icon .name=${item.icon} class="medium"></devtools-icon>
264
+ </div><div>${item.text}</div>`
265
+ )}
266
+ </div>
267
+ </div>
268
+ `;
269
+
270
+ const renderSettingItem = (settingItem: SettingItem): Lit.TemplateResult => {
271
+ return html`
272
+ <div>
273
+ <devtools-icon class="extra-large" .name=${settingItem.iconName}>
274
+ </devtools-icon>
275
+ </div>
276
+ <div class="padded">${settingItem.text}</div>
277
+ `;
278
+ };
279
+
280
+ const isDisabled = input.disabledReasons.length > 0;
281
+ const disabledReasonsJoined = input.disabledReasons.join('\n') || undefined;
282
+ const settings = Array.from(input.settingToParams.keys()).map(setting => {
283
+ const settingData = input.settingToParams.get(setting);
284
+ if (!settingData) {
285
+ return nothing;
286
+ }
287
+ const detailsClasses = {
288
+ 'whole-row': true,
289
+ open: settingData.settingExpandState.isSettingExpanded,
290
+ };
291
+ const tabindex = settingData.settingExpandState.isSettingExpanded ? '0' : '-1';
292
+ return html`
293
+ <div class="accordion-header" @click=${input.expandSetting.bind(this, setting)}>
294
+ <div class="icon-container centered">
295
+ <devtools-icon name=${settingData.iconName}></devtools-icon>
296
+ </div>
297
+ <div class="setting-card">
298
+ <h2>${settingData.settingName}</h2>
299
+ <div class="setting-description">${settingData.settingDescription}</div>
300
+ </div>
301
+ <div class="dropdown centered">
302
+ <devtools-button
303
+ .data=${{
304
+ title: settingData.settingExpandState.isSettingExpanded ? i18nString(UIStrings.showLess) : i18nString(UIStrings.showMore),
305
+ size: Buttons.Button.Size.SMALL,
306
+ iconName: settingData.settingExpandState.isSettingExpanded ? 'chevron-up' : 'chevron-down',
307
+ variant: Buttons.Button.Variant.ICON,
308
+ jslogContext: settingData.settingExpandState.expandSettingJSLogContext,
309
+ } as Buttons.Button.ButtonData}
310
+ ></devtools-button>
311
+ </div>
312
+ </div>
313
+ <div class="divider"></div>
314
+ <div class="toggle-container centered"
315
+ title=${ifDefined(disabledReasonsJoined)}
316
+ @click=${input.toggleSetting.bind(this, setting)}
317
+ >
318
+ <devtools-switch
319
+ .checked=${Boolean(setting.get()) && !isDisabled}
320
+ .jslogContext=${setting.name || ''}
321
+ .disabled=${isDisabled}
322
+ .label=${disabledReasonsJoined || settingData.enableSettingText}
323
+ data-testid=${settingData.enableSettingText}
324
+ @switchchange=${input.toggleSetting.bind(this, setting)}
325
+ ></devtools-switch>
326
+ </div>
327
+ <div class=${classMap(detailsClasses)}>
328
+ <div class="overflow-hidden">
329
+ <div class="expansion-grid">
330
+ <h3 class="expansion-grid-whole-row">${i18nString(UIStrings.whenOn)}</h3>
331
+ ${settingData.settingItems.map(item => renderSettingItem(item))}
332
+ <h3 class="expansion-grid-whole-row">${i18nString(UIStrings.thingsToConsider)}</h3>
333
+ ${settingData.toConsiderSettingItems.map(item => renderSettingItem(item))}
334
+ <div class="expansion-grid-whole-row">
335
+ <x-link
336
+ href=${settingData.learnMoreLink.url}
337
+ class="link"
338
+ tabindex=${tabindex}
339
+ jslog=${VisualLogging.link(settingData.learnMoreLink.linkJSLogContext).track({
340
+ click: true,
341
+ })}
342
+ >${i18nString(UIStrings.learnMore)}</x-link>
343
+ </div>
344
+ </div>
345
+ </div>
346
+ </div>
347
+ `;
348
+ });
349
+
350
+ render(html`
351
+ <style>${Input.checkboxStyles}</style>
352
+ <style>${aiSettingsTabStyles}</style>
353
+ <div class="ai-settings-container">
354
+ <div class="settings-container-wrapper" jslog=${VisualLogging.pane('chrome-ai')}>
355
+ ${sharedDisclaimer}
356
+ ${input.settingToParams.size ? html`
357
+ ${disabledReasonsExplainer}
358
+ <div class="settings-container">
359
+ ${settings}
360
+ </div>
361
+ ` : nothing}
362
+ </div></div>
363
+ `, target);
364
+ // clang-format on
365
+ };
366
+
367
+ export class AISettingsTab extends UI.Widget.VBox {
368
+ #view: View;
236
369
  #consoleInsightsSetting?: Common.Settings.Setting<boolean>;
237
370
  #aiAnnotationsSetting?: Common.Settings.Setting<boolean>;
238
371
  #aiAssistanceSetting?: Common.Settings.Setting<boolean>;
@@ -243,7 +376,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
243
376
  // To display a a setting, it needs to be added to this map.
244
377
  #settingToParams = new Map<Common.Settings.Setting<boolean>, AiSettingParams>();
245
378
 
246
- constructor() {
379
+ constructor(view?: View) {
247
380
  super();
248
381
  try {
249
382
  this.#consoleInsightsSetting = Common.Settings.Settings.instance().moduleSetting('console-insights-enabled');
@@ -269,15 +402,31 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
269
402
 
270
403
  this.#boundOnAidaAvailabilityChange = this.#onAidaAvailabilityChange.bind(this);
271
404
  this.#initSettings();
405
+ this.#view = view ?? AI_SETTINGS_TAB_DEFAULT_VIEW;
272
406
  }
273
407
 
274
- connectedCallback(): void {
408
+ override performUpdate(): void {
409
+ const disabledReasons = AiAssistanceModel.AiUtils.getDisabledReasons(this.#aidaAvailability);
410
+ const viewInput: ViewInput = {
411
+ disabledReasons,
412
+ sharedDisclaimerBulletPoints: this.#getSharedDisclaimerBulletPoints(),
413
+ settingToParams: this.#settingToParams,
414
+ expandSetting: this.#expandSetting.bind(this),
415
+ toggleSetting: this.#toggleSetting.bind(this),
416
+ };
417
+ this.#view(viewInput, undefined, this.contentElement);
418
+ }
419
+
420
+ override wasShown(): void {
421
+ super.wasShown();
275
422
  Host.AidaClient.HostConfigTracker.instance().addEventListener(
276
423
  Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED, this.#boundOnAidaAvailabilityChange);
277
424
  void this.#onAidaAvailabilityChange();
425
+ this.requestUpdate();
278
426
  }
279
427
 
280
- disconnectedCallback(): void {
428
+ override willHide(): void {
429
+ super.willHide();
281
430
  Host.AidaClient.HostConfigTracker.instance().removeEventListener(
282
431
  Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED, this.#boundOnAidaAvailabilityChange);
283
432
  }
@@ -400,7 +549,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
400
549
  const currentAidaAvailability = await Host.AidaClient.AidaClient.checkAccessPreconditions();
401
550
  if (currentAidaAvailability !== this.#aidaAvailability) {
402
551
  this.#aidaAvailability = currentAidaAvailability;
403
- void this.render();
552
+ this.requestUpdate();
404
553
  }
405
554
  }
406
555
 
@@ -438,7 +587,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
438
587
  return;
439
588
  }
440
589
  settingData.settingExpandState.isSettingExpanded = !settingData.settingExpandState.isSettingExpanded;
441
- void this.render();
590
+ this.requestUpdate();
442
591
  }
443
592
 
444
593
  #toggleSetting(setting: Common.Settings.Setting<boolean>, ev: Event): void {
@@ -477,24 +626,10 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
477
626
  // If the "AI Assistance" is toggled off, we remove all the history entries related to the feature.
478
627
  void AiAssistanceModel.AiHistoryStorage.AiHistoryStorage.instance().deleteAll();
479
628
  }
480
- void this.render();
481
- }
482
-
483
- #renderSharedDisclaimerItem(icon: string, text: Common.UIString.LocalizedString|Lit.TemplateResult):
484
- Lit.TemplateResult {
485
- // Disabled until https://crbug.com/1079231 is fixed.
486
- // clang-format off
487
- return html`
488
- <div>
489
- <devtools-icon .name=${icon} class="medium">
490
- </devtools-icon>
491
- </div>
492
- <div>${text}</div>
493
- `;
494
- // clang-format on
629
+ this.requestUpdate();
495
630
  }
496
631
 
497
- #renderSharedDisclaimer(): Lit.TemplateResult {
632
+ #getSharedDisclaimerBulletPoints(): Array<{icon: string, text: Common.UIString.LocalizedString|Lit.TemplateResult}> {
498
633
  const tosLink = UI.XLink.XLink.create(
499
634
  'https://policies.google.com/terms', i18nString(UIStrings.termsOfService), undefined, undefined,
500
635
  'terms-of-service');
@@ -504,7 +639,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
504
639
  const noLogging = Root.Runtime.hostConfig.aidaAvailability?.enterprisePolicyValue ===
505
640
  Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
506
641
 
507
- const bulletPoints = [
642
+ return [
508
643
  {icon: 'psychiatry', text: i18nString(UIStrings.experimentalFeatures)},
509
644
  {
510
645
  icon: 'google',
@@ -522,149 +657,5 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
522
657
  })}`,
523
658
  },
524
659
  ];
525
-
526
- return html`
527
- <div class="shared-disclaimer">
528
- <h2>${i18nString(UIStrings.boostYourProductivity)}</h2>
529
- <h3 class="disclaimer-list-header">${i18nString(UIStrings.thingsToConsider)}</h3>
530
- <div class="disclaimer-list">
531
- ${bulletPoints.map(item => this.#renderSharedDisclaimerItem(item.icon, item.text))}
532
- </div>
533
- </div>
534
- `;
535
- }
536
-
537
- #renderSettingItem(settingItem: SettingItem): Lit.TemplateResult {
538
- // Disabled until https://crbug.com/1079231 is fixed.
539
- // clang-format off
540
- return html`
541
- <div>
542
- <devtools-icon class="extra-large" .name=${settingItem.iconName}>
543
- </devtools-icon>
544
- </div>
545
- <div class="padded">${settingItem.text}</div>
546
- `;
547
- // clang-format on
548
- }
549
-
550
- #renderSetting(setting: Common.Settings.Setting<boolean>): Lit.LitTemplate {
551
- const settingData = this.#settingToParams.get(setting);
552
- if (!settingData) {
553
- return Lit.nothing;
554
- }
555
- const disabledReasons = AiAssistanceModel.AiUtils.getDisabledReasons(this.#aidaAvailability);
556
- const isDisabled = disabledReasons.length > 0;
557
- const disabledReasonsJoined = disabledReasons.join('\n') || undefined;
558
- const detailsClasses = {
559
- 'whole-row': true,
560
- open: settingData.settingExpandState.isSettingExpanded,
561
- };
562
- const tabindex = settingData.settingExpandState.isSettingExpanded ? '0' : '-1';
563
-
564
- // Disabled until https://crbug.com/1079231 is fixed.
565
- // clang-format off
566
- return html`
567
- <div class="accordion-header" @click=${this.#expandSetting.bind(this, setting)}>
568
- <div class="icon-container centered">
569
- <devtools-icon name=${settingData.iconName}></devtools-icon>
570
- </div>
571
- <div class="setting-card">
572
- <h2>${settingData.settingName}</h2>
573
- <div class="setting-description">${settingData.settingDescription}</div>
574
- </div>
575
- <div class="dropdown centered">
576
- <devtools-button
577
- .data=${{
578
- title: settingData.settingExpandState.isSettingExpanded ? i18nString(UIStrings.showLess) : i18nString(UIStrings.showMore),
579
- size: Buttons.Button.Size.SMALL,
580
- iconName: settingData.settingExpandState.isSettingExpanded ? 'chevron-up' : 'chevron-down',
581
- variant: Buttons.Button.Variant.ICON,
582
- jslogContext: settingData.settingExpandState.expandSettingJSLogContext,
583
- } as Buttons.Button.ButtonData}
584
- ></devtools-button>
585
- </div>
586
- </div>
587
- <div class="divider"></div>
588
- <div class="toggle-container centered"
589
- title=${ifDefined(disabledReasonsJoined)}
590
- @click=${this.#toggleSetting.bind(this, setting)}
591
- >
592
- <devtools-switch
593
- .checked=${Boolean(setting.get()) && !isDisabled}
594
- .jslogContext=${setting.name || ''}
595
- .disabled=${isDisabled}
596
- .label=${disabledReasonsJoined || settingData.enableSettingText}
597
- data-testid=${settingData.enableSettingText}
598
- @switchchange=${this.#toggleSetting.bind(this, setting)}
599
- ></devtools-switch>
600
- </div>
601
- <div class=${classMap(detailsClasses)}>
602
- <div class="overflow-hidden">
603
- <div class="expansion-grid">
604
- <h3 class="expansion-grid-whole-row">${i18nString(UIStrings.whenOn)}</h3>
605
- ${settingData.settingItems.map(item => this.#renderSettingItem(item))}
606
- <h3 class="expansion-grid-whole-row">${i18nString(UIStrings.thingsToConsider)}</h3>
607
- ${settingData.toConsiderSettingItems.map(item => this.#renderSettingItem(item))}
608
- <div class="expansion-grid-whole-row">
609
- <x-link
610
- href=${settingData.learnMoreLink.url}
611
- class="link"
612
- tabindex=${tabindex}
613
- jslog=${VisualLogging.link(settingData.learnMoreLink.linkJSLogContext).track({
614
- click: true,
615
- })}
616
- >${i18nString(UIStrings.learnMore)}</x-link>
617
- </div>
618
- </div>
619
- </div>
620
- </div>
621
- `;
622
- // clang-format on
623
- }
624
-
625
- #renderDisabledExplainer(disabledReasons: string[]): Lit.LitTemplate {
626
- // Disabled until https://crbug.com/1079231 is fixed.
627
- // clang-format off
628
- return html`
629
- <div class="disabled-explainer">
630
- ${disabledReasons.map(reason => html`
631
- <div class="disabled-explainer-row">
632
- <devtools-icon name="warning" class="medium" style="color: var(--icon-warning);">
633
- </devtools-icon>
634
- ${reason}
635
- </div>
636
- `)}
637
- </div>
638
- `;
639
- // clang-format on
640
- }
641
-
642
- override async render(): Promise<void> {
643
- const disabledReasons = AiAssistanceModel.AiUtils.getDisabledReasons(this.#aidaAvailability);
644
-
645
- // Disabled until https://crbug.com/1079231 is fixed.
646
- // clang-format off
647
- Lit.render(html`
648
- <style>${Input.checkboxStyles}</style>
649
- <style>${aiSettingsTabStyles}</style>
650
- <div class="settings-container-wrapper" jslog=${VisualLogging.pane('chrome-ai')}>
651
- ${this.#renderSharedDisclaimer()}
652
- ${this.#settingToParams.size > 0 ? html`
653
- ${disabledReasons.length ? this.#renderDisabledExplainer(disabledReasons) : Lit.nothing}
654
- <div class="settings-container">
655
- ${this.#settingToParams.keys().map(setting => this.#renderSetting(setting))}
656
- </div>
657
- ` : Lit.nothing}
658
- </div>
659
- `, this.#shadow, {host: this});
660
- // clang-format on
661
- }
662
- }
663
-
664
- customElements.define('devtools-settings-ai-settings-tab', AISettingsTab);
665
-
666
- declare global {
667
- interface HTMLElementTagNameMap {
668
- 'devtools-settings-ai-settings-tab': AISettingsTab;
669
660
  }
670
661
  }
@@ -8,6 +8,7 @@ import '../../ui/components/cards/cards.js';
8
8
  import * as Common from '../../core/common/common.js';
9
9
  import * as i18n from '../../core/i18n/i18n.js';
10
10
  import * as Buttons from '../../ui/components/buttons/buttons.js';
11
+ import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
11
12
  import * as UI from '../../ui/legacy/legacy.js';
12
13
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
13
14
 
@@ -112,7 +113,7 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
112
113
  const enabledSetting = Common.Settings.Settings.instance().moduleSetting('enable-ignore-listing');
113
114
  const enableIgnoreListing = this.contentElement.createChild('div', 'enable-ignore-listing');
114
115
  enableIgnoreListing.appendChild(
115
- UI.SettingsUI.createSettingCheckbox(i18nString(UIStrings.enableIgnoreListing), enabledSetting));
116
+ SettingsUI.SettingsUI.createSettingCheckbox(i18nString(UIStrings.enableIgnoreListing), enabledSetting));
116
117
  UI.Tooltip.Tooltip.install(enableIgnoreListing, i18nString(UIStrings.enableIgnoreListingTooltip));
117
118
 
118
119
  const enableIgnoreListingCard = settingsContent.createChild('devtools-card');
@@ -123,14 +124,15 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
123
124
  generalExclusionGroup.classList.add('general-exclusion-group');
124
125
  const ignoreListContentScripts =
125
126
  generalExclusionGroup.createChild('div', 'ignore-list-option')
126
- .appendChild(UI.SettingsUI.createSettingCheckbox(
127
+ .appendChild(SettingsUI.SettingsUI.createSettingCheckbox(
127
128
  i18nString(UIStrings.ignoreListContentScripts),
128
129
  Common.Settings.Settings.instance().moduleSetting('skip-content-scripts')));
129
130
 
130
131
  const automaticallyIgnoreListContainer = generalExclusionGroup.createChild('div', 'ignore-list-option');
131
- const automaticallyIgnoreList = automaticallyIgnoreListContainer.appendChild(UI.SettingsUI.createSettingCheckbox(
132
- i18nString(UIStrings.automaticallyIgnoreListKnownThirdPartyScripts),
133
- Common.Settings.Settings.instance().moduleSetting('automatically-ignore-list-known-third-party-scripts')));
132
+ const automaticallyIgnoreList =
133
+ automaticallyIgnoreListContainer.appendChild(SettingsUI.SettingsUI.createSettingCheckbox(
134
+ i18nString(UIStrings.automaticallyIgnoreListKnownThirdPartyScripts),
135
+ Common.Settings.Settings.instance().moduleSetting('automatically-ignore-list-known-third-party-scripts')));
134
136
 
135
137
  const automaticallyIgnoreLinkButton = new Buttons.Button.Button();
136
138
  automaticallyIgnoreLinkButton.data = {
@@ -148,7 +150,7 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
148
150
 
149
151
  const ignoreListAnonymousScripts =
150
152
  generalExclusionGroup.createChild('div', 'ignore-list-option')
151
- .appendChild(UI.SettingsUI.createSettingCheckbox(
153
+ .appendChild(SettingsUI.SettingsUI.createSettingCheckbox(
152
154
  i18nString(UIStrings.ignoreListAnonymousScripts),
153
155
  Common.Settings.Settings.instance().moduleSetting('skip-anonymous-scripts')));
154
156
 
@@ -11,6 +11,7 @@ import * as i18n from '../../core/i18n/i18n.js';
11
11
  import * as Platform from '../../core/platform/platform.js';
12
12
  import * as Buttons from '../../ui/components/buttons/buttons.js';
13
13
  import * as IconButton from '../../ui/components/icon_button/icon_button.js';
14
+ import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
14
15
  import * as UI from '../../ui/legacy/legacy.js';
15
16
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
16
17
 
@@ -126,8 +127,8 @@ export class KeybindsSettingsTab extends UI.Widget.VBox implements UI.ListContro
126
127
  const keybindsSetSetting = Common.Settings.Settings.instance().moduleSetting('active-keybind-set');
127
128
  const userShortcutsSetting = Common.Settings.Settings.instance().moduleSetting('user-shortcuts');
128
129
  keybindsSetSetting.addChangeListener(this.update, this);
129
- const keybindsSetSelect =
130
- UI.SettingsUI.createControlForSetting(keybindsSetSetting, i18nString(UIStrings.matchShortcutsFromPreset));
130
+ const keybindsSetSelect = SettingsUI.SettingsUI.createControlForSetting(
131
+ keybindsSetSetting, i18nString(UIStrings.matchShortcutsFromPreset));
131
132
 
132
133
  const card = settingsContent.createChild('devtools-card');
133
134
  card.heading = i18nString(UIStrings.shortcuts);
@@ -14,6 +14,7 @@ import * as Root from '../../core/root/root.js';
14
14
  import * as Buttons from '../../ui/components/buttons/buttons.js';
15
15
  import type * as Cards from '../../ui/components/cards/cards.js';
16
16
  import * as IconButton from '../../ui/components/icon_button/icon_button.js';
17
+ import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
17
18
  import * as Components from '../../ui/legacy/components/utils/utils.js';
18
19
  import * as UI from '../../ui/legacy/legacy.js';
19
20
  import {html, render} from '../../ui/lit/lit.js';
@@ -328,11 +329,9 @@ export class GenericSettingsTab extends UI.Widget.VBox implements SettingsTab {
328
329
 
329
330
  private createExtensionSection(settings: Common.Settings.SettingRegistration[]): void {
330
331
  const sectionName = Common.Settings.SettingCategory.EXTENSIONS;
331
- const settingUI = Components.Linkifier.LinkHandlerSettingUI.instance() as UI.SettingsUI.SettingUI;
332
+ const settingUI = Components.Linkifier.LinkHandlerSettingUI.instance();
332
333
  const element = settingUI.settingElement();
333
- if (element) {
334
- this.createStandardSectionElement(sectionName, settings, element);
335
- }
334
+ this.createStandardSectionElement(sectionName, settings, element);
336
335
  }
337
336
 
338
337
  private createSectionElement(
@@ -357,7 +356,7 @@ export class GenericSettingsTab extends UI.Widget.VBox implements SettingsTab {
357
356
  const sectionElement = document.createElement('div');
358
357
  for (const settingRegistration of settings) {
359
358
  const setting = Common.Settings.Settings.instance().moduleSetting(settingRegistration.settingName);
360
- const settingControl = UI.SettingsUI.createControlForSetting(setting);
359
+ const settingControl = SettingsUI.SettingsUI.createControlForSetting(setting);
361
360
  if (settingControl) {
362
361
  this.settingToControl.set(setting, settingControl);
363
362
  sectionElement.appendChild(settingControl);
@@ -403,15 +402,13 @@ export class ExperimentsSettingsTab extends UI.Widget.VBox implements SettingsTa
403
402
  render(
404
403
  html`
405
404
  <devtools-toolbar>
406
- <devtools-toolbar-input type="filter" placeholder=${
405
+ <devtools-toolbar-input autofocus type="filter" placeholder=${
407
406
  i18nString(UIStrings.searchExperiments)} style="flex-grow:1" @change=${
408
407
  this.#onFilterChanged.bind(this)}></devtools-toolbar-input>
409
408
  </devtools-toolbar>
410
409
  `,
411
410
  filterSection);
412
411
  this.renderExperiments('');
413
- const filter = filterSection.querySelector('devtools-toolbar-input') as HTMLElement;
414
- this.setDefaultFocusedElement(filter);
415
412
  }
416
413
 
417
414
  #onFilterChanged(e: CustomEvent<string>): void {
@@ -61,7 +61,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
61
61
  <input
62
62
  class="harmony-input"
63
63
  jslog=${VisualLogging.textField().track({keydown: 'Enter', change: true}).context(input.excludePatternSetting.name)}
64
- ${UI.SettingsUI.bindToSetting(input.excludePatternSetting)}
64
+ ${UI.UIUtils.bindToSetting(input.excludePatternSetting)}
65
65
  id="workspace-setting-folder-exclude-pattern"></input>
66
66
  </div>
67
67
  <div class="mappings-info">${i18nString(UIStrings.mappingsAreInferredAutomatically)}</div>