From b57d85264c745353653b4b92cdd0be6fc986b27d Mon Sep 17 00:00:00 2001 From: Clawdbot Date: Wed, 28 Jan 2026 17:04:12 +0100 Subject: [PATCH] fix: disable Delete button for main session instead of hiding - Add isMainSession prop to ChatProps - Show Delete button for all sessions but disable for main - Add tooltip explaining why main session cannot be deleted --- ui/src/ui/app-render.ts | 9 ++++----- ui/src/ui/views/chat.ts | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ui/src/ui/app-render.ts b/ui/src/ui/app-render.ts index e950e93be..d444cfd21 100644 --- a/ui/src/ui/app-render.ts +++ b/ui/src/ui/app-render.ts @@ -497,13 +497,12 @@ export function renderApp(state: AppViewState) { onSplitRatioChange: (ratio: number) => state.handleSplitRatioChange(ratio), assistantName: state.assistantName, assistantAvatar: state.assistantAvatar, - // Delete session (hidden for main session) + // Delete session (disabled for main session) showDeleteConfirm: state.chatDeleteConfirm, - onDeleteClick: + isMainSession: state.sessionKey === "main" || - parseAgentSessionKey(state.sessionKey)?.rest === "main" - ? undefined - : () => (state.chatDeleteConfirm = true), + parseAgentSessionKey(state.sessionKey)?.rest === "main", + onDeleteClick: () => (state.chatDeleteConfirm = true), onDeleteConfirm: async () => { state.chatDeleteConfirm = false; const { deleteSession } = await import("./controllers/sessions"); diff --git a/ui/src/ui/views/chat.ts b/ui/src/ui/views/chat.ts index 31beb8541..c7c8b38aa 100644 --- a/ui/src/ui/views/chat.ts +++ b/ui/src/ui/views/chat.ts @@ -70,6 +70,7 @@ export type ChatProps = { onChatScroll?: (event: Event) => void; // Delete session showDeleteConfirm?: boolean; + isMainSession?: boolean; onDeleteClick?: () => void; onDeleteConfirm?: () => void; onDeleteCancel?: () => void; @@ -407,9 +408,9 @@ export function renderChat(props: ChatProps) { ? html`