Skip to content

keyboard migration: ContentKeyboardPanel onto contained container

Created by: jedmund

Summary

Migrates the lesson/content keyboard panel (Views/Lesson/SharedKeyboardView.swift) off its hand-rolled inner shell and onto KeyboardContainer with .contained + declarative overlays.

  • Drops the local Color(white:0.1) rounded rect, 12pt inner padding, and the two .overlay(alignment: .top) blocks with hand-computed .offset(y:) math.
  • Degree labels + step arcs now travel through config.overlays with stable ids (degree-labels first so it stacks on top of step-arcs).
  • config.isScrollSafe = true explicitly, since .contained defaults to false — fixes the paging ScrollView stealing touches while keys are held.
  • Memoizes highlights into @State, updated via .onChange of active pitches, selected sequence notes, and page id, instead of rebuilding a PitchSet per frame.
  • Preserves the outer interactiveBackground card + 20pt padding + caption below the keyboard, and the callout reveal hook for attached callouts.

Stacks on top of phase 2 (PlayableKeyboard migration).

Test plan

  • Project builds for iOS simulator
  • Lesson right-slot keyboard still renders diagrams with degree labels + step arcs stacked above keys
  • Captions still appear below the keyboard inside the card
  • Scrolling between lesson pages while holding a key no longer steals the touch
  • Attached-callout pages still reveal on key press

Merge request reports

Loading