From 03605bfa6af05e5e2ab5bc0dc61fab45e23d9247 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 8 Jan 2026 12:04:11 +0100 Subject: [PATCH] chore: refine control ui links and composer --- CHANGELOG.md | 1 + ui/src/styles/components.css | 1 - ui/src/styles/layout.css | 25 +++++++++++++++++++++++++ ui/src/ui/app-render.ts | 12 +++++++++++- ui/src/ui/app.ts | 15 ++++++++++++++- ui/src/ui/views/chat.ts | 8 ++++++++ 6 files changed, 59 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c29525f9..61fe67f46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - WhatsApp: group `/model list` output by provider for scannability. (#456) - thanks @mcinteerj - Hooks: allow per-hook model overrides for webhook/Gmail runs (e.g. GPT 5 Mini). - Control UI: logs tab opens at the newest entries (bottom). +- Control UI: add Docs link, remove chat composer divider, and add New session button. ## 2026.1.8 diff --git a/ui/src/styles/components.css b/ui/src/styles/components.css index f864b845d..07a48afe9 100644 --- a/ui/src/styles/components.css +++ b/ui/src/styles/components.css @@ -952,7 +952,6 @@ margin-top: 0; padding-top: 12px; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, var(--panel) 35%); - border-top: 1px solid var(--border); } .shell--chat-focus .chat-compose { diff --git a/ui/src/styles/layout.css b/ui/src/styles/layout.css index 1b63258ec..df6f39c90 100644 --- a/ui/src/styles/layout.css +++ b/ui/src/styles/layout.css @@ -199,6 +199,31 @@ ); } +.docs-link { + position: fixed; + right: calc(var(--shell-pad) + 4px); + bottom: calc(var(--shell-pad) + 4px); + z-index: 30; + padding: 8px 12px; + border-radius: 999px; + border: 1px solid var(--border); + background: rgba(0, 0, 0, 0.35); + color: var(--text); + font-size: 12px; + letter-spacing: 0.4px; + text-transform: uppercase; + box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3); + transition: transform 140ms ease, border-color 140ms ease, + background 140ms ease, color 140ms ease; +} + +.docs-link:hover { + transform: translateY(-2px); + border-color: rgba(245, 159, 74, 0.5); + background: rgba(245, 159, 74, 0.18); + color: var(--text); +} + .content-header { display: flex; align-items: flex-end; diff --git a/ui/src/ui/app-render.ts b/ui/src/ui/app-render.ts index c9a39c3d8..97f766477 100644 --- a/ui/src/ui/app-render.ts +++ b/ui/src/ui/app-render.ts @@ -195,7 +195,7 @@ export type AppViewState = { handleWhatsAppWait: () => Promise; handleWhatsAppLogout: () => Promise; handleTelegramSave: () => Promise; - handleSendChat: () => Promise; + handleSendChat: (messageOverride?: string, opts?: { restoreDraft?: boolean }) => Promise; resetToolStream: () => void; handleLogsScroll: (event: Event) => void; exportLogs: (lines: string[], label: string) => void; @@ -449,6 +449,8 @@ export function renderApp(state: AppViewState) { }, onDraftChange: (next) => (state.chatMessage = next), onSend: () => state.handleSendChat(), + onNewSession: () => + state.handleSendChat("/new", { restoreDraft: true }), }) : nothing} @@ -517,6 +519,14 @@ export function renderApp(state: AppViewState) { }) : nothing} + + Docs + `; } diff --git a/ui/src/ui/app.ts b/ui/src/ui/app.ts index 63fca61e1..83f1fdc89 100644 --- a/ui/src/ui/app.ts +++ b/ui/src/ui/app.ts @@ -1001,10 +1001,20 @@ export class ClawdbotApp extends LitElement { async loadCron() { await Promise.all([loadCronStatus(this), loadCronJobs(this)]); } - async handleSendChat() { + async handleSendChat( + messageOverride?: string, + opts?: { restoreDraft?: boolean }, + ) { if (!this.connected) return; + const previousDraft = this.chatMessage; + if (messageOverride != null) { + this.chatMessage = messageOverride; + } this.resetToolStream(); const ok = await sendChat(this); + if (!ok && messageOverride != null) { + this.chatMessage = previousDraft; + } if (ok) { this.setLastActiveSessionKey(this.sessionKey); } @@ -1016,6 +1026,9 @@ export class ClawdbotApp extends LitElement { this.resetToolStream(); void loadChatHistory(this); } + if (ok && messageOverride != null && opts?.restoreDraft && previousDraft.trim()) { + this.chatMessage = previousDraft; + } this.scheduleChatScroll(); } diff --git a/ui/src/ui/views/chat.ts b/ui/src/ui/views/chat.ts index 4ade5051e..0ca7ca671 100644 --- a/ui/src/ui/views/chat.ts +++ b/ui/src/ui/views/chat.ts @@ -27,6 +27,7 @@ export type ChatProps = { onRefresh: () => void; onDraftChange: (next: string) => void; onSend: () => void; + onNewSession: () => void; }; export function renderChat(props: ChatProps) { @@ -116,6 +117,13 @@ export function renderChat(props: ChatProps) { >
+