From 3c94ab1f81656e6c8240f7347a2e7f0178c157de Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Mon, 14 Sep 2026 05:31:42 +0000 Subject: [PATCH 01/49] fix(models): the run strip blurs what the viewer blurs The router reports the latest run's rating on the run, not always on the output, and the strip read the output alone. A result rated sensitive could sit unblurred in its thumbnail beside a viewer that blurred it. Both now consult the run and the output, through one computed, so the gate cannot come apart again. --- .../components/workshop/PlaygroundOutput.test.ts | 14 ++++++++++++++ .../src/components/workshop/PlaygroundOutput.vue | 15 ++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/apps/website/src/components/workshop/PlaygroundOutput.test.ts b/apps/website/src/components/workshop/PlaygroundOutput.test.ts index 0f016e35524..3529d0ca658 100644 --- a/apps/website/src/components/workshop/PlaygroundOutput.test.ts +++ b/apps/website/src/components/workshop/PlaygroundOutput.test.ts @@ -334,4 +334,18 @@ describe('PlaygroundOutput', () => { screen.getByTestId('output-download').getAttribute('href') ).toContain('b.webp') }) + + it('blurs the latest run in the strip when the run, not its output, is rated sensitive', () => { + render(PlaygroundOutput, { + props: { + state: succeeded(output('latest'), true), + earlier: [{ output: output('first'), attachments: [] }], + now: 2_000 + } + }) + const thumbnail = (testId: string) => + within(screen.getByTestId(testId)).getByRole('img') + expect(thumbnail('earlier-latest')).toHaveClass('blur-md') + expect(thumbnail('earlier-run-0')).not.toHaveClass('blur-md') + }) }) diff --git a/apps/website/src/components/workshop/PlaygroundOutput.vue b/apps/website/src/components/workshop/PlaygroundOutput.vue index ae7df0f74f9..908c6c31a80 100644 --- a/apps/website/src/components/workshop/PlaygroundOutput.vue +++ b/apps/website/src/components/workshop/PlaygroundOutput.vue @@ -146,12 +146,18 @@ watch(primary, () => { selectedAttachment.value = undefined }) +// The router reports the latest run's rating on the run, not always on the +// output, so anything showing that run has to consult both. +const latestIsSensitive = computed( + () => + (state.status === 'succeeded' && state.nsfw) || latest.value?.nsfw === true +) // Earlier runs carry their own flag, so switching away from the latest output // must not drop the gate. const shownIsSensitive = computed(() => viewing.value ? viewing.value.output.nsfw === true || shown.value?.nsfw === true - : (state.status === 'succeeded' && state.nsfw) || shown.value?.nsfw === true + : latestIsSensitive.value || shown.value?.nsfw === true ) const blurred = computed(() => shownIsSensitive.value && !revealed.value) watch(shown, () => { @@ -165,6 +171,7 @@ watch(shown, () => { interface RunStop { readonly record?: RunRecord readonly output: RunOutput + readonly nsfw: boolean readonly name: string readonly testId: string } @@ -176,6 +183,7 @@ const runStops = computed(() => ...[...earlier].reverse().map((record, index) => ({ record, output: record.output, + nsfw: record.output.nsfw === true, name: t('workshop.output.earlierRun', locale).replace( '{number}', String(index + 1) @@ -185,6 +193,7 @@ const runStops = computed(() => { record: undefined, output: latest.value, + nsfw: latestIsSensitive.value, name: t('workshop.output.latest', locale), testId: 'earlier-latest' } @@ -503,7 +512,7 @@ const earlierClass = (active: boolean) =>