Agent Zero AI framework
ux: trigger focus on chat input after new chat and ctx switch
Alessandrodae502bc1d2c
diff --git a/webui/components/chat/input/input-store.js b/webui/components/chat/input/input-store.jsindex e49336d57..047458d86 100644--- a/webui/components/chat/input/input-store.js+++ b/webui/components/chat/input/input-store.js@@ -219,6 +219,13 @@ const model = {await fileBrowserStore.open(path);},+ focus() {+ const chatInput = document.getElementById("chat-input");+ if (chatInput) {+ chatInput.focus();+ }+ },+reset() {this.message = "";attachmentsStore.clearAttachments();diff --git a/webui/components/sidebar/chats/chats-store.js b/webui/components/sidebar/chats/chats-store.jsindex a3ad601ef..9b0ab247e 100644--- a/webui/components/sidebar/chats/chats-store.js+++ b/webui/components/sidebar/chats/chats-store.js@@ -12,6 +12,7 @@ import {import { store as notificationStore } from "/components/notifications/notification-store.js";import { store as tasksStore } from "/components/sidebar/tasks/tasks-store.js";import { store as syncStore } from "/components/sync/sync-store.js";+import { store as chatInputStore } from "/components/chat/input/input-store.js";const model = {contexts: [],diff --git a/webui/index.js b/webui/index.jsindex 29dd0fbed..ef632b17b 100644--- a/webui/index.js+++ b/webui/index.js@@ -557,6 +557,13 @@ export const setContext = function (id) {//skip one speech if enabled when switching contextif (preferencesStore.speech) skipOneSpeech = true;++ // Focus the chat input+ if (id) {+ setTimeout(() => {+ inputStore.focus();+ }, 50);+ }};export const deselectChat = function () {