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
pitchRangehelper. MovespitchRange(startOctave:endOctave:)off the renderer and ontoKeyboardContainerConfig. Updates 7 call sites (KeyboardCoordinator,PlayableKeyboardView,PlaygroundScreen,ScaleBuilderExercise,ModeExplorerView,ScaleExplorerView, plus shared usages). -
Move
KeyboardLabelModetoModels/. It's a model-layer enum thatKeyboardPresentationalready depended on; keeping it in the view-layer renderer file inverted the dependency graph. -
Rename
SynthKeyboardView→PianoKeys. Subviews renamed toWhiteKey/BlackKey(stay private). File moves fromViews/Tools/PlayableKeyboard/toViews/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 inKeyboardContainer+Docked.swiftandKeyboardContainer+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 insideKeyboardContainer/folder + its original definition inViews/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