commit 184d1c298517d557d0e740653f5d88708c5b3a59
parent 1c92a17816b8a5e883e47936b3c68fb6d11493fb
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sat, 10 Oct 2026 03:10:13 -0400
channels: "Clear failure list" keeps its log after the list empties
The section rendered its clear controls only while the failed list was
non-empty, so the refresh StreamActionLog fires at the end of its own run
unmounted the log with "Cleared N entries" in it. A `ran` flag set on
click keeps the block for the page's life, the button disabled at (0) —
the rule in FACTS.md, "A run log lives in the panel's React state", and
DiagnosticsStage's pattern. whisper.spec.ts:184 failed 3/3 under next start.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/editor/app/channels/[slug]/components/stages/TranscribeStage.tsx b/editor/app/channels/[slug]/components/stages/TranscribeStage.tsx
@@ -395,6 +395,13 @@ function FailedTranscriptionsSection({
const [clearQueue, setClearQueue] = useState(defaultQueueKey);
const [confirmText, setConfirmText] = useState("");
const armed = confirmText === "clear";
+ // A CLEAR EMPTIES ITS OWN LIST, and the controls must outlive that
+ // (plans/FACTS.md, "A run log lives in the panel's React state"). The run's
+ // refresh re-renders this section with no ids; gating the block on
+ // `ids.length` alone unmounted the StreamActionLog and its "Cleared N
+ // entries" with it. `ran` keeps the block for the rest of this page's life,
+ // its button disabled at (0); a reload drops it as before.
+ const [ran, setRan] = useState(false);
return (
<div
aria-label="failed transcriptions section"
@@ -418,7 +425,7 @@ function FailedTranscriptionsSection({
emptyMessage="No failed transcriptions."
itemAriaLabel={(id) => `failed transcription ${id}`}
/>
- {ids.length > 0 ? (
+ {ids.length > 0 || ran ? (
<div className="flex flex-col gap-2">
<label className="flex items-center gap-2 text-xs text-muted-foreground">
Type
@@ -433,14 +440,15 @@ function FailedTranscriptionsSection({
/>
</label>
<StreamActionLog
- trigger={() =>
- clearFailedTranscriptionsAction(slug, clearQueue)
- }
+ trigger={() => {
+ setRan(true);
+ return clearFailedTranscriptionsAction(slug, clearQueue);
+ }}
cancelAction={cancelJobAction}
buttonLabel={`Clear failure list (${ids.length})`}
runningLabel="Clearing…"
label="Clear failed transcriptions"
- disabled={!armed}
+ disabled={!armed || ids.length === 0}
extraControls={
<QueueControl
value={clearQueue}