diff --git a/ui/src/chat/ChatEmptyState.vue b/ui/src/chat/ChatEmptyState.vue
index fbafd777e..bfdc5837d 100644
--- a/ui/src/chat/ChatEmptyState.vue
+++ b/ui/src/chat/ChatEmptyState.vue
@@ -3,7 +3,10 @@ import { computed } from "vue";
import { useAccountsStore } from "@/accounts/accounts";
import Logo from "@/components/topbar/Logo.vue";
+import { Alert, AlertDescription } from "@/components/ui/alert";
+import { Button } from "@/components/ui/button";
import ChatSuggestions from "./ChatSuggestions.vue";
+import { chatModelReady } from "./state";
/**
* What the panel opens on before there is a conversation: the mark, a greeting
@@ -23,6 +26,12 @@ const greeting = computed(() => {
{{ greeting }}
-
+
+
+
+ No chat model connected.
+
+
+
diff --git a/ui/src/chat/ChatSuggestions.vue b/ui/src/chat/ChatSuggestions.vue
index f90576985..d11f26eb0 100644
--- a/ui/src/chat/ChatSuggestions.vue
+++ b/ui/src/chat/ChatSuggestions.vue
@@ -4,12 +4,13 @@ import { computed, onUnmounted } from "vue";
import { useRoute } from "vue-router";
import { Button } from "@/components/ui/button";
-import { placeholderHint, sendMessage } from "./state";
+import { chatModelReady, placeholderHint, sendMessage } from "./state";
import { suggestionsForRoute } from "./suggestions";
/**
* The suggested prompts for the page the operator is on. The empty
- * conversation lists them (`list`); beside the composer they are chips. A click
+ * conversation lists them (`list`); beside the composer they are a row of
+ * chips that scrolls sideways. None show until a chat model is configured. A click
* sends the prompt as its own message (sendMessage's textOverride path sends at
* once while no turn runs) rather than filling the field, and resting on one
* previews it as the composer's placeholder.
@@ -17,7 +18,8 @@ import { suggestionsForRoute } from "./suggestions";
defineProps<{ list?: boolean }>();
const route = useRoute();
-const prompts = computed(() => suggestionsForRoute(route));
+// No model, no prompts: one sent now could only fail.
+const prompts = computed(() => (chatModelReady.value ? suggestionsForRoute(route) : []));
function send(prompt: string): void {
placeholderHint.value = "";
@@ -26,6 +28,15 @@ function send(prompt: string): void {
function preview(prompt: string): void {
placeholderHint.value = prompt;
}
+// A vertical wheel scrolls the row sideways; a trackpad's sideways swipe
+// already does.
+function scrollSideways(event: WheelEvent): void {
+ if (Math.abs(event.deltaY) <= Math.abs(event.deltaX)) return;
+ const row = event.currentTarget as HTMLElement;
+ if (row.scrollWidth <= row.clientWidth) return;
+ event.preventDefault();
+ row.scrollLeft += event.deltaY;
+}
function clear(): void {
placeholderHint.value = "";
}
@@ -51,18 +62,21 @@ onUnmounted(clear);
+