@@ -192,6 +192,7 @@ function Settings(): React.JSX.Element {
192192 // leak through into a normal reopen of Settings.
193193 const [ hiddenExperimentalUnlocked , setHiddenExperimentalUnlocked ] = useState ( false )
194194 const contentScrollRef = useRef < HTMLDivElement | null > ( null )
195+ const searchInputRef = useRef < HTMLInputElement | null > ( null )
195196 const terminalFontsLoadedRef = useRef ( false )
196197 const pendingNavSectionRef = useRef < string | null > ( null )
197198 const pendingScrollTargetRef = useRef < string | null > ( null )
@@ -220,6 +221,30 @@ function Settings(): React.JSX.Element {
220221 return ( ) => document . removeEventListener ( 'keydown' , handleKeyDown )
221222 } , [ closeSettingsPage ] )
222223
224+ useEffect ( ( ) => {
225+ const handleFindShortcut = ( event : KeyboardEvent ) : void => {
226+ if ( event . defaultPrevented || event . altKey || event . shiftKey ) {
227+ return
228+ }
229+ // Why: Cmd on Mac, Ctrl elsewhere — matches the rest of the app's
230+ // mod-key convention (see App.tsx) and aligns with platform Find norms.
231+ const mod = isMac ? event . metaKey && ! event . ctrlKey : event . ctrlKey && ! event . metaKey
232+ if ( ! mod || event . key . toLowerCase ( ) !== 'f' ) {
233+ return
234+ }
235+ const input = searchInputRef . current
236+ if ( ! input ) {
237+ return
238+ }
239+ event . preventDefault ( )
240+ input . focus ( )
241+ input . select ( )
242+ }
243+
244+ document . addEventListener ( 'keydown' , handleFindShortcut )
245+ return ( ) => document . removeEventListener ( 'keydown' , handleFindShortcut )
246+ } , [ isMac ] )
247+
223248 useEffect (
224249 ( ) => ( ) => {
225250 // 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 {
603628 repoSections = { repoNavSections }
604629 hasRepos = { repos . length > 0 }
605630 searchQuery = { settingsSearchQuery }
631+ searchInputRef = { searchInputRef }
606632 onBack = { closeSettingsPage }
607633 onSearchChange = { setSettingsSearchQuery }
608634 onSelectSection = { scrollToSection }
0 commit comments