Skip to content

fix: full Nuxt-to-Next.js parity audit - #1

Merged
thomasluizon merged 1 commit into
mainfrom
fix/nuxt-nextjs-full-parity-audit
Apr 4, 2026
Merged

fix: full Nuxt-to-Next.js parity audit#1
thomasluizon merged 1 commit into
mainfrom
fix/nuxt-nextjs-full-parity-audit

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Summary

  • Complete cross-codebase audit comparing all pages, components, hooks, and stores between Nuxt.js (source of truth) and Next.js
  • 100+ issues fixed across 66 files (23 critical, 40+ major, 50+ minor)
  • Pin react/react-dom to exact 19.1.0 to fix version mismatch causing 500 errors on API routes

Critical fixes

  • Auth: PKCE OAuth via Supabase JS client, fix stale closure timeout, locale-aware language
  • Layout: Mount all 10+ missing global overlays (onboarding, celebrations, toasts, push prompt)
  • Habits: Connect reminderTimes/scheduledReminders to API requests, fix tags assignment on edit
  • Chat: Fix 403 rate-limit detection through server action, increment aiMessagesUsed counter
  • Preferences: Language switch now reloads page, full VAPID push notification subscription
  • Billing: Dedicated subscription routes with X-Forwarded-For for geolocation-based pricing
  • Retrospective: Fix hardcoded 'en' language, add markdown + DOMPurify sanitization
  • DescriptionViewer: Full markdown rendering with marked + DOMPurify (was only h1-h3/bold/italic)

Major fixes

  • Today page: Selection cascade to descendants, selectAll, ?date= query param, refresh button
  • HabitList: Auto-log parent prompt, move parent picker, children progress calculation, All view nesting
  • Forms: Goal linking limit 10 (was 5), sub-habit prefill, Pro gate on slip alerts, general mode auto-set
  • Calendar: Touch swipe navigation, date format alignment with Nuxt
  • Gamification: Exit animations on all 7 celebration/toast components
  • Color scheme: DB persistence + cross-device sync + first-login detection
  • Error boundaries for app and auth route groups
  • Portal containers to eliminate React key warnings
  • Onboarding: Fallback flag on error, weekStartDay optimistic update

Test plan

  • TypeScript type-check passes (0 errors)
  • All pages render without runtime errors
  • React version mismatch resolved (both 19.1.0)
  • React key warning resolved
  • Manual smoke test of habit log/create/edit flows
  • Manual smoke test of auth (Google OAuth + magic link)
  • Manual smoke test of chat with 403 rate limiting
  • Verify push notification subscription flow
  • Verify retrospective renders in user's locale

🤖 Generated with Claude Code

…60+ files

Complete cross-codebase audit comparing Nuxt.js (source of truth) against Next.js,
fixing all behavioral, functional, and structural differences.

Critical fixes:
- Auth: PKCE OAuth via Supabase JS client, fix stale closure timeout, locale
- Layout: Mount all 10+ missing global overlays (onboarding, celebrations, toasts)
- Habits: Connect reminderTimes/scheduledReminders to API, fix tags on edit
- Chat: Fix 403 detection via structured server action, increment aiMessagesUsed
- Preferences: Language switch reloads page, full VAPID push subscription
- Billing: Dedicated subscription routes with X-Forwarded-For for geo pricing
- Retrospective: Fix hardcoded language, add markdown + DOMPurify sanitization
- Description: Full markdown rendering with marked + DOMPurify

Major fixes:
- Today page: Selection cascade, selectAll, ?date= param, refresh button
- HabitList: Auto-log parent prompt, move parent picker, children progress
- Forms: Goal limit 10, sub-habit prefill, Pro gate on slip alerts
- Calendar: Swipe navigation, date format alignment
- Gamification: Exit animations on all 7 celebration components
- Color scheme: DB persistence + cross-device sync
- Error boundaries for app and auth layouts
- Portal containers to eliminate React key warnings
- Pin react/react-dom to exact 19.1.0 to fix version mismatch

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
orbit-ui-mobile-web Building Building Preview, Comment Apr 4, 2026 11:29pm

@thomasluizon
thomasluizon merged commit 8fd42b6 into main Apr 4, 2026
2 of 3 checks passed
@thomasluizon
thomasluizon deleted the fix/nuxt-nextjs-full-parity-audit branch April 4, 2026 23:29
thomasluizon added a commit that referenced this pull request Apr 15, 2026
…ferral/JWT

Security hardening on the web BFF auth layer:

- Dedicated /api/auth/{send-code,verify-code,google,logout} routes now call
  buildForwardedClientHeaders(request) so X-Forwarded-For / CF-Connecting-IP /
  X-Orbit-Country-Code / Accept-Language / X-Orbit-Time-Zone reach the .NET
  backend. Previously these routes sent no client context, so the backend's
  DistributedRateLimitFilter partitioned every anonymous auth request under
  the Next.js server IP — collapsing the per-client 5 req/min bucket.

- auth_token cookie maxAge changed from 86_400 (1 day) to 604_800 (7 days) so
  it matches the backend JwtSettings.ExpiryHours=168. Prevents daily forced
  token refresh round-trips.

- Length-cap the JWT payload segment in /api/auth/session before JSON.parse
  (4 KB ceiling). Blocks a memory-amplification vector where a malicious
  cookie contains a megabyte-scale base64 segment.

- Cap referral query-param at 40 chars before cookie write on the login page.

Includes new unit tests for send-code header forwarding and updates
auth-api.test.ts to assert the 7-day maxAge.

Covers frontend plan Area A #1, #2, #4, #5.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Apr 15, 2026
…lidators

Covers the P1 missing-validation findings in the audit:

- validateGoalDeadline(deadline, today): blocks past dates, rejects garbage
  strings (goals.form.deadlinePast / goals.form.deadlineInvalid i18n keys).
- validateReminderTimes(minutes): enforces the backend contract that
  minutes-before-due offsets are integers in [0, 1440] and unique.
- validateDueTimes(dueTime, dueEndTime): blocks the case where a user sets
  only the end time without a start time.

validateReminderSelection and validateHabitForm now delegate into the new
validators so inline errors fire on the existing form flows without
touching each component.

Adds en/pt-BR i18n keys with proper diacritics on the Portuguese strings.
Extends validation.test.ts and goal-form.test.ts with exhaustive boundary
cases.

Covers frontend plan Area D #1, #2, #3.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Apr 15, 2026
DraggableFlatList previously had no getItemLayout, so React Native had to
measure every row before rendering during initial scroll and drag events.
With 40+ habits on mid-tier Android this produces visible jank.

Adds an approximate ESTIMATED_HABIT_ITEM_HEIGHT=104 and wires getItemLayout
onto the primary DraggableFlatList driver. The value does not need to be
perfect: telling RN that rows are of roughly uniform height unlocks
scroll-to-offset fast-paths and smoother drag.

Covers frontend plan Area C #3 (P0 #9).

Note: Splitting habit-list.tsx + habit-card.tsx into smaller files
(Area C #1, #2) is deferred as a TODO — it is a large refactor across
2,119 + 1,511 LOC and is better done in a dedicated PR with profiling
measurements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Apr 15, 2026
Non-shippable fixes from the audit that require architectural decisions,
new migrations, or large refactors have TODO comments citing PLAN.md:

- auth-api.ts: tryRefreshSession mutex — needs single-flight dedup (Area A #6)
- actions/chat.ts: server-persisted conversations — needs DB migration + API
  contract change (coordinated with backend F4 / P0 #5)
- habit-list.tsx: split into smaller components (Area C #1)
- habit-list.tsx: mobile parity — port bulk-action-bar, controls-menu,
  today-filters from web (Area E #1)

Each TODO references PLAN.md with the audit section + priority so the
follow-up PR author can find the context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jul 10, 2026
…442)

Ticks the final two Stage-7 boxes of the harness-upgrade plan and marks the
whole plan complete. Batches the durable stage-tick edits accumulated across
this multi-session build (7a-7h were already ticked in the working tree; this
adds 7g + 7i + the completion note).

The build itself lives in the separate agentic-dev-workflow repo (PRs #1-#7):
7g = /update-harness (web-grounded monthly staleness audit); 7i = end-to-end
dogfood on a fixture. Documentation-only change here — no code touched.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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