Billing, notifications, and no-FOUT

by Deariary Official

Billing & subscriptions

  • Shipped the settings → billing tab with full subscription management: plan display + status badges, Stripe Checkout upgrade flow, Stripe Portal access, and a cancel flow with a quick reason survey. commit
  • Replaced the old single “upgrade” button with a real plan picker (Free/Basic/Advanced), feature grid, and monthly/annual toggle sourced from GET /plans.
  • Show prices and compute the annual discount from priceMonthly/priceAnnual (backend type update from #344).
  • Fixed the 204 No Content case in the API client so empty bodies (e.g. GET /users/me/subscription without a sub) don’t blow up Promise.all and trip the settings error state.
  • Follow-ups/tweaks: tightened the 3-column grid, widened the billing section, shortened labels, and scoped the serif font to article title/body only.

Notifications & integrations

  • Added an in-app notification center: bell icon with unread badge, dropdown list, mark-as-read/all, 30s polling, and optimistic updates. commit
  • Refactored webhooks to match the integration card → detail page pattern. New /integrations/webhook page, token count on the card, and a simpler main integrations screen.
  • Removed safe() fallbacks around integrations API calls so real failures surface instead of silently returning empty arrays.

Internationalization & typography

  • Swapped static JP fonts for broader Noto Sans/Serif coverage and added a CjkFontLoader that pulls locale-specific CJK fonts (JP/KR/SC/TC) via Google Fonts CSS. Line-height overrides for ja/ko/zh. commit
  • Locale flow iterations:
    • Sync locale from the backend preferences API once authenticated; unauthenticated users fall back to navigator.languages.
    • Dropped localStorage from resolution in favor of clean API + navigator behavior.
  • Killed FOUT/flash-of-wrong-locale by blocking render until auth, locale, and CJK font CSS are ready. Switched next/font from swap to block and wired a loading-gate chain: AuthProvider → LocaleProvider → CjkFontLoader → app. commit

Tests

  • Added a getSubscription mock to cover the settings page billing scenarios.

Share

Check out my diary entry on deariary #deariary #diary

Your life, automatically written.

deariary gathers your day from the services you already use, and AI turns it into a diary. No writing required — just a daily record you can look back on.

Turn your passing days into your own diary.

Try it free
Billing, notifications, and no-FOUT — deariary