refactor(ui): remove dead DS exports and unify wave gradient fallbacks (WS-G1)
Wave 5 G1 — evidence-based deletion only (docs/REFACTOR_WAVE5_AUDIT.md). Deleted (references = 0 repo-wide, grep verified): - apps/desktop/src/renderer/components/ProBadge.tsx (65 lines, self-reference only) - apps/admin/src/lib/supabase-server.ts (unused duplicate of the web wrapper; api-client already owns createSupabaseServerClient) - packages/ui: d3roSpace, d3roWeight, d3roMotion, darkTheme, lightTheme, getModePalette; `themes` kept module-private (used by getTheme) - packages/ui-native: d3roNativeSpace, d3roNativeWeight, d3roNativeMotion, d3roNativeOverlayShadow, D3roNativePaletteKey (+ barrel entries) Changed: - ds/AudioVisualizerBar, ds/GradientWave: SSR/무-문서 폴백 hex 대신 theme-raw RAW.dark.gradient 를 읽는다. 같은 색을 두 곳에 적지 않는다 (DP1). Verification: - npm run typecheck (desktop/web/admin/packages) GREEN - npm run lint --max-warnings=0 GREEN - npm run test GREEN - npm run typecheck:mobile, lint:mobile GREEN; test:mobile 599 GREEN - npm run check:design: 0 violations Kept (with reason): apps/desktop/src/preload/popup.ts (electron-vite entry), apps/*/src/proxy.ts (Next middleware), instrumentation.ts, *.d.ts, constants.ts WAVE_BAR (화면 고유 수치, P4).
This commit is contained in:
parent
f57e40d82a
commit
b8b91901eb
7 changed files with 25 additions and 135 deletions
|
|
@ -6,6 +6,10 @@
|
|||
import React, { useRef, useEffect } from 'react'
|
||||
import { Box, type BoxProps } from '@mui/material'
|
||||
import { d3roRadius } from '../../theme'
|
||||
import { RAW } from '../../theme-raw'
|
||||
|
||||
/** SSR/무-문서 환경 폴백 — 테마 원시값에서 가져온다(하드코딩 hex 금지). */
|
||||
const WAVE_FALLBACK = RAW.dark.gradient
|
||||
|
||||
export interface AudioVisualizerBarProps extends Omit<BoxProps, 'children'> {
|
||||
/** Real-time normalized audio RMS level (0.0 to 1.0) */
|
||||
|
|
@ -23,14 +27,15 @@ export interface AudioVisualizerBarProps extends Omit<BoxProps, 'children'> {
|
|||
}
|
||||
|
||||
function readVisualizerColors(): [string, string, string, string] {
|
||||
if (typeof document === 'undefined') return ['#60a5fa', '#3b82f6', '#818cf8', '#a78bfa']
|
||||
const fallback = [WAVE_FALLBACK.wave1, WAVE_FALLBACK.wave2, WAVE_FALLBACK.wave3, WAVE_FALLBACK.wave4]
|
||||
if (typeof document === 'undefined') return [fallback[0], fallback[1], fallback[2], fallback[3]]
|
||||
const style = getComputedStyle(document.documentElement)
|
||||
const read = (name: string, fallback: string): string => style.getPropertyValue(name).trim() || fallback
|
||||
const read = (name: string, fb: string): string => style.getPropertyValue(name).trim() || fb
|
||||
return [
|
||||
read('--d3-gradient-wave1', '#60a5fa'),
|
||||
read('--d3-gradient-wave2', '#3b82f6'),
|
||||
read('--d3-gradient-wave3', '#818cf8'),
|
||||
read('--d3-gradient-wave4', '#a78bfa'),
|
||||
read('--d3-gradient-wave1', fallback[0]),
|
||||
read('--d3-gradient-wave2', fallback[1]),
|
||||
read('--d3-gradient-wave3', fallback[2]),
|
||||
read('--d3-gradient-wave4', fallback[3]),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@
|
|||
|
||||
import { useRef, useEffect } from 'react'
|
||||
import { Box } from '@mui/material'
|
||||
import { RAW } from '../../theme-raw'
|
||||
|
||||
/** SSR/무-문서 환경 폴백 — 테마 원시값에서 가져온다(하드코딩 hex 금지). */
|
||||
const WAVE_FALLBACK = RAW.dark.gradient
|
||||
|
||||
interface GradientWaveProps {
|
||||
/** 실시간 오디오 레벨 0~1 (없으면 유휴 애니메이션만) */
|
||||
|
|
@ -27,15 +31,16 @@ interface GradientWaveProps {
|
|||
|
||||
/** :root에 주입된 웨이브 그라디언트 스톱을 읽는다 */
|
||||
function readWaveColors(): [string, string, string, string] {
|
||||
if (typeof document === 'undefined') return ['#60a5fa', '#3b82f6', '#818cf8', '#a78bfa']
|
||||
const fallback = [WAVE_FALLBACK.wave1, WAVE_FALLBACK.wave2, WAVE_FALLBACK.wave3, WAVE_FALLBACK.wave4]
|
||||
if (typeof document === 'undefined') return [fallback[0], fallback[1], fallback[2], fallback[3]]
|
||||
const style = getComputedStyle(document.documentElement)
|
||||
const read = (name: string, fallback: string): string =>
|
||||
style.getPropertyValue(name).trim() || fallback
|
||||
const read = (name: string, fb: string): string =>
|
||||
style.getPropertyValue(name).trim() || fb
|
||||
return [
|
||||
read('--d3-gradient-wave1', '#60a5fa'),
|
||||
read('--d3-gradient-wave2', '#3b82f6'),
|
||||
read('--d3-gradient-wave3', '#818cf8'),
|
||||
read('--d3-gradient-wave4', '#a78bfa'),
|
||||
read('--d3-gradient-wave1', fallback[0]),
|
||||
read('--d3-gradient-wave2', fallback[1]),
|
||||
read('--d3-gradient-wave3', fallback[2]),
|
||||
read('--d3-gradient-wave4', fallback[3]),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue