Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat(markdown): user_feedback card + task card polish + Run now context menu (#14727)

Arvin Xu79152fa222a5
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index f457df243c5..ef06cc08091 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -567,6 +567,7 @@
"taskList.contextMenu.copyLink": "Copy Link",
"taskList.contextMenu.copyLinkSuccess": "Link copied",
"taskList.contextMenu.priority": "Priority",
+ "taskList.contextMenu.runNow": "Run now",
"taskList.contextMenu.status": "Status",
"taskList.empty": "No tasks yet",
"taskList.emptyHero.greeting": "What should we tackle today?",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index 10509c6f63b..0d3ad9c11b3 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -567,6 +567,7 @@
"taskList.contextMenu.copyLink": "复制链接",
"taskList.contextMenu.copyLinkSuccess": "链接已复制",
"taskList.contextMenu.priority": "优先级",
+ "taskList.contextMenu.runNow": "立即运行",
"taskList.contextMenu.status": "状态",
"taskList.empty": "暂无任务",
"taskList.emptyHero.greeting": "今天想搞定点什么?",
diff --git a/packages/const/src/plugin.ts b/packages/const/src/plugin.ts
index dfeff393c1e..6485284311f 100644
--- a/packages/const/src/plugin.ts
+++ b/packages/const/src/plugin.ts
@@ -7,6 +7,7 @@ export const MENTION_TAG = 'mention';
export const THINKING_TAG = 'think';
export const LOCAL_FILE_TAG = 'localFile';
export const TASK_TAG = 'task';
+export const USER_FEEDBACK_TAG = 'user_feedback';
// https://regex101.com/r/TwzTkf/2
export const ARTIFACT_TAG_REGEX = /<lobeArtifact\b[^>]*>(?<content>[\S\s]*?)(?:<\/lobeArtifact>|$)/;
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskSubtasks.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskSubtasks.tsx
index 4b3b63f40bf..fb015d9e7fb 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskSubtasks.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskSubtasks.tsx
@@ -170,12 +170,14 @@ const TaskSubtasks = memo(() => {
event.preventDefault();
showContextMenu(
buildItems({
+ assigneeAgentId: subtask.assignee?.id,
identifier: subtask.identifier,
priority: subtask.priority,
status: subtask.status,
}),
);
installKeyboardHandlers({
+ assigneeAgentId: subtask.assignee?.id,
identifier: subtask.identifier,
priority: subtask.priority,
status: subtask.status,
diff --git a/src/features/AgentTasks/features/useTaskItemContextMenu.tsx b/src/features/AgentTasks/features/useTaskItemContextMenu.tsx
index c84094fb4d0..80668a429d5 100644
--- a/src/features/AgentTasks/features/useTaskItemContextMenu.tsx
+++ b/src/features/AgentTasks/features/useTaskItemContextMenu.tsx
@@ -8,11 +8,20 @@ import {
} from '@lobehub/ui';
import { App } from 'antd';
import { cssVar } from 'antd-style';
-import { BarChart3Icon, CircleDashedIcon, CopyIcon, LinkIcon, Trash2Icon } from 'lucide-react';
+import {
+ BarChart3Icon,
+ CircleDashedIcon,
+ CopyIcon,
+ LinkIcon,
+ PlayIcon,
+ Trash2Icon,
+} from 'lucide-react';
import { useCallback, useEffect, useMemo, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { useAppOrigin } from '@/hooks/useAppOrigin';
+import { useAgentStore } from '@/store/agent';
+import { builtinAgentSelectors } from '@/store/agent/selectors';
import { useTaskStore } from '@/store/task';
import { renderMenuExtra } from './menuExtra';
@@ -29,11 +38,14 @@ interface TaskItemContextMenu {
}
export interface TaskContextMenuTarget {
+ assigneeAgentId?: string | null;
identifier: string;
priority?: number | null;
status: string;
}
+const RUN_NOW_STATUSES = new Set<TaskStatus>(['backlog', 'completed']);
+
export interface TaskContextMenuActions {
buildItems: (task: TaskContextMenuTarget) => ContextMenuItem[];
installKeyboardHandlers: (task: TaskContextMenuTarget) => void;
@@ -48,6 +60,8 @@ export const useTaskContextMenuActions = (): TaskContextMenuActions => {
const updateTask = useTaskStore((s) => s.updateTask);
const refreshTaskList = useTaskStore((s) => s.refreshTaskList);
const deleteTask = useTaskStore((s) => s.deleteTask);
+ const runTask = useTaskStore((s) => s.runTask);
+ const inboxAgentId = useAgentStore(builtinAgentSelectors.inboxAgentId);
const cleanupRef = useRef<(() => void) | null>(null);
const activeSubmenuRef = useRef<ActiveSubmenu>(null);
@@ -111,8 +125,26 @@ export const useTaskContextMenuActions = (): TaskContextMenuActions => {
});
const taskUrl = `${appOrigin}/task/${task.identifier}`;
+ const canRunNow = RUN_NOW_STATUSES.has(currentStatus);
return [
+ ...(canRunNow
+ ? ([
+ {
+ icon: <Icon icon={PlayIcon} />,
+ key: 'runNow',
+ label: t('taskList.contextMenu.runNow'),
+ onClick: async ({ domEvent }) => {
+ domEvent.stopPropagation();
+ if (!task.assigneeAgentId && inboxAgentId) {
+ await updateTask(task.identifier, { assigneeAgentId: inboxAgentId });
+ }
+ await runTask(task.identifier);
+ },
+ },
+ { type: 'divider' },
+ ] satisfies GenericItemType[])
+ : []),
{
children: statusChildren,
icon: <Icon icon={CircleDashedIcon} />,
@@ -239,14 +271,25 @@ export const useTaskContextMenuActions = (): TaskContextMenuActions => {
};
return { buildItems, installKeyboardHandlers };
- }, [modal, message, t, appOrigin, updateTaskStatus, updateTask, refreshTaskList, deleteTask]);
+ }, [
+ modal,
+ message,
+ t,
+ appOrigin,
+ updateTaskStatus,
+ updateTask,
+ refreshTaskList,
+ deleteTask,
+ runTask,
+ inboxAgentId,
+ ]);
};
export const useTaskItemContextMenu = (task: TaskContextMenuTarget): TaskItemContextMenu => {
const { buildItems, installKeyboardHandlers } = useTaskContextMenuActions();
const items = useMemo(
() => buildItems(task),
- [buildItems, task.identifier, task.status, task.priority],
+ [buildItems, task.identifier, task.status, task.priority, task.assigneeAgentId],
);
const onContextMenu = useCallback(
() => installKeyboardHandlers(task),
diff --git a/src/features/Conversation/Markdown/plugins/Task/Render.tsx b/src/features/Conversation/Markdown/plugins/Task/Render.tsx
index a5c6534d452..cbc79078a7a 100644
--- a/src/features/Conversation/Markdown/plugins/Task/Render.tsx
+++ b/src/features/Conversation/Markdown/plugins/Task/Render.tsx
@@ -1,25 +1,12 @@
-import type { TaskStatus } from '@lobechat/types';
import { Flexbox, Text } from '@lobehub/ui';
-import { createStaticStyles, cssVar } from 'antd-style';
+import { createStaticStyles } from 'antd-style';
import { ClipboardList } from 'lucide-react';
import { memo, useMemo } from 'react';
-import TaskStatusIcon from '@/features/AgentTasks/features/TaskStatusIcon';
-
import { type MarkdownElementProps } from '../type';
import { useTaskCardScope } from './context';
import { type ParsedTaskContent, parseTaskContent } from './parseTaskContent';
-const KNOWN_STATUSES: TaskStatus[] = [
- 'backlog',
- 'canceled',
- 'completed',
- 'failed',
- 'paused',
- 'running',
- 'scheduled',
-];
-
const styles = createStaticStyles(({ css, cssVar }) => ({
divider: css`
inline-size: 100%;
@@ -112,9 +99,6 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
`,
}));
-const isKnownStatus = (status?: string): status is TaskStatus =>
- !!status && (KNOWN_STATUSES as string[]).includes(status);
-
const FieldRow = memo<{ label: string; value?: string }>(({ label, value }) => {
if (!value) return null;
return (
@@ -165,33 +149,10 @@ const Render = memo<TaskRenderProps>(({ children }) => {
<Flexbox flex={1} gap={4} style={{ minWidth: 0 }}>
<Flexbox horizontal align={'center'} gap={8} style={{ minWidth: 0 }}>
{parsed.identifier && <span className={styles.identifier}>{parsed.identifier}</span>}
- <Text ellipsis weight={500}>
+ <Text ellipsis style={{ flex: 1, minWidth: 0 }} weight={500}>
{titleText}
</Text>
</Flexbox>
- {(parsed.status || parsed.priority) && (
- <Flexbox horizontal align={'center'} gap={8}>
- {parsed.status && (
- <Flexbox horizontal align={'center'} gap={4}>
- {isKnownStatus(parsed.status) ? (
- <TaskStatusIcon size={14} status={parsed.status} />
- ) : (
- <span style={{ color: cssVar.colorTextTertiary, fontSize: 12 }}>
- {parsed.statusIcon}
- </span>
- )}
- <Text fontSize={12} type={'secondary'}>
- {parsed.status}
- </Text>
- </Flexbox>
- )}
- {parsed.priority && (
- <Text fontSize={12} type={'secondary'}>
- · Priority: {parsed.priority}
- </Text>
- )}
- </Flexbox>
- )}
</Flexbox>
</Flexbox>
@@ -207,17 +168,9 @@ const Render = memo<TaskRenderProps>(({ children }) => {
</>
)}
- {(parsed.description ||
- parsed.agent ||
- parsed.parent ||
- parsed.topics ||
- parsed.dependencies ||
- parsed.review) && (
+ {(parsed.description || parsed.dependencies || parsed.review) && (
<Flexbox gap={4}>
<FieldRow label="Description" value={parsed.description} />
- <FieldRow label="Agent" value={parsed.agent} />
- <FieldRow label="Parent" value={parsed.parent} />
- <FieldRow label="Topics" value={parsed.topics} />
<FieldRow label="Dependencies" value={parsed.dependencies} />
<FieldRow label="Review" value={parsed.review} />
</Flexbox>
diff --git a/src/features/Conversation/Markdown/plugins/UserFeedback/Render.tsx b/src/features/Conversation/Markdown/plugins/UserFeedback/Render.tsx
new file mode 100644
index 00000000000..8aaa18af947
--- /dev/null
+++ b/src/features/Conversation/Markdown/plugins/UserFeedback/Render.tsx
@@ -0,0 +1,115 @@
+import { Flexbox, Text } from '@lobehub/ui';
+import { createStaticStyles } from 'antd-style';
+import { MessageSquareText } from 'lucide-react';
+import { memo, useMemo } from 'react';
+
+import { type MarkdownElementProps } from '../type';
+import { type ParsedUserFeedbackComment, parseUserFeedback } from './parseUserFeedback';
+
+const styles = createStaticStyles(({ css, cssVar }) => ({
+ body: css`
+ padding-block-start: 12px;
+ padding-inline-start: 44px;
+ `,
+ comment: css`
+ font-size: 13px;
+ line-height: 1.6;
+ color: ${cssVar.colorText};
+ word-break: break-word;
+ white-space: pre-wrap;
+ `,
+ countBadge: css`
+ flex: none;
+
+ padding-block: 1px;
+ padding-inline: 6px;
+ border-radius: 4px;
+
+ font-size: 12px;
+ color: ${cssVar.colorTextSecondary};
+
+ background: ${cssVar.colorFillQuaternary};
+ `,
+ headerIcon: css`
+ display: flex;
+ flex: none;
+ align-items: center;
+ justify-content: center;
+
+ inline-size: 32px;
+ block-size: 32px;
+
+ color: ${cssVar.colorTextSecondary};
+ `,
+ root: css`
+ /* Override @lobehub/ui Markdown's default <details> card chrome (bg + padding + box-shadow).
+ Need !important because the lib targets via .parent details (higher specificity).
+ padding-bottom puts a 12px gap above the divider; margin-bottom puts a 12px gap below it,
+ matching the symmetric 12px the task card uses around its own internal divider. */
+ margin-block: 0 12px !important;
+ padding-block: 0 12px !important;
+ padding-inline: 0 !important;
+ border-block-end: 1px solid ${cssVar.colorSplit} !important;
+ border-radius: 0 !important;
+
+ background: transparent !important;
+ box-shadow: none !important;
+ `,
+ summary: css`
+ cursor: pointer;
+ list-style: none;
+
+ &::-webkit-details-marker {
+ display: none;
+ }
+ `,
+ time: css`
+ font-size: 12px;
+ color: ${cssVar.colorTextTertiary};
+ `,
+}));
+
+const Comment = memo<{ comment: ParsedUserFeedbackComment }>(({ comment }) => (
+ <Flexbox gap={2}>
+ {comment.time && <span className={styles.time}>{comment.time}</span>}
+ <div className={styles.comment}>{comment.content}</div>
+ </Flexbox>
+));
+
+Comment.displayName = 'UserFeedbackComment';
+
+const Render = memo<MarkdownElementProps>(({ children }) => {
+ const text = typeof children === 'string' ? children : String(children ?? '');
+ const comments = useMemo(() => parseUserFeedback(text), [text]);
+
+ if (comments.length === 0) return null;
+
+ const countLabel = comments.length === 1 ? '1 comment' : `${comments.length} comments`;
+
+ return (
+ <details className={styles.root}>
+ <summary className={styles.summary}>
+ <Flexbox horizontal align={'center'} gap={12}>
+ <span className={styles.headerIcon}>
+ <MessageSquareText size={16} />
+ </span>
+ <Flexbox horizontal align={'center'} flex={1} gap={8} style={{ minWidth: 0 }}>
+ <Text ellipsis weight={500}>
+ User feedback
+ </Text>
+ <span className={styles.countBadge}>{countLabel}</span>
+ </Flexbox>
+ </Flexbox>
+ </summary>
+ <Flexbox className={styles.body} gap={12}>
+ {comments.map((comment, idx) => (
+ <Comment comment={comment} key={comment.id ?? idx} />
+ ))}
+ </Flexbox>
+ </details>
+ );
+});
+
+Render.displayName = 'UserFeedbackRender';
+
+export default Render;
diff --git a/src/features/Conversation/Markdown/plugins/UserFeedback/index.ts b/src/features/Conversation/Markdown/plugins/UserFeedback/index.ts
new file mode 100644
index 00000000000..c512c020149
--- /dev/null
+++ b/src/features/Conversation/Markdown/plugins/UserFeedback/index.ts
@@ -0,0 +1,14 @@
+import { USER_FEEDBACK_TAG } from '@/const/plugin';
+
+import { type MarkdownElement } from '../type';
+import { remarkUserFeedbackBlock } from './remarkUserFeedbackBlock';
+import Component from './Render';
+
+const UserFeedbackElement: MarkdownElement = {
+ Component,
+ remarkPlugin: remarkUserFeedbackBlock,
+ scope: 'user',
+ tag: USER_FEEDBACK_TAG,
+};
+
+export default UserFeedbackElement;
diff --git a/src/features/Conversation/Markdown/plugins/UserFeedback/integration.test.ts b/src/features/Conversation/Markdown/plugins/UserFeedback/integration.test.ts
new file mode 100644
index 00000000000..c9d6c9e6897
--- /dev/null
+++ b/src/features/Conversation/Markdown/plugins/UserFeedback/integration.test.ts
@@ -0,0 +1,80 @@
+import remarkParse from 'remark-parse';
+import { unified } from 'unified';
+import { describe, expect, it } from 'vitest';
+
+import { USER_FEEDBACK_TAG } from '@/const/plugin';
+
+import { remarkTaskBlock } from '../Task/remarkTaskBlock';
+import { remarkUserFeedbackBlock } from './remarkUserFeedbackBlock';
+
+const runRemark = (markdown: string) => {
+ const processor = unified().use(remarkParse).use(remarkUserFeedbackBlock).use(remarkTaskBlock);
+ const tree = processor.parse(markdown);
+ return processor.runSync(tree);
+};
+
+describe('user_feedback remark integration', () => {
+ it('captures a user_feedback block sitting next to a <task> block', () => {
+ const markdown = `<user_feedback>
+<comment id="cmt_1" time="9d ago">你能否写成文档而不是写在最后一个输出里? </comment>
+<comment id="cmt_2" time="9d ago">不是写到linear 里,而是写 agent Document 里面</comment>
+</user_feedback>
+
+<task>
+T-31 总结下我前一天在 linear 上的工作情况
+Status: ⏰ scheduled Priority: -
+Instruction: 总结下我前一天在 linear 上的工作情况。以文档形式产出内容
+
+Review: (not configured)
+</task>`;
+
+ const tree: any = runRemark(markdown);
+ const feedbackNodes = (tree.children as any[]).filter(
+ (c) => c.type === `${USER_FEEDBACK_TAG}Block`,
+ );
+ const taskNodes = (tree.children as any[]).filter((c) => c.type === 'taskBlock');
+
+ expect(feedbackNodes).toHaveLength(1);
+ expect(taskNodes).toHaveLength(1);
+
+ const feedbackInner = feedbackNodes[0].data.hChildren[0].value as string;
+ expect(feedbackInner).toContain('<comment id="cmt_1"');
+ expect(feedbackInner).toContain('你能否写成文档而不是写在最后一个输出里?');
+ expect(feedbackInner).toContain('不是写到linear 里,而是写 agent Document 里面');
+
+ const taskInner = taskNodes[0].data.hChildren[0].value as string;
+ expect(taskInner).toContain('T-31');
+ expect(taskInner).toContain('Review: (not configured)');
+ });
+
+ it('captures a simple user_feedback block', () => {
+ const markdown = `<user_feedback>
+<comment time="1m ago">looks good</comment>
+</user_feedback>`;
+ const tree: any = runRemark(markdown);
+ const feedbackNodes = (tree.children as any[]).filter(
+ (c) => c.type === `${USER_FEEDBACK_TAG}Block`,
+ );
+ expect(feedbackNodes).toHaveLength(1);
+ expect(feedbackNodes[0].data.hChildren[0].value).toContain('looks good');
+ });
+
+ it('does not match when only the opening tag is present', () => {
+ const markdown = `<user_feedback>
+<comment time="1m ago">orphan</comment>`;
+ const tree: any = runRemark(markdown);
+ const feedbackNodes = (tree.children as any[]).filter(
+ (c) => c.type === `${USER_FEEDBACK_TAG}Block`,
+ );
+ expect(feedbackNodes).toHaveLength(0);
+ });
+
+ it('leaves unrelated markdown untouched', () => {
+ const markdown = `Just a normal paragraph without any tag.`;
+ const tree: any = runRemark(markdown);
+ const feedbackNodes = (tree.children as any[]).filter(
+ (c) => c.type === `${USER_FEEDBACK_TAG}Block`,
+ );
+ expect(feedbackNodes).toHaveLength(0);
+ });
+});
diff --git a/src/features/Conversation/Markdown/plugins/UserFeedback/parseUserFeedback.test.ts b/src/features/Conversation/Markdown/plugins/UserFeedback/parseUserFeedback.test.ts
new file mode 100644
index 00000000000..51f6289067f
--- /dev/null
+++ b/src/features/Conversation/Markdown/plugins/UserFeedback/parseUserFeedback.test.ts
@@ -0,0 +1,38 @@
+import { describe, expect, it } from 'vitest';
+
+import { parseUserFeedback } from './parseUserFeedback';
+
+describe('parseUserFeedback', () => {
+ it('parses comments with id and time', () => {
+ const raw = `<comment id="cmt_1" time="9d ago">你能否写成文档而不是写在最后一个输出里?</comment>
+<comment id="cmt_2" time="9d ago">不是写到linear 里,而是写 agent Document 里面</comment>`;
+
+ const parsed = parseUserFeedback(raw);
+
+ expect(parsed).toHaveLength(2);
+ expect(parsed[0]).toEqual({
+ content: '你能否写成文档而不是写在最后一个输出里?',
+ id: 'cmt_1',
+ time: '9d ago',
+ });
+ expect(parsed[1].content).toBe('不是写到linear 里,而是写 agent Document 里面');
+ });
+
+ it('handles comments without attributes', () => {
+ const raw = `<comment>plain feedback</comment>`;
+ const parsed = parseUserFeedback(raw);
+ expect(parsed).toEqual([{ content: 'plain feedback', id: undefined, time: undefined }]);
+ });
+
+ it('returns empty array for empty input', () => {
+ expect(parseUserFeedback('')).toEqual([]);
+ });
+
+ it('ignores stray text between comments', () => {
+ const raw = `noise<comment time="1m ago">a</comment>more noise<comment>b</comment>`;
+ const parsed = parseUserFeedback(raw);
+ expect(parsed).toHaveLength(2);
+ expect(parsed[0].content).toBe('a');
+ expect(parsed[1].content).toBe('b');
+ });
+});
diff --git a/src/features/Conversation/Markdown/plugins/UserFeedback/parseUserFeedback.ts b/src/features/Conversation/Markdown/plugins/UserFeedback/parseUserFeedback.ts
new file mode 100644
index 00000000000..fc1a1fa921e
--- /dev/null
+++ b/src/features/Conversation/Markdown/plugins/UserFeedback/parseUserFeedback.ts
@@ -0,0 +1,34 @@
+export interface ParsedUserFeedbackComment {
+ content: string;
+ id?: string;
+ time?: string;
+}
+
+const COMMENT_REGEX = /<comment\b(?<attrs>[^>]*)>(?<body>[\S\s]*?)<\/comment>/g;
+const ATTR_REGEX = /(\w+)\s*=\s*"([^"]*)"/g;
+
+const parseAttrs = (attrs: string): Record<string, string> => {
+ const out: Record<string, string> = {};
+ let match: RegExpExecArray | null;
+ ATTR_REGEX.lastIndex = 0;
+ while ((match = ATTR_REGEX.exec(attrs)) !== null) {
+ out[match[1]] = match[2];
+ }
+ return out;
+};
+
+export const parseUserFeedback = (raw: string): ParsedUserFeedbackComment[] => {
+ if (!raw) return [];
+ const comments: ParsedUserFeedbackComment[] = [];
+ let match: RegExpExecArray | null;
+ COMMENT_REGEX.lastIndex = 0;
+ while ((match = COMMENT_REGEX.exec(raw)) !== null) {
+ const attrs = parseAttrs(match.groups?.attrs ?? '');
+ comments.push({
+ content: (match.groups?.body ?? '').trim(),
+ id: attrs.id,
+ time: attrs.time,
+ });
+ }
+ return comments;
+};
diff --git a/src/features/Conversation/Markdown/plugins/UserFeedback/remarkUserFeedbackBlock.ts b/src/features/Conversation/Markdown/plugins/UserFeedback/remarkUserFeedbackBlock.ts
new file mode 100644
index 00000000000..291561961a5
--- /dev/null
+++ b/src/features/Conversation/Markdown/plugins/UserFeedback/remarkUserFeedbackBlock.ts
@@ -0,0 +1,60 @@
+import { SKIP, visit } from 'unist-util-visit';
+
+import { USER_FEEDBACK_TAG } from '@/const/plugin';
+
+const OPEN_TAG = `<${USER_FEEDBACK_TAG}>`;
+const CLOSE_TAG = `</${USER_FEEDBACK_TAG}>`;
+
+/**
+ * Captures `<user_feedback>...</user_feedback>` blocks from a markdown AST.
+ *
+ * Because the CommonMark/remark HTML parser only recognises tag names
+ * matching `[a-zA-Z][a-zA-Z0-9-]*`, an underscore in `user_feedback` keeps
+ * the opening and closing tags from being parsed as `html` nodes; they end
+ * up as plain text inside a paragraph (mixed with html nodes for inner
+ * `<comment ...>` tags). This plugin operates on those paragraphs.
+ */
+export const remarkUserFeedbackBlock = () => (tree: any) => {
+ visit(tree, 'paragraph', (paragraph: any, index, parent) => {
+ if (!parent || index == null) return;
+ if (!Array.isArray(paragraph.children)) return;
+
+ const buffer = paragraph.children
+ .map((child: any) => (typeof child.value === 'string' ? child.value : ''))
+ .join('');
+
+ const openIdx = buffer.indexOf(OPEN_TAG);
+ if (openIdx === -1) return;
+ const closeIdx = buffer.indexOf(CLOSE_TAG, openIdx + OPEN_TAG.length);
+ if (closeIdx === -1) return;
+
+ const inner = buffer.slice(openIdx + OPEN_TAG.length, closeIdx).trim();
+ const before = buffer.slice(0, openIdx).trim();
+ const after = buffer.slice(closeIdx + CLOSE_TAG.length).trim();
+
+ const replacement: any[] = [];
+ if (before) {
+ replacement.push({
+ children: [{ type: 'text', value: before }],
+ type: 'paragraph',
+ });
+ }
+ replacement.push({
+ data: {
+ hChildren: [{ type: 'text', value: inner }],
+ hName: USER_FEEDBACK_TAG,
+ },
+ position: paragraph.position,
+ type: `${USER_FEEDBACK_TAG}Block`,
+ });
+ if (after) {
+ replacement.push({
+ children: [{ type: 'text', value: after }],
+ type: 'paragraph',
+ });
+ }
+
+ parent.children.splice(index, 1, ...replacement);
+ return [SKIP, index + replacement.length];
+ });
+};
diff --git a/src/features/Conversation/Markdown/plugins/index.ts b/src/features/Conversation/Markdown/plugins/index.ts
index 97fff872f88..e91458d00a3 100644
--- a/src/features/Conversation/Markdown/plugins/index.ts
+++ b/src/features/Conversation/Markdown/plugins/index.ts
@@ -7,6 +7,7 @@ import Mention from './Mention';
import Task from './Task';
import Thinking from './Thinking';
import { type MarkdownElement } from './type';
+import UserFeedback from './UserFeedback';
export type { MarkdownElement } from './type';
@@ -17,6 +18,7 @@ export const markdownElements: MarkdownElement[] = [
LocalFile,
Mention,
Task,
+ UserFeedback,
ImageSearchRef,
LobeAgents,
];
diff --git a/src/locales/default/chat.ts b/src/locales/default/chat.ts
index 6d15d773335..b3f3d33afcb 100644
--- a/src/locales/default/chat.ts
+++ b/src/locales/default/chat.ts
@@ -700,6 +700,7 @@ export default {
'taskList.contextMenu.copyLink': 'Copy Link',
'taskList.contextMenu.copyLinkSuccess': 'Link copied',
'taskList.contextMenu.priority': 'Priority',
+ 'taskList.contextMenu.runNow': 'Run now',
'taskList.contextMenu.status': 'Status',
'taskList.kanban.addTask': 'Create task',
'taskList.kanban.backlog': 'Backlog',
diff --git a/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/index.tsx b/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/index.tsx
index f3eae86c286..acc723d73a8 100644
--- a/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/index.tsx
+++ b/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/index.tsx
@@ -259,9 +259,18 @@ const TopicItem = memo<TopicItemProps>(({ id, title, fav, active, threadId, meta
return <ProviderIcon color={cssVar.colorTextDescription} size={16} />;
}
}
- if (isHeterogeneousAgent) return null;
return (
- <Icon icon={HashIcon} size={'small'} style={{ color: cssVar.colorTextDescription }} />
+ <Icon
+ icon={HashIcon}
+ size={'small'}
+ style={{
+ color: cssVar.colorTextDescription,
+ // Heterogeneous agents (Claude Code, Codex, …) have no chat-style
+ // topic semantics, so suppress the `#` glyph while keeping its
+ // box so the title stays aligned with sibling rows.
+ visibility: isHeterogeneousAgent ? 'hidden' : undefined,
+ }}
+ />
);
})()}
onClick={handleClick}