Skip to content

Source Spec 002

Reese Hodge edited this page Sep 26, 2026 · 1 revision

Source Spec 002

This page distills frozen Spec Kit source 002. The active current-state truth is Feature-Volume-Knob. The spec directory has been removed from the active tree, so provenance is pinned to d3cf582 rather than cited as a live path.

Provenance

  • specs/002-volume-knob-up-down/spec.md@d3cf582: product scope, clarifications, user stories, requirements, entities, success criteria, assumptions, and exclusions.
  • specs/002-volume-knob-up-down/plan.md@d3cf582: implementation plan, constraints, component shape, TDD cycles, test strategy, and gotchas.
  • specs/002-volume-knob-up-down/tasks.md@d3cf582: dependency-ordered task list T001-T030 and FR-to-task traceability.

This source is superseded by the wiki per Wiki-Conventions: once the feature moved out of Spec Kit, Feature-Volume-Knob became the place to track current status, drift, and future implementation notes.

Product intent

The volume knob was specified to stop being a one-way wraparound control. Existing behavior raised volume one step per click and wrapped from step 11 back to 0. The desired behavior is a real-knob model: turn up, turn down, and stop at the ends.

The existing 12-step model remains unchanged:

  • Step range: 0..11.
  • Gain curve: step / 11.
  • LED bar: 11 visible segments.
  • Volume state: session-only; no persistence.

User stories

  1. P1: Turn volume down and stop at the ends. Right half raises, left half lowers, maximum and minimum clamp, and disabled state is inert.
  2. P2: Adjust by wheel or keyboard. Wheel over the knob raises or lowers, arrow keys adjust one step, Home/End jump to min/max, unrelated keys do nothing.
  3. P3: See the knob turn. A separate pointer rotates with a springy settle and respects reduced-motion preferences.

Requirements preserved

  • FR-001 to FR-004: raise and lower volume, clamp at both ends, and avoid redundant change notifications when already at an end.
  • FR-005 to FR-007: wheel and keyboard controls, with handled keys preventing page scroll.
  • FR-008 to FR-010: distinct accessible names, accessible value exposure, and inert/unavailable disabled behavior.
  • FR-011 to FR-012: preserve the 12-position model, step / 11 gain, and LED readout.
  • FR-013 to FR-016: rotating indicator, springy overshoot, no pointer-event interception, and reduced-motion support.
  • FR-017 to FR-018: preserve hit-area alignment and do not modify the TV frame artwork.

Implementation plan distilled

The plan deliberately uses TDD:

  1. Add pure volume helpers and tests.
  2. Split the hit-area into up/down halves.
  3. Replace wraparound with clamp behavior.
  4. Add keyboard support.
  5. Add mouse wheel support.
  6. Add rotating indicator CSS and component markup.
  7. Add reduced-motion CSS.
  8. Add App integration coverage.
  9. Add Playwright E2E coverage, including the unchanged panel-alignment test.

The planned component shape:

div.volume-knob-wrapper
  div.volume-knob
    div.volume-knob-indicator
    button.volume-knob-half--down
    button.volume-knob-half--up
  div.volume-led-bar

Constraints and traps

  • .volume-knob is an invisible hit-area over painted pixels and must keep its size and position.
  • panel-alignment.spec.ts asserts that geometry across multiple viewports.
  • The brass knob is baked into TV-frame.png; the animation must be an overlay, not a rotation or replacement of the artwork.
  • If .volume-knob changes from <button> to <div>, :disabled no longer matches; use a disabled class.
  • The rotating indicator needs pointer-events: none.
  • Fractional gains and angles require approximate assertions.
  • The old wraparound test should be deleted, not skipped, because it describes behavior the feature removes.

Out of scope

The frozen spec excludes drag-to-rotate, swipe gestures, persisted volume, mute, step-count changes, gain-curve changes, and unrelated reduced-motion refactors.

See Feature-Volume-Knob, Gotchas, and Index.

Clone this wiki locally