Skip to content

TUI theme plug + bulletin attestation on dot init#21

Merged
UtkarshBhardwaj007 merged 2 commits intomainfrom
ub/theme-plug-bulletin-attestation
Apr 18, 2026
Merged

TUI theme plug + bulletin attestation on dot init#21
UtkarshBhardwaj007 merged 2 commits intomainfrom
ub/theme-plug-bulletin-attestation

Conversation

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member

Summary

  • New src/utils/ui/theme/ plug — every screen renders through this single folder. Swap it to reskin, stub it to strip styling. No color/glyph/spacing literals outside this directory.
  • dot init now surfaces bulletin attestation status on every run (even for already-signed-in users): ~13d 4h · #14,582,331, with warning color under 24h and danger when expired.
  • Terminal tab title updates during long deploys (OSC 0): building → uploading → publishing → ✓/✕. TTY-gated so pipes/CI stay clean.

Behavior changes

  • dot initAccountSetup third row reads bulletin · ~13d 4h · #14,582,331 (or not attested / expired · #N) plus a dim quota hint underneath.
  • dot deploy running screen shows the OSC tab-title progression; the completion screen shows a chunk-upload sparkline.
  • All screens share a single Header (breadcrumb + hairline rule) and use uniform marks: · ⠋….

Implementation notes

  • src/utils/account/attestation.ts reads TransactionStorage.Authorizations + current block height and returns a pure AttestationStatus. formatAttestation is a pure function of status + block time; 14 unit tests cover the formatter's thresholds (>30d, 1–30d, 1–24h, <1h, expired, unauthorized). Block time is derived from Aura.SlotDuration and cached per process.
  • Header writes the OSC title on mount; DeployScreen also calls setWindowTitle on phase transitions and on finish/error. src/index.ts registers clearWindowTitle via onProcessShutdown so exit hands the tab back to the shell.
  • Existing checkAllowance behavior is unchanged — attestation is a separate read that surfaces expiry without touching the refresh threshold.
  • All 161 tests still pass. Typecheck clean.

Test plan

  • pnpm test — 161 pass
  • pnpm exec tsc --noEmit — no errors
  • dot init with a freshly-onboarded account — bulletin row shows ~Nd Mh · #block
  • dot init with an expired attestation — bulletin row shows expired · #block in red
  • dot init when attestation refresh is needed — spinner → new ~Nd · #block
  • dot deploy --signer dev — banner renders, tab title updates through phases, completion shows sparkline + success tab title
  • dot deploy | cat (piped) — no OSC escape codes leak into stdout

Follow-ups not in this PR

  • @polkadot-apps/* chain client writes Connecting to: … / SS58 Address: … to stdout during domain validation, which bleeds into Ink's render frame and stacks banners in scrollback. Header now reserves a top margin so the banner always has a blank line above it, but the proper fix is to capture that output and route it through the theme's LogTail. Flagged in CLAUDE.md conventions as a known rough edge.

…ation on dot init.

All screens now render through `src/utils/ui/theme/` — one folder holds
every color, glyph, and layout token used anywhere in the CLI. Swap the
folder to reskin; stub the exports to strip styling. No color literals,
glyph literals, or spacing constants live outside this directory.

`dot init` now queries bulletin attestation on every run — even for
already-signed-in users — and renders how long the upload quota is valid
for in human form (e.g. `~13d 4h · #14,582,331`), switching to warning
color under 24h and danger color when expired.

Terminal tab title updates during long deploys via OSC 0 (building →
uploading → publishing → ✓/✕), so `dot deploy` shows progress in the
tab strip while the user tabs away. TTY-gated so CI/pipe output stays
clean; cleared on process shutdown.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 18, 2026

Dev build ready — try this branch:

curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/ub/theme-plug-bulletin-attestation bash

Biome collapses whitespace in JSX text children, which broke the
"  ·  " separator rhythm in Hint rows. Wrapped those hints and the
AppBrowser column rows in template literals so biome leaves the
spacing alone; ran biome --write to fix the remaining visually-neutral
line-length issues.
@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit 46d6b79 into main Apr 18, 2026
5 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the ub/theme-plug-bulletin-attestation branch April 18, 2026 13:38
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