@@ -2,8 +2,10 @@ import { useState } from 'react';
22import { Tooltip , Avatar , theme } from 'antd' ;
33import { MessageSquare , Router , FolderOpen , User } from 'lucide-react' ;
44import { useTranslation } from 'react-i18next' ;
5- import { useUIStore } from '@/stores' ;
5+ import { useUIStore , useSettingsStore } from '@/stores' ;
66import { useUserProfileStore } from '@/stores/userProfileStore' ;
7+ import { getShortcutBinding , formatShortcutForDisplay } from '@/lib/shortcuts' ;
8+ import type { ShortcutAction } from '@/lib/shortcuts' ;
79import { useResolvedAvatarSrc } from '@/hooks/useResolvedAvatarSrc' ;
810import { UserProfileModal } from './UserProfileModal' ;
911import type { PageKey } from '@/types' ;
@@ -22,11 +24,21 @@ export function Sidebar() {
2224 const profile = useUserProfileStore ( ( s ) => s . profile ) ;
2325 const [ profileModalOpen , setProfileModalOpen ] = useState ( false ) ;
2426 const resolvedAvatarSrc = useResolvedAvatarSrc ( profile . avatarType , profile . avatarValue ) ;
27+ const settings = useSettingsStore ( ( s ) => s . settings ) ;
28+
29+ const NAV_SHORTCUT_MAP : Partial < Record < PageKey , ShortcutAction > > = {
30+ gateway : 'toggleGateway' ,
31+ } ;
2532
2633 const renderNavButton = ( item : { key : PageKey ; icon : React . ReactNode ; labelKey : string } ) => {
2734 const isActive = activePage === item . key ;
35+ const label = t ( item . labelKey ) ;
36+ const action = NAV_SHORTCUT_MAP [ item . key ] ;
37+ const title = action
38+ ? `${ label } (${ formatShortcutForDisplay ( getShortcutBinding ( settings , action ) ) } )`
39+ : label ;
2840 return (
29- < Tooltip key = { item . key } title = { t ( item . labelKey ) } placement = "right" >
41+ < Tooltip key = { item . key } title = { title } placement = "right" >
3042 < button
3143 onClick = { ( ) => setActivePage ( item . key ) }
3244 className = "flex items-center justify-center text-base transition-colors"
0 commit comments