perf: optimize app startup and background lifecycles
This commit is contained in:
@@ -82,7 +82,7 @@ export function LearningSidebar({ sidebarCollapsed }: LearningSidebarProps) {
|
||||
aria-current={catalogActive ? 'page' : undefined}
|
||||
onClick={() => navigate('/learning')}
|
||||
className={cn(
|
||||
'motion-press flex min-h-9 w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm font-semibold transition-colors active:scale-[0.985]',
|
||||
'motion-press flex min-h-9 w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm font-semibold transition-colors duration-100',
|
||||
catalogActive ? 'bg-brand-soft text-foreground' : 'text-foreground hover:bg-surface-subtle',
|
||||
sidebarCollapsed && 'justify-center px-0',
|
||||
)}
|
||||
@@ -96,7 +96,7 @@ export function LearningSidebar({ sidebarCollapsed }: LearningSidebarProps) {
|
||||
aria-label="生成课程"
|
||||
onClick={() => navigate('/learning?generate=1')}
|
||||
className={cn(
|
||||
'motion-press mt-1 flex min-h-9 w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm font-medium text-foreground transition-colors hover:bg-surface-subtle active:scale-[0.985]',
|
||||
'motion-press mt-1 flex min-h-9 w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm font-medium text-foreground transition-colors duration-100 hover:bg-surface-subtle',
|
||||
sidebarCollapsed && 'justify-center px-0',
|
||||
)}
|
||||
>
|
||||
@@ -146,7 +146,7 @@ export function LearningSidebar({ sidebarCollapsed }: LearningSidebarProps) {
|
||||
disabled={downloading === course.id}
|
||||
onClick={() => void openCourse(course)}
|
||||
className={cn(
|
||||
'motion-press group/course flex w-full items-center gap-2 rounded-xl px-2.5 py-2 text-left transition-[background-color,color,transform] active:scale-[0.985]',
|
||||
'motion-press group/course flex w-full items-center gap-2 rounded-xl px-2.5 py-2 text-left transition-colors duration-100',
|
||||
isActive ? 'bg-brand-selected text-foreground ring-1 ring-brand/20' : 'hover:bg-surface-tertiary',
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user