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.
This commit is contained in:
Menghuan1918
2026-09-27 22:18:19 +08:00
parent e500a3d2b9
commit a71d158f9a
47 changed files with 2373 additions and 4107 deletions
-32
View File
@@ -1,32 +0,0 @@
#!/usr/bin/env node
/**
* Compile the plugin's Tailwind entry (src/client/ui/theme.css) to a standalone
* stylesheet.
*
* The production path is tsdown's css-inline plugin (tsdown.config.ts), which
* inlines the compiled CSS into lib/client.js as a `<style data-plugin>` tag.
* The local visual harness (/tmp/dsh-visual) instead renders the REAL task-page
* components against a tokens stylesheet in a plain HTML page, so it needs the
* same utilities as a file it can `<link>` — this script is that file, built
* from the same pipeline (tsdown.config.ts exports `compileTailwind`) so the two
* cannot drift.
*
* Usage: node scripts/ui-css.mjs [outFile] (default /tmp/dsh-visual/tailwind.css)
*/
import { mkdir, readFile, writeFile } from 'node:fs/promises'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { compileTailwind } from '../tsdown.config.ts'
const ROOT = fileURLToPath(new URL('..', import.meta.url))
const ENTRY = resolve(ROOT, 'src/client/ui/theme.css')
const DEFAULT_OUT = '/tmp/dsh-visual/tailwind.css'
const outFile = resolve(process.argv[2] ?? DEFAULT_OUT)
// `from`/`base` stay anchored to the real entry file, so `@source` and
// `@import` resolve against src/client/ui regardless of the cwd we run from.
const source = await compileTailwind(await readFile(ENTRY, 'utf8'), ENTRY, { minify: false })
await mkdir(dirname(outFile), { recursive: true })
await writeFile(outFile, source)
process.stdout.write(`ui:css -> ${outFile} (${source.length} bytes)\n`)