This commit is contained in:
Taras Lukavyi 2026-01-30 13:56:49 +01:00 committed by GitHub
commit 1c2f3787ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 56 additions and 0 deletions

View File

@ -1369,6 +1369,26 @@
}
}
@media (max-width: 480px) {
.chat-compose__row {
flex-direction: column;
}
.chat-compose__actions {
gap: 4px;
justify-content: flex-end;
}
.chat-compose__actions .btn {
padding: 4px 8px;
font-size: 13px;
}
.chat-compose__actions .btn-kbd {
display: none;
}
}
/* ===========================================
QR Code
=========================================== */

View File

@ -497,6 +497,23 @@ export function renderApp(state: AppViewState) {
onSplitRatioChange: (ratio: number) => state.handleSplitRatioChange(ratio),
assistantName: state.assistantName,
assistantAvatar: state.assistantAvatar,
// Delete session (disabled for main session)
isMainSession:
state.sessionKey === "main" ||
parseAgentSessionKey(state.sessionKey)?.rest === "main",
onDelete: async () => {
const { deleteSession } = await import("./controllers/sessions");
await deleteSession(state as Parameters<typeof deleteSession>[0], state.sessionKey);
// Switch to main session after deletion
const mainKey = state.sessionsResult?.mainSessionKey ?? "main";
state.sessionKey = mainKey;
state.applySettings({
...state.settings,
sessionKey: mainKey,
lastActiveSessionKey: mainKey,
});
void loadChatHistory(state);
},
})
: nothing}

View File

@ -68,6 +68,9 @@ export type ChatProps = {
onCloseSidebar?: () => void;
onSplitRatioChange?: (ratio: number) => void;
onChatScroll?: (event: Event) => void;
// Delete session
isMainSession?: boolean;
onDelete?: () => void;
};
const COMPACTION_TOAST_DURATION_MS = 5000;
@ -361,6 +364,22 @@ export function renderChat(props: ChatProps) {
>
${canAbort ? "Stop" : "New session"}
</button>
${props.onDelete
? html`
<button
class="btn"
?disabled=${!props.connected || isBusy || props.isMainSession}
@click=${() => {
if (confirm(`Delete session "${props.sessionKey}"?`)) {
props.onDelete!();
}
}}
title=${props.isMainSession ? "Cannot delete main session" : "Delete this session"}
>
🗑
</button>
`
: nothing}
<button
class="btn primary"
?disabled=${!props.connected}