@@ -16,24 +16,26 @@ import { useAuth } from '@/lib/auth/AuthContext';
1616import { useTheme } from '@/hooks/useTheme' ;
1717import { SPRING , BEAT } from '@/lib/animation/springConfig' ;
1818import { soundPlayer } from '@/lib/audio/SoundPlayer' ;
19+ import { useIsNewbiePhase } from '@/features/onboarding/firstDive/useFirstDiveStore' ;
1920import FeedbackPanel from './FeedbackPanel' ;
2021
2122/* ── 导航配置 ── */
23+ // subtitle:新手期双标签副标题(隐喻名无法自解释,首潜完成前附直白说明)
2224const navSection1 = [
2325 { to : '/' , label : '首页' , icon : Home , shortcut : '⌘ 1' , exact : true } ,
2426] ;
2527
2628const navSection2 = [
27- { to : '/pomodoro' , label : '深潜' , icon : Timer , shortcut : '⌘ 2' , dotColor : 'bg-brand-500' } ,
28- { to : '/notes' , label : '结礁' , icon : FileText , shortcut : '⌘ 3' , dotColor : 'bg-note' } ,
29- { to : '/flashcards' , label : '反衰减呼吸' , icon : Layers , shortcut : '⌘ 4' , dotColor : 'bg-flashcard' } ,
30- { to : '/feynman' , label : '浮出水面' , icon : Lightbulb , shortcut : '⌘ 5' , dotColor : 'bg-feynman' } ,
29+ { to : '/pomodoro' , label : '深潜' , subtitle : '专注番茄钟' , icon : Timer , shortcut : '⌘ 2' , dotColor : 'bg-brand-500' } ,
30+ { to : '/notes' , label : '结礁' , subtitle : '学习笔记' , icon : FileText , shortcut : '⌘ 3' , dotColor : 'bg-note' } ,
31+ { to : '/flashcards' , label : '反衰减呼吸' , subtitle : '记忆闪卡' , icon : Layers , shortcut : '⌘ 4' , dotColor : 'bg-flashcard' } ,
32+ { to : '/feynman' , label : '浮出水面' , subtitle : '费曼讲解' , icon : Lightbulb , shortcut : '⌘ 5' , dotColor : 'bg-feynman' } ,
3133] ;
3234
3335const navSection3 = [
3436 { to : '/analytics' , label : '数据分析' , icon : BarChart3 , shortcut : '⌘ 6' } ,
35- { to : '/inspiration' , label : '萤火海沟' , icon : Sparkles , shortcut : '⌘ 6' } ,
36- { to : '/classroom' , label : '回声定位' , icon : Clapperboard , shortcut : '⌘ 7' , dotColor : 'bg-classroom' } ,
37+ { to : '/inspiration' , label : '萤火海沟' , subtitle : '灵感收集' , icon : Sparkles , shortcut : '⌘ 6' } ,
38+ { to : '/classroom' , label : '回声定位' , subtitle : '课堂采集' , icon : Clapperboard , shortcut : '⌘ 7' , dotColor : 'bg-classroom' } ,
3739] ;
3840
3941/* ── 蔡格尼克效应:待继续任务提示池 ── */
@@ -73,6 +75,8 @@ export default function Sidebar() {
7375 const setCaptureOpen = useCaptureStore ( ( s ) => s . setOpen ) ;
7476 const { user, isAuthenticated } = useAuth ( ) ;
7577 const { theme, toggleTheme } = useTheme ( ) ;
78+ // 新手期显示模块副标题(首潜完成后自动隐去)
79+ const isNewbie = useIsNewbiePhase ( ) ;
7680
7781 // TODO: 接入真实学习进度数据
7882 const _progressItems : { subject : string ; progress : number } [ ] = [ ] ;
@@ -194,9 +198,10 @@ export default function Sidebar() {
194198 </ motion . div >
195199 ) }
196200 { collapsed && < div className = "my-1 mx-1.5 border-t border-border/20" /> }
197- { navSection2 . map ( ( { to, label, icon : Icon , shortcut, dotColor } , i ) => (
201+ { navSection2 . map ( ( { to, label, subtitle , icon : Icon , shortcut, dotColor } , i ) => (
198202 < SidebarItem
199203 key = { to } to = { to } label = { label } icon = { Icon }
204+ subtitle = { isNewbie ? subtitle : undefined }
200205 shortcut = { collapsed ? undefined : shortcut }
201206 dotColor = { dotColor } collapsed = { collapsed } index = { i + 1 }
202207 />
@@ -209,9 +214,10 @@ export default function Sidebar() {
209214 </ div >
210215 ) }
211216 { collapsed && < div className = "my-1 mx-1.5 border-t border-border/20" /> }
212- { navSection3 . map ( ( { to, label, icon : Icon , shortcut, dotColor } , i ) => (
217+ { navSection3 . map ( ( { to, label, subtitle , icon : Icon , shortcut, dotColor } , i ) => (
213218 < SidebarItem
214219 key = { to } to = { to } label = { label } icon = { Icon }
220+ subtitle = { isNewbie ? subtitle : undefined }
215221 shortcut = { collapsed ? undefined : shortcut }
216222 dotColor = { dotColor } collapsed = { collapsed } index = { i + 6 }
217223 />
@@ -316,6 +322,8 @@ export default function Sidebar() {
316322interface SidebarItemProps {
317323 to : string ;
318324 label : string ;
325+ /** 新手期双标签副标题(如"专注番茄钟"),传入即显示 */
326+ subtitle ?: string ;
319327 icon : React . ComponentType < { className ?: string ; strokeWidth ?: string | number } > ;
320328 shortcut ?: string ;
321329 dotColor ?: string ;
@@ -324,7 +332,7 @@ interface SidebarItemProps {
324332 index ?: number ;
325333}
326334
327- function SidebarItem ( { to, label, icon : Icon , shortcut, dotColor, collapsed, end, index = 0 } : SidebarItemProps ) {
335+ function SidebarItem ( { to, label, subtitle , icon : Icon , shortcut, dotColor, collapsed, end, index = 0 } : SidebarItemProps ) {
328336 const location = useLocation ( ) ;
329337 // 切换到不同模块时播放导航音效(点击当前已激活项不响)
330338 const isCurrentActive = end ? location . pathname === to : location . pathname === to || location . pathname . startsWith ( to + '/' ) ;
@@ -383,6 +391,9 @@ function SidebarItem({ to, label, icon: Icon, shortcut, dotColor, collapsed, end
383391 isActive ? 'opacity-100' : 'opacity-60 group-hover:opacity-100' ,
384392 ) } >
385393 { label }
394+ { subtitle && (
395+ < span className = "ml-1.5 text-[11px] text-text-tertiary/70" > · { subtitle } </ span >
396+ ) }
386397 </ span >
387398 ) }
388399 { /* 快捷键提示 — hover 显示 */ }
0 commit comments