diff --git a/app/components/chat-list.tsx b/app/components/chat-list.tsx
index 2c7b95aa..02ea086b 100644
--- a/app/components/chat-list.tsx
+++ b/app/components/chat-list.tsx
@@ -67,7 +67,10 @@ export function ChatItem(props: {
>
)}
-
@@ -77,14 +80,14 @@ export function ChatItem(props: {
}
export function ChatList(props: { narrow?: boolean }) {
- const [sessions, selectedIndex, selectSession, removeSession, moveSession] =
- useChatStore((state) => [
+ const [sessions, selectedIndex, selectSession, moveSession] = useChatStore(
+ (state) => [
state.sessions,
state.currentSessionIndex,
state.selectSession,
- state.removeSession,
state.moveSession,
- ]);
+ ],
+ );
const chatStore = useChatStore();
const navigate = useNavigate();
diff --git a/app/components/chat.tsx b/app/components/chat.tsx
index 8fc39e31..4c168669 100644
--- a/app/components/chat.tsx
+++ b/app/components/chat.tsx
@@ -391,7 +391,7 @@ export function Chat() {
const onPromptSelect = (prompt: Prompt) => {
setPromptHints([]);
inputRef.current?.focus();
- setUserInput(prompt.content);
+ setTimeout(() => setUserInput(prompt.content), 60);
};
// auto grow input
diff --git a/app/components/mask.tsx b/app/components/mask.tsx
index bfaab2b7..3f239aca 100644
--- a/app/components/mask.tsx
+++ b/app/components/mask.tsx
@@ -296,7 +296,10 @@ export function MaskPage() {
icon={}
text={Locale.Mask.Page.Create}
bordered
- onClick={() => maskStore.create()}
+ onClick={() => {
+ const createdMask = maskStore.create();
+ setEditingMaskId(createdMask.id);
+ }}
/>
diff --git a/app/components/sidebar.tsx b/app/components/sidebar.tsx
index 47a31172..77621964 100644
--- a/app/components/sidebar.tsx
+++ b/app/components/sidebar.tsx
@@ -138,7 +138,11 @@ export function SideBar(props: { className?: string }) {
}
- onClick={chatStore.deleteSession}
+ onClick={() => {
+ if (confirm(Locale.Home.DeleteChat)) {
+ chatStore.deleteSession(chatStore.currentSessionIndex);
+ }
+ }}
/>
diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx
index 5b6ed959..c16f94a4 100644
--- a/app/components/ui-lib.tsx
+++ b/app/components/ui-lib.tsx
@@ -158,6 +158,7 @@ export type ToastProps = {
text: string;
onClick: () => void;
};
+ onClose?: () => void;
};
export function Toast(props: ToastProps) {
@@ -167,7 +168,10 @@ export function Toast(props: ToastProps) {
{props.content}
{props.action && (