refactor(settings): split monolithic page into /settings/{users,data,systems} (#190) #192

Merged
maximus merged 1 commit from issue-190-restructure-settings-pages into main 2026-05-03 13:57:44 +00:00
Owner

Fixes #190

Summary

Splits the monolithic 12-card SettingsPage into a hub plus 3 thematic sub-pages mounted via a shared SettingsLayout (<Outlet/>):

  • /settings -> SettingsHomePage (3 cards-cluster + PageHelp)
  • /settings/users -> Comptes, Licences, Guide d utilisation (DocsContent inline)
  • /settings/data -> Categories, Sauvegarde, Confidentialite des prix
  • /settings/systems -> Version, Mise a jour (UpdateCard), Historique des versions (ChangelogContent), Journaux + commentaires

Extracts DocsPage and ChangelogPage bodies into reusable DocsContent / ChangelogContent components ; the legacy /docs and /changelog routes become <Navigate replace> redirects to preserve external bookmarks and release-note links. UpdateCard is extracted from the inline updater block for symmetry.

TokenStoreFallbackBanner is mounted once at the top of SettingsLayout (visible across the 4 main settings routes). The two /settings/categories/{standard,migrate} routes stay flat (siblings, not nested) to keep their focused flows free of the banner ; their internal back-links now point to /settings/data.

i18n FR + EN gain settings.{home, users, data, systems, backToHome} ; docs/architecture.md table updated ; CHANGELOG bilingual entry under [Unreleased] > Changed/Modifie.

Pure presentation refactor : no new business logic, no Tauri commands, no SQL migrations, all features preserved.

Test plan

  • npm run build (tsc + vite) green
  • npm test (vitest) - 3720 tests pass
  • cargo check green
  • cargo test --lib --tests - 71 tests pass (the doctest in return_calculator.rs is pre-existing on main, unrelated)
  • Manual smoke (post-merge): navigate /settings, /settings/users, /settings/data, /settings/systems ; verify /docs and /changelog redirect ; verify CategoriesV1DiscoveryBanner -> /settings/categories/standard still works ; verify the back-buttons on /settings/categories/{standard,migrate} reach /settings/data
Fixes #190 ## Summary Splits the monolithic 12-card SettingsPage into a hub plus 3 thematic sub-pages mounted via a shared SettingsLayout (`<Outlet/>`): - `/settings` -> `SettingsHomePage` (3 cards-cluster + PageHelp) - `/settings/users` -> Comptes, Licences, Guide d utilisation (DocsContent inline) - `/settings/data` -> Categories, Sauvegarde, Confidentialite des prix - `/settings/systems` -> Version, Mise a jour (UpdateCard), Historique des versions (ChangelogContent), Journaux + commentaires Extracts `DocsPage` and `ChangelogPage` bodies into reusable `DocsContent` / `ChangelogContent` components ; the legacy `/docs` and `/changelog` routes become `<Navigate replace>` redirects to preserve external bookmarks and release-note links. `UpdateCard` is extracted from the inline updater block for symmetry. `TokenStoreFallbackBanner` is mounted once at the top of `SettingsLayout` (visible across the 4 main settings routes). The two `/settings/categories/{standard,migrate}` routes stay flat (siblings, not nested) to keep their focused flows free of the banner ; their internal back-links now point to `/settings/data`. i18n FR + EN gain `settings.{home, users, data, systems, backToHome}` ; `docs/architecture.md` table updated ; CHANGELOG bilingual entry under `[Unreleased] > Changed/Modifie`. Pure presentation refactor : no new business logic, no Tauri commands, no SQL migrations, all features preserved. ## Test plan - [x] `npm run build` (tsc + vite) green - [x] `npm test` (vitest) - 3720 tests pass - [x] `cargo check` green - [x] `cargo test --lib --tests` - 71 tests pass (the doctest in `return_calculator.rs` is pre-existing on main, unrelated) - [ ] Manual smoke (post-merge): navigate `/settings`, `/settings/users`, `/settings/data`, `/settings/systems` ; verify `/docs` and `/changelog` redirect ; verify `CategoriesV1DiscoveryBanner` -> `/settings/categories/standard` still works ; verify the back-buttons on `/settings/categories/{standard,migrate}` reach `/settings/data`
maximus added 1 commit 2026-05-03 13:50:25 +00:00
refactor(settings): split monolithic Settings page into 3 sub-pages (#190)
All checks were successful
PR Check / rust (pull_request) Successful in 22m55s
PR Check / frontend (pull_request) Successful in 2m27s
f02fd95ab1
The single 12-card SettingsPage is replaced by a hub at /settings linking
to three thematic sub-pages mounted via a shared SettingsLayout (Outlet):

  /settings           SettingsHomePage     (3 cards-cluster + PageHelp)
  /settings/users     UsersSettingsPage    (Account, License, DocsContent)
  /settings/data      DataSettingsPage     (Categories, DataManagement,
                                            PriceFetchConsentToggle)
  /settings/systems   SystemsSettingsPage  (Version, UpdateCard,
                                            ChangelogContent, LogViewer)

DocsPage and ChangelogPage are extracted into reusable DocsContent /
ChangelogContent components and the standalone /docs and /changelog
routes become Navigate redirects to preserve external bookmarks and
release-note links. UpdateCard is extracted from the inline updater
block for symmetry and testability.

TokenStoreFallbackBanner is mounted once in SettingsLayout, surfacing
the OS-keychain-fallback warning across the four main routes only.
The two existing /settings/categories/{standard,migrate} sub-routes
stay flat (siblings of SettingsLayout) to keep their focused flows
free of the banner — their internal back-links now point to
/settings/data.

i18n FR/EN gain settings.{home, users, data, systems, backToHome};
docs/architecture.md and CHANGELOG{,.fr}.md updated. Pure refactor of
presentation: no new business logic, no Tauri commands, no SQL
migrations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
maximus added the
status:review
source:human
type:refactor
labels 2026-05-03 13:50:51 +00:00
Author
Owner

Verdict : APPROVE

Sommaire

Refactor propre de presentation : la SettingsPage monolithique de 12 cards est splittee en hub + 3 sous-pages thematiques via SettingsLayout + <Outlet>. Aucun changement de logique metier, redirects preservant les bookmarks /docs + /changelog, i18n FR/EN a jour, CHANGELOG bilingue + docs/architecture.md a jour, build + 3720 tests vitest + 71 tests cargo verts.

Points positifs

  • Extraction nette : DocsContent / ChangelogContent / UpdateCard deviennent reutilisables
  • Routes nested correctes : /settings/categories/{standard,migrate} volontairement hors SettingsLayout (banner non-desire sur ces flux focused) — bien justifie dans la PR body
  • Liens internes (CategoriesMigrationPage, CategoriesStandardGuidePage, ErrorScreen) mis a jour vers /settings/data partout
  • Aucun lien residuel direct vers /docs ou /changelog dans le code (les redirects font le boulot pour les bookmarks externes)
  • Aucun secret, aucune migration SQL touchee, aucune commande Tauri ajoutee
  • Conventional commit format, 1 commit propre

Suggestions (non bloquantes)

  1. DocsContent.tsx — IntersectionObserver root : l'observer perdait son root: container en passant de la sidebar dediee vers le scroll de <main> (AppShell). Avec root: undefined, le viewport est utilise — le rootMargin -30% 0px -60% 0px reste fonctionnel puisque <main> occupe le viewport entier (h-screen overflow-y-auto). A surveiller au smoke manuel : le scroll-spy doit highlighter la bonne section quand on defile dans /settings/users.

  2. DocsContent.tsx — TOC pas sticky : la nav TOC est desormais en haut du composant et defile avec le contenu (pas sticky). Le flux original avait une sidebar fixe w-56 avec TOC toujours visible. Si l'UX se degrade sur les sections du bas (Reglages, Bilan), envisager className="sticky top-0 z-10 ..." sur le <nav> dans une PR de suivi.

  3. SystemsSettingsPage.tsx — version card inline : la version card duplique le pattern de carte directement inline (15 lignes) plutot que via un VersionCard extrait. Coherent avec la taille actuelle, mais a considerer si la carte grossit.

  4. Pas de test ajoute : aucun test n'a ete ajoute pour le hub/layout/sous-pages. Pour un refactor de presentation pur c'est defendable, mais un test minimal renders three section cards with correct links sur SettingsHomePage couterait peu et verrouillerait la structure (utile contre les futures regressions de routing).

  5. Double padding : <main> dans AppShell a p-6, SettingsLayout ajoute aussi p-6. C'est le meme pattern que SettingsPage precedente (p-6 max-w-2xl mx-auto), donc pas un nouveau bug — mais c'est un total de 48px de padding horizontal sur les sous-pages settings (24+24). Pas bloquant, juste un point a noter.

## Verdict : APPROVE ### Sommaire Refactor propre de presentation : la `SettingsPage` monolithique de 12 cards est splittee en hub + 3 sous-pages thematiques via `SettingsLayout` + `<Outlet>`. Aucun changement de logique metier, redirects preservant les bookmarks `/docs` + `/changelog`, i18n FR/EN a jour, CHANGELOG bilingue + `docs/architecture.md` a jour, build + 3720 tests vitest + 71 tests cargo verts. ### Points positifs - Extraction nette : `DocsContent` / `ChangelogContent` / `UpdateCard` deviennent reutilisables - Routes nested correctes : `/settings/categories/{standard,migrate}` volontairement hors `SettingsLayout` (banner non-desire sur ces flux focused) — bien justifie dans la PR body - Liens internes (`CategoriesMigrationPage`, `CategoriesStandardGuidePage`, `ErrorScreen`) mis a jour vers `/settings/data` partout - Aucun lien residuel direct vers `/docs` ou `/changelog` dans le code (les redirects font le boulot pour les bookmarks externes) - Aucun secret, aucune migration SQL touchee, aucune commande Tauri ajoutee - Conventional commit format, 1 commit propre ### Suggestions (non bloquantes) 1. **`DocsContent.tsx` — IntersectionObserver root** : l'observer perdait son `root: container` en passant de la sidebar dediee vers le scroll de `<main>` (AppShell). Avec `root: undefined`, le viewport est utilise — le rootMargin `-30% 0px -60% 0px` reste fonctionnel puisque `<main>` occupe le viewport entier (`h-screen overflow-y-auto`). A surveiller au smoke manuel : le scroll-spy doit highlighter la bonne section quand on defile dans `/settings/users`. 2. **`DocsContent.tsx` — TOC pas sticky** : la nav TOC est desormais en haut du composant et defile avec le contenu (pas `sticky`). Le flux original avait une sidebar fixe `w-56` avec TOC toujours visible. Si l'UX se degrade sur les sections du bas (Reglages, Bilan), envisager `className="sticky top-0 z-10 ..."` sur le `<nav>` dans une PR de suivi. 3. **`SystemsSettingsPage.tsx` — version card inline** : la version card duplique le pattern de carte directement inline (15 lignes) plutot que via un `VersionCard` extrait. Coherent avec la taille actuelle, mais a considerer si la carte grossit. 4. **Pas de test ajoute** : aucun test n'a ete ajoute pour le hub/layout/sous-pages. Pour un refactor de presentation pur c'est defendable, mais un test minimal `renders three section cards with correct links` sur `SettingsHomePage` couterait peu et verrouillerait la structure (utile contre les futures regressions de routing). 5. **Double padding** : `<main>` dans `AppShell` a `p-6`, `SettingsLayout` ajoute aussi `p-6`. C'est le meme pattern que `SettingsPage` precedente (`p-6 max-w-2xl mx-auto`), donc pas un nouveau bug — mais c'est un total de 48px de padding horizontal sur les sous-pages settings (24+24). Pas bloquant, juste un point a noter.
maximus merged commit efea8fb273 into main 2026-05-03 13:57:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: maximus/Simpl-Resultat#192
No description provided.