Skip to content

Feat/share countdown#10

Merged
ififi2017 merged 2 commits into
mainfrom
feat/share-countdown
Jul 5, 2026
Merged

Feat/share countdown#10
ififi2017 merged 2 commits into
mainfrom
feat/share-countdown

Conversation

@ififi2017

Copy link
Copy Markdown
Owner

No description provided.

ififi2017 and others added 2 commits July 5, 2026 21:20
Translations are fetched client-side and were cached with a
StaleWhileRevalidate service-worker strategy, so the first visit after a
deploy served the previous translation.json (missing newly added keys
such as monthlyWorkingDays) until a second load or a cache clear.

- Switch /locales/ SW caching from StaleWhileRevalidate to NetworkFirst
  (fresh when online, cached fallback when offline)
- Inject a per-deploy NEXT_PUBLIC_BUILD_ID (Vercel commit SHA, else a
  build-time timestamp) and append it as ?v=<buildId> to locale fetches,
  busting HTTP/CDN caches once per deploy while staying cacheable and
  offline-capable within a deploy

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
After starting the countdown, users can share "how long until off work" as
text or a polished image to promote the site.

- Share dialog (image / text tabs) opened from the countdown view
- Mood emoji picker (8 moods); each mood drives the share image's gradient
- Canvas-generated image (square 1080² + story 1080×1920, 2x DPR) with the
  countdown, mood emoji, progress bar, site logo, QR code and URL
- Text share with the site URL; all share links carry UTM params for
  attribution in analytics
- One-click platform intents: X, Facebook, WhatsApp, Telegram, LINE, Reddit,
  Weibo. Native Web Share (with image file) on mobile, plus download / copy
  image / copy text on desktop
- Share content never includes salary/earnings (component receives only
  timeLeft/progress); image regenerates on mood/format change, not per tick
- Fixed-height preview keeps the old image during regeneration so switching
  mood/format never shifts the layout
- Lazy-loaded dialog (qrcode + canvas) keeps initial bundle unchanged
- New i18n keys across all 19 locales; unit tests for share/mood helpers

Also fixes a pre-existing dark-mode bug: `body` used `color: var(--foreground)`
without the `hsl()` wrapper, making the raw HSL triplet an invalid color that
fell back to black. Inherited-color UI (the dialog) rendered black text in dark
mode; now wrapped in hsl(). Dialog content also gets text-foreground and
overscroll-contain (prevents overscroll bleed-through on iOS).

Deps: qrcode, @radix-ui/react-dialog. Adds vitest.config.ts for the "@" alias.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
off-work-30 Ready Ready Preview, Comment Jul 5, 2026 4:40pm

@ififi2017
ififi2017 merged commit 5ecd223 into main Jul 5, 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