File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,6 +291,11 @@ const Sidebar: React.FC<SidebarProps> = (props) => {
291291 return map ;
292292 } , [ commands ] ) ;
293293
294+ const focusSearchShortcutString = useMemo ( ( ) => {
295+ const command = commandMap . get ( 'document-tree-focus-search' ) ;
296+ return command ?. shortcutString ?? null ;
297+ } , [ commandMap ] ) ;
298+
294299 const getEffectiveShortcut = useCallback ( ( commandId : string ) : string [ ] | null => {
295300 const custom = customShortcuts [ commandId ] ;
296301 if ( custom && custom . length > 0 ) {
@@ -500,8 +505,13 @@ const Sidebar: React.FC<SidebarProps> = (props) => {
500505 value = { searchTerm }
501506 onChange = { ( e ) => setSearchTerm ( e . target . value ) }
502507 onKeyDown = { handleSearchKeyDown }
503- className = " w-full bg-background border border-border-color rounded-md pl-9 pr-9 py-1 text-xs text-text-main focus:ring-2 focus:ring-primary focus:outline-none placeholder:text-text-secondary"
508+ className = { ` w-full bg-background border border-border-color rounded-md pl-9 py-1 text-xs text-text-main focus:ring-2 focus:ring-primary focus:outline-none placeholder:text-text-secondary ${ focusSearchShortcutString && ! searchTerm . trim ( ) ? 'pr-24' : 'pr-9' } ` }
504509 />
510+ { focusSearchShortcutString && ! searchTerm . trim ( ) && (
511+ < span className = "pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-[10px] font-medium uppercase tracking-wide text-text-tertiary" >
512+ { focusSearchShortcutString }
513+ </ span >
514+ ) }
505515 { searchTerm . trim ( ) && (
506516 < button
507517 type = "button"
You can’t perform that action at this time.
0 commit comments