From 5bbcb2c850616688cd8b60c2bcca7bfb96a4c05c Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 13 Apr 2026 14:11:18 +0200 Subject: [PATCH] Remove unused background overlay and update tests --- src/app/app.css | 7 -- src/runner-web/RunnerCanvas.tsx | 51 -------------- tests/unit/runner-canvas.test.tsx | 6 +- tests/unit/world-background-renderer.test.ts | 73 ++++++++++++++++++++ 4 files changed, 77 insertions(+), 60 deletions(-) create mode 100644 tests/unit/world-background-renderer.test.ts diff --git a/src/app/app.css b/src/app/app.css index c67f54b3..b80d3b33 100644 --- a/src/app/app.css +++ b/src/app/app.css @@ -1258,13 +1258,6 @@ button:disabled { pointer-events: auto; } -.runner-canvas__background-overlay { - position: absolute; - inset: 0; - z-index: 0; - pointer-events: none; -} - .runner-canvas__loading-overlay--hidden { opacity: 0; visibility: hidden; diff --git a/src/runner-web/RunnerCanvas.tsx b/src/runner-web/RunnerCanvas.tsx index e7d3c772..5b5c7777 100644 --- a/src/runner-web/RunnerCanvas.tsx +++ b/src/runner-web/RunnerCanvas.tsx @@ -15,14 +15,12 @@ import type { RuntimeInteractionPrompt } from "../runtime-three/runtime-interact import { areRuntimeClockStatesEqual, createRuntimeClockState, - resolveRuntimeDayNightWorldState, type RuntimeClockState } from "../runtime-three/runtime-project-time"; import type { RuntimeNavigationMode, RuntimeSceneDefinition } from "../runtime-three/runtime-scene-build"; -import { createWorldBackgroundStyle } from "../shared-ui/world-background-style"; const FORWARD_RUNTIME_CLOCK_INTERVAL_MS = 240; @@ -73,28 +71,13 @@ export function RunnerCanvas({ useState(null); const [firstPersonTelemetry, setFirstPersonTelemetry] = useState(null); - const [visualRuntimeClock, setVisualRuntimeClock] = useState(runtimeClock); const overlayMessage = runnerMessage ?? sceneLoadState.message; const overlayStatus = overlayMessage !== null ? "error" : sceneLoadState.status; const runnerReady = overlayStatus === "ready"; - const resolvedWorld = resolveRuntimeDayNightWorldState( - runtimeScene.world, - runtimeScene.time, - visualRuntimeClock - ); onRuntimeClockChangeRef.current = onRuntimeClockChange; - useEffect(() => { - lastForwardedRuntimeClockRef.current = runtimeClock; - setVisualRuntimeClock((currentClock) => - areRuntimeClockStatesEqual(currentClock, runtimeClock) - ? currentClock - : runtimeClock - ); - }, [runtimeClock.dayCount, runtimeClock.dayLengthMinutes, runtimeClock.timeOfDayHours]); - useEffect(() => { const container = containerRef.current; @@ -111,12 +94,6 @@ export function RunnerCanvas({ runtimeHost.setRuntimeMessageHandler(onRuntimeMessageChange); runtimeHost.setSceneLoadStateHandler(setSceneLoadState); runtimeHost.setRuntimeClockStateHandler?.((clock) => { - setVisualRuntimeClock((currentClock) => - areRuntimeClockStatesEqual(currentClock, clock) - ? currentClock - : clock - ); - const now = performance.now(); if ( @@ -226,35 +203,7 @@ export function RunnerCanvas({ data-testid="runner-shell" aria-label="Built-in scene runner" aria-busy={!runnerReady} - style={createWorldBackgroundStyle( - resolvedWorld.background, - resolvedWorld.background.mode === "image" - ? (loadedImageAssets[resolvedWorld.background.assetId] - ?.sourceUrl ?? null) - : null - )} > - {resolvedWorld.nightBackgroundOverlay === null ? null : ( -