Skip to content

fix(og): the card was a serif name on an empty field — give it the subnet's mark and the brand face - #11494

Merged
JSONbored merged 1 commit into
mainfrom
fix/og-card-font-and-bleed
Aug 19, 2026
Merged

fix(og): the card was a serif name on an empty field — give it the subnet's mark and the brand face#11494
JSONbored merged 1 commit into
mainfrom
fix/og-card-font-and-bleed

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Three defects in #11493's first cut, all visible only in the rendered image — which is why I rendered it rather than trusting the exit code.

The font was a fallback, not a choice

ImageResponse without fonts renders in its own default, and the shipped card came out in a serif — not the wordmark's typeface, and it read as a different product. The Node path never showed this because scripts/refresh-og-image.ts passes satori the fonts explicitly.

Space Grotesk now loads through workers-og's own loadGoogleFont, subset to the glyphs the card actually draws.

It did not fill the canvas

width:100%;height:100% left a white band down the right edge and along the bottom: satori resolves a percentage against the parent it is given, and workers-og does not hand it one the way the Node call does. A fixed 1200×630 is the canvas either renderer is asked for, so it cannot disagree with itself.

It carried no identity

A name on a flat field, with "Metagraphed" spelled out next to our own icon. The registry already holds logo_url for 60 of 129 subnets — on our own cache, so inlining one is not a third-party fetch. The card draws it now. The other 69 get a numbered badge, and the footer is the icon alone: the wordmark was saying in text what the mark already says.

The mark is the netuid, not the alpha symbol

The symbol was the obvious choice and is the subnet's on-chain identity — but those symbols are Greek, Cyrillic and Arabic, and Space Grotesk is Latin-only. Rendered, subnet 1's α came out as ?. Loading a font per subnet to cover one glyph is not a trade worth making for a link preview, and a ? on the cards belonging to the subnets with the least identity is the worst possible place for one.

The logo fetch is allowlisted

logo_url is a registry row a contributor can edit. Without an allowlist that row points this Worker at any host it likes and the render inlines whatever comes back — an SSRF with an image on the end of it.

https on our own logo host, nothing else. Five tests cover it, including metagraph.sh.evil.example — a subdomain that only looks like ours — and the off-host cases assert the request never leaves.

A logo that will not load is not a failed card: it falls through to the badge. The digest keys on the logo URL rather than its bytes, because that URL is content-addressed by the logo cache already.

Startup CPU, re-measured

283 / 301 / 319 ms against the ~400 ms limit — unchanged from the 313 ms baseline. The font and logo work happens in the handler, not at module scope.

Verification

Full suite 960 files / 22,106 passed, build, lint, format, all 72 CI validators, patch coverage 100% (21/21 lines, 28/28 branches). Both variants rendered and inspected before pushing.

…bnet's mark and the brand face

Three defects in the first cut, all visible only in the rendered image:

THE FONT WAS A FALLBACK, not a choice. `ImageResponse` without `fonts` renders
in its own default and the shipped card came out in a serif, which is not the
wordmark's typeface. The Node path never showed this because
scripts/refresh-og-image.ts passes satori the fonts explicitly. Space Grotesk is
now loaded through workers-og's own `loadGoogleFont`, subset to the glyphs the
card draws.

THE CARD DID NOT FILL THE CANVAS. `width:100%;height:100%` left a white band
down the right edge and along the bottom: satori resolves a percentage against
the parent it is given, and workers-og does not hand it one the way the Node
satori call does. Fixed 1200x630 is the canvas either renderer is asked for, so
it cannot disagree with itself.

IT CARRIED NO IDENTITY. A name on a flat field, with the wordmark spelled out
beside our own icon. The registry already holds `logo_url` for 60 of 129
subnets -- on our own cache, so inlining one is not a third-party fetch -- and
the card now draws it. The other 69 get a numbered badge, and the footer is the
icon alone: the wordmark said in text what the mark already says.

THE MARK IS THE NETUID, NOT THE ALPHA SYMBOL. The symbol was the obvious choice
and is the subnet's on-chain identity, but those symbols are Greek, Cyrillic and
Arabic letters and Space Grotesk is Latin-only -- rendered, subnet 1's `α` came
out as `?`. Loading a font per subnet to cover one glyph is not a trade worth
making for a link preview, and a `?` on the cards of the subnets with the least
identity is the worst possible place for one.

The logo fetch is allowlisted to https on our own logo host and nothing else.
`logo_url` is a registry row a contributor can edit, so without that the row
points this Worker at any host it likes and the render inlines whatever comes
back. Five tests cover the allowlist, including a subdomain that only looks
like ours; the off-host cases assert the request never leaves.

A logo that will not load is not a failed card -- it falls through to the badge.
The digest keys on the logo URL rather than its bytes, because that URL is
content-addressed by the logo cache already.

Startup CPU re-measured after the change: 283/301/319 ms against a ~400 ms
limit, unchanged from the 313 ms baseline -- the font and logo work happens in
the handler, not at module scope.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
metagraphed-wss-lb 7f206c6 Aug 19 2026, 11:21 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
metagraphed-data-api 7f206c6 Aug 19 2026, 11:21 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
metagraphed-registry-sync-api 7f206c6 Aug 19 2026, 11:21 AM

@superagent-security

Copy link
Copy Markdown

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.65%. Comparing base (15426f5) to head (7f206c6).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11494      +/-   ##
==========================================
+ Coverage   95.63%   95.65%   +0.01%     
==========================================
  Files         788      788              
  Lines       46902    46926      +24     
  Branches    17223    17236      +13     
==========================================
+ Hits        44857    44886      +29     
+ Misses        531      527       -4     
+ Partials     1514     1513       -1     
Files with missing lines Coverage Δ
src/og-entity-card.ts 92.38% <100.00%> (+8.43%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 2c54e37 into main Aug 19, 2026
17 checks passed
@JSONbored
JSONbored deleted the fix/og-card-font-and-bleed branch August 19, 2026 11:25
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