From 5a1b6ac426ecf293f2ef0df1a9fc21cc71a771bd Mon Sep 17 00:00:00 2001 From: Claude Code Date: Wed, 28 Jan 2026 05:02:14 +0000 Subject: [PATCH] fix: remove duplicate End Session button from MessagesTab Removed the duplicate "End Session" button that appeared in the chat interface alongside the "Stop Session" button in the session header. Both buttons performed similar functions, causing user confusion. Changes: - Removed "End session" button from MessagesTab component (line 701-709) - Removed unused 'ending' state variable - Removed unused 'handleEndSession' function - Removed 'onEndSession' prop from MessagesTabProps interface - Updated Send button disabled condition to remove 'ending' reference - Removed 'handleEndSession' handler from page.tsx - Removed 'onEndSession' prop from MessagesTab component usage The canonical "Stop Session" button in the session header remains as the only way to stop sessions, providing a clearer and more consistent UX. Fixes: RHOAIENG-41580 --- .../[name]/sessions/[sessionName]/page.tsx | 15 ---------- .../src/components/session/MessagesTab.tsx | 30 ++++--------------- 2 files changed, 5 insertions(+), 40 deletions(-) diff --git a/components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsx b/components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsx index 1776504c9..d41c041b6 100644 --- a/components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsx +++ b/components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsx @@ -1242,20 +1242,6 @@ export default function ProjectSessionDetailPage({ // LEGACY: Old handleInterrupt removed - now using aguiInterrupt from useAGUIStream // which calls the proper AG-UI interrupt endpoint that signals Claude SDK - const handleEndSession = () => { - // Use stop API to end the session - stopMutation.mutate( - { projectName, sessionName, data: { reason: "end_session" } }, - { - onSuccess: () => successToast("Session ended successfully"), - onError: (err) => - errorToast( - err instanceof Error ? err.message : "Failed to end session", - ), - }, - ); - }; - // Duration calculation removed - startTime/completionTime no longer in status const durationMs = undefined; @@ -1904,7 +1890,6 @@ export default function ProjectSessionDetailPage({ setChatInput={setChatInput} onSendChat={() => Promise.resolve(sendChat())} onInterrupt={aguiInterrupt} - onEndSession={() => Promise.resolve(handleEndSession())} onGoToResults={() => {}} onContinue={handleContinue} workflowMetadata={workflowMetadata} diff --git a/components/frontend/src/components/session/MessagesTab.tsx b/components/frontend/src/components/session/MessagesTab.tsx index 3e45d60b6..8c58c3a43 100644 --- a/components/frontend/src/components/session/MessagesTab.tsx +++ b/components/frontend/src/components/session/MessagesTab.tsx @@ -24,7 +24,6 @@ export type MessagesTabProps = { setChatInput: (v: string) => void; onSendChat: () => Promise; onInterrupt: () => Promise; - onEndSession: () => Promise; onGoToResults?: () => void; onContinue: () => void; workflowMetadata?: WorkflowMetadata; @@ -39,9 +38,8 @@ export type MessagesTabProps = { }; -const MessagesTab: React.FC = ({ session, streamMessages, chatInput, setChatInput, onSendChat, onInterrupt, onEndSession, onGoToResults, onContinue, workflowMetadata, onCommandClick, isRunActive = false, showWelcomeExperience, welcomeExperienceComponent, activeWorkflow, userHasInteracted = false, queuedMessages = [], hasRealMessages = false }) => { +const MessagesTab: React.FC = ({ session, streamMessages, chatInput, setChatInput, onSendChat, onInterrupt, onGoToResults, onContinue, workflowMetadata, onCommandClick, isRunActive = false, showWelcomeExperience, welcomeExperienceComponent, activeWorkflow, userHasInteracted = false, queuedMessages = [], hasRealMessages = false }) => { const [interrupting, setInterrupting] = useState(false); - const [ending, setEnding] = useState(false); const [sendingChat, setSendingChat] = useState(false); const [showSystemMessages, setShowSystemMessages] = useState(false); const [agentsPopoverOpen, setAgentsPopoverOpen] = useState(false); @@ -169,15 +167,6 @@ const MessagesTab: React.FC = ({ session, streamMessages, chat } }; - const handleEndSession = async () => { - setEnding(true); - try { - await onEndSession(); - } finally { - setEnding(false); - } - }; - // Get filtered autocomplete items const getFilteredItems = () => { if (!autocompleteType) return []; @@ -689,24 +678,15 @@ const MessagesTab: React.FC = ({ session, streamMessages, chat Stop ) : ( - )} -