mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-19 07:59:34 +00:00
ux: trigger focus on chat input after new chat and ctx switch
This commit is contained in:
parent
b6d152c873
commit
dae502bc1d
3 changed files with 15 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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: [],
|
||||
|
|
|
|||
|
|
@ -557,6 +557,13 @@ export const setContext = function (id) {
|
|||
|
||||
//skip one speech if enabled when switching context
|
||||
if (preferencesStore.speech) skipOneSpeech = true;
|
||||
|
||||
// Focus the chat input
|
||||
if (id) {
|
||||
setTimeout(() => {
|
||||
inputStore.focus();
|
||||
}, 50);
|
||||
}
|
||||
};
|
||||
|
||||
export const deselectChat = function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue