From 899083a8f55344930ff9b0b2ab33df9d3839ef12 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 3e1695e63f0a7..ac4282859eb32 100644 --- a/apps/web/src/components/sidebar/SidebarThreadRow.tsx +++ b/apps/web/src/components/sidebar/SidebarThreadRow.tsx @@ -2,7 +2,6 @@ import { useAtomMount } 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 { contextMenuSourceOf } from "../../contextMenuSource"; import { requestCustomSnooze } from "../CustomSnoozeDialog"; import { useSupportsMultiplePullRequests } from "~/hooks/useSupportsMultiplePullRequests"; @@ -56,7 +55,6 @@ import { TerminalIcon, Undo2Icon, UserRoundIcon, - XIcon, } from "lucide-react"; import { memo, @@ -727,11 +725,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( @@ -1663,7 +1656,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP )} - {props.settlementSupported || showSnoozeButton || hasUnsentDraft ? ( + {props.settlementSupported || showSnoozeButton ? ( - {hasUnsentDraft ? ( - - - } - > - - - - Discard draft - - - ) : null} {showSnoozeButton ? (