From 054407aa5cfd36b5d9ed33f0184e390b5d26aefb Mon Sep 17 00:00:00 2001 From: LucaP Date: Sun, 11 Oct 2026 02:06:45 +0300 Subject: [PATCH] fix: read Static and disable quality when a system setting withholds the scene --- src/components/DriveControls.vue | 12 ++++++++---- tests/unit/SceneCanvas.test.ts | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/components/DriveControls.vue b/src/components/DriveControls.vue index 6e12aae..74cf9aa 100644 --- a/src/components/DriveControls.vue +++ b/src/components/DriveControls.vue @@ -94,12 +94,16 @@ const statusText = computed(() => { return null; }); -/** The scene was lost or never started: the quality choice has nothing to - * act on, so it reads Static and is disabled rather than claiming High. */ +/** The scene was lost, never started, or is withheld by a system setting + * (reduced motion, data saver): the quality choice has nothing to act on, so + * it reads Static and is disabled rather than claiming High. Visitor choices + * (pause, saved Static) keep it enabled so they can be changed back. */ const visualsUnavailable = computed( () => - props.policy.reason === "full" && - (props.sceneStatus === "failed" || props.sceneStatus === "static"), + props.policy.reason === "system-reduce" || + props.policy.reason === "data-saver" || + (props.policy.reason === "full" && + (props.sceneStatus === "failed" || props.sceneStatus === "static")), ); const runAction = (): void => { diff --git a/tests/unit/SceneCanvas.test.ts b/tests/unit/SceneCanvas.test.ts index fa2b5b3..db45094 100644 --- a/tests/unit/SceneCanvas.test.ts +++ b/tests/unit/SceneCanvas.test.ts @@ -390,6 +390,25 @@ describe("DriveControls", () => { expect(select.element.value).toBe("static"); wrapper.unmount(); }); + + it.each(["system-reduce", "data-saver"] as const)( + "disables the quality choice and reads Static under %s", + async (reason) => { + const wrapper = mount(DriveControls, { + props: { + policy: policy({ reason, allowSceneRequest: false, allowAutomaticVideo: false, maximumTier: "static" }), + maximumQuality: "high", + sceneStatus: "idle", + audioState: { kind: "idle" }, + }, + }); + await wrapper.get('[aria-label="Drive settings"]').trigger("click"); + const select = wrapper.get('[aria-label="Quality control"]'); + expect(select.element.disabled).toBe(true); + expect(select.element.value).toBe("static"); + wrapper.unmount(); + }, + ); }); describe("JourneyHud", () => {