Skip to content

Commit a3cd0aa

Browse files
saphidclaude
andauthored
fix(web): deleting an archived thread also clears its draft, staged uploads and terminal state (pingdotgg#29164)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent a0056dd commit a3cd0aa

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎apps/web/src/hooks/useThreadActions.permissions.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,12 @@ describe("thread action permissions", () => {
331331
expect(state.requests).toEqual([
332332
expect.objectContaining({ action: "delete", environmentId: secondary }),
333333
]);
334+
expect(state.localEffects).toEqual([
335+
"refresh-archive",
336+
"release-uploads",
337+
"clear-draft",
338+
"clear-terminal-ui",
339+
]);
334340
expect(threadPanelStatePresence(target)).toEqual(panelStateCleared);
335341
});
336342

‎apps/web/src/hooks/useThreadActions.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,9 @@ export function useThreadActions() {
447447
if (result._tag === "Success") {
448448
expireThreadUndos(target, [...LIST_PLACEMENT_UNDO_KINDS, "archive"]);
449449
refreshArchivedThreadsForEnvironment(target.environmentId);
450+
releaseComposerDraftUploads(target);
451+
clearComposerDraftForThread(target);
452+
clearTerminalUiState(target);
450453
clearDeletedThreadPanelState(target);
451454
}
452455
return result;

0 commit comments

Comments
 (0)