Skip to content

feat(og): dynamic OG rendering for all entity routes + block/receipt#768

Merged
achalvs merged 22 commits intomainfrom
feat/static-og-images
Apr 6, 2026
Merged

feat(og): dynamic OG rendering for all entity routes + block/receipt#768
achalvs merged 22 commits intomainfrom
feat/static-og-images

Conversation

@achalvs
Copy link
Copy Markdown
Collaborator

@achalvs achalvs commented Mar 21, 2026

Summary

  • Add dynamic OG image rendering for all entity routes: transaction, receipt, block, token, address, and contract
  • New static OG images for /explorer, /blocks, and /tokens listing pages
  • Add Pilat font (OTF with tabular numeral support) for all data cards
  • New BlockCard component with SVG transaction histogram and gas usage progress bar
  • Explorer routes updated to emit proper <meta og:image> tags for blocks, tokens listing, and receipt pages
  • Fix address/contract OG rendering (previously returned empty responses in production)
  • Comprehensive visual polish: pill badges, currency icons, status badges, smart date formatting

Route Coverage

Route Type Status
/explorer Static Updated background
/tx/:hash Dynamic Transaction card with status badge, event details
/receipt/:hash Dynamic Receipt card (dedicated endpoint)
/block/:id Dynamic BlockCard with histogram + gas bar
/token/:address Dynamic TokenCard with icon, holder count, supply
/address/:address (EOA) Dynamic AddressCard with holdings, assets, activity
/address/:address (contract) Dynamic ContractCard with methods, deployer
/blocks Static Static listing image
/tokens Static Static listing image

Screenshots

Dynamic Routes

RouteRendered
/tx/:hash
/receipt/:hash
/block/:id
/token/:address
/address/:address (EOA)
/address/:address (contract)

Technical Changes

OG Worker (apps/og)

  • New background template images for all routes
  • Pilat Book OTF font with font-feature-settings: "tnum" for tabular numerals
  • SVG-based transaction histogram and gas usage progress bar (inline data URIs)
  • BlockCard with prev-block tx counts, gas percentage visualization
  • ReceiptCard with status badge, event details, fee token label
  • Smart date formatting: "Month Day · HH:MM:SS" (drops year if current)
  • Pill badge styling with 8px border radius across all badges
  • Currency symbol icons ($, euro) next to currency names
  • Empty states: "No events to display." / "Failed to render summary."

Explorer (apps/explorer)

  • Block detail loader fetches 7 prior blocks' tx counts for histogram
  • head() passes prevBlocks and status params in OG URLs
  • Contract call events always show "Call" action (status shown via badge)
  • Receipt sidebar: "View →" pill button instead of Tempo lockup
  • Receipt card: brighter dark mode background (bg-base-alt)

Test Plan

  • GET /explorer returns updated static image
  • GET /tx/:hash?... renders card with status badge, event details
  • GET /receipt/:hash?... renders receipt card
  • GET /block/:id?... renders BlockCard with histogram + gas bar
  • GET /token/:address?... renders TokenCard with icon and real data
  • GET /address/:address?...&accountType=account renders AddressCard
  • GET /address/:address?...&accountType=contract renders ContractCard
  • All OG images are 1200x630 webp
  • Rate limiting applies to all OG routes
  • Caching (s-maxage=3600) applies in production

@achalvs achalvs force-pushed the feat/static-og-images branch 2 times, most recently from 55af6ce to bf92856 Compare March 21, 2026 05:40
@achalvs achalvs requested review from bpierre, goksu and o-az and removed request for bpierre, goksu and o-az March 21, 2026 05:41
@achalvs achalvs force-pushed the feat/static-og-images branch from bf92856 to 22cc72d Compare March 21, 2026 05:50
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 21, 2026

Cloudflare Deployments

App Environment Status Preview
explorer devnet [OK] Deployed View Preview
explorer mainnet [OK] Deployed View Preview
explorer testnet [OK] Deployed View Preview
fee-payer devnet [>>] Skipped No changes
fee-payer moderato [>>] Skipped No changes
fee-payer privy [>>] Skipped No changes
og - [OK] Deployed View Preview
tokenlist - [>>] Skipped No changes

@achalvs achalvs force-pushed the feat/static-og-images branch 2 times, most recently from 681171c to dd756a6 Compare March 21, 2026 06:13
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 21, 2026

Bundle Size Report

Metric Size Δ Change
Total 4.1 MB -663.7 KB (-13.6%)
Gzip 1.2 MB -107.3 KB (-8.0%)
Brotli 1.0 MB -85.9 KB (-7.4%)
Chunk changes (>1KB)
Chunk Change
assets/KeyManager.js (removed) -477.4 KB
assets/QueryBuilder.js (removed) -423.4 KB
assets/router.js -303.0 KB
assets/wagmi.config.js -166.8 KB
assets/_hash.js -129.1 KB
assets/BaseTanStackRouterDevtoolsPanel-Bmws3ikM.js (removed) -99.5 KB
assets/Intro.js (removed) -66.0 KB
assets/createSsrRpc.js (removed) -43.8 KB
assets/isAddressEqual.js -32.5 KB
assets/path.js (removed) -30.6 KB
assets/FloatingTanStackRouterDevtools-B7vy70jP.js (removed) -24.4 KB
assets/_layout.js -21.4 KB
assets/stringify.js (removed) -19.7 KB
assets/Hash.js -16.4 KB
assets/address.js -14.1 KB
assets/getAction.js -13.0 KB
assets/base.js (removed) -12.8 KB
assets/utils.js -10.1 KB
assets/token.server.js (removed) -9.8 KB
assets/Address.js -9.7 KB
...and 38 more

Compared against main branch (baseline from 2/4/2026, 5:13:51 PM)

@achalvs achalvs force-pushed the feat/static-og-images branch 3 times, most recently from 36567e0 to 0ac8936 Compare March 21, 2026 06:38
@achalvs
Copy link
Copy Markdown
Collaborator Author

achalvs commented Mar 21, 2026

OG Image Test Matrix (50 test cases)

All images from real Tempo mainnet data. URLs constructed as explorer will generate post-merge.

Blocks (8)

Type Link Test Case Rendered
Block 10468400 1 txs, 0.0% gas
Block 10468300 2 txs, 0.0% gas
Block 10468000 1 txs, 0.0% gas
Block 10467500 1 txs, 0.0% gas
Block 10467000 2 txs, 0.0% gas
Block 10466000 1 txs, 0.0% gas
Block 10465000 2 txs, 0.0% gas
Block 10460000 1 txs, 0.0% gas

Transactions (11)

Type Link Test Case Rendered
TX 0xcd17…b8f7 User tx, reverted
TX 0x1400…802a System tx, success
TX 0x30be…a4f9 System tx, success
TX 0x50bd…b8f4 User tx, success
TX 0x1658…573d System tx, success
TX 0x6931…2547 User tx, reverted
TX 0xafc8…5176 System tx, success
TX 0xed4c…be1a System tx, success
TX Multi-event (Swap+Transfer+Sync)
TX Single event (Transfer)
TX No events, fee only

Receipts (10)

Type Link Test Case Rendered
Receipt 0xcd17…b8f7 Receipt view
Receipt 0x1400…802a Receipt view
Receipt 0x30be…a4f9 Receipt view
Receipt 0x50bd…b8f4 Receipt view
Receipt 0x1658…573d Receipt view
Receipt 0x6931…2547 Receipt view
Receipt 0xafc8…5176 Receipt view
Receipt 0xed4c…be1a Receipt view
Receipt Multi-event w/ total
Receipt Fee + Total

Addresses (6)

Type Link Test Case Rendered
Address 0xf70d…dbef High activity (24K txs)
Address 0x9e00…4e1a Active, holds USDC.e
Address 0x6fba…c243 Empty account
Address 0x5997…b48d Low activity (32 txs)
Address 0x97d1…34a5 Active, no tokens
Address 0xccc8…15be Single transaction

Contracts (6)

Type Link Test Case Rendered
Contract 0x20c0…0000 pathUSD token (8 methods)
Contract 0xdec0…0000 TempoSwap DEX (4 methods)
Contract 0xccc8…15be Unnamed contract
Contract 0x403c…0000 AccessControl (3 methods)
Contract 0xfeec…0000 FeeController (4 methods)
Contract 0x20fc…0000 TokenFactory (10 methods)

Tokens (6)

Type Link Test Case Rendered
Token pathUSD pathUSD (USD)
Token alphaUSD alphaUSD (fee token, USD)
Token betaUSD betaUSD (fee token, USD)
Token thetaUSD thetaUSD (USD)
Token USDC.e USDC.e (USD)
Token EURC.e EURC.e (EUR)

Static (3)

Type Link Test Case Rendered
Static Explorer Landing
Static Blocks Blocks
Static Tokens Tokens

@achalvs achalvs force-pushed the feat/static-og-images branch 2 times, most recently from 9775ddd to 8663d7b Compare March 21, 2026 07:04
Restore dynamic OG image rendering for all entity routes (tx, token,
address, receipt, block) with updated background templates.

- /tx/:hash renders ReceiptCard on transaction background
- /receipt/:hash renders ReceiptCard on receipt background
- /block/:id renders BlockCard on block background (new)
- /token/:address renders TokenCard on token background
- /address/:address renders AddressCard on address/contract background
- /blocks and /tokens serve static listing images
- /explorer serves static default image
- Replace Tempo Receipt logo with TEMPO lockup SVG
- Add BlockCard component and blockOgQuerySchema
- Add OG meta tags to explorer block detail pages
@achalvs achalvs force-pushed the feat/static-og-images branch from 8663d7b to e7bd4fb Compare March 21, 2026 07:13
achalvs added 5 commits March 24, 2026 04:03
- Show "No events to display." when events array is empty
- Show "Failed to render summary." when eventsFailed flag is set
- Wire eventsFailed query param through schema and route handlers
…tweaks

- Add contractCall case to both OG event formatters so system txs show
  "Call 0xc0000000 on 0x000...000" instead of bare "Call"
- Replace ReceiptMark logo with "View →" pill button in tx sidebar
- Brighten receipt card background (bg-base-alt) for dark mode visibility
achalvs added 16 commits March 24, 2026 10:20
…col layout

Takumi's renderer doesn't handle React fragments inside flex-col
containers, causing events to render side-by-side instead of stacked.
- Fee: always show "Fee (pathUSD)" label, "$0.00" in grey for zero-fee txs
- Date: rename to "Time (UTC)", smart format "Month Day ⋅ HH:MM:SS"
  (drop year if current year)
- Status: add Success/Failed badge with color coding on tx/receipt cards
- Blocks: reorder (Miner/Parent above Txns/Gas), add tx histogram
  with blue current bar, add 20-segment gas usage progress bar
- Events: purple for hex selectors, no-wrap when no amount column
- Addresses: "$0.00" grey for empty holdings, remove Last Active
  from contracts
- Params: add status field to tx schema, prevBlocks to block schema
… reorder fields

- TxHistogram: maxHeight 80->40, bar width 8->12px, grey #d1d5db->#e5e7eb
- GasProgressBar: unfilled #e5e7eb->#f3f4f6
- Pipe dividers: lighter color, histogram pipe 40->28px
- Field order: Transactions + Gas Usage now above Miner + Parent
…ted txs

- Replace U+22C5 dot operator with U+00B7 middle dot (Pilat font compat)
- Move status badge after block number, not before
- Always use "Call" as contract call action name (not "Failed" for
  reverted txs) since status is shown via the badge
OG worker:
- Convert TxHistogram and GasProgressBar from div-based to inline SVG
  data URIs for dramatically faster WASM rendering
- Fix cdot U+22C5 -> U+00B7 middle dot (Pilat font compat)
- Move status badge after block number, not before
- Gracefully skip histogram when prevBlocks data missing

Explorer:
- Block loader fetches 7 prior blocks' tx counts via Promise.all
- head() passes prevBlocks param in OG URL for histogram rendering
- Set fontWeight 400 explicitly on token name (prevents synthetic bold)
- Increase name truncation from 18 to 28 chars (allows longer names)
- Reduce font size from text-5xl to text-[42px] with line-height 1.1
- Show "0" in grey for holders when data unavailable (was showing —)
- Badge border radius (6px) + consistent padding on Success/Failed
- Status badge text size reduced to 20px
- Don't show $0 on event amounts (hides useless amounts)
- Pill styling shared constant (8px radius, consistent padding)
- All badges (tokens, methods, action) use rounded pill style
- Gradient increased from 60px to 100px
- Card minHeight 400px to ensure gradient coverage
- Holdings row vertical centering with padding
- Token name: stack badge below if name > 20 chars
- Currency symbol icon (circle with $,€ etc) next to currency name
- Holders greyed when 0, supply shows "0.00" greyed when empty
- Contract header: items-center for vertical alignment
- Assets label added before token badges in address card
- Token badge margin fix: no left margin on first badge
- Method badges: increased maxCharsPerRow to 48, single flex-wrap
  row to prevent premature +N overflow
@achalvs achalvs merged commit 30857f7 into main Apr 6, 2026
15 checks passed
@achalvs achalvs deleted the feat/static-og-images branch April 6, 2026 18:14
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