Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions apps/web/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3284,6 +3284,16 @@ export default function ChatView({ threadId }: ChatViewProps) {
});
};

const onClearQueue = useCallback(() => {
setOptimisticUserMessages((existing) => {
for (const msg of existing) {
if (msg.queued) revokeUserMessagePreviewUrls(msg);
}
return existing.filter((msg) => !msg.queued);
});
setQueuedMessages([]);
}, []);

const onRespondToApproval = useCallback(
async (requestId: ApprovalRequestId, decision: ProviderApprovalDecision) => {
const api = readNativeApi();
Expand Down Expand Up @@ -4776,9 +4786,30 @@ export default function ChatView({ threadId }: ChatViewProps) {
</span>
) : null}
{queuedMessages.length > 0 && phase === "running" ? (
<span className="text-muted-foreground/60 text-xs">
<button
type="button"
className="flex items-center gap-1 text-muted-foreground/60 text-xs transition-colors hover:text-destructive"
onClick={onClearQueue}
title="Clear queued messages"
aria-label="Clear queued messages"
>
{queuedMessages.length} queued
</span>
<svg
width="10"
height="10"
viewBox="0 0 10 10"
fill="currentColor"
aria-hidden="true"
>
<path
d="M2 2l6 6M8 2l-6 6"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
fill="none"
/>
</svg>
</button>
) : null}
{activePendingProgress ? (
<div className="flex items-center gap-2">
Expand Down
Loading
Loading