Fix an issue where animations on the phone preview stopped prematurely

This commit is contained in:
James Babcock committed 2026-10-03 15:54:57 -07:00
1 parent eb7f385644
commit 4234d3e9e9
14 files changed
+160 -6

No files matched your search

+13 -1
View File
@@ -331,6 +331,7 @@ class DashboardController {
private offPhoneLockState: (() => void) | null = null;
private offEvenAppConflict: (() => void) | null = null;
private offFrameMetrics: (() => void) | null = null;
private offPreviewAnimation: (() => void) | null = null;
private offFirmwareInfo: (() => void) | null = null;
private offVoiceStatus: (() => void) | null = null;
private offAndroidNotification: (() => void) | null = null;
@@ -1586,6 +1587,10 @@ class DashboardController {
}
}
});
// A menu slide reaches the glasses as one frame whose display list
// animates on-device; the mirror replays it in the compositor and needs
// a pull per step, or it keeps whichever mid-motion frame it last got.
this.offPreviewAnimation = communicator.onPreviewAnimationFrame(() => this.schedulePreviewUpdate());
this.offFirmwareInfo = communicator.onFirmwareInfo((info) => {
this.appendLog(
`firmware: L=${info.leftVersion || "?"} R=${info.rightVersion || "?"}` +
@@ -1680,6 +1685,8 @@ class DashboardController {
this.offEvenAppConflict = null;
this.offFrameMetrics?.();
this.offFrameMetrics = null;
this.offPreviewAnimation?.();
this.offPreviewAnimation = null;
this.offFirmwareInfo?.();
this.offFirmwareInfo = null;
this.offVoiceStatus?.();
@@ -1785,6 +1792,8 @@ class DashboardController {
this.offEvenAppConflict = null;
this.offFrameMetrics?.();
this.offFrameMetrics = null;
this.offPreviewAnimation?.();
this.offPreviewAnimation = null;
this.offFirmwareInfo?.();
this.offFirmwareInfo = null;
this.offVoiceStatus?.();
@@ -2847,7 +2856,10 @@ class DashboardController {
}
this.previewTrailingTimer = setTimeout(() => {
this.previewTrailingTimer = null;
this.updateCompositePreview();
// Re-check rather than pull directly: a timer that fires a millisecond
// early would fail the floor in updateCompositePreview and drop the
// burst's last frame (an animation's settled frame) until the 1s poll.
this.schedulePreviewUpdate();
}, wait);
}
+1
View File
@@ -764,6 +764,7 @@ export class IosPreviewController {
if (this.active) this.onConnectionState({ ...this.state })
this.schedulePreviewUpdate()
}),
communicator.onPreviewAnimationFrame(() => { if (this.communicator === communicator) this.schedulePreviewUpdate() }),
communicator.onWearState(wearing => { if (this.communicator === communicator) this.handleWearState(wearing) }),
communicator.addCompassListener(receiveCompassEvent),
communicator.onAncsRelayFrame(frame => { if (this.communicator === communicator) notifications.receive(frame) }),