This commit is contained in:
3 files changed
+16
-10
No files matched your search
@@ -251,7 +251,6 @@ function onKeydown(event: KeyboardEvent): void {
|
||||
>
|
||||
<p v-if="recordError" class="px-1 text-caption text-danger" role="alert">{{ recordError }}</p>
|
||||
<Button
|
||||
v-else
|
||||
size="sm"
|
||||
:variant="composerText.trim() ? 'default' : 'secondary'"
|
||||
:disabled="!composerText.trim()"
|
||||
|
||||
@@ -72,9 +72,9 @@ function submitPrompt(): void {
|
||||
|
||||
<template>
|
||||
<Popover v-model:open="open">
|
||||
<PopoverTrigger as-child>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<PopoverTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
@@ -83,10 +83,10 @@ function submitPrompt(): void {
|
||||
>
|
||||
<Ellipsis />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>More</TooltipContent>
|
||||
</Tooltip>
|
||||
</PopoverTrigger>
|
||||
</PopoverTrigger>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>More</TooltipContent>
|
||||
</Tooltip>
|
||||
<PopoverContent align="end" class="grid w-64 gap-0.5 p-1">
|
||||
<template v-if="currentSession">
|
||||
<Button
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { onMounted, onUnmounted, ref, watch, type Ref } from "vue";
|
||||
import { computed, onMounted, onUnmounted, ref, watch, type Ref } from "vue";
|
||||
|
||||
import { api } from "@/lib/api";
|
||||
import { randomUUID } from "@/lib/uuid";
|
||||
@@ -195,7 +195,14 @@ export async function answerAsk(answer: string): Promise<boolean> {
|
||||
export const sessions = ref<ChatSession[]>([]);
|
||||
export const currentSession = ref("");
|
||||
export const messages = ref<ChatMessage[]>([]);
|
||||
export const composerText = ref("");
|
||||
const drafts = ref<Record<string, string>>({});
|
||||
/** The unsent text of the open conversation; each conversation keeps its own. */
|
||||
export const composerText = computed({
|
||||
get: () => drafts.value[currentSession.value] ?? "",
|
||||
set: (value: string) => {
|
||||
drafts.value = { ...drafts.value, [currentSession.value]: value };
|
||||
},
|
||||
});
|
||||
export const statusText = ref("Ready");
|
||||
export const isSending = ref(false);
|
||||
export const isLoadingSession = ref(false);
|
||||
|
||||
Reference in new issue
Block a user