From 328da5e6ebc6a6541ff8becb57fc1a3d840b8b9a Mon Sep 17 00:00:00 2001 From: kdletters Date: Fri, 28 Aug 2026 18:26:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A9=E5=B1=95=E5=85=B1=E4=BA=AB=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=BA=93=E5=B9=B6=E6=8E=A5=E5=85=A5=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 收口平台异步、筛选、图标、信息、列表、运行态和统计组件到共享包 - 新增 Label、Checkbox、Skeleton、Table 语义基础组件 - 展示页与代表性业务页面改用共享 canonical 导出并补齐交互反馈 - 同步共享样式、组件测试和前端架构决策文档 --- .../shared-memory/decision-log.md | 7 + ...端架构】共享基础组件库与展示页-2026-08-26.md | 19 +- .../src/components/PlatformActionButton.tsx | 91 ++-- .../components/PlatformAsyncStatePanel.tsx | 37 ++ .../src/components/PlatformEmptyState.tsx | 130 +++++- .../src/components/PlatformFieldLabel.tsx | 44 ++ .../src/components/PlatformFilterToolbar.tsx | 112 +++++ .../src/components/PlatformIconBadge.tsx | 92 ++++ .../src/components/PlatformIconButton.tsx | 63 +-- .../src/components/PlatformInfoBlock.tsx | 100 ++++ .../components/PlatformNavigableListItem.tsx | 88 ++++ .../src/components/PlatformPillBadge.tsx | 48 +- .../src/components/PlatformProgressBar.tsx | 90 ++++ .../components/PlatformRuntimeStatusToast.tsx | 103 +++++ .../src/components/PlatformSegmentedTabs.tsx | 248 ++++++++++ .../src/components/PlatformStatGrid.tsx | 158 +++++++ .../src/components/PlatformStatusMessage.tsx | 118 ++++- .../src/components/PlatformSubpanel.tsx | 225 ++++++++- .../src/components/PlatformTextField.tsx | 192 +++++++- packages/shared/src/components/index.ts | 108 ++++- .../components/platformActionButtonModel.ts | 134 ++++++ .../components/platformComponents.test.tsx | 108 +++++ .../src/components/platformPillBadgeModel.ts | 68 +++ packages/shared/src/components/styles.css | 430 +++++++++++++++++- packages/shared/src/components/ui.test.tsx | 44 ++ packages/shared/src/components/ui.tsx | 18 + .../shared/src/components/ui/checkbox.tsx | 21 + packages/shared/src/components/ui/index.ts | 17 + packages/shared/src/components/ui/label.tsx | 21 + .../shared/src/components/ui/skeleton.tsx | 16 + packages/shared/src/components/ui/table.tsx | 112 +++++ src/components/CustomWorldEntityCatalog.tsx | 2 +- .../BarkBattlePreviewCard.tsx | 3 +- .../common/PlatformActionButton.tsx | 97 +--- .../common/PlatformAsyncStatePanel.tsx | 39 +- src/components/common/PlatformEmptyState.tsx | 129 +----- src/components/common/PlatformFieldLabel.tsx | 52 +-- .../common/PlatformFilterToolbar.tsx | 113 +---- src/components/common/PlatformIconBadge.tsx | 92 +--- src/components/common/PlatformIconButton.tsx | 162 +------ src/components/common/PlatformInfoBlock.tsx | 103 +---- .../common/PlatformNavigableListItem.tsx | 93 +--- src/components/common/PlatformPillBadge.tsx | 46 +- src/components/common/PlatformProgressBar.tsx | 93 +--- .../common/PlatformRuntimeStatusToast.tsx | 110 +---- .../common/PlatformSegmentedTabs.tsx | 249 +--------- src/components/common/PlatformStatGrid.tsx | 160 +------ .../common/PlatformStatusMessage.tsx | 115 +---- src/components/common/PlatformSubpanel.tsx | 232 +--------- src/components/common/PlatformTextField.tsx | 192 +------- .../common/platformActionButtonModel.ts | 140 +----- .../common/platformPillBadgeModel.ts | 73 +-- src/components/rpg-entry/RpgEntryHomeView.tsx | 14 +- .../SharedComponentsShowcasePage.tsx | 70 ++- .../SquareHoleResultView.tsx | 2 +- src/index.css | 1 + 56 files changed, 3128 insertions(+), 2316 deletions(-) create mode 100644 packages/shared/src/components/PlatformAsyncStatePanel.tsx create mode 100644 packages/shared/src/components/PlatformFieldLabel.tsx create mode 100644 packages/shared/src/components/PlatformFilterToolbar.tsx create mode 100644 packages/shared/src/components/PlatformIconBadge.tsx create mode 100644 packages/shared/src/components/PlatformInfoBlock.tsx create mode 100644 packages/shared/src/components/PlatformNavigableListItem.tsx create mode 100644 packages/shared/src/components/PlatformProgressBar.tsx create mode 100644 packages/shared/src/components/PlatformRuntimeStatusToast.tsx create mode 100644 packages/shared/src/components/PlatformSegmentedTabs.tsx create mode 100644 packages/shared/src/components/PlatformStatGrid.tsx create mode 100644 packages/shared/src/components/platformActionButtonModel.ts create mode 100644 packages/shared/src/components/platformComponents.test.tsx create mode 100644 packages/shared/src/components/platformPillBadgeModel.ts create mode 100644 packages/shared/src/components/ui/checkbox.tsx create mode 100644 packages/shared/src/components/ui/label.tsx create mode 100644 packages/shared/src/components/ui/skeleton.tsx create mode 100644 packages/shared/src/components/ui/table.tsx diff --git a/docs/project-memory/shared-memory/decision-log.md b/docs/project-memory/shared-memory/decision-log.md index 7c49f0673..974958cce 100644 --- a/docs/project-memory/shared-memory/decision-log.md +++ b/docs/project-memory/shared-memory/decision-log.md @@ -7759,3 +7759,10 @@ CI 上 `background_agent_runtime_recovers_stale_running_before_pending_task` 在 - 决策:共享 Web UI 采用 shadcn 的源码归属项目模式,新增 canonical source 放入 `packages/shared/src/components/ui`,统一通过 `packages/shared/src/lib/utils.ts` 的 `cn` 与 CVA 组织变体;不引入 MUI / Ant Design 全量组件,也不一次性重写现有业务 common。 - 首步:`Button`、`Modal`、`SegmentedTabs`、`Switch`、`Input`、`Textarea`、`Badge`、`Card` 已迁移到 `components/ui` canonical source,保留 `@genarrative/shared/components` 的旧 API 作为兼容适配;Button/Input/Badge 用 CVA,Dialog/Tabs/Switch 按需使用 Radix,Tailwind 4 继续消费现有 `--platform-*` token 与 `.genarrative-ui-*` 样式。原生 Select 暂不迁移。 - 边界:网站与 Tauri WebView 可消费该 DOM 源码,移动端 React Native 不导入这套组件与 CSS;Radix primitive 仅在 Dialog、Tabs、Switch 等具体组件迁移时按需加入。 + +## 2026-08-28 共享平台 chrome 与基础语义件继续扩展 + +- 决策:无业务依赖的 `PlatformAsyncStatePanel`、`PlatformFilterToolbar`、`PlatformIconBadge`、`PlatformInfoBlock`、`PlatformNavigableListItem`、`PlatformRuntimeStatusToast`、`PlatformStatGrid` 实现统一收口到 `packages/shared/src/components`;`src/components/common` 仅保留兼容导出,展示页和部分实际业务页面开始直接消费共享 barrel。 +- 基础件:`components/ui` 新增语义 `Label`、原生 `Checkbox`、`Skeleton` 和语义 `Table` 组合件;继续沿用项目自有 shadcn open-code 源码,不引入额外运行时依赖。 +- 样式:筛选工具栏与可导航列表行的 hover/active/focus/disabled 反馈、移动端断点和独立宿主所需 chrome 放入共享样式;共享主题仍只消费 `--platform-*` token,不依赖网站总 CSS。 +- 验证:相关共享/兼容组件 10 个测试文件共 36 个断言、类型检查、编码检查、定向 ESLint、`git diff --check` 和生产构建均通过。 diff --git a/docs/technical/【前端架构】共享基础组件库与展示页-2026-08-26.md b/docs/technical/【前端架构】共享基础组件库与展示页-2026-08-26.md index 68463b32b..20c66a2e0 100644 --- a/docs/technical/【前端架构】共享基础组件库与展示页-2026-08-26.md +++ b/docs/technical/【前端架构】共享基础组件库与展示页-2026-08-26.md @@ -1,6 +1,6 @@ # 共享基础组件库与展示页 -更新时间:`2026-08-26` +更新时间:`2026-08-28` ## 目标 @@ -19,17 +19,28 @@ - `Subpanel`、`Modal` - `Status`、`EmptyState`、`Badge` - `ProgressBar`、`SegmentedTabs`、`Switch` -- `Spinner`、`Divider` +- `Spinner`、`Divider`、`Label`、`Checkbox`、`Skeleton` +- `Table`(含 `TableHeader`、`TableBody`、`TableRow`、`TableHead`、`TableCell`、`TableCaption`、`TableFooter`) + +平台 chrome 组件(同样从 `@genarrative/shared/components` 导出): + +- `PlatformActionButton`、`PlatformIconButton`、`PlatformPillBadge` +- `PlatformStatusMessage`、`PlatformEmptyState`、`PlatformTextField` +- `PlatformProgressBar`、`PlatformSegmentedTabs`、`PlatformFieldLabel`、`PlatformSubpanel` +- `PlatformAsyncStatePanel`、`PlatformFilterToolbar`、`PlatformIconBadge`、`PlatformRuntimeStatusToast` +- `PlatformInfoBlock`、`PlatformNavigableListItem`、`PlatformStatGrid` 迁移约定:`Button`、`Modal`、`SegmentedTabs`、`Switch`、`Input`、`Textarea`、`Badge`、`Card` 的 canonical source 位于 `packages/shared/src/components/ui`,旧的 `@genarrative/shared/components` API 作为兼容适配层继续保留。`Button`、`Input`、`Badge` 使用 CVA,Dialog/Tabs/Switch 使用按需 Radix primitive;原生 `SelectField` 暂不迁移,避免破坏现有 `