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.

💄 style: localize task run controls and show step count in turn process fold (#16376)

Arvin Xud9004ed04b49
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 859c6b756cc..2bb9a7a0c18 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -750,6 +750,12 @@
"taskDetail.subtasks": "Subtasks",
"taskDetail.titlePlaceholder": "Task title",
"taskDetail.topicDrawer.untitled": "Untitled",
+ "taskDetail.topicMenu.copyId": "Copy Topic ID",
+ "taskDetail.topicMenu.copyOperationId": "Copy Operation ID",
+ "taskDetail.topicMenu.open": "Open Run",
+ "taskDetail.topicMenu.stop": "Stop Run",
+ "taskDetail.topicMenu.stopConfirm.content": "The current run will be canceled. Generated messages are kept and you can re-run the task later.",
+ "taskDetail.topicMenu.stopConfirm.title": "Stop Run?",
"taskDetail.untitled": "Untitled",
"taskDetail.updateFailed": "Failed to update task",
"taskList.activeTasks": "Active Tasks",
@@ -945,8 +951,10 @@
"translate.clear": "Clear Translation",
"tts.action": "Text-to-Speech",
"tts.clear": "Clear Speech",
- "turnProcess.done": "Processed",
- "turnProcess.ranFor": "Ran for {{duration}}",
+ "turnProcess.done_one": "Ran {{count}} step",
+ "turnProcess.done_other": "Ran {{count}} steps",
+ "turnProcess.ranFor_one": "Ran {{count}} step ({{duration}})",
+ "turnProcess.ranFor_other": "Ran {{count}} steps ({{duration}})",
"untitledAgent": "Untitled Agent",
"untitledGroup": "Untitled Group",
"updateAgent": "Update Agent Information",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index a052c14ef0a..7c8679fd8ea 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -750,6 +750,12 @@
"taskDetail.subtasks": "子任务",
"taskDetail.titlePlaceholder": "输入任务标题…",
"taskDetail.topicDrawer.untitled": "未命名",
+ "taskDetail.topicMenu.copyId": "复制话题 ID",
+ "taskDetail.topicMenu.copyOperationId": "复制 Operation ID",
+ "taskDetail.topicMenu.open": "打开运行",
+ "taskDetail.topicMenu.stop": "停止运行",
+ "taskDetail.topicMenu.stopConfirm.content": "当前运行将被取消。已生成的消息会保留,你可以稍后重新运行任务。",
+ "taskDetail.topicMenu.stopConfirm.title": "停止运行?",
"taskDetail.untitled": "无标题",
"taskDetail.updateFailed": "任务更新失败",
"taskList.activeTasks": "进行中的任务",
@@ -945,8 +951,10 @@
"translate.clear": "删除翻译",
"tts.action": "语音朗读",
"tts.clear": "删除语音",
- "turnProcess.done": "已处理",
- "turnProcess.ranFor": "共运行 {{duration}}",
+ "turnProcess.done_one": "共运行 {{count}} 步",
+ "turnProcess.done_other": "共运行 {{count}} 步",
+ "turnProcess.ranFor_one": "共运行 {{count}} 步 ({{duration}})",
+ "turnProcess.ranFor_other": "共运行 {{count}} 步 ({{duration}})",
"untitledAgent": "未命名助理",
"untitledGroup": "未命名群组",
"updateAgent": "更新助理信息",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index 8f25378e5fa..226f6854b41 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -884,6 +884,13 @@ export default {
'taskDetail.reassignDisabled': 'Cannot reassign agent while task is running',
'taskDetail.titlePlaceholder': 'Task title',
'taskDetail.topicDrawer.untitled': 'Untitled',
+ 'taskDetail.topicMenu.copyId': 'Copy Topic ID',
+ 'taskDetail.topicMenu.copyOperationId': 'Copy Operation ID',
+ 'taskDetail.topicMenu.open': 'Open Run',
+ 'taskDetail.topicMenu.stop': 'Stop Run',
+ 'taskDetail.topicMenu.stopConfirm.content':
+ 'The current run will be canceled. Generated messages are kept and you can re-run the task later.',
+ 'taskDetail.topicMenu.stopConfirm.title': 'Stop Run?',
'taskDetail.updateFailed': 'Failed to update task',
'createTask.assignee': 'Assignee',
@@ -1041,8 +1048,10 @@ export default {
'translate.clear': 'Clear Translation',
'tts.action': 'Text-to-Speech',
'tts.clear': 'Clear Speech',
- 'turnProcess.done': 'Processed',
- 'turnProcess.ranFor': 'Ran for {{duration}}',
+ 'turnProcess.done_one': 'Ran {{count}} step',
+ 'turnProcess.done_other': 'Ran {{count}} steps',
+ 'turnProcess.ranFor_one': 'Ran {{count}} step ({{duration}})',
+ 'turnProcess.ranFor_other': 'Ran {{count}} steps ({{duration}})',
'untitledAgent': 'Untitled Agent',
'untitledGroup': 'Untitled Group',
'updateAgent': 'Update Agent Information',
diff --git a/packages/shared-tool-ui/src/Render/Linear/index.tsx b/packages/shared-tool-ui/src/Render/Linear/index.tsx
index e76f6850525..91141a587b4 100644
--- a/packages/shared-tool-ui/src/Render/Linear/index.tsx
+++ b/packages/shared-tool-ui/src/Render/Linear/index.tsx
@@ -46,7 +46,6 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
display: flex;
gap: 6px;
align-items: center;
-
min-width: 0;
`,
timeItem: css`
@@ -198,7 +197,7 @@ const EntityCard = memo<{ entity: LinearEntity }>(({ entity }) => {
// A bare UUID id only earns a slot when there's no title to carry the card
// (e.g. comments / attachments, where it's also the link target). Human ids
- // like `LOBE-123` always stay.
+ // like `LIN-123` always stay.
const showId = Boolean(id) && (!title || !isUuidLike(id!));
return (
diff --git a/packages/shared-tool-ui/src/Render/Linear/utils.test.ts b/packages/shared-tool-ui/src/Render/Linear/utils.test.ts
index 1ba4a57649b..b29a9892c20 100644
--- a/packages/shared-tool-ui/src/Render/Linear/utils.test.ts
+++ b/packages/shared-tool-ui/src/Render/Linear/utils.test.ts
@@ -5,7 +5,7 @@ import { buildLinearRenderModel, isUuidLike } from './utils';
describe('isUuidLike', () => {
it('matches bare UUIDs but not human Linear ids', () => {
expect(isUuidLike('55a0597c-be21-4e73-a1ff-1a45aedf0184')).toBe(true);
- expect(isUuidLike('LOBE-123')).toBe(false);
+ expect(isUuidLike('LIN-123')).toBe(false);
expect(isUuidLike('TEST-456')).toBe(false);
expect(isUuidLike('Engineering')).toBe(false);
});
diff --git a/packages/shared-tool-ui/src/Render/Linear/utils.ts b/packages/shared-tool-ui/src/Render/Linear/utils.ts
index 24b6b098592..2256d0bcf65 100644
--- a/packages/shared-tool-ui/src/Render/Linear/utils.ts
+++ b/packages/shared-tool-ui/src/Render/Linear/utils.ts
@@ -79,7 +79,7 @@ export interface LinearEntity {
// A bare UUID (e.g. a team/comment internal id) carries no meaning for the
// reader; suppress it when the entity already has a human-readable title. Linear
-// human ids like `LOBE-123` never match this shape, so they stay visible.
+// human ids like `LIN-123` never match this shape, so they stay visible.
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;
export const isUuidLike = (value: string): boolean => UUID_PATTERN.test(value);
diff --git a/src/features/Conversation/Messages/AssistantGroup/components/Group.tsx b/src/features/Conversation/Messages/AssistantGroup/components/Group.tsx
index 0b8bf4be7e0..d8261f8193c 100644
--- a/src/features/Conversation/Messages/AssistantGroup/components/Group.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/components/Group.tsx
@@ -456,10 +456,10 @@ const Group = memo<GroupChildrenProps>(
return (
<WorkflowCollapse
assistantMessageId={id}
+ blocks={segment.blocks.map((block) => withMarkdownStreamingState(block, lastBlockId))}
defaultWorkflowExpandLevel={defaultWorkflowExpandLevel}
disableEditing={disableEditing}
key={segment.blocks[0]?.renderKey ?? `${id}.workflow.${index}`}
- blocks={segment.blocks.map((block) => withMarkdownStreamingState(block, lastBlockId))}
workflowChromeComplete={
workflowChromeComplete ||
(hasRenderedContentAfter(segments, index) && !hasPendingIntervention(segment.blocks))
@@ -503,7 +503,7 @@ const Group = memo<GroupChildrenProps>(
<Flexbox className={styles.container} gap={8}>
{foldProcess ? (
<>
- <ProcessFold durationText={durationText}>
+ <ProcessFold durationText={durationText} stepCount={blocks.length}>
<Flexbox gap={8}>
{processSegments.map((segment, index) => renderSegment(segment, index))}
</Flexbox>
diff --git a/src/features/Conversation/Messages/AssistantGroup/components/ProcessFold.tsx b/src/features/Conversation/Messages/AssistantGroup/components/ProcessFold.tsx
index f0379a4501f..a0fcae48e0c 100644
--- a/src/features/Conversation/Messages/AssistantGroup/components/ProcessFold.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/components/ProcessFold.tsx
@@ -11,6 +11,8 @@ interface ProcessFoldProps {
defaultExpanded?: boolean;
/** Formatted turn duration, e.g. "3m 37s". Hidden when absent. */
durationText?: string;
+ /** Number of steps in the turn = count of assistant (call_llm) messages. */
+ stepCount: number;
}
/**
@@ -22,14 +24,16 @@ interface ProcessFoldProps {
* affordance — never persisted.
*/
const ProcessFold = memo<ProcessFoldProps>(
- ({ children, durationText, defaultExpanded = false }) => {
+ ({ children, durationText, stepCount, defaultExpanded = false }) => {
const { t } = useTranslation('chat');
const [expanded, setExpanded] = useState(defaultExpanded);
const expandedKeys = useMemo(() => (expanded ? [PROCESS_KEY] : []), [expanded]);
const title = (
<Text style={{ minWidth: 0 }} type={'secondary'}>
- {durationText ? t('turnProcess.ranFor', { duration: durationText }) : t('turnProcess.done')}
+ {durationText
+ ? t('turnProcess.ranFor', { count: stepCount, duration: durationText })
+ : t('turnProcess.done', { count: stepCount })}
</Text>
);