From a71d158f9a3afa3de7ee1a86b34844d90ed771d0 Mon Sep 17 00:00:00 2001 From: Menghuan1918 Date: Mon, 21 Sep 2026 11:59:29 +0800 Subject: [PATCH] revert(tasks-ui): drop the shadcn/Tailwind layer and return to the plugin's own UI system shadcn's defaults are built for a standalone app: 14px body, 36px controls, solid primary fills and elevation read as a foreign surface next to this plugin's own tabs (files, changes, side chat, settings), which are 12/11/10px type, 28px controls, hairline borders and flat panels. Retuning the layer did not converge, so the layer goes. - Removed: src/client/ui/** (21 vendored components), components.json, scripts/ui-css.mjs, the Tailwind/PostCSS compile step in tsdown, and the deps tailwindcss / @tailwindcss/postcss / postcss / radix-ui / class-variance-authority / tailwind-merge. (diff and simple-icons stay: they patch undeclared bare imports of the host primitives, unrelated to shadcn.) - The seven page surfaces are back on the plugin's own base: *.module.css with --dsw-* tokens plus the host primitives (Button/Menu/Modal/Pill/Tag/Switch/ Input/Tooltip/StateDot/MarkdownText). Behaviour, data-* hooks, aria labels, i18n keys and the AnchoredPopover geometry/drag/dismiss contract are unchanged; the non-styling fixes landed during the shadcn era (model id dedupe, task-window CAS, drawer arming, popover dragging, the chunk packaging glob) were re-applied and are covered by the existing specs. - The tasks page returns to the core bundle: `tasks` left CHUNK_NAMES / CHUNKS / ChunkName, src/client/chunks/tasks.tsx is gone and tabs.tsx imports SubagentView directly. - The reverted stylesheet was retuned to the plugin's measured vocabulary (12/11/10px, 28px controls, border-l2 with border-l1 hairlines, hover fills, no static shadows, --dsw-shadow-lv2/3 on floating layers only) and verified against a 70-assertion real-browser contract; the harness's own two measurement defects were fixed with a falsification test proving the assertions still catch injected regressions (56/70, 14 FAIL). - Tests: ui-foundation / ui-bundle / ui-shadows (the shadcn guards) deleted, theme.spec scoped back to the plugin's own stylesheets, bundle-route and manifest-consistency chunk lists back to four. Docs: AGENTS.md and the plugin guide drop the Tailwind/shadcn guidance; the design doc marks those sections superseded and records why the layer was removed. Verified: typecheck/lint clean; 133 files / 1410 tests; core bundle 987.3 KiB with no radix-ui/--tw-/tailwind strings and no client-tasks.js; mount e2e 7/7; 20 real-browser screenshots at 360/720 for graph, tree, board, task window, drawer (including armed), both popovers and the 77-node fixture. --- components.json | 20 - docs/external-plugin-guide.md | 26 - ...09-14-tasks-graph-workflow-teams-design.md | 46 +- ...2026-09-17-dsh-0.1.6-alpha.2-adaptation.md | 2 + scripts/ui-css.mjs | 32 - src/client/AnchoredPopover.tsx | 9 +- src/client/JobsDrawer.tsx | 354 ++--- src/client/SubagentView.module.css | 216 ++- src/client/SubagentView.tsx | 133 +- src/client/TaskWindow.tsx | 347 ++--- src/client/TasksGraph.tsx | 429 +++--- src/client/TasksPopovers.tsx | 371 ++--- src/client/TasksTree.tsx | 161 +-- src/client/TeamBoard.tsx | 415 +++--- src/client/chunks/tasks.tsx | 20 - src/client/index.tsx | 3 - src/client/tasks-canvas.module.css | 112 +- src/client/tasks-graph.module.css | 1193 +++++++++++++++++ src/client/tasks-shared.tsx | 62 +- src/client/ui/badge.tsx | 50 - src/client/ui/button-group.tsx | 83 -- src/client/ui/button.tsx | 69 - src/client/ui/card.tsx | 91 -- src/client/ui/collapsible.tsx | 31 - src/client/ui/dropdown-menu.tsx | 254 ---- src/client/ui/empty.tsx | 103 -- src/client/ui/field.tsx | 246 ---- src/client/ui/input-group.tsx | 168 --- src/client/ui/input.tsx | 20 - src/client/ui/item.tsx | 193 --- src/client/ui/label.tsx | 21 - src/client/ui/popover.tsx | 86 -- src/client/ui/scroll-area.tsx | 55 - src/client/ui/separator.tsx | 25 - src/client/ui/skeleton.tsx | 13 - src/client/ui/spinner.tsx | 17 - src/client/ui/textarea.tsx | 17 - src/client/ui/theme.css | 269 ---- src/client/ui/toggle-group.tsx | 81 -- src/client/ui/toggle.tsx | 44 - src/client/ui/tooltip.tsx | 54 - src/client/ui/utils.ts | 16 - tests/manifest-consistency.spec.ts | 7 +- tests/theme.spec.ts | 46 +- tests/ui-bundle.spec.ts | 125 -- tests/ui-foundation.spec.ts | 238 ---- tests/ui-shadows.spec.ts | 107 -- 47 files changed, 2373 insertions(+), 4107 deletions(-) delete mode 100644 components.json delete mode 100644 scripts/ui-css.mjs delete mode 100644 src/client/chunks/tasks.tsx create mode 100644 src/client/tasks-graph.module.css delete mode 100644 src/client/ui/badge.tsx delete mode 100644 src/client/ui/button-group.tsx delete mode 100644 src/client/ui/button.tsx delete mode 100644 src/client/ui/card.tsx delete mode 100644 src/client/ui/collapsible.tsx delete mode 100644 src/client/ui/dropdown-menu.tsx delete mode 100644 src/client/ui/empty.tsx delete mode 100644 src/client/ui/field.tsx delete mode 100644 src/client/ui/input-group.tsx delete mode 100644 src/client/ui/input.tsx delete mode 100644 src/client/ui/item.tsx delete mode 100644 src/client/ui/label.tsx delete mode 100644 src/client/ui/popover.tsx delete mode 100644 src/client/ui/scroll-area.tsx delete mode 100644 src/client/ui/separator.tsx delete mode 100644 src/client/ui/skeleton.tsx delete mode 100644 src/client/ui/spinner.tsx delete mode 100644 src/client/ui/textarea.tsx delete mode 100644 src/client/ui/theme.css delete mode 100644 src/client/ui/toggle-group.tsx delete mode 100644 src/client/ui/toggle.tsx delete mode 100644 src/client/ui/tooltip.tsx delete mode 100644 src/client/ui/utils.ts delete mode 100644 tests/ui-bundle.spec.ts delete mode 100644 tests/ui-foundation.spec.ts delete mode 100644 tests/ui-shadows.spec.ts diff --git a/components.json b/components.json deleted file mode 100644 index 4e5a9eb..0000000 --- a/components.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema.json", - "style": "new-york", - "rsc": false, - "tsx": true, - "tailwind": { - "config": "", - "css": "src/client/ui/theme.css", - "baseColor": "neutral", - "cssVariables": true, - "prefix": "" - }, - "aliases": { - "components": "src/client/ui", - "ui": "src/client/ui", - "lib": "src/client/ui", - "utils": "src/client/ui/utils", - "hooks": "src/client/ui" - } -} diff --git a/docs/external-plugin-guide.md b/docs/external-plugin-guide.md index 73665de..57605b6 100644 --- a/docs/external-plugin-guide.md +++ b/docs/external-plugin-guide.md @@ -1004,32 +1004,6 @@ interface SettingsDescriptor { - 类名是 CSS Modules 哈希,**不是契约**;精确命中用 `[data-dsh-better-sidebar]` + 子串类名(`[class*='panel']`)或 DOM 结构。 - 改动本契约必须同步本文档、设计文档与 `tests/theme.spec.ts`。 -### 12.3 在插件里用 Tailwind / shadcn/ui - -本仓库自己的任务管理页(v0.20 起)就是这套姿势的参考实现:组件源码 vendoring 在 `src/client/ui/`,样式由 Tailwind v4 编译,颜色全部经 shadcn 语义令牌桥接到 `--dsw-*`。你的插件照做即可自动兼容全部皮肤;**接入的难点只有三条,其余都是常规 Tailwind**。 - -**① 只引 `theme` + `utilities`,绝不引 preflight。** 插件的 CSS 最终是全局 `