mirror of
https://github.com/phranck/TUIkit.git
synced 2026-06-20 09:54:37 +00:00
Performance & memory: - HeroTerminal: fix setInterval one-time random (now recursive setTimeout), reuse single Howl for seeks, track all timers via pendingTimersRef - RainOverlay: cap at 30fps, skip on prefers-reduced-motion - SpinnerLights: pre-compute boxShadow at spawn, nextId in useRef - Remove eager audio preloads from <head> (Howler loads lazily) - CloudBackground: remove unnecessary 'use client' (now Server Component) Type safety & correctness: - Import BootStep/SchoolStep/JoshuaStep/TerminalEntry from terminal-parser instead of duplicating interfaces; typed terminal-data.ts export - ThemeProvider: isTheme() type guard replaces unsafe 'as Theme' casts, instanceof guard for event.target, try/catch on localStorage.setItem - useCopyToClipboard: cancel previous timer on rapid clicks, try/catch around clipboard API, cleanup on unmount - TerminalScreen: use config.initialCursorDelay instead of magic 18000, type predicate for filter(), track glitch reset timer for cleanup Accessibility (WCAG): - prefers-reduced-motion: global CSS rule + JS skip in Rain/Spinner/Glitch - aria-hidden on decorative elements (Rain, Spinner, Clouds) - focus-visible ring on ThemeSwitcher, CodePreview, PackageBadge buttons - aria-pressed on active theme button, nav aria-label, main tabIndex Code quality: - Extract useCopyToClipboard hook (CodePreview + PackageBadge) - bg-frosted-glass CSS utility replaces 3x inline color-mix - hover:bg-white/* → hover:bg-foreground/* for theme consistency - Remove dead zoomed prop, stale eslint-disable, move lineRefsRef up - import type for ReactNode in FeatureCard