Skip to content

feat: render sponsor/track logos from HARP logo_url via next/image - #9

Merged
balebbae merged 2 commits into
mainfrom
devin/1790715080-logo-urls
Sep 29, 2026
Merged

balebbae merged 2 commits into
mainfrom
devin/1790715080-logo-urls

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Companion to hackutd/hackutd-harp#15. HARP's /v1/public/sponsors and /v1/public/tracks no longer inline base64 logo_data; they return

logo_url: "{HARP}/v1/public/{sponsors|tracks}/{id}/logo?v=<updated_at>"   // "" when no logo

served keyless with ETag + Cache-Control: public, max-age=31536000, immutable. This PR consumes that so logos stop being embedded as data: URIs in the page HTML (every visitor was downloading every logo, uncached and unresized) and instead go through next/image → Vercel image optimizer/CDN + browser cache.

  • lib/types.ts: Sponsor/Track drop logo_data/logo_content_type, gain logo_url: string.
  • lib/api.ts: track validation swaps the content-type check for isTrackLogoUrl ("" or absolute http(s)).
  • lib/format.ts: sponsorLogoSrc(data, contentType) → logoSrc(url); passes through http(s) only, null otherwise so callers keep their monogram / text-only fallbacks. Shared by both components.
  • components/sponsor-logo.tsx, components/challenge-tracks.tsx: <img src="data:..."> → <Image> (fill in a h-16 box for sponsors; 96×48 for tracks).
  • next.config.ts: images.remotePatterns is derived from HARP_API_BASE_URL at build time, restricted to pathname: "/v1/public/*/*/logo" (query left open because ?v= varies). Deploy note: HARP_API_BASE_URL must be present in the Vercel build environment, not just runtime — it already is if it's set as a normal env var, but if it's missing at build time remote logos will 400 from the optimizer. Upstream immutable max-age makes Next cache optimized variants for the full year (docs: TTL is max(minimumCacheTTL, upstream)).
  • README / .env.example updated accordingly.

Must be deployed together with (or after) the HARP PR — until then logo_url is absent and every sponsor renders the monogram / tracks render text-only (no crash; validation treats missing field as invalid tracks payload, so the tracks section shows its unavailable state).

Checks: lint, format:check, typecheck, next build (with HARP_API_BASE_URL set) pass.

Link to Devin session: https://app.devin.ai/sessions/919a1d99cd6c4f7d9452edb8a04fe394
Open in Devin Desktop: https://app.devin.ai/desktop/session/919a1d99cd6c4f7d9452edb8a04fe394?variant=devin
Requested by: @balebbae

HARP's public API now returns logo_url (keyless, versioned, immutable
cache) instead of inline base64 logo_data. Consume it with next/image
and allow-list the HARP host in images.remotePatterns.
@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
zero-day-2026 Ready Ready Preview Sep 29, 2026 9:36pm UTC

Request Review

@balebbae
balebbae merged commit 427b4d3 into main Sep 29, 2026
2 checks passed

This branch was successfully deployed

1 active deployment
Preview — 3b20b4ef Deployed Sep 29, 2026 by vercel[bot]
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