Repository navigation
Component Volume Knob
The volume knob is an invisible clickable hit area over the TV artwork plus an 11-segment LED bar. It exists today as a controlled React component; volume storage is local to Component-Frontend-App, and gain application happens through Component-Audio-Chain. The related feature page is Feature-Volume-Knob.
-
packages/frontend/src/components/VolumeKnob.tsxrenders the control and converts continuous gain to discrete steps. -
packages/frontend/src/App.tsxowns[volume, setVolume] = useState(6 / 11), passes props intoVolumeKnob, and callsaudioChain.setVolume(volume)(the chain is a lazyuseStatevalue, not a ref). -
packages/frontend/src/App.csspositions.volume-knob-wrapper, styles.volume-knob,.volume-led-bar,.volume-led,.volume-led--lit,.volume-led--dim, and.volume-led--max. -
packages/frontend/src/stores/voiceStore.tswas checked because it is related voice state, but it does not contain volume state today.
VolumeKnob.tsx exports:
export function VolumeKnob({
volume,
onVolumeChange,
disabled,
}: VolumeKnobProps)Internal prop shape:
interface VolumeKnobProps {
volume: number;
onVolumeChange: (volume: number) => void;
disabled: boolean;
}Internal helpers:
-
gainToStep(volume: number): numberroundsvolume * 11and clamps to0..11. -
stepToGain(step: number): numberreturns0for step0, otherwisestep / 11.
voiceStore.ts exports useVoiceStore, whose state is isSpeaking, isMouthOpen, isMicActive, and isGreeting; it has no volume, setVolume, or persisted audio-level action.
-
MAX_STEP = 11andLED_COUNT = 11. - The app starts at step 6 for audible base volume. The indicator maps every volume step proportionally across the calibrated arc from -235 degrees at step 0 (bottom-left) to 45 degrees at step 11 (down-right), placing step 6 at about 55% of the arc.
- Clicking cycles
0 -> 1 -> ... -> 11 -> 0. - External volume remains the normalized gain contract
0..1. - The button exposes
aria-valuemin={0},aria-valuemax={11},aria-valuenow={step}, andaria-valuetext. - Step 11 changes
aria-valuetextto11 of 11 — one louder. - LED segments
1..stepare lit unless disabled. - The eleventh LED gets
volume-led--maxand, when lit, a warm accent color. - The component does not handle drag, wheel, keyboard-specific increments, or persisted volume.
App places VolumeKnob in controlPanel, which CrtFrame renders inside .crt-panel. CSS positions the wrapper at top: 40.1% inside the panel. The button itself is transparent and circular (width: 55%; aspect-ratio: 1 / 1) so it acts as a hit target over the painted brass knob in the TV image. The LED bar sits below it with 11 flexed segments.
- The current implementation is click-to-cycle only. Any specified richer physical knob behavior is not present in code today.
- Volume is not owned by
voiceStore; it is local React state inApp.tsx. Reloading the app resets it to step 6 (6 / 11gain). Turning the TV off and on preserves the selected step. - Disabled state dims LEDs by leaving them unlit even if the underlying volume state is non-zero.
- Concept-Cloud-Only-Inference
- Concept-Budget-Ceiling
- Concept-Personality-Gate
- Concept-IP-And-Legal-Posture
- Concept-Supply-Chain-Discipline
- Concept-Graceful-Degradation
- Concept-Observability
- Concept-Testing-And-TDD
- Concept-Credential-Hygiene
Editing in the browser? Wiki edits are live and bypass wiki:lint. Read
Guide-Wiki-Contributing first.