From 69f2478fd7c48d6fb6555ecceab3cc53503ea96e Mon Sep 17 00:00:00 2001 From: Simon <10131203+gaomeng1900@users.noreply.github.com> Date: Tue, 3 Mar 2026 20:52:55 +0800 Subject: [PATCH] fix(panel): remove timestamp (not well defined) --- packages/ui/src/i18n/locales.ts | 4 ++-- packages/ui/src/panel/Panel.ts | 10 +++------- packages/ui/src/panel/cards.ts | 10 ---------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/packages/ui/src/i18n/locales.ts b/packages/ui/src/i18n/locales.ts index eacf31e..9250a57 100644 --- a/packages/ui/src/i18n/locales.ts +++ b/packages/ui/src/i18n/locales.ts @@ -15,7 +15,7 @@ const enUS = { close: 'Close', expand: 'Expand history', collapse: 'Collapse history', - step: 'Step {{number}} · {{time}}{{duration}}', + step: 'Step {{number}}', }, tools: { clicking: 'Clicking element [{{index}}]...', @@ -63,7 +63,7 @@ const zhCN = { close: '关闭', expand: '展开历史', collapse: '收起历史', - step: '步骤 {{number}} · {{time}}{{duration}}', + step: '步骤 {{number}}', }, tools: { clicking: '正在点击元素 [{{index}}]...', diff --git a/packages/ui/src/panel/Panel.ts b/packages/ui/src/panel/Panel.ts index 23e83b6..1ebf9a5 100644 --- a/packages/ui/src/panel/Panel.ts +++ b/packages/ui/src/panel/Panel.ts @@ -1,6 +1,6 @@ import { I18n, type SupportedLanguage } from '../i18n' import { truncate } from '../utils' -import { createCard, createReflectionLines, formatTime } from './cards' +import { createCard, createReflectionLines } from './cards' import type { AgentActivity, PanelAgentAdapter } from './types' import styles from './Panel.module.css' @@ -187,7 +187,6 @@ export class Panel { tempCard.innerHTML = createCard({ icon: '❓', content: `Question: ${question}`, - meta: formatTime(this.#config.language ?? 'en-US'), type: 'question', }) const cardElement = tempCard.firstElementChild as HTMLElement @@ -591,15 +590,12 @@ export class Panel { /** Create cards for a history event */ #createHistoryCards(event: PanelAgentAdapter['history'][number]): string[] { const cards: string[] = [] - const time = formatTime(this.#config.language ?? 'en-US') const meta = event.type === 'step' && event.stepIndex !== undefined ? this.#i18n.t('ui.panel.step', { number: (event.stepIndex + 1).toString(), - time, - duration: '', }) - : time + : undefined if (event.type === 'step') { // Reflection card @@ -636,7 +632,7 @@ export class Panel { /** Create cards for an action */ #createActionCards( action: { name: string; input: unknown; output: string }, - meta: string + meta?: string ): string[] { const cards: string[] = [] diff --git a/packages/ui/src/panel/cards.ts b/packages/ui/src/panel/cards.ts index 5c33afb..00f254b 100644 --- a/packages/ui/src/panel/cards.ts +++ b/packages/ui/src/panel/cards.ts @@ -32,16 +32,6 @@ export function createCard({ icon, content, meta, type }: CardOptions): string { ` } -/** Format timestamp for cards */ -export function formatTime(locale: string = 'en-US'): string { - return new Date().toLocaleTimeString(locale, { - hour12: false, - hour: '2-digit', - minute: '2-digit', - second: '2-digit', - }) -} - /** Create reflection lines from reflection object */ export function createReflectionLines(reflection: { evaluation_previous_goal?: string