From 741469e88e6c9e4770907cf8eb9b3c34d75404c8 Mon Sep 17 00:00:00 2001 From: Z8MB1E Date: Fri, 9 Oct 2026 13:13:19 -0400 Subject: [PATCH] fix(voiceover): scope script submission counts per script listScriptsForUser passes all submissions at once, so a take on one script was being counted under every script's card. Skip submissions whose script id doesn't match the card being rendered so each count stays scoped to its own script. --- src/lib/voiceover/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/voiceover/index.ts b/src/lib/voiceover/index.ts index 9588a1d0..09fc3984 100644 --- a/src/lib/voiceover/index.ts +++ b/src/lib/voiceover/index.ts @@ -58,6 +58,11 @@ function buildScriptView( let otherSubmissionCount = 0; for (const submission of submissions) { + // depth: 0 — `script` is a numeric id here. Scope every count to this + // script so a submission on one script never bleeds onto another's card. + // `listScriptsForUser` passes ALL submissions at once, so without this a + // single take surfaces under every script (a prod display bug). + if (submission.script !== script.id) continue; if (submission.user === userId) { mySubmissions.push(toSubmissionSummary(submission)); } else {