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>
|
<p v-if="recordError" class="px-1 text-caption text-danger" role="alert">{{ recordError }}</p>
|
||||||
<Button
|
<Button
|
||||||
v-else
|
|
||||||
size="sm"
|
size="sm"
|
||||||
:variant="composerText.trim() ? 'default' : 'secondary'"
|
:variant="composerText.trim() ? 'default' : 'secondary'"
|
||||||
:disabled="!composerText.trim()"
|
:disabled="!composerText.trim()"
|
||||||
|
|||||||
@@ -72,9 +72,9 @@ function submitPrompt(): void {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Popover v-model:open="open">
|
<Popover v-model:open="open">
|
||||||
<PopoverTrigger as-child>
|
<Tooltip>
|
||||||
<Tooltip>
|
<TooltipTrigger as-child>
|
||||||
<TooltipTrigger as-child>
|
<PopoverTrigger as-child>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon-sm"
|
size="icon-sm"
|
||||||
@@ -83,10 +83,10 @@ function submitPrompt(): void {
|
|||||||
>
|
>
|
||||||
<Ellipsis />
|
<Ellipsis />
|
||||||
</Button>
|
</Button>
|
||||||
</TooltipTrigger>
|
</PopoverTrigger>
|
||||||
<TooltipContent>More</TooltipContent>
|
</TooltipTrigger>
|
||||||
</Tooltip>
|
<TooltipContent>More</TooltipContent>
|
||||||
</PopoverTrigger>
|
</Tooltip>
|
||||||
<PopoverContent align="end" class="grid w-64 gap-0.5 p-1">
|
<PopoverContent align="end" class="grid w-64 gap-0.5 p-1">
|
||||||
<template v-if="currentSession">
|
<template v-if="currentSession">
|
||||||
<Button
|
<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 { api } from "@/lib/api";
|
||||||
import { randomUUID } from "@/lib/uuid";
|
import { randomUUID } from "@/lib/uuid";
|
||||||
@@ -195,7 +195,14 @@ export async function answerAsk(answer: string): Promise<boolean> {
|
|||||||
export const sessions = ref<ChatSession[]>([]);
|
export const sessions = ref<ChatSession[]>([]);
|
||||||
export const currentSession = ref("");
|
export const currentSession = ref("");
|
||||||
export const messages = ref<ChatMessage[]>([]);
|
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 statusText = ref("Ready");
|
||||||
export const isSending = ref(false);
|
export const isSending = ref(false);
|
||||||
export const isLoadingSession = ref(false);
|
export const isLoadingSession = ref(false);
|
||||||
|
|||||||
Reference in new issue
Block a user