feat(#3850): add searchable settings with section navigation and field highlight#3936
feat(#3850): add searchable settings with section navigation and field highlight#3936rodboev wants to merge 3 commits into
Conversation
…and field highlight
|
| Filename | Overview |
|---|---|
| static/panels.js | Adds _buildSettingsIndex, filterSettings, _navigateToSettingsField, _resolveSettingsField, _highlightSettingsField. Core logic for session safety and rAF scroll is sound, but _buildSettingsIndex eagerly loads Provider/Plugin panes that have no .settings-field elements, making the eager loads wasted I/O and leaving those sections unsearchable. |
| static/index.html | Adds search input and results dropdown inside .settings-search wrapper; #settingsSearchResults is correctly nested inside the positioned wrapper so absolute positioning resolves properly. |
| static/i18n.js | Adds settings_search_placeholder and settings_search_no_results to all 13 locales; translations look appropriate. |
| static/style.css | Adds dropdown positioning, result item styles, and settings-field-pulse animation; position:relative on .settings-search is redundant (.sidebar-search already sets it) but harmless. |
| tests/test_3850_settings_search.py | Static text-search regression tests that verify all new functions, CSS classes, and i18n keys are present; structurally sound and matches the implementation. |
Sequence Diagram
sequenceDiagram
participant U as User
participant SI as settingsSearch input
participant FS as filterSettings()
participant BI as _buildSettingsIndex()
participant LP as loadProvidersPanel / loadPluginsPanel
participant DOM as Live DOM
participant NF as _navigateToSettingsField()
U->>SI: types query (oninput)
SI->>FS: filterSettings(query)
FS->>FS: "seq = ++_settingsSearchSeq"
FS->>BI: await _buildSettingsIndex()
alt first search this session
BI->>LP: await Promise.all([load…])
LP-->>DOM: rebuild pane HTML (network fetch)
BI->>DOM: querySelectorAll('.settings-field') per pane
DOM-->>BI: index entries (Providers/Plugins: 0 results ⚠️)
BI-->>FS: index ready
else index already built
BI-->>FS: return immediately
end
FS->>FS: seq check (drop stale queries)
FS->>FS: render up to 12 results in dropdown
U->>FS: clicks a result
FS->>NF: _navigateToSettingsField(entry)
NF->>NF: "switchSettingsSection(sectionKey, {skipLazyLoad:true})"
NF->>NF: requestAnimationFrame → _resolveSettingsField(entry)
NF->>DOM: querySelector label[data-i18n].closest('.settings-field')
NF->>NF: scrollIntoView + _highlightSettingsField(el)
Reviews (4): Last reviewed commit: "fix(#3850): resolve search targets in th..." | Re-trigger Greptile
…x dropdown anchoring
a5495ca to
691910f
Compare
…stale index builds
Thinking Path
switchSettingsSection()at panels.js:6068 activates a pane and handles lazy loading for Providers/Plugins; all we need is to wire a search input to it._highlightQuestionRow()in ui.js:494 — a CSS animation class added then removed after 1.8s using abox-shadowpulse onvar(--focus-ring). The same pattern applies here to.settings-field.loadProvidersPanel()/loadPluginsPanel(). The spec says to index from live DOM after eagerly loading both panes on first search focus, which is the right call: it keeps the index always current and avoids maintaining a parallel i18n-key allowlist.What Changed
static/index.html: add#settingsSearchinput and#settingsSearchResultsdropdown inside#settingsMenubefore the first section button (line 351)static/panels.js: add_buildSettingsIndex(),filterSettings(),_navigateToSettingsField(),_highlightSettingsField(); invalidate_settingsIndexin_beginSettingsPanelSession(); register outside-click dismissalstatic/i18n.js: addsettings_search_placeholder,settings_search_no_resultsstatic/style.css: add.settings-search-results,.settings-search-result,.settings-search-section/arrow/label/empty,.settings-field-highlightanimationWhy It Matters
Users can now find any setting by name without knowing its section, making the settings panel usable as a control center rather than a tab-navigation puzzle — especially useful for power users managing many settings across sections.
Verification
Manual: open Settings, type "theme" in search input, verify results show "Appearance › Theme"; click result, verify Appearance pane opens and theme field scrolls into view with pulse animation.
Risks / Follow-ups
scrollIntoViewcall usesrequestAnimationFrameto wait for pane activation; an additional frame delay may be needed if lazy-loaded panes take longer than one frame to render their fieldsModel Used
Claude Opus 4.6 via Claude Code CLI