Apple Watch: Sound-effects and vibrate settings, build scripts

This commit is contained in:
James Babcock committed 2026-11-04 03:04:43 -08:00
1 parent 2696f3b76c
commit 6df52021c8
13 files changed
+117 -29

No files matched your search

+7
View File
@@ -127,6 +127,7 @@ function loadRemote({ phase = 'disconnected', preview = false, now = 1_800_000_0
'../ui/dashboard-settings': {
onAnySettingChanged() {}, watchCanUnlockSetting: setting(true), watchCrownClockwiseNextSetting: setting(false),
watchMirrorAssistantSetting: setting(true), watchRemoteEnabledSetting: setting(true),
watchVibrateOnInputSetting: setting(true), watchSoundEffectsSetting: setting(false),
},
'../ui/shell/shell': { shell },
'../ui/shell/voice-activity': { voiceActivity: { subscribe() {}, isActive: () => false } },
@@ -207,6 +208,12 @@ test('a watch that does not know its battery shows no level, not an empty one',
assert.equal(levels.watch, null);
});
test('the mirrored state carries the Apple Watch feedback settings', () => {
const state = loadRemote({ preview: true }).remote.buildState();
assert.equal(state.vibrateOnInput, true);
assert.equal(state.soundEffects, false);
});
test('the mirrored state says when gestures are landing on the preview', () => {
const state = loadRemote({ preview: true }).remote.buildState();
assert.equal(state.preview, true);
+3 -2
View File
@@ -123,7 +123,7 @@ do {
"screenOn":true,"locked":false,"worn":null,"listening":false,"battery":78,"charging":false,"silentMode":false,
"caseBattery":64,"caseCharging":null,"foreground":{"appId":"music","title":"Music"},
"windows":[{"windowId":"w1","title":"Music","appId":"music","focused":true,"closeable":false,"acceptsText":true}],
"apps":[{"appId":"timer","title":"Timer"}],"remoteEnabled":true,"crownClockwiseNext":true,"canUnlock":false,
"apps":[{"appId":"timer","title":"Timer"}],"remoteEnabled":true,"vibrateOnInput":false,"soundEffects":true,"canUnlock":false,
"mirrorAssistant":true,"assistantAvailable":true}
"""
let state = PhoneState.parse(json, updatedAt: 42)
@@ -134,7 +134,7 @@ do {
check(state?.foreground == AppEntry(appId: "music", title: "Music"), "foreground")
check(state?.windows.first?.acceptsText == true && state?.windows.first?.closeable == false, "window flags")
check(state?.apps.map(\.appId) == ["timer"], "apps")
check(state?.crownClockwiseNext == true && state?.canUnlock == false, "settings")
check(state?.vibrateOnInput == false && state?.soundEffects == true && state?.canUnlock == false, "settings")
check(state?.updatedAt == 42, "updatedAt")
}
@@ -143,6 +143,7 @@ do {
let state = PhoneState.parse("{\"battery\":140,\"unknownField\":[1,2]}", updatedAt: 0)
check(state?.battery == nil, "out-of-range percentage is unknown")
check(state?.remoteEnabled == true && state?.canUnlock == true, "permissive defaults")
check(state?.vibrateOnInput == true && state?.soundEffects == false, "feedback defaults")
check(state?.phase == "disconnected" && state?.takesInput == false, "disconnected default")
check(PhoneState.parse("not json", updatedAt: 0) == nil, "garbage is rejected")
check(PhoneState.parse("[1]", updatedAt: 0) == nil, "a non-object is rejected")