chrome-devtools-frontend 1.0.1514545 → 1.0.1515796

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 (163) hide show
  1. package/AUTHORS +1 -0
  2. package/docs/committers_policy.md +1 -1
  3. package/docs/contributing/infrastructure.md +101 -5
  4. package/front_end/Images/gdp-logo-dark.png +0 -0
  5. package/front_end/Images/gdp-logo-light.png +0 -0
  6. package/front_end/core/common/Settings.ts +11 -32
  7. package/front_end/entrypoints/main/main-meta.ts +2 -2
  8. package/front_end/generated/InspectorBackendCommands.js +4 -4
  9. package/front_end/generated/SupportedCSSProperties.js +12 -0
  10. package/front_end/generated/protocol.ts +10 -1
  11. package/front_end/global_typings/global_defs.d.ts +15 -1
  12. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +22 -23
  13. package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +6 -7
  14. package/front_end/models/ai_assistance/ai_assistance.ts +3 -0
  15. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +141 -2
  16. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +96 -10
  17. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +123 -55
  18. package/front_end/models/cpu_profile/ProfileTreeModel.ts +1 -1
  19. package/front_end/models/extensions/ExtensionPanel.ts +4 -0
  20. package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +5 -1
  21. package/front_end/models/javascript_metadata/NativeFunctions.js +7 -7
  22. package/front_end/models/text_utils/TextUtils.ts +26 -0
  23. package/front_end/models/trace/Processor.ts +1 -1
  24. package/front_end/models/trace/helpers/Trace.ts +1 -1
  25. package/front_end/models/trace/insights/DocumentLatency.ts +9 -7
  26. package/front_end/models/trace/types/Configuration.ts +12 -0
  27. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +6 -7
  28. package/front_end/panels/ai_assistance/components/ChatView.ts +1 -2
  29. package/front_end/panels/application/components/BackForwardCacheStrings.ts +8 -2
  30. package/front_end/panels/common/BadgeNotification.ts +10 -8
  31. package/front_end/panels/common/GdpSignUpDialog.ts +25 -16
  32. package/front_end/panels/common/gdpSignUpDialog.css +10 -14
  33. package/front_end/panels/console/ConsoleView.ts +4 -0
  34. package/front_end/panels/elements/ElementsPanel.ts +4 -0
  35. package/front_end/panels/elements/StylePropertiesSection.ts +4 -4
  36. package/front_end/panels/network/NetworkConfigView.ts +1 -1
  37. package/front_end/panels/network/NetworkLogView.ts +2 -2
  38. package/front_end/panels/network/components/HeaderSectionRow.ts +2 -3
  39. package/front_end/panels/profiler/HeapProfileView.ts +1 -3
  40. package/front_end/panels/profiler/HeapSnapshotView.ts +5 -1
  41. package/front_end/panels/profiler/ProfileDataGrid.ts +4 -0
  42. package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +7 -29
  43. package/front_end/panels/profiler/ProfileView.ts +4 -0
  44. package/front_end/panels/recorder/components/CreateRecordingView.ts +2 -2
  45. package/front_end/panels/search/SearchView.ts +322 -248
  46. package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
  47. package/front_end/panels/settings/SettingsScreen.ts +1 -1
  48. package/front_end/panels/settings/components/SyncSection.ts +59 -14
  49. package/front_end/panels/settings/components/syncSection.css +17 -4
  50. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +4 -7
  51. package/front_end/panels/sources/SourcesView.ts +4 -0
  52. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
  53. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +6 -3
  54. package/front_end/panels/timeline/CountersGraph.ts +5 -5
  55. package/front_end/panels/timeline/TimelineDetailsView.ts +2 -2
  56. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +4 -3
  57. package/front_end/panels/timeline/TimelineFlameChartView.ts +9 -4
  58. package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -2
  59. package/front_end/panels/timeline/TimelinePanel.ts +4 -3
  60. package/front_end/panels/timeline/TimelineTreeView.ts +6 -2
  61. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -1
  62. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -2
  63. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +6 -6
  64. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +2 -2
  65. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -3
  66. package/front_end/panels/timeline/utils/utils.ts +0 -8
  67. package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
  68. package/front_end/{panels/timeline/utils → services/tracing}/FreshRecording.ts +1 -1
  69. package/front_end/services/tracing/tracing.ts +2 -0
  70. package/front_end/third_party/chromium/README.chromium +1 -1
  71. package/front_end/third_party/puppeteer/README.chromium +2 -2
  72. package/front_end/third_party/puppeteer/package/README.md +6 -3
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +11 -1
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +2 -2
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +5 -1
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +30 -8
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +1 -3
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js +8 -2
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +5 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +8 -2
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +5 -0
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  101. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +12 -2
  102. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +22 -8
  103. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +11 -1
  105. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +2 -2
  107. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +5 -1
  109. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  110. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +30 -8
  111. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +1 -3
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.d.ts +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js +8 -2
  118. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +5 -1
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +8 -2
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +5 -0
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/types.d.ts +12 -2
  129. package/front_end/third_party/puppeteer/package/package.json +4 -4
  130. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +1 -1
  131. package/front_end/third_party/puppeteer/package/src/api/Page.ts +13 -2
  132. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +50 -8
  133. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +0 -1
  134. package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +8 -1
  135. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +21 -5
  136. package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
  137. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +12 -0
  138. package/front_end/ui/components/text_editor/config.ts +66 -16
  139. package/front_end/ui/legacy/Dialog.ts +38 -13
  140. package/front_end/ui/legacy/InspectorView.ts +7 -9
  141. package/front_end/ui/legacy/ProgressIndicator.ts +4 -5
  142. package/front_end/ui/legacy/SearchableView.ts +73 -55
  143. package/front_end/ui/legacy/SettingsUI.ts +5 -5
  144. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +1 -4
  145. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +5 -5
  146. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +4 -2
  147. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +2 -2
  148. package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +2 -2
  149. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +1 -4
  150. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
  151. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -2
  152. package/front_end/ui/legacy/components/source_frame/JSONView.ts +10 -10
  153. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -0
  154. package/front_end/ui/legacy/components/source_frame/XMLView.ts +4 -0
  155. package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -4
  156. package/front_end/ui/legacy/searchableView.css +0 -4
  157. package/front_end/ui/visual_logging/Debugging.ts +24 -12
  158. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  159. package/package.json +3 -3
  160. package/front_end/Images/src/gdp-logo-standalone.svg +0 -9
  161. /package/front_end/{panels/timeline/utils → models/ai_assistance/performance}/AICallTree.ts +0 -0
  162. /package/front_end/{panels/timeline/utils → models/ai_assistance/performance}/AIContext.ts +0 -0
  163. /package/front_end/{panels/timeline/utils/InsightAIContext.ts → models/ai_assistance/performance/AIQueries.ts} +0 -0
@@ -108,69 +108,51 @@ const str_ = i18n.i18n.registerUIStrings('panels/search/SearchView.ts', UIString
108
108
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
109
109
  const {ref} = Directives;
110
110
 
111
- export class SearchView extends UI.Widget.VBox {
112
- private focusOnShow: boolean;
113
- private isIndexing: boolean;
114
- private searchId: number;
115
- private searchMatchesCount: number;
116
- private searchResultsCount: number;
117
- private nonEmptySearchResultsCount: number;
118
- private searchingView: UI.Widget.Widget|null;
119
- private notFoundView: UI.Widget.Widget|null;
120
- private searchConfig: Workspace.SearchConfig.SearchConfig|null;
121
- private pendingSearchConfig: Workspace.SearchConfig.SearchConfig|null;
122
- private searchResultsPane: SearchResultsPane|null;
123
- private progressIndicator: UI.ProgressIndicator.ProgressIndicator|null;
124
- private visiblePane: UI.Widget.Widget|null;
125
- private searchPanelElement!: HTMLElement;
126
- private searchResultsElement!: HTMLElement;
127
- protected search!: HTMLInputElement;
128
- protected matchCaseButton!: Buttons.Button.Button;
129
- protected regexButton!: Buttons.Button.Button;
130
- private searchMessageElement!: HTMLElement;
131
- private searchProgressPlaceholderElement!: HTMLElement;
132
- private searchResultsMessageElement!: HTMLElement;
133
- private readonly advancedSearchConfig: Common.Settings.Setting<{
134
- query: string,
135
- ignoreCase: boolean,
136
- isRegex: boolean,
137
- }>;
138
- private searchScope: SearchScope|null;
139
-
140
- // We throttle adding search results, otherwise we trigger DOM layout for each
141
- // result added.
142
- #throttler: Common.Throttler.Throttler;
143
- #pendingSearchResults: SearchResult[] = [];
144
- #emptyStartView: UI.EmptyWidget.EmptyWidget;
145
-
146
- constructor(settingKey: string, throttler: Common.Throttler.Throttler) {
147
- super({
148
- jslog: `${VisualLogging.panel('search').track({resize: true})}`,
149
- useShadowDom: true,
150
- });
151
- this.setMinimumSize(0, 40);
111
+ interface SearchViewInput {
112
+ query: string;
113
+ focusSearchInput: boolean;
114
+ matchCase: boolean;
115
+ isRegex: boolean;
116
+ searchMessage: string;
117
+ searchResultsMessage: string;
118
+ onQueryChange: (query: string) => void;
119
+ onQueryKeyDown: (evt: KeyboardEvent) => void;
120
+ onPanelKeyDown: (evt: KeyboardEvent) => void;
121
+ onClearSearchInput: () => void;
122
+ onToggleRegex: () => void;
123
+ onToggleMatchCase: () => void;
124
+ onRefresh: () => void;
125
+ onClearSearch: () => void;
126
+ }
152
127
 
153
- this.focusOnShow = false;
154
- this.isIndexing = false;
155
- this.searchId = 1;
156
- this.searchMatchesCount = 0;
157
- this.searchResultsCount = 0;
158
- this.nonEmptySearchResultsCount = 0;
159
- this.searchingView = null;
160
- this.notFoundView = null;
161
- this.searchConfig = null;
162
- this.pendingSearchConfig = null;
163
- this.searchResultsPane = null;
164
- this.progressIndicator = null;
165
- this.visiblePane = null;
166
- this.#throttler = throttler;
128
+ interface SearchViewOutput {
129
+ searchResultsElement?: HTMLElement;
130
+ searchProgressPlaceholderElement?: HTMLElement;
131
+ }
167
132
 
168
- // clang-format off
169
- /* eslint-disable-next-line rulesdir/no-lit-render-outside-of-view */
170
- render(html`
133
+ type View = (input: SearchViewInput, output: SearchViewOutput, target: HTMLElement) => void;
134
+
135
+ export const DEFAULT_VIEW: View = (input, output, target) => {
136
+ const {
137
+ query,
138
+ focusSearchInput,
139
+ matchCase,
140
+ isRegex,
141
+ searchMessage,
142
+ searchResultsMessage,
143
+ onQueryChange,
144
+ onQueryKeyDown,
145
+ onPanelKeyDown,
146
+ onClearSearchInput,
147
+ onToggleRegex,
148
+ onToggleMatchCase,
149
+ onRefresh,
150
+ onClearSearch,
151
+ } = input;
152
+ // clang-format off
153
+ render(html`
171
154
  <style>${searchViewStyles}</style>
172
- <div class="search-drawer-header" @keydown=${this.onKeyDownOnPanel}
173
- ${ref(e => {this.searchPanelElement = e as HTMLElement;})}>
155
+ <div class="search-drawer-header" @keydown=${onPanelKeyDown}>
174
156
  <div class="search-container">
175
157
  <div class="toolbar-item-search">
176
158
  <devtools-icon name="search"></devtools-icon>
@@ -181,10 +163,17 @@ export class SearchView extends UI.Widget.VBox {
181
163
  change: true, keydown: 'ArrowUp|ArrowDown|Enter'})}
182
164
  aria-label=${i18nString(UIStrings.find)}
183
165
  size="100" results="0"
184
- @keydown=${this.onKeyDown}
185
- ${ref(e => {this.search = e as HTMLInputElement;})}>
166
+ .value=${query}
167
+ @keydown=${onQueryKeyDown}
168
+ @input=${(e: Event) => onQueryChange((e.target as HTMLInputElement).value)}
169
+ ${ref(e => {
170
+ if (e instanceof HTMLInputElement && focusSearchInput) {
171
+ e.focus();
172
+ e.select();
173
+ }
174
+ })}>
186
175
  <devtools-button class="clear-button" tabindex="-1"
187
- @click=${this.onSearchInputClear}
176
+ @click=${onClearSearchInput}
188
177
  .data=${{
189
178
  variant: Buttons.Button.Variant.ICON,
190
179
  iconName: 'cross-circle-filled',
@@ -193,40 +182,40 @@ export class SearchView extends UI.Widget.VBox {
193
182
  title: i18nString(UIStrings.clearInput),
194
183
  } as Buttons.Button.ButtonData}
195
184
  ></devtools-button>
196
- <devtools-button @click=${this.regexButtonToggled} .data=${{
185
+ <devtools-button @click=${onToggleRegex} .data=${{
197
186
  variant: Buttons.Button.Variant.ICON_TOGGLE,
198
187
  iconName: 'regular-expression',
199
188
  toggledIconName: 'regular-expression',
200
189
  toggleType: Buttons.Button.ToggleType.PRIMARY,
201
190
  size: Buttons.Button.Size.SMALL,
202
- toggled: false,
203
- title: i18nString(UIStrings.enableRegularExpression),
191
+ toggled: isRegex,
192
+ title: isRegex ? i18nString(UIStrings.disableRegularExpression) : i18nString(UIStrings.enableRegularExpression),
204
193
  jslogContext: 'regular-expression',
205
194
  } as Buttons.Button.ButtonData}
206
- ${ref(e => {this.regexButton = e as Buttons.Button.Button;})}
195
+ class="regex-button"
207
196
  ></devtools-button>
208
- <devtools-button @click=${this.matchCaseButtonToggled} .data=${{
197
+ <devtools-button @click=${onToggleMatchCase} .data=${{
209
198
  variant: Buttons.Button.Variant.ICON_TOGGLE,
210
199
  iconName: 'match-case',
211
200
  toggledIconName: 'match-case',
212
201
  toggleType: Buttons.Button.ToggleType.PRIMARY,
213
202
  size: Buttons.Button.Size.SMALL,
214
- toggled: false,
215
- title: i18nString(UIStrings.enableCaseSensitive),
203
+ toggled: matchCase,
204
+ title: matchCase ? i18nString(UIStrings.disableCaseSensitive) : i18nString(UIStrings.enableCaseSensitive),
216
205
  jslogContext: 'match-case',
217
206
  } as Buttons.Button.ButtonData}
218
- ${ref(e => {this.matchCaseButton = e as Buttons.Button.Button;})}
207
+ class="match-case-button"
219
208
  ></devtools-button>
220
209
  </div>
221
210
  </div>
222
211
  <devtools-toolbar class="search-toolbar" jslog=${VisualLogging.toolbar()}>
223
- <devtools-button title=${i18nString(UIStrings.refresh)} @click=${this.onAction}
212
+ <devtools-button title=${i18nString(UIStrings.refresh)} @click=${onRefresh}
224
213
  .data=${{
225
214
  variant: Buttons.Button.Variant.TOOLBAR,
226
215
  iconName: 'refresh',
227
216
  jslogContext: 'search.refresh',
228
217
  } as Buttons.Button.ButtonData}></devtools-button>
229
- <devtools-button title=${i18nString(UIStrings.clear)} @click=${this.onClearSearch}
218
+ <devtools-button title=${i18nString(UIStrings.clear)} @click=${onClearSearch}
230
219
  .data=${{
231
220
  variant: Buttons.Button.Variant.TOOLBAR,
232
221
  iconName: 'clear',
@@ -234,59 +223,146 @@ export class SearchView extends UI.Widget.VBox {
234
223
  } as Buttons.Button.ButtonData}></devtools-button>
235
224
  </devtools-toolbar>
236
225
  </div>
237
- <div class="search-results" @keydown=${this.onKeyDownOnPanel}
238
- ${ref(e => {this.searchResultsElement = e as HTMLElement;})}>
226
+ <div class="search-results" @keydown=${onPanelKeyDown}
227
+ ${ref(e => {output.searchResultsElement = e as HTMLElement;})}>
239
228
  </div>
240
- <div class="search-toolbar-summary" @keydown=${this.onKeyDownOnPanel}>
241
- <div class="search-message" ${ref(e => {this.searchMessageElement = e as HTMLElement;})}></div>
242
- <div class="flex-centered" ${ref(e => {this.searchProgressPlaceholderElement = e as HTMLElement;})}>
229
+ <div class="search-toolbar-summary" @keydown=${onPanelKeyDown}>
230
+ <div class="search-message">${searchMessage}</div>
231
+ <div class="flex-centered" ${ref(e => {output.searchProgressPlaceholderElement = e as HTMLElement;})}>
243
232
  </div>
244
- <div class="search-message" ${ref(e => {this.searchResultsMessageElement = e as HTMLElement;})}>
245
- </div>
246
- </div>`, this.contentElement, {host: this});
247
- // clang-format on
233
+ <div class="search-message">${searchResultsMessage}</div>
234
+ </div>`, target);
235
+ // clang-format on
236
+ };
237
+
238
+ export class SearchView extends UI.Widget.VBox {
239
+ readonly #view: View;
240
+ #focusSearchInput: boolean;
241
+ #isIndexing: boolean;
242
+ #searchId: number;
243
+ #searchMatchesCount: number;
244
+ #searchResultsCount: number;
245
+ #nonEmptySearchResultsCount: number;
246
+ #searchingView: UI.Widget.Widget|null;
247
+ #notFoundView: UI.Widget.Widget|null;
248
+ #searchConfig: Workspace.SearchConfig.SearchConfig|null;
249
+ #pendingSearchConfig: Workspace.SearchConfig.SearchConfig|null;
250
+ #searchResultsPane: SearchResultsPane|null;
251
+ #progressIndicator: UI.ProgressIndicator.ProgressIndicator|null;
252
+ #visiblePane: UI.Widget.Widget|null;
253
+ #searchResultsElement!: HTMLElement;
254
+ #query: string;
255
+ #matchCase = false;
256
+ #isRegex = false;
257
+ #searchMessage = '';
258
+ #searchProgressPlaceholderElement!: HTMLElement;
259
+ #searchResultsMessage = '';
260
+ readonly #advancedSearchConfig: Common.Settings.Setting<{
261
+ query: string,
262
+ ignoreCase: boolean,
263
+ isRegex: boolean,
264
+ }>;
265
+ #searchScope: SearchScope|null;
266
+
267
+ // We throttle adding search results, otherwise we trigger DOM layout for each
268
+ // result added.
269
+ #throttler: Common.Throttler.Throttler;
270
+ #pendingSearchResults: SearchResult[] = [];
271
+ #emptyStartView: UI.EmptyWidget.EmptyWidget;
272
+
273
+ constructor(settingKey: string, throttler: Common.Throttler.Throttler, view = DEFAULT_VIEW) {
274
+ super({
275
+ jslog: `${VisualLogging.panel('search').track({resize: true})}`,
276
+ useShadowDom: true,
277
+ });
278
+ this.#view = view;
279
+ this.setMinimumSize(0, 40);
248
280
 
249
- this.advancedSearchConfig = Common.Settings.Settings.instance().createLocalSetting(
281
+ this.#focusSearchInput = false;
282
+ this.#isIndexing = false;
283
+ this.#searchId = 1;
284
+ this.#query = '';
285
+ this.#searchMatchesCount = 0;
286
+ this.#searchResultsCount = 0;
287
+ this.#nonEmptySearchResultsCount = 0;
288
+ this.#searchingView = null;
289
+ this.#notFoundView = null;
290
+ this.#searchConfig = null;
291
+ this.#pendingSearchConfig = null;
292
+ this.#searchResultsPane = null;
293
+ this.#progressIndicator = null;
294
+ this.#visiblePane = null;
295
+ this.#throttler = throttler;
296
+
297
+ this.#advancedSearchConfig = Common.Settings.Settings.instance().createLocalSetting(
250
298
  settingKey + '-search-config', new Workspace.SearchConfig.SearchConfig('', true, false).toPlainObject());
251
299
 
252
- this.load();
253
- this.searchScope = null;
300
+ this.performUpdate();
301
+ this.#load();
302
+ this.performUpdate();
303
+ this.#searchScope = null;
254
304
 
255
305
  this.#emptyStartView = new UI.EmptyWidget.EmptyWidget(
256
306
  i18nString(UIStrings.noSearchResult), i18nString(UIStrings.typeAndPressSToSearch, {
257
307
  PH1: UI.KeyboardShortcut.KeyboardShortcut.shortcutToString(UI.KeyboardShortcut.Keys.Enter)
258
308
  }));
259
- this.showPane(this.#emptyStartView);
309
+ this.#showPane(this.#emptyStartView);
310
+ }
311
+
312
+ override performUpdate(): void {
313
+ const input: SearchViewInput = {
314
+ query: this.#query,
315
+ focusSearchInput: this.#focusSearchInput,
316
+ matchCase: this.#matchCase,
317
+ isRegex: this.#isRegex,
318
+ searchMessage: this.#searchMessage,
319
+ searchResultsMessage: this.#searchResultsMessage,
320
+ onQueryChange: (query: string) => {
321
+ this.#query = query;
322
+ },
323
+ onQueryKeyDown: this.#onQueryKeyDown.bind(this),
324
+ onPanelKeyDown: this.#onPanelKeyDown.bind(this),
325
+ onClearSearchInput: this.#onClearSearchInput.bind(this),
326
+ onToggleRegex: this.#onToggleRegex.bind(this),
327
+ onToggleMatchCase: this.#onToggleMatchCase.bind(this),
328
+ onRefresh: this.#onRefresh.bind(this),
329
+ onClearSearch: this.#onClearSearch.bind(this),
330
+ };
331
+ const output: SearchViewOutput = {};
332
+ this.#view(input, output, this.contentElement);
333
+ this.#focusSearchInput = false;
334
+ if (output.searchResultsElement) {
335
+ this.#searchResultsElement = output.searchResultsElement;
336
+ }
337
+ if (output.searchProgressPlaceholderElement) {
338
+ this.#searchProgressPlaceholderElement = output.searchProgressPlaceholderElement;
339
+ }
260
340
  }
261
341
 
262
- regexButtonToggled(): void {
263
- this.regexButton.title = this.regexButton.toggled ? i18nString(UIStrings.disableRegularExpression) :
264
- i18nString(UIStrings.enableRegularExpression);
342
+ #onToggleRegex(): void {
343
+ this.#isRegex = !this.#isRegex;
344
+ this.performUpdate();
265
345
  }
266
346
 
267
- matchCaseButtonToggled(): void {
268
- this.matchCaseButton.title = this.matchCaseButton.toggled ? i18nString(UIStrings.disableCaseSensitive) :
269
- i18nString(UIStrings.enableCaseSensitive);
347
+ #onToggleMatchCase(): void {
348
+ this.#matchCase = !this.#matchCase;
349
+ this.performUpdate();
270
350
  }
271
351
 
272
- private buildSearchConfig(): Workspace.SearchConfig.SearchConfig {
273
- return new Workspace.SearchConfig.SearchConfig(
274
- this.search.value, !this.matchCaseButton.toggled, this.regexButton.toggled);
352
+ #buildSearchConfig(): Workspace.SearchConfig.SearchConfig {
353
+ return new Workspace.SearchConfig.SearchConfig(this.#query, !this.#matchCase, this.#isRegex);
275
354
  }
276
355
 
277
356
  toggle(queryCandidate: string, searchImmediately?: boolean): void {
278
- this.search.value = queryCandidate;
279
- if (this.isShowing()) {
280
- this.focus();
281
- } else {
282
- this.focusOnShow = true;
283
- }
357
+ this.#query = queryCandidate;
358
+ this.requestUpdate();
359
+ this.focus();
284
360
 
285
- this.initScope();
361
+ this.#initScope();
286
362
  if (searchImmediately) {
287
- this.onAction();
363
+ this.#onRefresh();
288
364
  } else {
289
- this.startIndexing();
365
+ this.#startIndexing();
290
366
  }
291
367
  }
292
368
 
@@ -294,208 +370,208 @@ export class SearchView extends UI.Widget.VBox {
294
370
  throw new Error('Not implemented');
295
371
  }
296
372
 
297
- private initScope(): void {
298
- this.searchScope = this.createScope();
373
+ #initScope(): void {
374
+ this.#searchScope = this.createScope();
299
375
  }
300
376
 
301
- override wasShown(): void {
302
- super.wasShown();
303
- if (this.focusOnShow) {
304
- this.focus();
305
- this.focusOnShow = false;
306
- }
307
- }
308
-
309
- private onIndexingFinished(): void {
310
- if (!this.progressIndicator) {
377
+ #onIndexingFinished(): void {
378
+ if (!this.#progressIndicator) {
311
379
  return;
312
380
  }
313
381
 
314
- const finished = !this.progressIndicator.isCanceled();
315
- this.progressIndicator.done();
316
- this.progressIndicator = null;
317
- this.isIndexing = false;
318
- this.searchMessageElement.textContent = finished ? '' : i18nString(UIStrings.indexingInterrupted);
382
+ const finished = !this.#progressIndicator.isCanceled();
383
+ this.#progressIndicator.done();
384
+ this.#progressIndicator = null;
385
+ this.#isIndexing = false;
386
+ this.#searchMessage = finished ? '' : i18nString(UIStrings.indexingInterrupted);
319
387
  if (!finished) {
320
- this.pendingSearchConfig = null;
388
+ this.#pendingSearchConfig = null;
321
389
  }
322
- if (!this.pendingSearchConfig) {
390
+ this.performUpdate();
391
+ if (!this.#pendingSearchConfig) {
323
392
  return;
324
393
  }
325
- const searchConfig = this.pendingSearchConfig;
326
- this.pendingSearchConfig = null;
327
- this.innerStartSearch(searchConfig);
394
+ const searchConfig = this.#pendingSearchConfig;
395
+ this.#pendingSearchConfig = null;
396
+ this.#innerStartSearch(searchConfig);
328
397
  }
329
398
 
330
- private startIndexing(): void {
331
- this.isIndexing = true;
332
- if (this.progressIndicator) {
333
- this.progressIndicator.done();
399
+ #startIndexing(): void {
400
+ this.#isIndexing = true;
401
+ if (this.#progressIndicator) {
402
+ this.#progressIndicator.done();
334
403
  }
335
- this.progressIndicator = document.createElement('devtools-progress');
336
- this.searchMessageElement.textContent = i18nString(UIStrings.indexing);
337
- this.searchProgressPlaceholderElement.appendChild(this.progressIndicator);
338
- if (this.searchScope) {
339
- this.searchScope.performIndexing(
340
- new Common.Progress.ProgressProxy(this.progressIndicator, this.onIndexingFinished.bind(this)));
404
+ this.#progressIndicator = document.createElement('devtools-progress');
405
+ this.#searchMessage = i18nString(UIStrings.indexing);
406
+ this.#searchProgressPlaceholderElement.appendChild(this.#progressIndicator);
407
+ this.performUpdate();
408
+ if (this.#searchScope) {
409
+ this.#searchScope.performIndexing(
410
+ new Common.Progress.ProgressProxy(this.#progressIndicator, this.#onIndexingFinished.bind(this)));
341
411
  }
342
412
  }
343
413
 
344
- private onSearchInputClear(): void {
345
- this.search.value = '';
346
- this.save();
414
+ #onClearSearchInput(): void {
415
+ this.#query = '';
416
+ this.requestUpdate();
417
+ this.#save();
347
418
  this.focus();
348
- this.showPane(this.#emptyStartView);
419
+ this.#showPane(this.#emptyStartView);
349
420
  }
350
421
 
351
- private onSearchResult(searchId: number, searchResult: SearchResult): void {
352
- if (searchId !== this.searchId || !this.progressIndicator) {
422
+ #onSearchResult(searchId: number, searchResult: SearchResult): void {
423
+ if (searchId !== this.#searchId || !this.#progressIndicator) {
353
424
  return;
354
425
  }
355
- if (this.progressIndicator?.isCanceled()) {
356
- this.onIndexingFinished();
426
+ if (this.#progressIndicator?.isCanceled()) {
427
+ this.#onIndexingFinished();
357
428
  return;
358
429
  }
359
- if (!this.searchResultsPane) {
360
- this.searchResultsPane = new SearchResultsPane((this.searchConfig as Workspace.SearchConfig.SearchConfig));
361
- this.showPane(this.searchResultsPane);
430
+ if (!this.#searchResultsPane) {
431
+ this.#searchResultsPane = this.createSearchResultsPane();
432
+ this.#showPane(this.#searchResultsPane);
362
433
  }
363
434
  this.#pendingSearchResults.push(searchResult);
364
435
  void this.#throttler.schedule(async () => this.#addPendingSearchResults());
365
436
  }
366
437
 
438
+ protected createSearchResultsPane(): SearchResultsPane {
439
+ return new SearchResultsPane((this.#searchConfig as Workspace.SearchConfig.SearchConfig));
440
+ }
441
+
367
442
  #addPendingSearchResults(): void {
368
443
  for (const searchResult of this.#pendingSearchResults) {
369
- this.addSearchResult(searchResult);
444
+ this.#addSearchResult(searchResult);
370
445
  if (searchResult.matchesCount()) {
371
- this.searchResultsPane?.addSearchResult(searchResult);
446
+ this.#searchResultsPane?.addSearchResult(searchResult);
372
447
  }
373
448
  }
374
449
  this.#pendingSearchResults = [];
375
450
  }
376
451
 
377
- private onSearchFinished(searchId: number, finished: boolean): void {
378
- if (searchId !== this.searchId || !this.progressIndicator) {
452
+ #onSearchFinished(searchId: number, finished: boolean): void {
453
+ if (searchId !== this.#searchId || !this.#progressIndicator) {
379
454
  return;
380
455
  }
381
- if (!this.searchResultsPane) {
382
- this.nothingFound();
456
+ if (!this.#searchResultsPane) {
457
+ this.#nothingFound();
383
458
  }
384
- this.searchFinished(finished);
385
- this.searchConfig = null;
386
- UI.ARIAUtils.LiveAnnouncer.alert(
387
- this.searchMessageElement.textContent + ' ' + this.searchResultsMessageElement.textContent);
459
+ this.#searchFinished(finished);
460
+ this.#searchConfig = null;
461
+ UI.ARIAUtils.LiveAnnouncer.alert(this.#searchMessage + ' ' + this.#searchResultsMessage);
388
462
  }
389
463
 
390
- private innerStartSearch(searchConfig: Workspace.SearchConfig.SearchConfig): void {
391
- this.searchConfig = searchConfig;
392
- if (this.progressIndicator) {
393
- this.progressIndicator.done();
464
+ #innerStartSearch(searchConfig: Workspace.SearchConfig.SearchConfig): void {
465
+ this.#searchConfig = searchConfig;
466
+ if (this.#progressIndicator) {
467
+ this.#progressIndicator.done();
394
468
  }
395
- this.progressIndicator = document.createElement('devtools-progress');
396
- this.searchStarted(this.progressIndicator);
397
- if (this.searchScope) {
398
- void this.searchScope.performSearch(
399
- searchConfig, this.progressIndicator, this.onSearchResult.bind(this, this.searchId),
400
- this.onSearchFinished.bind(this, this.searchId));
469
+ this.#progressIndicator = document.createElement('devtools-progress');
470
+ this.#searchStarted(this.#progressIndicator);
471
+ if (this.#searchScope) {
472
+ void this.#searchScope.performSearch(
473
+ searchConfig, this.#progressIndicator, this.#onSearchResult.bind(this, this.#searchId),
474
+ this.#onSearchFinished.bind(this, this.#searchId));
401
475
  }
402
476
  }
403
477
 
404
- private resetSearch(): void {
405
- this.stopSearch();
406
- this.showPane(null);
407
- this.searchResultsPane = null;
408
- this.searchMessageElement.textContent = '';
409
- this.searchResultsMessageElement.textContent = '';
478
+ #resetSearch(): void {
479
+ this.#stopSearch();
480
+ this.#showPane(null);
481
+ this.#searchResultsPane = null;
482
+ this.#searchMessage = '';
483
+ this.#searchResultsMessage = '';
484
+ this.performUpdate();
410
485
  }
411
486
 
412
- private stopSearch(): void {
413
- if (this.progressIndicator && !this.isIndexing) {
414
- this.progressIndicator.cancel();
487
+ #stopSearch(): void {
488
+ if (this.#progressIndicator && !this.#isIndexing) {
489
+ this.#progressIndicator.cancel();
415
490
  }
416
- if (this.searchScope) {
417
- this.searchScope.stopSearch();
491
+ if (this.#searchScope) {
492
+ this.#searchScope.stopSearch();
418
493
  }
419
- this.searchConfig = null;
494
+ this.#searchConfig = null;
420
495
  }
421
496
 
422
- private searchStarted(progressIndicator: UI.ProgressIndicator.ProgressIndicator): void {
423
- this.searchMatchesCount = 0;
424
- this.searchResultsCount = 0;
425
- this.nonEmptySearchResultsCount = 0;
426
- if (!this.searchingView) {
427
- this.searchingView = new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.searching), '');
497
+ #searchStarted(progressIndicator: UI.ProgressIndicator.ProgressIndicator): void {
498
+ this.#searchMatchesCount = 0;
499
+ this.#searchResultsCount = 0;
500
+ this.#nonEmptySearchResultsCount = 0;
501
+ if (!this.#searchingView) {
502
+ this.#searchingView = new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.searching), '');
428
503
  }
429
- this.showPane(this.searchingView);
430
- this.searchMessageElement.textContent = i18nString(UIStrings.searching);
431
- this.searchProgressPlaceholderElement.appendChild(progressIndicator);
432
- this.updateSearchResultsMessage();
433
- }
434
-
435
- private updateSearchResultsMessage(): void {
436
- if (this.searchMatchesCount && this.searchResultsCount) {
437
- if (this.searchMatchesCount === 1 && this.nonEmptySearchResultsCount === 1) {
438
- this.searchResultsMessageElement.textContent = i18nString(UIStrings.foundMatchingLineInFile);
439
- } else if (this.searchMatchesCount > 1 && this.nonEmptySearchResultsCount === 1) {
440
- this.searchResultsMessageElement.textContent =
441
- i18nString(UIStrings.foundDMatchingLinesInFile, {PH1: this.searchMatchesCount});
504
+ this.#showPane(this.#searchingView);
505
+ this.#searchMessage = i18nString(UIStrings.searching);
506
+ this.performUpdate();
507
+ this.#searchProgressPlaceholderElement.appendChild(progressIndicator);
508
+ this.#updateSearchResultsMessage();
509
+ }
510
+
511
+ #updateSearchResultsMessage(): void {
512
+ if (this.#searchMatchesCount && this.#searchResultsCount) {
513
+ if (this.#searchMatchesCount === 1 && this.#nonEmptySearchResultsCount === 1) {
514
+ this.#searchResultsMessage = i18nString(UIStrings.foundMatchingLineInFile);
515
+ } else if (this.#searchMatchesCount > 1 && this.#nonEmptySearchResultsCount === 1) {
516
+ this.#searchResultsMessage = i18nString(UIStrings.foundDMatchingLinesInFile, {PH1: this.#searchMatchesCount});
442
517
  } else {
443
- this.searchResultsMessageElement.textContent = i18nString(
518
+ this.#searchResultsMessage = i18nString(
444
519
  UIStrings.foundDMatchingLinesInDFiles,
445
- {PH1: this.searchMatchesCount, PH2: this.nonEmptySearchResultsCount});
520
+ {PH1: this.#searchMatchesCount, PH2: this.#nonEmptySearchResultsCount});
446
521
  }
447
522
  } else {
448
- this.searchResultsMessageElement.textContent = '';
523
+ this.#searchResultsMessage = '';
449
524
  }
525
+ this.performUpdate();
450
526
  }
451
527
 
452
- private showPane(panel: UI.Widget.Widget|null): void {
453
- if (this.visiblePane) {
454
- this.visiblePane.detach();
528
+ #showPane(panel: UI.Widget.Widget|null): void {
529
+ if (this.#visiblePane) {
530
+ this.#visiblePane.detach();
455
531
  }
456
532
  if (panel) {
457
- panel.show(this.searchResultsElement);
533
+ panel.show(this.#searchResultsElement);
458
534
  }
459
- this.visiblePane = panel;
535
+ this.#visiblePane = panel;
460
536
  }
461
537
 
462
- private nothingFound(): void {
463
- if (!this.notFoundView) {
464
- this.notFoundView = new UI.EmptyWidget.EmptyWidget(
538
+ #nothingFound(): void {
539
+ if (!this.#notFoundView) {
540
+ this.#notFoundView = new UI.EmptyWidget.EmptyWidget(
465
541
  i18nString(UIStrings.noMatchesFound), i18nString(UIStrings.nothingMatchedTheQuery));
466
542
  }
467
- this.showPane(this.notFoundView);
543
+ this.#showPane(this.#notFoundView);
468
544
  }
469
545
 
470
- private addSearchResult(searchResult: SearchResult): void {
546
+ #addSearchResult(searchResult: SearchResult): void {
471
547
  const matchesCount = searchResult.matchesCount();
472
- this.searchMatchesCount += matchesCount;
473
- this.searchResultsCount++;
548
+ this.#searchMatchesCount += matchesCount;
549
+ this.#searchResultsCount++;
474
550
  if (matchesCount) {
475
- this.nonEmptySearchResultsCount++;
551
+ this.#nonEmptySearchResultsCount++;
476
552
  }
477
- this.updateSearchResultsMessage();
553
+ this.#updateSearchResultsMessage();
478
554
  }
479
555
 
480
- private searchFinished(finished: boolean): void {
481
- this.searchMessageElement.textContent =
482
- finished ? i18nString(UIStrings.searchFinished) : i18nString(UIStrings.searchInterrupted);
556
+ #searchFinished(finished: boolean): void {
557
+ this.#searchMessage = finished ? i18nString(UIStrings.searchFinished) : i18nString(UIStrings.searchInterrupted);
558
+ this.performUpdate();
483
559
  }
484
560
 
485
561
  override focus(): void {
486
- this.search.focus();
487
- this.search.select();
562
+ this.#focusSearchInput = true;
563
+ this.requestUpdate();
488
564
  }
489
565
 
490
566
  override willHide(): void {
491
- this.stopSearch();
567
+ this.#stopSearch();
492
568
  }
493
569
 
494
- private onKeyDown(event: KeyboardEvent): void {
495
- this.save();
570
+ #onQueryKeyDown(event: KeyboardEvent): void {
571
+ this.#save();
496
572
  switch (event.keyCode) {
497
573
  case UI.KeyboardShortcut.Keys.Enter.code:
498
- this.onAction();
574
+ this.#onRefresh();
499
575
  break;
500
576
  }
501
577
  }
@@ -518,7 +594,7 @@ export class SearchView extends UI.Widget.VBox {
518
594
  *
519
595
  * @param event KeyboardEvent
520
596
  */
521
- private onKeyDownOnPanel(event: KeyboardEvent): void {
597
+ #onPanelKeyDown(event: KeyboardEvent): void {
522
598
  const isMac = Host.Platform.isMac();
523
599
  // "Command + Alt + ]" for Mac
524
600
  const shouldShowAllForMac =
@@ -534,46 +610,44 @@ export class SearchView extends UI.Widget.VBox {
534
610
  !isMac && event.ctrlKey && !event.metaKey && event.shiftKey && event.code === 'BracketLeft';
535
611
 
536
612
  if (shouldShowAllForMac || shouldShowAllForOtherPlatforms) {
537
- this.searchResultsPane?.showAllMatches();
613
+ this.#searchResultsPane?.showAllMatches();
538
614
  void VisualLogging.logKeyDown(event.currentTarget, event, 'show-all-matches');
539
615
  } else if (shouldCollapseAllForMac || shouldCollapseAllForOtherPlatforms) {
540
- this.searchResultsPane?.collapseAllResults();
616
+ this.#searchResultsPane?.collapseAllResults();
541
617
  void VisualLogging.logKeyDown(event.currentTarget, event, 'collapse-all-results');
542
618
  }
543
619
  }
544
620
 
545
- private save(): void {
546
- this.advancedSearchConfig.set(this.buildSearchConfig().toPlainObject());
621
+ #save(): void {
622
+ this.#advancedSearchConfig.set(this.#buildSearchConfig().toPlainObject());
547
623
  }
548
624
 
549
- private load(): void {
550
- const searchConfig = Workspace.SearchConfig.SearchConfig.fromPlainObject(this.advancedSearchConfig.get());
551
- this.search.value = searchConfig.query();
552
-
553
- this.matchCaseButton.toggled = !searchConfig.ignoreCase();
554
- this.matchCaseButtonToggled();
625
+ #load(): void {
626
+ const searchConfig = Workspace.SearchConfig.SearchConfig.fromPlainObject(this.#advancedSearchConfig.get());
627
+ this.#query = searchConfig.query();
555
628
 
556
- this.regexButton.toggled = searchConfig.isRegex();
557
- this.regexButtonToggled();
629
+ this.#matchCase = !searchConfig.ignoreCase();
630
+ this.#isRegex = searchConfig.isRegex();
631
+ this.requestUpdate();
558
632
  }
559
633
 
560
- private onAction(): void {
561
- const searchConfig = this.buildSearchConfig();
634
+ #onRefresh(): void {
635
+ const searchConfig = this.#buildSearchConfig();
562
636
  if (!searchConfig.query()?.length) {
563
637
  return;
564
638
  }
565
- this.resetSearch();
566
- ++this.searchId;
567
- this.initScope();
568
- if (!this.isIndexing) {
569
- this.startIndexing();
639
+ this.#resetSearch();
640
+ ++this.#searchId;
641
+ this.#initScope();
642
+ if (!this.#isIndexing) {
643
+ this.#startIndexing();
570
644
  }
571
- this.pendingSearchConfig = searchConfig;
645
+ this.#pendingSearchConfig = searchConfig;
572
646
  }
573
647
 
574
- private onClearSearch(): void {
575
- this.resetSearch();
576
- this.onSearchInputClear();
648
+ #onClearSearch(): void {
649
+ this.#resetSearch();
650
+ this.#onClearSearchInput();
577
651
  }
578
652
 
579
653
  get throttlerForTest(): Common.Throttler.Throttler {