From 6f01a29723f82ed7b8e913e1ff19953a9e02d1c2 Mon Sep 17 00:00:00 2001 From: hypercross Date: Mon, 13 Jul 2026 10:24:33 +0800 Subject: [PATCH] refactor(journal): simplify fallback variable retrieval Return the fallback value as-is instead of applying local modifications, as the stream value is already authoritative for untracked variables. --- src/components/journal/var-reactivity.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/journal/var-reactivity.ts b/src/components/journal/var-reactivity.ts index 804b689..95ffca7 100644 --- a/src/components/journal/var-reactivity.ts +++ b/src/components/journal/var-reactivity.ts @@ -137,14 +137,11 @@ export function getCombined(key: string, fallback?: VariableStore): string { return String(baseNum + modSum); } - // Fall back to stream store + // Fall back to stream store. The stream value is authoritative for + // variables not tracked locally — it already includes any mods from + // the sender's engine, so we return it as-is without adding local mods. const fb = fallback?.[key]; - if (fb !== undefined) { - if (isTagValue(fb)) return fb; - const fbNum = parseFloat(fb); - if (!isNaN(fbNum)) return String(fbNum + modSum); - return fb; - } + if (fb !== undefined) return fb; // No base, but has mods if (mods.length > 0) return String(modSum);