Skip to content

Add /release-notes/[tag] Route Handler for Sparkle WebView#2

Merged
FuJacob merged 9 commits into
mainfrom
feat/sparkle-release-notes
May 25, 2026
Merged

Add /release-notes/[tag] Route Handler for Sparkle WebView#2
FuJacob merged 9 commits into
mainfrom
feat/sparkle-release-notes

Conversation

@FuJacob
Copy link
Copy Markdown
Owner

@FuJacob FuJacob commented May 25, 2026

Summary

Adds frontend/app/release-notes/[tag]/route.ts — a Route Handler that returns a single self-contained HTML document for one release. This is what Sparkle's update alert will load via <sparkle:releaseNotesLink> in the next Cotabby appcast (separate PR in the tabby repo).

Why a Route Handler and not a page:

  • Sparkle's alert window is small (~460px) and short-lived. The existing /release-notes page is wrapped by app/layout.tsx (DM_Sans from Google Fonts, Vercel Analytics, the full Providers tree). All of that loads on every Check for Updates click — wrong fit.
  • Route Handlers in Next.js bypass the root layout entirely. We return one HTML document with an inline stylesheet, system font stack, and prefers-color-scheme: dark parity, and nothing else.

Companion human-facing /release-notes index page is left untouched.

Validation

npm run build
# ✓ Compiled successfully
# ƒ /release-notes/[tag]   appears in the route table as Dynamic, server-rendered on demand

npm run lint
# (pre-existing privacy/page.tsx <a href> warning unrelated to this change)

Manual smoke (once deployed): hit https://cotabby.app/release-notes/v1.6.0 (or any tag that exists) in a real browser — should render a slim release-notes page with no nav, no footer, no analytics beacon.

How releases are fetched

GET /repos/fujacob/tabby/releases/tags/{tag} per request, with next: { revalidate: 300 } so the GitHub API call is edge-cached for 5 min. Response also carries Cache-Control: public, s-maxage=300, stale-while-revalidate=86400 so Vercel's CDN absorbs spikes during the "Check for Updates" UX.

Setting GITHUB_TOKEN in Vercel env vars is recommended (existing fetch already supports it) — unauth limit is 60/hr per IP; authenticated is 5000/hr.

Failure mode

If GitHub 404s or rate-limits, the handler returns a 404 with a minimal page that links to https://github.com/FuJacob/tabby/releases so the user always has a path forward. Negative responses use a much shorter cache TTL (30s s-maxage, 5min SWR) so transient GitHub blips don't get pinned for hours.

Linked issues

None. Companion PR coming in fujacob/tabby to flip scripts/generate_appcast.py to point at this route.

Risk / rollout notes

  • Until the Tabby appcast generator PR lands, this route is dormant for Sparkle traffic — only direct browser visits hit it.
  • Accepts both /release-notes/v1.2.3 and /release-notes/1.2.3 (normalizes internally) so a future caller that drops the v doesn't 404.
  • Tag is forwarded to GitHub's API path-encoded; the encodeURIComponent call defends against .. / %2F style inputs but the broader URL pattern restriction is enforced by GitHub returning 404 for unknown tags.

Sparkle's update alert loads sparkle:releaseNotesLink from the appcast in
an embedded WKWebView. Pointing that link at the existing site page pulls
in DM_Sans, Vercel Analytics, and the rest of the marketing chrome on
every update prompt — bad fit for a 460px alert window.

This Route Handler bypasses app/layout.tsx entirely and returns a single
self-contained HTML document with an inline stylesheet, system font
stack, and prefers-color-scheme dark mode. Fetches one release at a time
via GET /repos/fujacob/tabby/releases/tags/{tag}, edge-cached for 5 min.
Tag input accepts both v1.2.3 and 1.2.3 because the appcast template
uses the raw git tag today.

Companion human-facing /release-notes index page is unchanged. The Tabby
appcast generator will be updated in a separate PR to point at this URL.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

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

Project Deployment Actions Updated (UTC)
matcha-landing Ready Ready Preview, Comment May 25, 2026 2:41pm
tabby-landing Ready Ready Preview, Comment May 25, 2026 2:41pm

FuJacob and others added 8 commits May 25, 2026 04:05
… accent, Cotabby metadata

Pivot type to Bricolage Grotesque (display) + Inter (body) via next/font.
Re-anchor accent from terracotta to the new logo's electric blue (#2b7fff),
recolor selection, and rename site title/applicationName/siteName to Cotabby.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Switch body Inter -> Inter Tight, base weight 500, bump weight utilities one
class (medium->semibold->bold). BETA badge styling left untouched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Point header/footer/legal/feedback logos at new-logo.png, fix alt text, and
regenerate all favicons + app/apple icons from the new mark.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Rename visible 'tabby' copy -> 'Cotabby', model names -> cotabby-fast-1/
balanced-1, support email -> support@cotabby.app, and TabbyLogoChip ->
CotabbyLogoChip. Convert privacy release-notes link to next/link. External
repo/domain/.dmg URLs left intact. BETA styling untouched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the original grey 40px grid with the navy + baby-blue diagonal striped
grid (96px, fixed).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… models

- Enlarge grid to a fixed full-site background; drop the spotlight mask
- Add sleeping cat draped over the hero card edge (trimmed asset)
- Replace eyebrow tags with lucide icons beside card headers
- Update to four model names (swift / swift-pro / balanced / careful)
- Rework permissions cards: icon row, parallel copy, prominent privacy footer
- Flatten the models preview list (no nested boxes, stacked name/note)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Drop cotabby-balanced-1, rename swift-pro to balanced (3 models total)
- Reword "on-device" to "local" across marketing + legal copy
- Round logo corners, regenerate app/apple icons
- Add full-bleed fading "cotabby" wordmark below the footer
- Polish permissions cards, install visual, CTA paws, nav report-bug link

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@FuJacob FuJacob merged commit ba72786 into main May 25, 2026
3 checks passed
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