From 7b295df8ff817f68a65b147d8d54370625119b0b Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Fri, 13 Nov 2026 00:25:18 +1100 Subject: [PATCH] feat(chat): page-aware suggested prompts beside the composer, sent on click (#1905, #1906) The suggestion strip moves out of the empty transcript into the composer, above the field, so prompts stay reachable without scrolling to the top and show in the collapsed bar where there is room (hidden below the md breakpoint in the collapsed bar, wrapping when expanded on a phone). Clicking a prompt calls sendMessage({ textOverride }), which sends at once while no turn runs instead of filling the composer. Prompt sets are keyed off the current route name, the same identity the page tag uses: task detail (naming the open task), tasks, events, workflows, schedules, settings, and a default set. The empty transcript keeps its logo and no longer owns the fixed prompt list; the dead prompt re-emit in ChatTranscript is removed. --- ui/src/chat/ChatComposer.vue | 5 ++ ui/src/chat/ChatEmptyState.vue | 27 +------- ui/src/chat/ChatSuggestions.vue | 42 +++++++++++++ ui/src/chat/ChatTranscript.vue | 7 +-- ui/src/chat/suggestions.ts | 103 +++++++++++++++++++++++++++++++ ui/test/chat-suggestions.test.ts | 79 ++++++++++++++++++++++++ 6 files changed, 233 insertions(+), 30 deletions(-) create mode 100644 ui/src/chat/ChatSuggestions.vue create mode 100644 ui/src/chat/suggestions.ts create mode 100644 ui/test/chat-suggestions.test.ts diff --git a/ui/src/chat/ChatComposer.vue b/ui/src/chat/ChatComposer.vue index d3f043888..ec2ea38b1 100644 --- a/ui/src/chat/ChatComposer.vue +++ b/ui/src/chat/ChatComposer.vue @@ -9,6 +9,7 @@ import { cn } from "@/lib/utils"; import { Textarea } from "@/components/ui/textarea"; import { isExactCommand, replaceToken } from "./commands"; import ChatSlashPalette from "./ChatSlashPalette.vue"; +import ChatSuggestions from "./ChatSuggestions.vue"; import { closeCommandMenu, commandMatches, @@ -242,6 +243,10 @@ function onKeydown(event: KeyboardEvent): void { /> + +
import Logo from "@/components/topbar/Logo.vue"; -import { Button } from "@/components/ui/button"; /** - * What the panel opens on before there is a conversation: an invitation, and - * three prompts that fill the composer. The text is handed up rather than - * typed into the composer here, because the composer owns its own focus. + * What the panel opens on before there is a conversation: the mark. The + * suggested prompts live beside the composer (ChatSuggestions), where they + * are reachable whether or not the transcript is empty. */ -const emit = defineEmits<{ prompt: [text: string] }>(); - -// Prompts an operator might actually ask, rather than demonstrations of the -// feature. -const PROMPTS = [ - "Summarise active tasks", - "Show running agents", - "Check system status", -]; diff --git a/ui/src/chat/ChatSuggestions.vue b/ui/src/chat/ChatSuggestions.vue new file mode 100644 index 000000000..45ffd4646 --- /dev/null +++ b/ui/src/chat/ChatSuggestions.vue @@ -0,0 +1,42 @@ + + + diff --git a/ui/src/chat/ChatTranscript.vue b/ui/src/chat/ChatTranscript.vue index 2b8e4629f..b7ae29676 100644 --- a/ui/src/chat/ChatTranscript.vue +++ b/ui/src/chat/ChatTranscript.vue @@ -39,8 +39,6 @@ import { * that set scrollTop by hand would have no "reader scrolled away" state and no * way back down, so MessageScroller owns this. */ -const emit = defineEmits<{ prompt: [text: string] }>(); - function parts(message: ChatMessage, index: number) { const from = message.from ?? message.From ?? ""; // Anything this browser's composer did not send is Archie's answer. @@ -102,10 +100,7 @@ useLiveResource("chat", () => void reloadTranscript());
- +