From 5c31ae91cab03aeb8021aa425016051c8bc83b6c Mon Sep 17 00:00:00 2001 From: Suzumiya Date: Thu, 17 Sep 2026 17:36:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E4=BF=AE=E8=B5=84=E6=BA=90=E5=8D=A1?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E5=90=8D=E6=82=AC=E5=81=9C=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E5=B9=B6=E6=94=B6=E7=9F=AD=E6=96=87=E6=A1=A3=E5=8D=A1=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 完整资源名改挂在覆盖整卡、真正命中指针的选中按钮 title 上,名称条自身不再挂悬停不到的 title - 无障碍名保持原有 aria-label 不变,长名仍是 CSS 单行省略 - 断言改为校验选中按钮 title,并钉住名称条不挂 title - 文档卡分支注释只写当前行为,去掉旧实现说明 --- .../src/view/project-development/index.tsx | 14 ++++++-------- .../tests/appSurface/project-development.suite.ts | 14 +++++++++----- .../tests/resourceCanvasCardName.test.tsx | 15 ++++++++++----- .../tests/resourceRename.test.tsx | 13 ++++++------- 4 files changed, 31 insertions(+), 25 deletions(-) diff --git a/apps/ai-game-creator-shell/src/view/project-development/index.tsx b/apps/ai-game-creator-shell/src/view/project-development/index.tsx index 12ac2247a..d4a9a3219 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/index.tsx +++ b/apps/ai-game-creator-shell/src/view/project-development/index.tsx @@ -981,11 +981,7 @@ const ResourceCard = memo(function ResourceCard({ ); } - /** - * 文档卡:居中图标,**不显示正文摘要**(旧实现把前 3 行正文铺在卡面上, - * 与"卡面不显示无效正文片段"冲突)。原文预览、代码块与 UI JSON 识别都留在 - * 独立详情浮层,卡面这条链路不再读内容做展示。 - */ + /** 文档卡:卡面只给居中的文档图标,不铺正文。 */ if (isDocumentCard) { return ( @@ -1079,13 +1075,13 @@ const ResourceCard = memo(function ResourceCard({ 它来自现有正式命名链路——manifest 资产的 `localPath` 就是生成时的 `assetName` 落盘名,用户重命名也会改写同一份 `localPath`,因此这里消费 投影 label 即可,不从临时输入或历史任务名另取一份显示名,也不持久化第二份 - 名称。名称长了由 CSS 单行省略,完整名称在 `title` 上;`data-resource-name` + 名称。名称长了由 CSS 单行省略,完整名称挂在整卡选中按钮的 `title` 上 + (名称条自身 `pointer-events: none`,悬停不到);`data-resource-name` 是给端到端验收的稳定判据。 */} {resource.label} @@ -1119,7 +1115,9 @@ const ResourceCard = memo(function ResourceCard({ aria-label={`选中资源:${categoryLabels[resource.category]} ${resource.label}`} aria-pressed={selected} data-resource-id={resource.id} - title="选中资源" + // 名称条 `pointer-events: none`,鼠标命中的是覆盖整卡的这颗按钮, + // 所以「长名可悬停读全」的完整名挂在这里;无障碍名仍是上面的 aria-label。 + title={resource.label} /> {isMedia ? (