From 43e9e7baa042adadcc25c8bba33003b82b9e735c Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 11 Apr 2026 11:39:33 +0200 Subject: [PATCH] Simplify interaction prompt display and handling in various components --- src/app/App.tsx | 18 +-- src/runner-web/RunnerCanvas.tsx | 4 +- src/runtime-three/runtime-host.ts | 54 ++++--- .../runtime-interaction-system.ts | 20 ++- .../domain/runtime-interaction-system.test.ts | 55 +++++++ tests/e2e/runtime-click-interaction.e2e.ts | 144 ++++++++++-------- tests/unit/runner-canvas.test.tsx | 24 ++- 7 files changed, 212 insertions(+), 107 deletions(-) diff --git a/src/app/App.tsx b/src/app/App.tsx index bc4b89e7..c6f28f65 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -6910,21 +6910,15 @@ export function App({ store, initialStatusMessage }: AppProps) {
Interaction
- {activeNavigationMode === "firstPerson" - ? runtimeInteractionPrompt === null - ? "No target" - : "Ready" - : "Not available"} + {runtimeInteractionPrompt === null ? "No target" : "Ready"}
- {activeNavigationMode === "firstPerson" - ? runtimeInteractionPrompt === null - ? "Aim at an authored Interactable or Scene Exit and click when a prompt appears." - : `Click "${runtimeInteractionPrompt.prompt}" within ${runtimeInteractionPrompt.range.toFixed(1)}m.` - : "Switch to First Person to use click interactions."} + {runtimeInteractionPrompt === null + ? "Aim at an authored Interactable or Scene Exit and click when a prompt appears." + : `Click "${runtimeInteractionPrompt.prompt}" within ${runtimeInteractionPrompt.range.toFixed(1)}m.`}
@@ -6937,7 +6931,7 @@ export function App({ store, initialStatusMessage }: AppProps) { {runtimeGlobalState.lastSceneTransition.toSceneName} )} - {activeNavigationMode === "firstPerson" ? ( + {
- ) : null} + }
diff --git a/src/runner-web/RunnerCanvas.tsx b/src/runner-web/RunnerCanvas.tsx index 65a0f442..56e30abd 100644 --- a/src/runner-web/RunnerCanvas.tsx +++ b/src/runner-web/RunnerCanvas.tsx @@ -225,9 +225,7 @@ export function RunnerCanvas({ {runnerReady && navigationMode === "firstPerson" ? (