Files
HealthLog/src/app/settings/page.tsx
T
Marc-André BombeckandClaude Opus 4.7 3221f86eea feat(settings): introduce dynamic-route shell + redirect /settings → /settings/account (#139)
* feat(settings): introduce dynamic-route shell + redirect /settings → /settings/account

Splits the 3218-LOC /settings monolith into a routing surface only — no
section content moves in this PR. Each of the eight slugs (account,
integrations, notifications, dashboard, ai, api, advanced, about) now lives
at its own /settings/[section] route and renders inside a new
<SettingsShell> sidebar+main layout. Every section currently shows a
placeholder ("Moving here with the next release update") so reviewers can
validate the URL structure in isolation. The historic monolith is preserved
verbatim as page.legacy.tsx for section-by-section extraction by the
follow-up PRs (A2-account, A2-about, A2-ai, A2-integrations,
A2-notifications, A2-rest).

Behaviour change: existing entry points (sidebar nav, topbar dropdown,
onboarding hand-off, dashboard checklist, Withings callback, Codex
callback) now point at /settings/<slug> instead of /settings#anchor. The
/settings root is a 308 (permanentRedirect) to /settings/account so old
bookmarks and external links keep working.

Co-Authored-By: Marc-André Bombeck <mbombeck@gmail.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(settings): route every Codex OAuth callback redirect to /settings/integrations

Review-pass H1: only the late success/failure paths in the Codex OAuth
callback were updated to point at the new section route. The four early
branches — rate-limited, provider-supplied `?error=...`, missing params,
invalid state — still redirected to `/settings?codex_error=...`.

After the section split that path 308-redirects to `/settings/account`,
where the Codex error toast/banner doesn't live. Users hitting any of
those edge cases would land on the wrong screen with the error code
silently lost.

All six branches now go to `/settings/integrations?codex_error=...`,
matching the success and token-exchange-failure paths and the existing
Withings callback shape.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 14:15:15 +02:00

21 lines
890 B
TypeScript

import { permanentRedirect } from "next/navigation";
/**
* `/settings` is a thin permanent redirect to `/settings/account`.
*
* Pre-v1.4 the entire settings UI lived in this single 3000+ LOC file. As part
* of the v1.4 settings split (PR series A2), each concern moved to its own
* route under `/settings/[section]/page.tsx`. The historic monolith is
* preserved verbatim in `page.legacy.tsx` for section-by-section extraction in
* the follow-up PRs (A2-account, A2-about, A2-ai, A2-integrations,
* A2-notifications, A2-rest).
*
* 308 (`permanentRedirect`) keeps the request method intact and is the right
* answer for a permanent address change — bookmarks, deep-links, and any
* external systems that POST to `/settings` will follow the redirect with
* their original method.
*/
export default function SettingsRoot(): never {
permanentRedirect("/settings/account");
}