From b826b04429661d7dd937e059e96dc1891b9b0eef Mon Sep 17 00:00:00 2001 From: Roo Code Date: Thu, 15 Jan 2026 23:13:28 +0000 Subject: [PATCH 1/2] feat: add settings tab titles to search index - Register tab titles as searchable items after indexing completes - Use special naming convention "tab-{sectionName}" for tab title entries - Allows users to search for tab names like "MCP" to quickly navigate to tabs - Fixes issue where searching for tab names returned no results --- .../src/components/settings/SettingsView.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index 4f7499a1b10..a750483ac5b 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -588,18 +588,33 @@ const SettingsView = forwardRef(({ onDone, t const initialTab = useRef(activeTab) const isIndexing = indexingTabIndex < sectionNames.length const isIndexingComplete = !isIndexing + const tabTitlesRegistered = useRef(false) // Index all tabs by cycling through them on mount useLayoutEffect(() => { if (indexingTabIndex >= sectionNames.length) { - // All tabs indexed, return to initial tab + // All tabs indexed, now register tab titles as searchable items + if (!tabTitlesRegistered.current && searchContextValue) { + sections.forEach(({ id }) => { + const tabTitle = t(`settings:sections.${id}`) + // Register each tab title as a searchable item + // Using a special naming convention for tab titles: "tab-{sectionName}" + searchContextValue.registerSetting({ + settingId: `tab-${id}`, + section: id, + label: tabTitle, + }) + }) + tabTitlesRegistered.current = true + } + // Return to initial tab setActiveTab(initialTab.current) return } // Move to the next tab on next render setIndexingTabIndex((prev) => prev + 1) - }, [indexingTabIndex]) + }, [indexingTabIndex, searchContextValue, sections, t]) // Determine which tab content to render (for indexing or active display) const renderTab = isIndexing ? sectionNames[indexingTabIndex] : activeTab From 357a7759e77429297a2880310ad2bb227b0eea50 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Fri, 16 Jan 2026 03:39:05 +0000 Subject: [PATCH 2/2] fix: move setActiveTab inside conditional to prevent unexpected tab resets --- webview-ui/src/components/settings/SettingsView.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index a750483ac5b..d86007e80fe 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -606,9 +606,9 @@ const SettingsView = forwardRef(({ onDone, t }) }) tabTitlesRegistered.current = true + // Return to initial tab + setActiveTab(initialTab.current) } - // Return to initial tab - setActiveTab(initialTab.current) return }