webui: switch to chat view when user sends a message
When a user sends a message by hitting the Send button or pressing Enter,
automatically switch them back to the Chat view so they can immediately
see that their message is being processed.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: s35da158cf333d3abk
diff --git a/webui/src/web-components/sketch-app-shell.ts b/webui/src/web-components/sketch-app-shell.ts
index 0b58a10..a95c37c 100644
--- a/webui/src/web-components/sketch-app-shell.ts
+++ b/webui/src/web-components/sketch-app-shell.ts
@@ -840,6 +840,11 @@
return;
}
try {
+ // Always switch to chat view when sending a message so user can see processing
+ if (this.viewMode !== "chat") {
+ this.toggleViewMode("chat", true);
+ }
+
// Send the message to the server
const response = await fetch("chat", {
method: "POST",