Skip to content

feat: revamp admin dashboard with design system + TigerBeetle explorer#1

Merged
knutties merged 8 commits into
mainfrom
feat/admin-dashboard-revamp
May 27, 2026
Merged

feat: revamp admin dashboard with design system + TigerBeetle explorer#1
knutties merged 8 commits into
mainfrom
feat/admin-dashboard-revamp

Conversation

@tsdk02

@tsdk02 tsdk02 commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • New design system: replaces Pico with a custom token-based stylesheet (Inter + JetBrains Mono, dark sidebar shell, stat cards, tabs, breadcrumbs) shared across every admin page.
  • New TigerBeetle explorer mounted at /admin/tb: overview, accounts query/lookup/detail with balance history, transfers query/lookup/detail, pending transfers (post/void), and a u128 ↔ UUID ↔ hex ↔ INR decoder.
  • LedgerRepo gains 6 read methods wrapping lookup_accounts, lookup_transfers, query_accounts, query_transfers, get_account_transfers, get_account_balances for the explorer.

What's in scope

  • crates/pba_service/src/admin/tb.rs — new explorer handlers
  • crates/pba_service/src/domain/tb_explorer.rs — view types with flag/code decoders and sentinel matching
  • crates/pba_service/src/repository/ledger_repo.rs — explorer query methods
  • crates/pba_service/templates/base.html — design system + sidebar shell
  • crates/pba_service/templates/admin/* — every PBA admin page rewritten to the new system
  • crates/pba_service/templates/admin/tb/* — 8 new explorer templates

What's not in scope

  • No new auth/write gating — the entire /admin surface remains unauthenticated (inherits existing behavior). Any future admin hardening should be done consistently across the whole surface, not piecemeal.
  • No schema changes, no API changes.
Screenshot 2026-04-20 at 11 24 03 AM Screenshot 2026-04-20 at 11 24 16 AM Screenshot 2026-04-20 at 11 24 32 AM

Test plan

  • cargo build -p pba-service is green
  • just infra-start && just run boots without errors
  • Visit /admin — sidebar, breadcrumbs, stat cards render with Inter font
  • Create an account, deposit/pay/withdraw — all forms submit and redirect cleanly
  • Visit /admin/tb — sentinel balances, quick-links and schema reference visible
  • /admin/tb/accounts?mode=query&ledger=1&limit=100 lists all accounts
  • Click into an account → balance history renders for pool accounts (empty for sentinels, as designed)
  • /admin/tb/transfers?mode=query&ledger=1&code=200 returns payment-leg transfers
  • /admin/tb/pending lists pending transfers when any exist; Post/Void buttons work
  • /admin/tb/decoder?input=<uuid> shows u128/UUID/hex/INR representations

@tsdk02 tsdk02 self-assigned this Apr 20, 2026
@knutties knutties force-pushed the feat/admin-dashboard-revamp branch from 48babf5 to 6c3bf71 Compare May 21, 2026 16:10
tsdk02 and others added 2 commits May 21, 2026 21:48
- New design system: replaces Pico with a custom token-based stylesheet
  (Inter + JetBrains Mono, dark sidebar shell, stat cards, tabs,
  breadcrumbs) shared across every admin page.
- New TigerBeetle explorer mounted at /admin/tb: overview, accounts
  query/lookup/detail with balance history, transfers query/lookup/detail,
  pending transfers (post/void), and a u128 / UUID / hex / INR decoder.
- LedgerRepo gains 6 read methods wrapping lookup_accounts,
  lookup_transfers, query_accounts, query_transfers,
  get_account_transfers, get_account_balances for the explorer.
- Separate PB/normal transaction views, kind filter tabs, timestamp fixes.

Rebased onto main:
- Reconcile templates with main: payment/withdrawal forms gain optional
  gateway_ref input; transaction & normal-account detail pages keep the
  legacy strong/colon kv labels so existing UI E2E selectors still match;
  withdrawal and payment detail panels render gateway_ref alongside the
  new design.
- Dashboard adds a top-level "Total accounts" stat card combining PB +
  normal counts (preserves the existing dashboard E2E assertion).
- Transfer detail renders status inside `id="transfer-status"` for the
  transfer admin UI tests.
- Self-host htmx.min.js under /admin/static so the admin UI works in
  networks that cannot reach unpkg.com.
- Restore main's tests/model/SDK so the new normal-account/UUIDv7/
  gateway_ref behavior remains under test coverage.
- Update extract_pending_balance test helper to walk the new
  stat-card structure (case-insensitive label, scoped to one article,
  ignores the pill-pending CSS class name).
The admin dashboard revamp was authored against an older base and
inadvertently reverted #31 (commit 199d955), which had added
DB_MIGRATION_MODE=run to the dev/test runners. Without it, the binary
falls back to its production-safe default of skipping migrations, so a
fresh `just run` left the schema behind main — most visibly, the new
transactions.reverses_transaction_id column was missing and
/admin/transactions failed with a database error.

Restores the env var in:
- process-compose.yml (`just run`)
- process-compose.test.yml (both CI and local-dev branches)
- justfile `run-service` and `watch` recipes

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@knutties knutties force-pushed the feat/admin-dashboard-revamp branch from 6c3bf71 to a503dad Compare May 21, 2026 16:36
knutties and others added 6 commits May 21, 2026 22:11
The dashboard revamp branch was authored against an older base where the
PB services were unprefixed (account_service, deposit_service, etc.) and
brought those files along when it rebased forward. Main had since renamed
them to pb_*_service plus added normal_*_service siblings, so the
unprefixed copies ended up sitting alongside the active ones — never
declared in service.rs/repository.rs, never compiled, just clutter.

Removes the five stale files:
- service/account_service.rs    (superseded by pb_account_service)
- service/deposit_service.rs    (superseded by pb_deposit_service)
- service/payment_service.rs    (superseded by pb_payment_service)
- service/withdrawal_service.rs (superseded by pb_withdrawal_service)
- repository/account_repo.rs    (superseded by pb_account_repo)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The dashboard revamp branch was authored against an older base and
inadvertently reverted #35's deposit_timeout poller logic, which had
added transfer-pair handling: when a pending transfer (correlation_id
set) times out, both legs are voided in one UPDATE WHERE correlation_id,
and a HashSet dedups so the second leg returned by
find_timed_out_pending is skipped.

After the rebase HEAD was back to per-row updates that treat each leg
independently — non-atomic (one leg briefly voided while the other is
still pending), with two warn lines per pair and a redundant no-op UPDATE
on the second leg.

Restores main's version verbatim.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The dashboard revamp branch was authored against a base predating #37
(commit 48268d1, "feat: generate UUIDv7 for all entity IDs") and during
rebase its generate_transfer_id() helper landed back on Uuid::new_v4().

Every other ID site in the codebase uses Uuid::now_v7(); restore parity
here. v7 IDs are time-ordered, which keeps TigerBeetle's LSM keys
roughly sequential and avoids the random-insert penalty v4 would
re-introduce.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The dashboard revamp renamed the brand from 'PBA Admin' (main) to
'PBA Ledger' across every template's <title>, breadcrumb root link,
and the new sidebar's brand-name. Reverts the wording to 'PBA Admin'
in all 24 templates to match main.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The dashboard revamp branch was authored before two forward-progress
changes on main and the rebase silently reverted them in both workflows:

- ci.yml lost DB_MIGRATION_MODE: run from the env: block (added in #29).
  Without it the E2E CI service would start with the production-safe
  default of skipping migrations, leaving the test schema behind and
  failing any schema-dependent step.

- docker-publish.yml regressed from main's matrix multi-arch build
  (linux/amd64 + linux/arm64 with per-arch cache scopes plus a separate
  create-manifest job that assembles the :tag and :latest manifests
  from both arches) back to a single-arch build-and-push job. The arm64
  image and the multi-arch manifest were no longer being produced.

Restores both workflows verbatim from origin/main.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…erfile

The dashboard revamp branch was authored before two further main-forward
changes; the rebase silently reverted both:

- jsonwebtoken 10 → 9 (#30 / 1629964 bumped it 9.3.1 → 10.3.0). The
  Cargo.lock churn (ring/signature swap, openssl 0.10.79 → .78,
  rustls-webpki 0.103.13 → .10) is downstream of the crate downgrade.
- Dockerfile dropped main's ARCH=$(uname -m) Zig-tarball selection
  (#33 / c453499, the multi-platform docker image PR) and hardcoded
  x86_64-linux. This is the matching half of the docker-publish.yml
  multi-arch regression already restored in 9359b60 — without it the
  arm64 matrix leg would have failed to build.

Restores all three files verbatim from origin/main; cargo check passes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@knutties knutties merged commit ff7480b into main May 27, 2026
6 checks passed
@knutties knutties deleted the feat/admin-dashboard-revamp branch May 27, 2026 11:28
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.

2 participants