Skip to content

Viewer: redesigned live explorer - #204

Open
satran004 wants to merge 3 commits into
mainfrom
viewer/redesign
Open

satran004 wants to merge 3 commits into
mainfrom
viewer/redesign

Conversation

@satran004

Copy link
Copy Markdown
Member

A full redesign of Yaci Viewer: a modern, live explorer for a local devnet and for any Yaci Store, including Mainnet.

What's new

  • App shell
    • light and dark themes in the DevKit look, with fonts bundled so it works offline
    • a collapsible sidebar grouped into Explore, Staking and Governance
    • a status badge showing the network (found from the store), tip block and whether updates are live
  • Search everywhere (⌘K, /, or paste anywhere)
    • recognises blocks, transactions, addresses, stake accounts, pools, DReps, assets, policies, scripts, datums and epochs
    • ambiguous hashes are checked against the store before being offered
  • Live dashboard
    • new blocks slide in, with a "next block" countdown
    • trends for block time, transactions and block load
    • a latest-transactions feed, epoch progress and ADA supply
    • uses the live-blocks WebSocket when the store has one; otherwise it polls
  • Transaction page
    • an inputs → transaction → outputs flow, with change outputs marked
    • a "where the ADA went" breakdown
    • script execution budgets
    • redeemers and datums decoded from CBOR into readable trees
    • mints and burns, metadata, collateral, reference inputs, signers and raw JSON
  • Every other page is rebuilt in the same style
    • blocks (← and → keys step between blocks)
    • addresses and stake accounts (with delegated pool and DRep)
    • assets (CIP-25/68), scripts and datums
    • a new Epochs section with protocol parameters
    • Ada pots, pools, delegations, rewards, withdrawals and certificates
    • governance: overview, proposals with a vote tally, DReps, votes, committee and constitution

Fixes

  • Security: the governance anchor page fetched any URL server-side, which could reach internal services. It now refuses private and internal addresses, and checks them again after DNS lookup and on every redirect. It also enforces a size limit and a time budget, and compares the document's BLAKE2b-256 hash with the hash on chain. Pool metadata fetches use the same guard.
  • Paging: the store's pages are 1-based, so page 2 of address, stake and similar lists showed page 1 again.
  • Broken pages and data:
    • the epoch-stakes page always failed because of doubled /api/v1 paths
    • the live stats sent when the page connects (aggregate_data) were silently dropped
    • the block page showed its transaction table twice
  • Docker: the image ran the Vite dev server. It is now a multi-stage production build (node build) on port 5173, with a .dockerignore.
  • Config: in config/env, PUBLIC_INDEXER_CLIENT_BASE_URL now follows HOST_STORE_API_PORT.
  • Redirects: old routes redirect to their new homes (/governance/govactions, /adapot, /rewards/account/[a]).

Dependencies

  • Upgraded:
    • Svelte 5.16 → 5.57, to fix hydration bugs
    • SvelteKit 2.15 → 2.70
    • vite-plugin-svelte 5.1.1, adapter-node 5.5.7
  • Added (dev only, pinned exactly):
    • @lucide/svelte
    • @fontsource-variable/{inter,space-grotesk,jetbrains-mono}
    • @types/node
  • Removed: daisyui, moment, svelte-feather-icons, classnames, @popperjs/core
  • Removed code: the unused src/routes/api proxy and old components, utilities and stores

Testing

  • npx svelte-check: 0 errors, 0 warnings
  • npm run test:unit: 26 passing. These cover formatting, search classification, CBOR, address and bech32 helpers, and the anchor URL guard.
  • Playwright smoke tests (tests/smoke.spec.ts): 19 passing against a local devnet. The old tests/test.ts never matched Playwright's pattern, so it never ran.
  • npm run build passes, and the Docker image was built and run against a devnet.
  • Checked by hand in light and dark mode, at desktop and phone width:

Known limits

  • Public IPFS gateways often rate-limit; IPFS_GATEWAY can name a preferred (public) gateway.
  • On Mainnet, an asset's transaction and UTxO tabs can time out on the store side. The error shows inside that tab.

🤖 Generated with Claude Code

satran004 and others added 3 commits October 17, 2026 00:58
- Design tokens (light and dark) on Tailwind, matching the DevKit brand;
  self-hosted Inter, Space Grotesk and JetBrains Mono for offline devnets
- App shell: collapsible sidebar grouped by task, top bar with search,
  network and live status, theme toggle, page progress bar, view
  transitions; replaces the full-screen spinner on every navigation
- Search everywhere (Cmd/Ctrl+K, /, or paste): classifies the input and
  checks ambiguous hashes against the store
- API client for server loads and the browser (honours
  PUBLIC_INDEXER_CLIENT_BASE_URL), BigInt-safe formatting
- Live layer: WebSocket with reconnect and backoff, polling fallback
  for stores without the live module; reads aggregate_data correctly
- Dashboard: live block conveyor with a forging countdown, block time,
  tx and block-load trends, latest transactions, epoch ring, supply
- Upgrade Svelte 5.16 -> 5.57 and Kit 2.15 -> 2.70 (hydration fixes)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Transaction page: visual UTxO flow (inputs -> tx -> outputs) with
  change detection and address highlighting, where-the-ADA-went
  breakdown, scripts with execution budget bars, decoded redeemers and
  datums (Plutus data CBOR decoder), mint/burn, metadata with CIP
  labels, collateral, reference inputs, required signers, raw JSON
- Block page: prev/next with arrow keys, live confirmations, size gauge,
  consensus fields on demand; blocks list with size bars and live rows
- Transactions list with live rows on page 1
- Address page: type from the header, balance (with /amounts fallback),
  stake account and pool derived via bech32, txs/UTxOs/tokens tabs
- Stake account page: controlled stake, pool and DRep delegation,
  rewards, withdrawals, other rewards
- Fix paging: these Yaci Store endpoints are 1-based, so page 2 of an
  address or stake account used to show page 1 again
- CIP-68 asset names, signed mint quantities, address lookup page,
  friendly 404/503 page
- Theme follows the OS until the user picks one
- Remove the old home-page widgets and WebSocket store

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New and redesigned pages
- Epochs (new): list with live progress for the current epoch, and an
  epoch page with blocks and grouped, filterable protocol parameters
- Assets: unit/policy/fingerprint pages with mint and burn history,
  CIP-68 names, supply; scripts (native script tree, CBOR) and datums
- Ada pots with trend charts; withdrawals
- Pools: lookup plus recent registrations and retirements; pool page
  with metadata, stake trend, delegators, blocks and rewards
- Rewards, epoch stakes (fix the doubled /api/v1 in its loader and the
  browser fetches that ignored the client base URL), and one design for
  the five certificate lists
- Governance: overview, proposals (govactions redirects there), action
  page with a vote tally, DReps, votes, committee, constitution and DRep
  activity

Security
- The governance anchor page fetched any URL on the server. Anchors and
  pool metadata now go through one safe fetcher: http(s) on 80/443 and
  ipfs only, no private/loopback/link-local/reserved addresses (also
  checked after DNS, at connect time, and on every redirect), size and
  time limits, JSON only. Anchors are checked against their on-chain
  BLAKE2b-256 hash

Fixes and cleanup
- API timeouts now also race the request (SvelteKit's server fetch can
  ignore the abort signal); the live clock reads real time on the server
- Remove DaisyUI, the old components, utilities, stores and dead routes;
  drop moment, svelte-feather-icons, classnames and @popperjs/core
- Docker image runs the production build (node build) on 5173 instead of
  the Vite dev server; the browser store URL follows HOST_STORE_API_PORT
- Playwright smoke tests that actually run (19 pages and flows), unit
  tests for formatting, search, CBOR, bech32, addresses and URL safety
- README rewritten

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown

Initial automated review · Aster

Hi @satran004, thanks for the PR! 🙏 This is an automatic first check by an AI reviewer. It does not replace maintainer review and may be wrong.

Reviewed commit: 9c1ad4a3211cd7b94820c4a38eb34737fd448edf

Issues found:

  • applications/viewer/src/routes/transactions/[id]/+page.svelte:76 — The bundled Store response builder leaves invalid false, so failed-script transactions are labeled “Success”; please obtain a reliable status before asserting success.
  • applications/viewer/src/lib/live/chain.svelte.ts:254 — After a devnet reset, the old higher-height blocks win this sort, leaving the dashboard on the obsolete tip; please clear or reconcile the cached chain.
  • applications/viewer/src/lib/live/chain.svelte.ts:290 — When polling catches up multiple blocks, only the newest block’s transactions are fetched, so intermediate transactions never reach the feed; please fetch the full gap.
  • applications/viewer/src/routes/assets/unit/[unit]/+page.server.ts:31 — The bundled Store’s holders endpoint uses zero-based pages, so this skips the first 20 holders; please send page - 1 for this endpoint.
  • applications/viewer/src/routes/transactions/[id]/+page.svelte:187 — Collateral returns use amounts, but UtxoCard reads amount, so nonzero returns display zero ADA and omit native assets; please normalize this payload.

Not tested: Code was read only, not built or run. The head CI build was still running.

This branch has not been deployed

No deployments
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