Просмотр исходного кода

fix(web): identify plan preview tabs with a plan icon

Yichen Jiang 3 недель назад
Родитель
Сommit
3fb29e0803

+ 2 - 2
packages/client/ui-plan/README.i18n.yaml

@@ -2,5 +2,5 @@
 # side as of the last confirmed-consistent state. Both languages carry equal authority;
 # after editing either side, bring the other along and re-record with:
 #   pnpm run verify-translation-pairing --write packages/client/ui-plan/README.md
-README.md: c081d12d40377baf777d293582104b33e657e7fe
-README.zh.md: a253d2257a694c3466f376665b4dbe33e950020a
+README.md: f7e7aede2c76717228d101153e4d3d2f8d3f88c4
+README.zh.md: 9ab37a25dd7cb406b42bf5c531445357d6725e2e

+ 1 - 1
packages/client/ui-plan/README.md

@@ -33,7 +33,7 @@ While the effective target is plan mode, the seat renders the warn-colored "Plan
 
 ### Reading submitted plans
 
-When a Turn ends, each submitted plan appears in its final artifact area, using the file-delivery card treatment with a Markdown icon, title, and Open action. A pending plan opens automatically once per submission in the current browser session. Closing it stays effective across review remounts; a new submission opens its own plan. Historical cards open only when clicked. Use the card or review strip’s View full plan link to read and copy the complete Markdown. Different submissions retain separate tabs; the review buttons alone decide whether implementation may begin.
+When a Turn ends, each submitted plan appears in its final artifact area, using the file-delivery card treatment with a Markdown icon, title, and Open action. A pending plan opens automatically once per submission in the current browser session. Closing it stays effective across review remounts; a new submission opens its own plan. Historical cards open only when clicked. Use the card or review strip’s View full plan link to read and copy the complete Markdown. Plan tabs show a document-and-pen icon. Different submissions retain separate tabs; the review buttons alone decide whether implementation may begin.
 
 A review without a logged invocation also opens automatically. Its complete text lives only in the tab’s navigation memory, and the pending review card can reopen it. Reloading the page loses that text; an expired preview directs the user back to a pending review.
 

+ 1 - 1
packages/client/ui-plan/README.zh.md

@@ -33,7 +33,7 @@ kind: "package-reference"
 
 ### 查看已提交的计划
 
-回合结束后,每次提交的计划都会显示在该回合末尾的产物区域,并采用文件产物卡片的样式,包含 Markdown 图标、标题和“打开”操作。在当前浏览器会话中,每份待审计划自动打开一次;关闭后,重新挂载审批组件不会再次展开,新提交会打开其对应计划。历史卡片仅在点击后打开。通过卡片或审批条带上的“查看全文”链接可阅读和复制完整 Markdown。不同提交保留独立标签页;是否开始实施仍由审批按钮决定。
+回合结束后,每次提交的计划都会显示在该回合末尾的产物区域,并采用文件产物卡片的样式,包含 Markdown 图标、标题和“打开”操作。在当前浏览器会话中,每份待审计划自动打开一次;关闭后,重新挂载审批组件不会再次展开,新提交会打开其对应计划。历史卡片仅在点击后打开。通过卡片或审批条带上的“查看全文”链接可阅读和复制完整 Markdown。计划标签页显示文档加笔的图标。不同提交保留独立标签页;是否开始实施仍由审批按钮决定。
 
 没有已记录调用标识的审批也会自动打开。完整正文只保存在标签页的导航内存中,待处理审批卡片可以重新打开它。刷新页面会丢失该正文;失效的预览会提示用户返回待处理审批。
 

+ 1 - 0
packages/client/ui-plan/src/client/PlanPreview.module.css

@@ -37,4 +37,5 @@
 .toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
 .document { color: var(--dsw-alias-label-primary); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
 .message { padding: 24px; color: var(--dsw-alias-label-secondary); font-size: 14px; }
+.titleIcon { display: inline-flex; flex: none; }
 @media (max-width: 767px) { .preview { padding: 16px 18px 32px; } }

+ 4 - 4
packages/client/ui-plan/src/client/PlanPreview.tsx

@@ -1,6 +1,6 @@
 /** Read-only Markdown viewer for logged plans and temporary review documents. */
 import { useMemo } from 'react'
-import { IconCopyOutline16, MarkdownText, writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives'
+import { IconCopyOutline16, IconPlanOutline14, MarkdownText, writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives'
 import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
 import type {} from '@deepseek-ai/dsh-client-ui-sidebar-right/client'
 import type {} from './plan-resource.ts'
@@ -42,9 +42,9 @@ export function PlanPreview({ useTabInfo, useResource, t }: PlanPreviewProps) {
 }
 
 /**
- * Display the plan heading in its tab after resource recovery.
+ * Display a plan icon and the heading in its tab after resource recovery.
  * @param props - Framework-bound tab identity and resource reader.
- * @returns the recovered plan title or the tab's initial localized label.
+ * @returns a decorative plan icon followed by the recovered title or initial localized label.
  */
 export function PlanTitle({ useTabInfo, useResource }: PropsRuntime<'sidebar.right.pane.tab.title'>) {
   const tab = useTabInfo()
@@ -52,5 +52,5 @@ export function PlanTitle({ useTabInfo, useResource }: PropsRuntime<'sidebar.rig
   const params = tab.tab.navigation.params
   const plan = isReviewPreviewAddress(tab.tab.navigation.address)
     ? (params !== undefined && 'planReview' in params ? params.planReview : undefined) : resource.value
-  return <span>{plan?.title ?? tab.tab.title}</span>
+  return <><span className={css.titleIcon} aria-hidden="true"><IconPlanOutline14 size={16} /></span>{plan?.title ?? tab.tab.title}</>
 }