feat(webui): highlight skill references in sent messages

This commit is contained in:
chengyongru
2026-07-21 22:56:04 +08:00
committed by chengyongru
parent 89d8c055a8
commit 79b89f4f4c
7 changed files with 216 additions and 6 deletions
+8 -3
View File
@@ -18,10 +18,10 @@ import {
import { useTranslation } from "react-i18next";
import { AttachmentTile } from "@/components/AttachmentTile";
import { CliAppMentionText } from "@/components/CliAppMentionText";
import { ImageLightbox } from "@/components/ImageLightbox";
import { MarkdownText, preloadMarkdownText } from "@/components/MarkdownText";
import { SlashCommandText } from "@/components/SlashCommandText";
import { UserMessageText } from "@/components/UserMessageText";
import {
Tooltip,
TooltipContent,
@@ -37,6 +37,7 @@ import type {
CliAppInfo,
McpPresetInfo,
SlashCommand,
SkillSummary,
UICliAppAttachment,
UIMcpPresetAttachment,
UIImage,
@@ -51,6 +52,7 @@ interface MessageBubbleProps {
cliApps?: CliAppInfo[];
mcpPresets?: McpPresetInfo[];
slashCommands?: SlashCommand[];
skills?: SkillSummary[];
onOpenFilePreview?: (path: string) => void;
onForkFromHere?: () => void;
}
@@ -143,6 +145,7 @@ export function MessageBubble({
cliApps = [],
mcpPresets = [],
slashCommands = [],
skills = [],
onOpenFilePreview,
onForkFromHere,
}: MessageBubbleProps) {
@@ -171,15 +174,17 @@ export function MessageBubble({
const messageText = slashCommand ? (
<>
<SlashCommandText command={slashCommand.command} />
<CliAppMentionText
<UserMessageText
text={message.content.slice(slashCommand.command.length)}
skills={skills}
cliApps={mentionCliApps}
mcpPresets={mentionMcpPresets}
/>
</>
) : (
<CliAppMentionText
<UserMessageText
text={message.content}
skills={skills}
cliApps={mentionCliApps}
mcpPresets={mentionMcpPresets}
/>