From 8dba4e6decc4ae0d95e5d177b22d5072da6ff21d Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Fri, 13 Nov 2026 13:05:42 +1100 Subject: [PATCH] feat(ui): topbar chat button; a docked chat hides when minimised --- ui/src/App.vue | 2 ++ ui/src/chat/ChatDock.vue | 7 ++++-- ui/src/chat/ChatTopbarButton.vue | 42 ++++++++++++++++++++++++++++++++ ui/src/chat/state.ts | 2 ++ 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 ui/src/chat/ChatTopbarButton.vue diff --git a/ui/src/App.vue b/ui/src/App.vue index ada6e2758..4fef5d929 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -11,6 +11,7 @@ import AppSidebar from "@/components/AppSidebar.vue"; import CommandPalette from "@/components/command-palette/CommandPalette.vue"; import AccountMenu from "@/components/topbar/AccountMenu.vue"; import OrgCrumb from "@/components/topbar/OrgCrumb.vue"; +import ChatTopbarButton from "@/chat/ChatTopbarButton.vue"; import SectionCrumb from "@/components/topbar/SectionCrumb.vue"; import Brand from "@/components/topbar/Brand.vue"; import Logo from "@/components/topbar/Logo.vue"; @@ -112,6 +113,7 @@ watch(() => accounts.status?.user, (user) => { + diff --git a/ui/src/chat/ChatDock.vue b/ui/src/chat/ChatDock.vue index a645b1cf9..c3adf4a92 100644 --- a/ui/src/chat/ChatDock.vue +++ b/ui/src/chat/ChatDock.vue @@ -43,7 +43,7 @@ import { type Rect, type ResizeDir, } from "./ChatDockLayout"; -import { escapeOwnedByLayer, isSending, reloadTranscript, useChat, useEscapeLayer } from "./state"; +import { dockExpanded, escapeOwnedByLayer, isSending, reloadTranscript, useChat, useEscapeLayer } from "./state"; import { setDockOpen, unseenCount } from "./unseen"; /** @@ -87,7 +87,7 @@ useChat(); // mounted while collapsed, so a reply that lands then is still read and counted. useLiveResource("chat", () => void reloadTranscript()); -const expanded = ref(false); +const expanded = dockExpanded; watch(expanded, setDockOpen, { immediate: true }); // The old edge-pin preference moves into the new key before useStorage reads it. @@ -438,6 +438,9 @@ function onPinKey(event: KeyboardEvent): void { 'pointer-events-none fixed z-40 transition-[left,top,bottom,width,height] duration-200 ease-out motion-reduce:transition-none', (dragging || resizing) && 'transition-none', !desktop && 'inset-x-0 bottom-4 flex justify-center px-3 max-md:bottom-2', + // Docked, minimising hides the dock; the topbar button and Ctrl+/ bring + // it back. It stays mounted so the session and a turn in flight survive. + desktop && mode !== 'float' && !expanded && 'hidden', )" :style="wrapStyle" > diff --git a/ui/src/chat/ChatTopbarButton.vue b/ui/src/chat/ChatTopbarButton.vue new file mode 100644 index 000000000..f6d9e42fc --- /dev/null +++ b/ui/src/chat/ChatTopbarButton.vue @@ -0,0 +1,42 @@ + + + diff --git a/ui/src/chat/state.ts b/ui/src/chat/state.ts index 328b89e6d..1328418ec 100644 --- a/ui/src/chat/state.ts +++ b/ui/src/chat/state.ts @@ -206,6 +206,8 @@ export const sessions = ref([]); export const currentSession = ref(""); export const messages = ref([]); const drafts = ref>({}); +/** Whether the chat dock shows the conversation; the dock, Ctrl+/ and the topbar button share it. */ +export const dockExpanded = ref(false); /** A suggested prompt the pointer or focus rests on, previewed as the composer placeholder. */ export const placeholderHint = ref(""); /** The unsent text of the open conversation; each conversation keeps its own. */