You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#84 made key-driven recompilation work. What is missing is a written contract for what callers may rely on. Three rules, each verified against the runtime source:
Every value read inside content is frozen at compile time. The internal composition is created, composed once, and disposed (Jindong.kt:120-127); there is no recomposition path. Keys are the only recompile trigger.
Keys are playback triggers. Put state in keys exactly when its change should fire playback. A slider value passed as a key fires a vibration on every drag step; state that only shapes the pattern belongs inside content. The sample app hit this distinction in review (feat: rebuild sample app as an 8-screen haptic verification harness #86).
Cancel-and-restart is best effort. A key change cancels the in-flight playback before starting the new one, with ordering guaranteed by the manager's state lock (HapticManager.kt:126-149). Neither Vibrator.cancel() nor CHHapticPatternPlayer.stop reports completion, so a few milliseconds of physical overlap are possible.
Scope
KDoc on Jindong plus a documentation page covering the three rules.
Document the value-embedding idiom Jindong(pattern) { Clip(pattern) }. A Jindong(pattern, vararg keys) overload was prototyped and dropped: Jindong(p) { ... } resolves to the existing vararg overload with p as a key, which compiles and silently plays the lambda instead of the pattern.
Regression tests: a parameter change without a key must not re-fire; a key change must.
Related: #56 covers suppressing playback on initial composition, which belongs to the same contract.
Summary
#84 made key-driven recompilation work. What is missing is a written contract for what callers may rely on. Three rules, each verified against the runtime source:
contentis frozen at compile time. The internal composition is created, composed once, and disposed (Jindong.kt:120-127); there is no recomposition path. Keys are the only recompile trigger.keysexactly when its change should fire playback. A slider value passed as a key fires a vibration on every drag step; state that only shapes the pattern belongs insidecontent. The sample app hit this distinction in review (feat: rebuild sample app as an 8-screen haptic verification harness #86).HapticManager.kt:126-149). NeitherVibrator.cancel()norCHHapticPatternPlayer.stopreports completion, so a few milliseconds of physical overlap are possible.Scope
Jindongplus a documentation page covering the three rules.Jindong(pattern) { Clip(pattern) }. AJindong(pattern, vararg keys)overload was prototyped and dropped:Jindong(p) { ... }resolves to the existing vararg overload withpas a key, which compiles and silently plays the lambda instead of the pattern.Related: #56 covers suppressing playback on initial composition, which belongs to the same contract.
Depends on #90.