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
Lint Fixes:
- Fix setState in useEffect warnings by using lazy initialization and useLayoutEffect
- Remove unused parameters and variables (patterns, zoomed)
- Add eslint-disable comments for legitimate patterns (hydration, cleanup)
- Fix ref mutation warnings in cleanup functions
Code Optimizations:
- Remove dead Patterns interface and regex objects from CodePreview
- Simplify tokenizeLine to use combined regex directly
- Use lazy state initialization in ThemeProvider to avoid SSR mismatch
- Split audio preload and mount state into separate effects
- Use useLayoutEffect for synchronous DOM updates (terminalOpacity reset)
- Improve cleanup by copying ref values before use
- Add proper cancelAnimationFrame cleanup for fade animation
Result: ✓ All lint errors fixed, production build successful
- Next.js static site in docs/ with SN Pro font and WarText headline
- 4 phosphor themes (Green, Amber, White, Red) with localStorage persistence
- Animated cloud background tinted to active theme
- SF Symbols icons via sf-symbols-lib/hierarchical
- PackageBadge with copy-to-clipboard, version from CI tag
- CI workflow builds landing page + DocC, deploys to GitHub Pages
- Version auto-resolved from git tags on deploy