* fix(ui/topbar): replace Jump to with a command palette, drop filler chrome Jump to opens a shadcn-vue Command dialog that finds pages, tasks and workflows by name. The connection indicator shows only when the stream is lost, the dead documentation link is gone, and the profile menu label has no stray whitespace. * fix(ui): trim stray whitespace from template text and drop em dashes from copy Element text that started or ended with a line break rendered with leading and trailing spaces. Also removes the unused 'soon' nav state and the nav group components no route reaches. * fix(ui): drop the space a hidden spinner left before button text * fix(ui/status): one dense Status page, full-width settings, problems-only apply status Status drops its tabs and the duplicate health card; services list only what is wrong. Settings pages use the full width, the resizable sidebar handle is gone, and apply status shows only processes that have not applied a change. PageHeader puts the title and actions on one line. * refactor(ui): use shadcn ToggleGroup and Badge, drop SegmentedControl and StatusPill Status badges show only when a state needs attention: no Running, Enabled, Active, Listening or live pills next to healthy rows. Removes the unused pagination, radio-group and scroll-area components. * fix(ui/history): use the shadcn Table with fixed columns so nothing is clipped * fix(ui/workflows): apply ?workflow= only once the workflow is listed Selecting it before the definitions loaded opened an empty canvas. * refactor(ui/workflows): use shadcn Input, NativeSelect, Checkbox and Button in editors Replaces hand-rolled inputs, selects, the repository mode switch and icon buttons in the workflow editor, bind dialog, harness page, sources panel and review gate. Adds the upstream shadcn-vue NativeSelect. * style(ui): rounded-rectangle controls instead of pills Halves the radius scale so inputs, selects and buttons stop reading as pills, and badges and chips lose their full rounding. * fix(ui/alerts): centre the bell's failed state and stop it contradicting Needs you * fix(ui/tasks): one header line, aligned columns, no placeholder issue numbers Tasks puts its filters beside the title and drops the stat tiles the dashboard already shows. Sort headers align with their cells, chat tasks no longer show their synthetic issue number, and Logs and the task not-found page use the shared header. * fix(ui/dashboard): shared header and cards, empty cards stay silent Needs you uses the shadcn Card and drops its duplicate Open button; quality gates and token outlook render only when there is something to show; the throughput strip moves into the dashboard, its only user. * refactor(ui/stores): one Pinia store per feature Splits the site-wide control-plane store and the module-level refs into settings, workflows, tasks, events, org and session stores. Identity requests move into lib/api. Drops store fields nothing read: per-resource stream state, the states map and loadApplyStatus. * fix(ui/org): one header for the org area, sections drop their repeated titles The org name is the page title with the admin's org switcher and New org beside it; Members and Workspaces tables sit in cards like other pages. * fix(ui/events): shadcn Tabs for the capture, map and bind steps Replaces the numbered step strip with line tabs that carry each step's count; the Listening pill is gone and Capture off shows only when it is. * fix(ui/workflows): confirm a workflow delete in an AlertDialog, not window.confirm * style(ui/settings): denser setting rows
114 lines
3.8 KiB
Vue
114 lines
3.8 KiB
Vue
<script setup lang="ts">
|
|
import { computed } from "vue";
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
import {
|
|
MessageScroller,
|
|
MessageScrollerButton,
|
|
MessageScrollerContent,
|
|
MessageScrollerItem,
|
|
MessageScrollerProvider,
|
|
MessageScrollerViewport,
|
|
} from "@/components/ui/message-scroller";
|
|
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 {
|
|
messages,
|
|
sendMessage,
|
|
streamingTurn,
|
|
type ChatMessage,
|
|
} from "./state";
|
|
|
|
/**
|
|
* The conversation: the messages so far, the turn still arriving, and what the
|
|
* panel says before either exists.
|
|
*
|
|
* The scroller follows the tail, and stops following the moment the reader
|
|
* scrolls up rather than yanking them back on every streamed token. That is
|
|
* what MessageScroller is for, so it is used rather than re-derived: an
|
|
* earlier version set scrollTop from a watcher, which has neither the
|
|
* "reader scrolled away" state nor a way back down.
|
|
*/
|
|
const emit = defineEmits<{ prompt: [text: string] }>();
|
|
|
|
function parts(message: ChatMessage) {
|
|
const from = message.from ?? message.From ?? "";
|
|
// Anything this browser's composer did not send is Archie's answer.
|
|
return {
|
|
text: message.text ?? message.Text ?? "",
|
|
tools: message.tool_calls || message.ToolCalls || [],
|
|
// Attachments have no bytes left to render -- the record kept their
|
|
// metadata only -- so the bubble labels them.
|
|
media: message.media || [],
|
|
assistant: from !== "web",
|
|
update: message.update,
|
|
choose: message.choose,
|
|
};
|
|
}
|
|
|
|
const bubbles = computed(() => messages.value.map(parts));
|
|
</script>
|
|
|
|
<template>
|
|
<MessageScrollerProvider auto-scroll default-scroll-position="end">
|
|
<MessageScroller class="min-h-0 flex-1">
|
|
<MessageScrollerViewport>
|
|
<MessageScrollerContent class="gap-4 p-4">
|
|
<ChatEmptyState
|
|
v-if="!bubbles.length && !streamingTurn"
|
|
@prompt="emit('prompt', $event)"
|
|
/>
|
|
|
|
<template v-else>
|
|
<MessageScrollerItem
|
|
v-for="(bubble, i) in bubbles"
|
|
:key="i"
|
|
:message-id="`m${i}`"
|
|
>
|
|
<ChatBubble
|
|
:text="bubble.text"
|
|
:tools="bubble.tools"
|
|
:media="bubble.media"
|
|
:assistant="bubble.assistant"
|
|
>
|
|
<ChatUpdateCard v-if="bubble.update" :update="bubble.update" />
|
|
<ChatChooseCard v-if="bubble.choose" :choose="bubble.choose" />
|
|
</ChatBubble>
|
|
</MessageScrollerItem>
|
|
|
|
<!-- The live turn is a bubble like any other, so what arrives is
|
|
rendered by the same rules as what was already there. It is the
|
|
scroll anchor while it streams. -->
|
|
<MessageScrollerItem
|
|
v-if="streamingTurn"
|
|
message-id="streaming"
|
|
scroll-anchor
|
|
>
|
|
<ChatBubble
|
|
:text="streamingTurn.text || '…'"
|
|
:tools="streamingTurn.tools"
|
|
assistant
|
|
streaming
|
|
>
|
|
<Button
|
|
v-if="streamingTurn.isError && streamingTurn.turn"
|
|
variant="outline"
|
|
size="sm"
|
|
class="mt-2"
|
|
@click="sendMessage({ turn: streamingTurn.turn })"
|
|
>Retry</Button>
|
|
<ChatAskCard v-if="streamingTurn.ask" :ask="streamingTurn.ask" />
|
|
</ChatBubble>
|
|
</MessageScrollerItem>
|
|
</template>
|
|
</MessageScrollerContent>
|
|
</MessageScrollerViewport>
|
|
|
|
<MessageScrollerButton />
|
|
</MessageScroller>
|
|
</MessageScrollerProvider>
|
|
</template>
|