feat(webui): unify mention candidate display

This commit is contained in:
chengyongru authored and chengyongru committed 2026-10-27 11:53:49 +08:00
1 parent 69d2fd87b0
commit 8857d4f9c8
4 files changed
+180 -45

No files matched your search

+19 -2
View File
@@ -4,13 +4,30 @@ import { MessageBubble } from "@/components/MessageBubble";
import { ThreadComposer } from "@/components/thread/ThreadComposer";
import { ThemeProvider, useTheme } from "@/hooks/useTheme";
import { useReadingTypography } from "@/hooks/useReadingTypography";
import type { ChatSummary, SlashCommand, UIMessage } from "@/lib/types";
import type { ChatSummary, CliAppInfo, McpPresetInfo, SlashCommand, UIMessage } from "@/lib/types";
const session: ChatSummary = {
key: "websocket:typography", channel: "websocket", chatId: "typography",
createdAt: null, updatedAt: null, title: "Reference target", preview: "",
handle: { id: "handle_12345678901234567890123456789012", name: "typography" },
};
const longSession: ChatSummary = {
...session, key: "websocket:long-reference", chatId: "long-reference", title: "A longer conversation title",
handle: { id: "handle_abcdefabcdefabcdefabcdefabcdefab", name: "mimamimamimamima" },
};
const logo = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Crect width='20' height='20' fill='navy'/%3E%3C/svg%3E";
const cliApps: CliAppInfo[] = [{
name: "drawio", display_name: "Draw.io", category: "diagram", description: "Diagram editor",
requires: "", source: "fixture", entry_point: "drawio", install_supported: true,
installed: true, available: true, status: "installed", skill_installed: true, logo_url: logo,
}];
const linearPreset: McpPresetInfo = {
name: "linear", display_name: "Linear", category: "productivity", description: "Issue tracker",
docs_url: "", transport: "streamableHttp", requires: "", note: "", install_supported: true,
installed: true, configured: true, available: true, status: "configured", required_fields: [],
connection_summary: "", logo_url: logo,
};
const mcpPresets = [linearPreset, { ...linearPreset, name: "adobe-express-docs", display_name: "Adobe Express Developer" }];
const commands: SlashCommand[] = [{
command: "/goal", title: "Start a goal", description: "Start a sustained goal.",
icon: "activity", lifecycle: "agent_turn_with_args", acceptsArgs: true,
@@ -27,7 +44,7 @@ export function InlineReferencesFixture() {
return <ThemeProvider theme={theme}>
<main className="mx-auto h-full max-w-[var(--content-column-width)] space-y-6 overflow-y-auto p-4">
{[answer, ...sent].map(message => <MessageBubble key={message.id} message={message} slashCommands={commands} />)}
<ThreadComposer compactWhenIdle sessions={[session]} modelLabel="Fixture" persistDraft={false} slashCommands={commands}
<ThreadComposer compactWhenIdle sessions={[session, longSession]} cliApps={cliApps} mcpPresets={mcpPresets} modelLabel="Fixture" persistDraft={false} slashCommands={commands}
onSend={(text, _media, options) => setSent(current => [...current, {
id: `sent-${current.length}`, role: "user", content: text, createdAt: current.length + 2,
}, ...(options?.userShell ? [{