feat(webui): bootstrap Vue 3 + shadcn-vue, replacing the Preact dashboard
Sam owns this codebase and reads Vue fluently, not Preact; a UI its maintainer
cannot read is the liability that outweighs the port. shadcn-vue is Vue-only,
so adopting it means the framework moves with it.
Scaffolded per the official Vite guide: `npm create vite --template vue-ts`,
Tailwind v4 via @tailwindcss/vite, `shadcn-vue init` (Reka UI, Lucide, neutral
base, CSS variables). Button and DropdownMenu are added, the latter being what
the pending navigation restructure needs.
Two deviations from the guide, both forced:
- The guide sets `baseUrl` alongside `paths`. TypeScript 6 deprecates
`baseUrl` and errors on it, and this project is heading for TS 7 native, so
`paths` stands alone and resolves relative to the config file. Not a
downgrade: the scaffold's typescript ~6.0.2 is untouched.
- vite.config.ts keeps `base: "./"` and unhashed asset names. ui/embed.go
embeds a committed dist/, served from a path the build does not know;
hashed names would also orphan a file in git on every rebuild.
The Preact app and its 43 test files are deleted rather than ported, on Sam's
instruction: tests return when there is behaviour worth pinning rather than a
port to re-assert. `task test:ui` is now a vue-tsc typecheck, which is what
would actually catch a broken component; an empty `npm test` would pass
vacuously.
ui/src/router/index.ts carries the route table and is the new source of truth
for TestDashboardPagesRegistryCoversEveryRoute, which parsed main.jsx before.
Keeping that contract alive matters: it is what caught the stale /chat entry
earlier today. Every route resolves to a named placeholder view, so an unported
page is visibly unported rather than blank.
golangci-lint now excludes ui/node_modules. The dashboard toolchain pulls in
`flatted`, which ships a Go implementation beside its JavaScript, and the gate
was failing on complexity in a vendored third-party file.
The shadcn MCP server is registered in the root .mcp.json. `shadcn-vue mcp init`
writes it to the directory it runs in, which for a nested ui/ is a path Claude
Code never reads.
This commit is contained in:
1 parent
da0116f0ba
commit
d933d36449
166 files changed
+6768
-16833
No files matched your search
+10
-5
@@ -201,14 +201,19 @@ tasks:
|
||||
- bash tools/uidist.sh check
|
||||
|
||||
test:ui:
|
||||
desc: Run the dashboard's node tests (DOM-building primitives)
|
||||
desc: Type-check the dashboard (no unit tests during the Vue migration)
|
||||
dir: ui
|
||||
# Without this, a fresh clone fails the gate on a missing jsdom rather
|
||||
# than a real test failure: ui/node_modules is gitignored and nothing
|
||||
# else in `task check` installs it.
|
||||
# The Preact suite was dropped with the Preact app in the shadcn-vue
|
||||
# migration; tests come back when there is behaviour worth pinning rather
|
||||
# than a port to re-assert. Until then vue-tsc is the gate that would
|
||||
# actually catch a broken component, and an empty `npm test` would pass
|
||||
# vacuously.
|
||||
#
|
||||
# ui:deps so a fresh clone fails on a real error rather than on a missing
|
||||
# node_modules, which is gitignored and installed by nothing else.
|
||||
deps: [ui:deps]
|
||||
cmds:
|
||||
- npm test
|
||||
- npm run typecheck
|
||||
|
||||
dev:
|
||||
desc: "Develop: archied live-reload + archie-gateway + archie-state-store + archie-ui + Vite HMR together. Open http://localhost:5173"
|
||||
|
||||
Reference in new issue
Block a user