Skip to content

keyboard subsystem: Phase 4 cleanup, consolidation, rename

Created by: jedmund

Summary

Final phase of the keyboard subsystem rework: cleanup, consolidation, and renames that only made sense once every caller was on KeyboardContainer.

  • Rehome pitchRange helper. Moves pitchRange(startOctave:endOctave:) off the renderer and onto KeyboardContainerConfig. Updates 7 call sites (KeyboardCoordinator, PlayableKeyboardView, PlaygroundScreen, ScaleBuilderExercise, ModeExplorerView, ScaleExplorerView, plus shared usages).
  • Move KeyboardLabelMode to Models/. It's a model-layer enum that KeyboardPresentation already depended on; keeping it in the view-layer renderer file inverted the dependency graph.
  • Rename SynthKeyboardViewPianoKeys. Subviews renamed to WhiteKey / BlackKey (stay private). File moves from Views/Tools/PlayableKeyboard/ to Views/Components/KeyboardContainer/. Container docstring updated. File-top doc notes that future input surfaces (DrumPads, StepGrid, XYPad) will be peer renderers in sibling containers, not subtypes.

Stacks on top of phase 3 (ContentKeyboardPanel migration).

Invariants verified (grep)

  • SynthKeyboardView / SynthWhiteKey / SynthBlackKey - zero hits app-wide
  • PianoKeys( - only in KeyboardContainer+Docked.swift and KeyboardContainer+Contained.swift
  • SynthKeyboardView.pitchRange - zero hits
  • .offset(y: inside keyboard-using callers - zero hits (Playground's remaining .offset(y:) uses are unrelated animations)
  • ScrollDisabler - only inside KeyboardContainer/ folder + its original definition in Views/Lesson/

Test plan

  • Project builds for iOS simulator
  • Docked keyboard (PlayableKeyboard exercises) still renders and plays
  • Contained keyboards (VirtualSynth, ModMatrix, ScaleExplorer, ModeExplorer, ScaleBuilder, Playground, lesson content panel) still render and play
  • Overlays (step arcs, degree labels) still align with keys in all contexts

Merge request reports

Loading