From 474f88afc1cd82ad8e5dcf9a0251e4c32999decc Mon Sep 17 00:00:00 2001 From: hao Date: Fri, 13 Nov 2026 23:25:08 -0800 Subject: [PATCH] fix(web): sidebar thread rows no longer discard an unsent draft on a stray click A thread row with an unsent draft showed a Discard draft button on hover, right where the pointer lands when switching threads. One missed click cleared the prompt typed in that thread's composer. Remove the button from thread rows. The pen indicator and row highlight still mark the draft, and draft-only rows keep their discard button. Co-Authored-By: Claude Fable 5.2 --- .../components/sidebar/SidebarThreadRow.tsx | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/apps/web/src/components/sidebar/SidebarThreadRow.tsx b/apps/web/src/components/sidebar/SidebarThreadRow.tsx index 9387988979e5..7cb147e7b9ee 100644 --- a/apps/web/src/components/sidebar/SidebarThreadRow.tsx +++ b/apps/web/src/components/sidebar/SidebarThreadRow.tsx @@ -2,7 +2,6 @@ import { useAtomMount, useAtomValue } from "@effect/atom-react"; import { asLaunchingThread } from "@t3tools/client-runtime/state/thread-inbox"; import { ThreadHoverCard, ThreadHoverCardPopup } from "../ThreadHoverCard"; import { ThreadTerminalStatusButton } from "../ThreadStatusIndicators"; -import { discardComposerDraft } from "../../lib/discardComposerDraft"; import { formatWorktreePathForDisplay } from "../../worktreeCleanup"; import { contextMenuSourceOf } from "../../contextMenuSource"; import { requestCustomSnooze } from "../CustomSnoozeDialog"; @@ -58,7 +57,6 @@ import { TerminalIcon, Undo2Icon, UserRoundIcon, - XIcon, } from "lucide-react"; import { memo, @@ -760,11 +758,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP const terminalStatus = terminalStatusFromRunningIds(runningTerminalIds, messages); const terminalProcessCount = runningTerminalIds.length; const hasUnsentDraft = useThreadHasUnsentDraft(threadRef) && !props.isRouteThread; - const handleDiscardDraftClick = (event: ReactMouseEvent) => { - event.preventDefault(); - event.stopPropagation(); - discardComposerDraft(threadRef); - }; const gitCwd = thread.worktreePath ?? props.project?.workspaceRoot ?? null; const linkedPullRequestStatus = useLinkedThreadPullRequest( @@ -1667,7 +1660,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP )} - {props.settlementSupported || showSnoozeButton || hasUnsentDraft ? ( + {props.settlementSupported || showSnoozeButton ? ( - {hasUnsentDraft ? ( - - - } - > - - - - Discard draft - - - ) : null} {showSnoozeButton ? (