feat: revamp admin dashboard with design system + TigerBeetle explorer#1
Merged
Conversation
48babf5 to
6c3bf71
Compare
- 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>
6c3bf71 to
a503dad
Compare
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>
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
/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.LedgerRepogains 6 read methods wrappinglookup_accounts,lookup_transfers,query_accounts,query_transfers,get_account_transfers,get_account_balancesfor the explorer.What's in scope
crates/pba_service/src/admin/tb.rs— new explorer handlerscrates/pba_service/src/domain/tb_explorer.rs— view types with flag/code decoders and sentinel matchingcrates/pba_service/src/repository/ledger_repo.rs— explorer query methodscrates/pba_service/templates/base.html— design system + sidebar shellcrates/pba_service/templates/admin/*— every PBA admin page rewritten to the new systemcrates/pba_service/templates/admin/tb/*— 8 new explorer templatesWhat's not in scope
/adminsurface remains unauthenticated (inherits existing behavior). Any future admin hardening should be done consistently across the whole surface, not piecemeal.Test plan
cargo build -p pba-serviceis greenjust infra-start && just runboots without errors/admin— sidebar, breadcrumbs, stat cards render with Inter font/admin/tb— sentinel balances, quick-links and schema reference visible/admin/tb/accounts?mode=query&ledger=1&limit=100lists all accounts/admin/tb/transfers?mode=query&ledger=1&code=200returns payment-leg transfers/admin/tb/pendinglists pending transfers when any exist; Post/Void buttons work/admin/tb/decoder?input=<uuid>shows u128/UUID/hex/INR representations