Skip to content

feat: replace vanilla JS dashboard with Preact + Vite + Tailwind SPA#43

Merged
pratyush618 merged 11 commits intomasterfrom
feat/dashboard-rebuild
Mar 22, 2026
Merged

feat: replace vanilla JS dashboard with Preact + Vite + Tailwind SPA#43
pratyush618 merged 11 commits intomasterfrom
feat/dashboard-rebuild

Conversation

@pratyush618
Copy link
Copy Markdown
Collaborator

Summary

  • Replaces the vanilla JS dashboard (~700 lines, 8 template files) with a Preact + Vite + Tailwind CSS + TypeScript SPA compiled to a single 128KB self-contained HTML file
  • Adds 3 new pages (Resources, Queue Management, System Internals) alongside 8 existing ones; all 11 pages share dark/light mode, auto-refresh, toast notifications, and loading states
  • Backend simplified: dashboard.py reads one pre-built file via importlib.resources instead of composing templates at serve time

Changes

Frontend (dashboard/)

  • Preact 10 + @preact/signals + preact-router; Tailwind CSS v4; lucide-preact icons; TypeScript strict mode
  • 11 pages: Overview, Jobs, Job Detail, Metrics (timeseries chart), Logs, Workers, Queues, Resources, Circuit Breakers, Dead Letters, System
  • Shared components: StatCard, Badge, Button, DataTable, Pagination, Toast, ConfirmDialog, EmptyState, ProgressBar
  • Canvas charts: ThroughputChart (sparkline), TimeseriesChart (stacked bars); SVG DAG viewer for job dependencies
  • vite-plugin-singlefile inlines all JS + CSS into one HTML; build script copies output to py_src/taskito/templates/dashboard.html
  • Biome linter + formatter with biome.json config

Python (py_src/taskito/)

  • dashboard.py: replaced 8-template composition with _get_spa_html() — thread-safe lazy load of single pre-built HTML

CI (.github/workflows/ci.yml)

  • New dashboard-lint job: biome ci, tsc --noEmit, vite build

Docs (docs/)

  • docs/guide/dashboard.md: full 14-step tutorial, updated REST API reference (30+ endpoints), development guide, project structure, and build pipeline explanation
  • docs/changelog.md: 0.10.0 dashboard rebuild entry

Test plan

  • cargo test passes (all feature combos)
  • pytest passes (357 tests, dashboard endpoints covered in test_dashboard.py)
  • ruff + mypy clean
  • cd dashboard && npx biome ci src/ passes
  • cd dashboard && npx tsc --noEmit passes
  • cd dashboard && npx vite build produces dashboard.html
  • Dashboard loads at localhost:8080 with all 11 pages rendering correctly
  • Dark/light mode toggle persists in localStorage
  • Auto-refresh dropdown cycles through 2s / 5s / 10s / off
  • Job cancel, replay, dead-letter retry, queue pause/resume all show toast confirmations

Set up the dashboard frontend build system with Preact, Vite,
Tailwind CSS v4, and TypeScript. Includes API client, type
definitions for all 30+ endpoints, data-fetching hooks with
auto-refresh, theme/toast signals, and utility functions.

Output is a single HTML file via vite-plugin-singlefile.
App shell with sidebar navigation (lucide icons, grouped sections,
active indicator), header with gradient logo, theme toggle, and
refresh control. Reusable UI components: stat cards with status
icons, data tables with alternating rows, badges with status dots,
buttons with hover/active states, toasts with slide-in animation,
confirm dialogs with backdrop blur, loading spinners, skeleton
screens, and empty states.

Canvas-based charts: throughput sparkline with gradient fill,
timeseries stacked bar chart, SVG dependency DAG viewer.
Overview (stats grid, throughput chart, recent jobs), Jobs (7-field
filter panel, paginated table), Job Detail (status-colored accent,
error history, task logs, replay history, DAG), Metrics (timeseries
chart, latency color-coding, time range selector), Logs (task/level
filters), Workers (status dot, heartbeat cards), Circuit Breakers,
Dead Letters (retry/purge with confirm dialog).

Three new pages: Resources (health, pool stats, dependencies),
Queue Management (per-queue stats, pause/resume with icons),
System Internals (proxy reconstruction + interception metrics).
Simplify dashboard.py to read a single pre-built HTML file instead
of composing from 8 separate template files. Remove old vanilla JS
sources (700 lines) now replaced by the Preact build.

The built dashboard.html (128KB, 32KB gzipped) is a self-contained
SPA with all CSS and JS inlined via vite-plugin-singlefile. Users
still get zero-dependency install — Node.js is only needed by
contributors modifying the dashboard source.
Rewrite dashboard.md to reflect the Preact + Tailwind rebuild:
11 pages documented, all 30+ REST API endpoints listed, new
development section for contributors, updated feature list.

Add dashboard rebuild entry to 0.10.0 changelog.
Add step-by-step tutorial walkthrough covering all 11 dashboard
pages: overview, jobs, job detail, metrics, logs, workers, queues,
resources, circuit breakers, dead letters, and system internals.

Include build pipeline diagram, project structure reference, and
programmatic API usage examples (pause/resume, bulk retry).

Add dashboard section to quickstart guide.
Add Biome (Rust-based linter + formatter) for TypeScript/TSX code
quality. Fix all lint errors: add type="button" to interactive
buttons, add SVG title for accessibility, replace forEach with
for-of where return values were discarded.

New npm scripts: lint, lint:fix, format, format:check, ci.
Pre-commit hooks: dashboard-lint (biome ci) and dashboard-typecheck
(tsc --noEmit) trigger on dashboard/src/ changes.
CI: new dashboard-lint job runs biome, typecheck, and build check.
Replace non-null assertion with type cast in main.tsx. Use template
literals instead of string concatenation in sidebar, logs, and
dead-letters pages. Zero warnings in CI annotations.
Search input in header navigates directly to job detail page by ID.
Auto-refresh indicator shows relative time since last data fetch
("just now", "3s ago") and highlights the refresh icon when active.
DataTable supports optional checkbox selection with select-all
header toggle. Jobs page shows bulk action bar when items are
selected: Cancel Selected (with confirm dialog), Replay Selected,
and Clear Selection. Actions process jobs sequentially and show
toast with success/failure counts.
Toggle between list view (flat, paginated) and grouped view that
collapses dead letters by error message. Groups show occurrence
count, expandable item list, and Retry All button. Groups sorted
by count descending so the most common errors appear first.
@pratyush618 pratyush618 merged commit 0100159 into master Mar 22, 2026
11 checks passed
@pratyush618 pratyush618 deleted the feat/dashboard-rebuild branch March 31, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant