diff --git a/src/renderer/src/components/settings/AccountsPane.tsx b/src/renderer/src/components/settings/AccountsPane.tsx index 8a99966ce..b503998e3 100644 --- a/src/renderer/src/components/settings/AccountsPane.tsx +++ b/src/renderer/src/components/settings/AccountsPane.tsx @@ -428,7 +428,16 @@ export function AccountsPane({ settings, updateSettings }: AccountsPaneProps): R [ + entry.title, + entry.description ?? '', + ...(entry.keywords ?? []) + ])} className="space-y-3 px-1 py-2" > {/* Why: Settings deep-links can target this subsection directly from diff --git a/src/renderer/src/components/settings/GeneralPane.tsx b/src/renderer/src/components/settings/GeneralPane.tsx index 2622fa973..5eaf6e1a2 100644 --- a/src/renderer/src/components/settings/GeneralPane.tsx +++ b/src/renderer/src/components/settings/GeneralPane.tsx @@ -422,7 +422,15 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea [ + entry.title, + entry.description ?? '', + ...(entry.keywords ?? []) + ])} className="flex items-center justify-between gap-4 px-1 py-2" >
diff --git a/src/renderer/src/components/settings/ManageSessionsSection.tsx b/src/renderer/src/components/settings/ManageSessionsSection.tsx index d6b9a4b7c..79e8de123 100644 --- a/src/renderer/src/components/settings/ManageSessionsSection.tsx +++ b/src/renderer/src/components/settings/ManageSessionsSection.tsx @@ -17,6 +17,7 @@ import { } from '../ui/dialog' import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' import { SearchableSetting } from './SearchableSetting' +import { MANAGE_SESSIONS_SEARCH_ENTRIES } from './terminal-search' import { useAppStore } from '../../store' import { activateAndRevealWorktree } from '@/lib/worktree-activation' import { activateTabAndFocusPane } from '@/lib/activate-tab-and-focus-pane' @@ -285,9 +286,9 @@ export function ManageSessionsSection(): React.JSX.Element {
{/* Why: full-width sessions card. The table *is* the primary diff --git a/src/renderer/src/components/settings/Settings.tsx b/src/renderer/src/components/settings/Settings.tsx index 68cffee2b..089ef8e40 100644 --- a/src/renderer/src/components/settings/Settings.tsx +++ b/src/renderer/src/components/settings/Settings.tsx @@ -192,6 +192,7 @@ function Settings(): React.JSX.Element { // leak through into a normal reopen of Settings. const [hiddenExperimentalUnlocked, setHiddenExperimentalUnlocked] = useState(false) const contentScrollRef = useRef(null) + const searchInputRef = useRef(null) const terminalFontsLoadedRef = useRef(false) const pendingNavSectionRef = useRef(null) const pendingScrollTargetRef = useRef(null) @@ -220,6 +221,30 @@ function Settings(): React.JSX.Element { return () => document.removeEventListener('keydown', handleKeyDown) }, [closeSettingsPage]) + useEffect(() => { + const handleFindShortcut = (event: KeyboardEvent): void => { + if (event.defaultPrevented || event.altKey || event.shiftKey) { + return + } + // Why: Cmd on Mac, Ctrl elsewhere — matches the rest of the app's + // mod-key convention (see App.tsx) and aligns with platform Find norms. + const mod = isMac ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey + if (!mod || event.key.toLowerCase() !== 'f') { + return + } + const input = searchInputRef.current + if (!input) { + return + } + event.preventDefault() + input.focus() + input.select() + } + + document.addEventListener('keydown', handleFindShortcut) + return () => document.removeEventListener('keydown', handleFindShortcut) + }, [isMac]) + useEffect( () => () => { // Why: the settings search is a transient in-page filter. Leaving it behind makes the next @@ -603,6 +628,7 @@ function Settings(): React.JSX.Element { repoSections={repoNavSections} hasRepos={repos.length > 0} searchQuery={settingsSearchQuery} + searchInputRef={searchInputRef} onBack={closeSettingsPage} onSearchChange={setSettingsSearchQuery} onSelectSection={scrollToSection} diff --git a/src/renderer/src/components/settings/SettingsSidebar.tsx b/src/renderer/src/components/settings/SettingsSidebar.tsx index b23d2c655..ba10f88c5 100644 --- a/src/renderer/src/components/settings/SettingsSidebar.tsx +++ b/src/renderer/src/components/settings/SettingsSidebar.tsx @@ -1,7 +1,11 @@ +import type { RefObject } from 'react' import { ArrowLeft, Search, Server, type LucideIcon, type LucideProps } from 'lucide-react' +import { isMacUserAgent } from '@/components/terminal-pane/pane-helpers' import { Button } from '../ui/button' import { Input } from '../ui/input' +const SEARCH_SHORTCUT_HINT = isMacUserAgent() ? '⌘F' : 'Ctrl+F' + type NavSection = { id: string title: string @@ -20,6 +24,7 @@ type SettingsSidebarProps = { repoSections: RepoNavSection[] hasRepos: boolean searchQuery: string + searchInputRef?: RefObject onBack: () => void onSearchChange: (query: string) => void onSelectSection: ( @@ -34,6 +39,7 @@ export function SettingsSidebar({ repoSections, hasRepos, searchQuery, + searchInputRef, onBack, onSearchChange, onSelectSection @@ -56,11 +62,17 @@ export function SettingsSidebar({
onSearchChange(event.target.value)} placeholder="Search settings" - className="pl-9" + className="pl-9 pr-14" /> + {searchQuery === '' ? ( + + {SEARCH_SHORTCUT_HINT} + + ) : null}