feat(recap): add rolling 12-month recap page #162

Merged
ellamizuki merged 1 commit from feat/recap-page into main 2026-09-10 04:39:20 +00:00
ellamizuki commented 2026-09-10 04:31:09 +00:00 (Migrated from github.com)

What

Adds a public /recap page that aggregates a rolling window of the last twelve months instead of per-year pages, so it never needs annual maintenance. Available in all seven locales.

Sections

  • Coding — new wakatime.getStats tRPC procedure using the documented last_year range (the previous last_12_months range no longer exists in the current API docs; verified live). Prefers including_other_language totals and degrades to null on request failure, matching the resilience contract of the existing routers.
  • Listening — extends the existing lastfm range procedures with a year_term option mapped to Last.fm's 12month period for top artists and tracks. Backwards compatible: the music page keeps using the original three ranges.
  • Writing — new recapRouter exposing summary (post counts deduped across translations), topViewed, and topLiked. Views and likes are all-time database counters with no timestamps, so those lists are explicitly labeled as all-time instead of pretending to be scoped to the window.

prefixPathname in next-intl concatenates blindly, so a href that is already locale-prefixed would double-prefix for non-default locales (/pt/pt/blog/...). Same-locale post links pass an unprefixed path and let next-intl prefix exactly once; posts that only exist in another locale render a plain localized <a>.

Also

  • Header and footer nav entries (recap label in all locale files)
  • Sitemap entry
  • i18n messages for en, pt, es, fr, de, ja, zh-CN
  • Unit tests: recap router (translation dedupe, rolling window, locale fallback, missing-document filtering) and WakaTime stats mapping (payload preference order, null degradation)

Validation

  • pnpm test:unit: 292 tests / 70 files passing
  • App lint and turbo type-check: clean
  • next build: green, /[locale]/recap prerendered for all locales
## What Adds a public `/recap` page that aggregates a rolling window of the last twelve months instead of per-year pages, so it never needs annual maintenance. Available in all seven locales. ## Sections - **Coding** — new `wakatime.getStats` tRPC procedure using the documented `last_year` range (the previous `last_12_months` range no longer exists in the current API docs; verified live). Prefers `including_other_language` totals and degrades to `null` on request failure, matching the resilience contract of the existing routers. - **Listening** — extends the existing `lastfm` range procedures with a `year_term` option mapped to Last.fm's `12month` period for top artists and tracks. Backwards compatible: the music page keeps using the original three ranges. - **Writing** — new `recapRouter` exposing `summary` (post counts deduped across translations), `topViewed`, and `topLiked`. Views and likes are all-time database counters with no timestamps, so those lists are explicitly labeled as all-time instead of pretending to be scoped to the window. ## Locale link handling `prefixPathname` in next-intl concatenates blindly, so a href that is already locale-prefixed would double-prefix for non-default locales (`/pt/pt/blog/...`). Same-locale post links pass an unprefixed path and let next-intl prefix exactly once; posts that only exist in another locale render a plain localized `<a>`. ## Also - Header and footer nav entries (`recap` label in all locale files) - Sitemap entry - i18n messages for en, pt, es, fr, de, ja, zh-CN - Unit tests: recap router (translation dedupe, rolling window, locale fallback, missing-document filtering) and WakaTime stats mapping (payload preference order, null degradation) ## Validation - `pnpm test:unit`: 292 tests / 70 files passing - App lint and `turbo type-check`: clean - `next build`: green, `/[locale]/recap` prerendered for all locales
isyuricunha (Migrated from github.com) reviewed 2026-09-10 04:31:09 +00:00
vercel[bot] commented 2026-09-10 04:31:15 +00:00 (Migrated from github.com)

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

Project Deployment Actions Updated
website-docs Ready Ready Preview Sep 10, 2026 4:36am UTC
website-web Ready Ready Preview Sep 10, 2026 4:36am UTC
[vc]: #VLyvrY5Z54Fg4w3IG3fQc8fsm4L3AD1eLE8LXDVKWv8=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ3ZWJzaXRlLXdlYiIsInByb2plY3RJZCI6InByal9iNnJGaEFBUEhJWFI3M2Nlb2RFMHl2bEJ3MzgyIiwicm9vdERpcmVjdG9yeSI6ImFwcHMvd2ViIiwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL3l1cmktY3VuaGFzLXByb2plY3RzL3dlYnNpdGUtd2ViL0Rvb0VpRjd2S3NhamZqenVwbzVYZVJRbTE5dlkiLCJwcmV2aWV3VXJsIjoid2Vic2l0ZS13ZWItZ2l0LWZlYXQtcmVjYXAtcGFnZS15dXJpLWN1bmhhcy1wcm9qZWN0cy52ZXJjZWwuYXBwIiwibmV4dENvbW1pdFN0YXR1cyI6IkRFUExPWUVEIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6IndlYnNpdGUtd2ViLWdpdC1mZWF0LXJlY2FwLXBhZ2UteXVyaS1jdW5oYXMtcHJvamVjdHMudmVyY2VsLmFwcCJ9fSx7Im5hbWUiOiJ3ZWJzaXRlLWRvY3MiLCJwcm9qZWN0SWQiOiJwcmpfMmVVMnNUTTBpZFk3MHJUYnNjQ0N0RXQ2TUZPdyIsInJvb3REaXJlY3RvcnkiOiJhcHBzL2RvY3MiLCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20veXVyaS1jdW5oYXMtcHJvamVjdHMvd2Vic2l0ZS1kb2NzLzk1elZ4OEZzMUVCbW5yVjVOTkNKb3lTZk5OOFkiLCJwcmV2aWV3VXJsIjoid2Vic2l0ZS1kb2NzLWdpdC1mZWF0LXJlY2FwLXBhZ2UteXVyaS1jdW5oYXMtcHJvamVjdHMudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJ3ZWJzaXRlLWRvY3MtZ2l0LWZlYXQtcmVjYXAtcGFnZS15dXJpLWN1bmhhcy1wcm9qZWN0cy52ZXJjZWwuYXBwIn19XX0= The latest updates on your projects. Learn more about [Vercel for GitHub](https://vercel.link/github-learn-more). | Project | Deployment | Actions | Updated | | :--- | :----- | :------ | :------ | | <a href="https://vercel.com/yuri-cunhas-projects/website-docs"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_2eU2sTM0idY70rTbscCCtEt6MFOw&teamId=team_g087rqPZJa9s4DWPeZtQhxa9&s=32" width="16" height="16" align="middle" alt="" /></sup></a> [website-docs](https://vercel.com/yuri-cunhas-projects/website-docs) | ![Ready](https://vercel.com/static/status/ready.svg) [Ready](https://vercel.com/yuri-cunhas-projects/website-docs/95zVx8Fs1EBmnrV5NNCJoySfNN8Y) | [Preview](https://website-docs-git-feat-recap-page-yuri-cunhas-projects.vercel.app) | <relative-time datetime="2026-09-10T04:36:17.154Z">Sep 10, 2026 4:36am UTC</relative-time> | | <a href="https://vercel.com/yuri-cunhas-projects/website-web"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_b6rFhAAPHIXR73ceodE0yvlBw382&teamId=team_g087rqPZJa9s4DWPeZtQhxa9&s=32" width="16" height="16" align="middle" alt="" /></sup></a> [website-web](https://vercel.com/yuri-cunhas-projects/website-web) | ![Ready](https://vercel.com/static/status/ready.svg) [Ready](https://vercel.com/yuri-cunhas-projects/website-web/DooEiF7vKsajfjzupo5XeRQm19vY) | [Preview](https://website-web-git-feat-recap-page-yuri-cunhas-projects.vercel.app) | <relative-time datetime="2026-09-10T04:36:17.155Z">Sep 10, 2026 4:36am UTC</relative-time> |
Sign in to join this conversation.
No description provided.