From a18b91c48c835cf7b3131621a2321e750f816924 Mon Sep 17 00:00:00 2001 From: yuanzonghao Date: Thu, 4 Jun 2026 09:17:30 +0800 Subject: [PATCH] fix(play): story-card clicks no longer trigger vision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Symptom: on a choice beat, clicking the dialogue/narration card fired the vision ("识图") flow instead of doing nothing. Picking an option with fast clicks that landed on the card repeatedly kicked off the expensive /api/vision → insert-beat/scene chain — janky and confusing. Root cause: the story-card
had `pointer-events-none`, so clicks passed through to the background onClick (handleImageClick), which on choice beats calls onBackgroundClick → vision. Fix: the card now owns its clicks (`pointer-events-auto` + handleCardClick): - mid-typing → completes the text (VN skip affordance, unchanged) - continue beat → advances, as before - choice beat → no-op (no vision) Clicking the actual scene art still triggers vision; choice buttons already had pointer-events-auto and are unaffected. Co-Authored-By: Claude Opus 4.7 --- components/PlayCanvas.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/components/PlayCanvas.tsx b/components/PlayCanvas.tsx index 9869ff1..8e58285 100644 --- a/components/PlayCanvas.tsx +++ b/components/PlayCanvas.tsx @@ -276,6 +276,18 @@ export function PlayCanvas({ }); } + // Card swallows its own clicks so they never fall through to the image's + // vision (识图) trigger: while typing a click completes the text, a continue + // beat advances, and a choice beat stays inert (player must pick an option). + function handleCardClick() { + if (phase !== "ready" || !beat) return; + if (!typingDone) { + skipTypewriter(); + return; + } + if (beat.next.type === "continue") onAdvance(); + } + const interactive = phase === "ready" && !!imageUrl; const dimmed = phase === "transitioning"; @@ -366,7 +378,8 @@ export function PlayCanvas({ {(beat.narration || beat.line) && (