feat(dashboard): rewrite on React + Vite + TanStack stack#57
Merged
pratyush618 merged 42 commits intomasterfrom Apr 24, 2026
Merged
feat(dashboard): rewrite on React + Vite + TanStack stack#57pratyush618 merged 42 commits intomasterfrom
pratyush618 merged 42 commits intomasterfrom
Conversation
…indicator, error boundary)
Old Preact single-file dashboard is gone; the new React + Vite SPA (formerly dashboard-next/) now lives at the canonical path. dashboard.py drops the legacy templates/dashboard.html fallback and serves a 503 with clear rebuild instructions if assets aren't bundled. Docs and CI updated.
- ruff/mypy now explicitly target py_src/ AND tests/ (tests/ was previously implicit via the .* glob — making it explicit ensures a regression in test code still trips the gate). - Switched dashboard hooks from npx → pnpm exec so they use the pinned pnpm@10.30.3 toolchain consistently with CI. - New dashboard-test hook runs vitest on any src/ change so the 34-test suite guards every commit touching the dashboard.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
CI typecheck was failing with TS2345 errors across every route file because src/routeTree.gen.ts is a build artifact the TanStack Router Vite plugin emits during `vite build` — but tsc ran before build. Without the file, every createFileRoute(...) collapsed to 'never' and all the router-typed navigate calls failed. Changes: - Added @tanstack/router-cli devDep; new `pnpm routes` script invokes `tsr generate` standalone so typecheck doesn't depend on Vite. - typecheck script now runs `tsr generate && tsc --noEmit`. - CI has a dedicated 'Generate route tree' step before Biome/tsc/vitest. - Renamed output to the CLI's default `routeTree.gen.ts` (camelCase); updated vite.config.ts + main.tsx + .gitignore to match. - Typed an implicitly-any mouse handler in recent-jobs.tsx that was surfaced alongside the route errors.
The Python test matrix runs without pnpm, so py_src/taskito/static/ is empty and the new dashboard.py 503 fallback was firing on every test_spa_html_served run in CI. Rather than teaching the Python CI to run the Node build, keep the tests self-contained: synthesise a minimal index.html in tmp_path and monkeypatch the static-root cache. This also lets us explicitly cover the 503 fallback with a dedicated test_spa_missing_assets_returns_503. - test_spa_html_served: seeds a fake SPA, asserts 200 + HTML shell - test_spa_missing_assets_returns_503: asserts 503 + rebuild hint in body Both tests reset the module's memoised static root via monkeypatch so they can't leak state to other tests.
…obals The previous test fix reached into _-prefixed module globals (_static_root, _static_root_resolved) via monkeypatch. That was correct but coupled the tests to internal memoisation that could shift under refactoring. Replace with a small StaticAssets class: - Encapsulates root + lookup + index-html resolution - StaticAssets.from_package() does the lazy package probe - Module-level _get_default_assets() memoises the package result - _make_handler(queue, static_assets=...) takes an explicit instance - serve_dashboard(..., static_assets=...) passes it through Tests now construct StaticAssets(tmp_path) or StaticAssets(None) directly — no monkeypatch, no internal-state coupling. The new shape also lets embedders ship a customised dashboard bundle by constructing their own StaticAssets, which the original design couldn't accommodate. Expanded SPA test coverage from 2 to 5 cases: - bundled assets serve index.html - hashed /assets/* resolve with immutable cache headers - unknown route falls back to index for client-side routing - missing /assets/* file returns 404 (never the index) - no bundle returns 503 with rebuild hint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full rewrite of the web dashboard on a Vite + React + TanStack Router/Query + shadcn/ui + Tailwind v4 stack. Same Python entrypoint (`taskito dashboard --app myapp:queue`), zero Node runtime in production — the built SPA ships inside the wheel. Replaces the Preact single-file dashboard that preceded it.
What's new in the UI
Backend changes
Architecture
Bundle
CI + pre-commit
Test plan
Notes for reviewers