Skip to content

Polish: markdown tables, dev-docs sidebar, 404 chrome + refactor sweep - #19

Merged
bobbyonmagic merged 1 commit into
mainfrom
feat/polish-refactor
May 17, 2026
Merged

bobbyonmagic merged 1 commit into
mainfrom
feat/polish-refactor

Conversation

@bobbyonmagic

Copy link
Copy Markdown
Collaborator

User-visible

  • Markdown tables render now. Vanilla remark doesn't parse GFM tables — added remark-gfm to blog.ts + docs.ts, plus table styling in .blog-content (bordered card, uppercase header, zebra rows, inline-code cells, GFM checkbox lists). The screenshot you sent of built-for-claude-code will look like a proper table now.
  • /docs is a real dev-docs layout. Left sidebar listing all docs + Resources block (GitHub, blog, API spec, llms.txt). Mobile drawer. Active state. Right-side TOC stays on doc detail pages.
  • 404 has nav chrome. Wrapped not-found.tsx in MarketingNav + MarketingFooter so users hitting a dead URL can navigate out. Added Pricing/Blog/Docs quick links.

Refactor sweep (no behavior change)

  • isPaidTier(tier) helper in lib/pricing.ts. Replaces 4 scattered tier === "pro" || tier === "family" checks.
  • useTier() hook in src/hooks/. Collapses three near-identical useEffect blocks (dashboard, billing, settings). Exposes refetch() for the Stripe-redirect flow.
  • sendEmail() helper in lib/email.ts. Centralizes the env-check + SDK + try/catch pattern that was repeated three different ways (raw fetch in register, raw fetch + .catch in forgot-password, Resend SDK in stripe webhook). All three now call sendEmail(). Monthly-report refactored on top of it too.

Verified

  • npx tsc --noEmit: clean on touched files
  • npm test: 68/68 ✓

User-visible fixes:
- Markdown tables now render. Vanilla remark wasn't parsing GFM tables;
  added remark-gfm to blog.ts + docs.ts and styled <table> in
  .blog-content (bordered card with zebra rows, uppercase header, code
  cells, GFM checkbox lists).
- /docs is now a real dev-docs layout — left sidebar with all docs +
  Resources block (GitHub, blog, API spec, llms.txt), mobile drawer,
  active state. Right-side TOC still appears on doc detail pages.
- 404 page wrapped in MarketingNav + MarketingFooter so users don't
  hit a dead-end. Added Pricing/Blog/Docs quick links.

Refactor sweep (no behavior change):
- isPaidTier(tier) helper in lib/pricing.ts. Replaces 4 scattered
  `tier === "pro" || tier === "family"` checks in billing, settings,
  admin pages.
- useTier() hook in src/hooks/. Collapses three near-identical
  useEffect blocks (dashboard, billing, settings) into one. Exposes
  refetch() for the Stripe-redirect flow.
- sendEmail() helper in lib/email.ts. Centralises the
  RESEND_API_KEY-check + Resend SDK + try/catch pattern that was
  repeated three different ways (raw fetch in register, raw fetch +
  .catch in forgot-password, Resend SDK in stripe webhook). All three
  now call sendEmail(). Monthly-report helper also refactored on top
  of it for consistency.

Vitest 68/68 green, tsc clean on touched files.
@bobbyonmagic
bobbyonmagic merged commit 3501c61 into main May 17, 2026
1 check passed
@bobbyonmagic
bobbyonmagic deleted the feat/polish-refactor branch May 17, 2026 08:26
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