Merge branch 'main' into feat/1905-1906-chat-suggestions
This commit is contained in:
commit
2bec268b29
37 files changed
+1310
-185
No files matched your search
@@ -4,18 +4,17 @@ import { computed } from "vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
MessageScroller,
|
||||
MessageScrollerButton,
|
||||
MessageScrollerContent,
|
||||
MessageScrollerItem,
|
||||
MessageScrollerProvider,
|
||||
MessageScrollerViewport,
|
||||
} from "@/components/ui/message-scroller";
|
||||
import { useLiveResource } from "@/stores/session";
|
||||
import ChatAskCard from "./ChatAskCard.vue";
|
||||
import ChatBubble from "./ChatBubble.vue";
|
||||
import ChatChooseCard from "./ChatChooseCard.vue";
|
||||
import ChatUpdateCard from "./ChatUpdateCard.vue";
|
||||
import ChatEmptyState from "./ChatEmptyState.vue";
|
||||
import ChatJumpButton from "./ChatJumpButton.vue";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import {
|
||||
@@ -27,7 +26,6 @@ import {
|
||||
sessionError,
|
||||
streamingTurn,
|
||||
type ChatMessage,
|
||||
reloadTranscript,
|
||||
} from "./state";
|
||||
|
||||
/**
|
||||
@@ -61,9 +59,21 @@ const bubbles = computed(() => messages.value.map(parts));
|
||||
// the scroller sees one row grow and settle, not one leave and another arrive.
|
||||
const rows = computed(() => {
|
||||
const turn = streamingTurn.value;
|
||||
if (!turn) return bubbles.value.map((bubble) => ({ ...bubble, live: false }));
|
||||
if (!turn) {
|
||||
return bubbles.value.map((bubble) => ({
|
||||
...bubble,
|
||||
live: false,
|
||||
reasoning: "",
|
||||
thinkingPending: false,
|
||||
}));
|
||||
}
|
||||
return [
|
||||
...bubbles.value.map((bubble) => ({ ...bubble, live: false })),
|
||||
...bubbles.value.map((bubble) => ({
|
||||
...bubble,
|
||||
live: false,
|
||||
reasoning: "",
|
||||
thinkingPending: false,
|
||||
})),
|
||||
{
|
||||
id: `m${bubbles.value.length}`,
|
||||
text: turn.text || "…",
|
||||
@@ -73,12 +83,14 @@ const rows = computed(() => {
|
||||
update: undefined,
|
||||
choose: undefined,
|
||||
live: true,
|
||||
reasoning: turn.reasoning ?? "",
|
||||
// Nothing said and nothing reasoned yet: the turn may still be thinking,
|
||||
// so the row shows the pending thinking trace. Once the answer's text
|
||||
// arrives without any reasoning, the trace is not rendered at all.
|
||||
thinkingPending: !turn.text && !(turn.reasoning ?? ""),
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
// A task this conversation started reports its outcome into it.
|
||||
useLiveResource("chat", () => void reloadTranscript());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -115,6 +127,8 @@ useLiveResource("chat", () => void reloadTranscript());
|
||||
:media="row.media"
|
||||
:assistant="row.assistant"
|
||||
:streaming="row.live"
|
||||
:reasoning="row.reasoning"
|
||||
:thinking-pending="row.thinkingPending"
|
||||
>
|
||||
<template v-if="row.live && streamingTurn">
|
||||
<Button
|
||||
@@ -136,7 +150,7 @@ useLiveResource("chat", () => void reloadTranscript());
|
||||
</MessageScrollerContent>
|
||||
</MessageScrollerViewport>
|
||||
|
||||
<MessageScrollerButton />
|
||||
<ChatJumpButton />
|
||||
</MessageScroller>
|
||||
</MessageScrollerProvider>
|
||||
</template>
|
||||
Reference in new issue
Block a user