fix: list the System sections on the Settings home in the page's order (#372)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 1m56s

Self-review of PR #470: the System card of the Settings home lists the
page's sections as chips, still with the version history before the logs.
The chips now follow the page (version, update, logs, history), and a test
renders the page and compares its section headings with the card, so the
two cannot drift apart again. SECTIONS is exported for that test, as
DocsContent exports its own. The /settings/systems row of
docs/architecture.md names both unreleased headings and the card.

Resolves #372

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
le king fu 2026-10-18 18:12:35 -04:00
parent 0513d717c7
commit 5decb985f1
3 changed files with 16 additions and 3 deletions

View file

@ -580,7 +580,7 @@ Les modules payants sont enveloppés dans des **layout-routes pathless `RequireF
| `/settings` | `SettingsLayout` (layout) + `SettingsHomePage` (index) | Hub des paramètres : 3 cards-cluster vers les sous-pages. Le layout monte `TokenStoreFallbackBanner` une seule fois, partagé par les 4 routes principales |
| `/settings/users` | `UsersSettingsPage` | Comptes (Maximus), licences et guide d'utilisation (rendu inline depuis `DocsContent`) |
| `/settings/data` | `DataSettingsPage` | Catégories (avec liens vers `/settings/categories/standard` et `/settings/categories/migrate`), backup chiffré et confidentialité de la récupération de prix |
| `/settings/systems` | `SystemsSettingsPage` | Version, mise à jour (`UpdateCard`), journaux + commentaires (`LogViewerCard`), puis historique des versions (`ChangelogContent`), dans cet ordre : le Journal ne descend plus sous l'historique, qui s'allonge à chaque release (#372). `ChangelogContent` n'est monté qu'une fois `getVersion()` résolu (ou en échec : version inconnue, écrite au Journal) ; il ouvre les notes de la version installée et replie les autres, chaque titre de version étant un bouton (`aria-expanded`, chevron), avec un bouton « Tout déplier / Tout replier » ; un « Unreleased » vide est masqué |
| `/settings/systems` | `SystemsSettingsPage` | Version, mise à jour (`UpdateCard`), journaux + commentaires (`LogViewerCard`), puis historique des versions (`ChangelogContent`), dans cet ordre : le Journal ne descend plus sous l'historique, qui s'allonge à chaque release (#372). `ChangelogContent` n'est monté qu'une fois `getVersion()` résolu (ou en échec : version inconnue, écrite au Journal) ; il ouvre les notes de la version installée et replie les autres, chaque titre de version étant un bouton (`aria-expanded`, chevron), avec un bouton « Tout déplier / Tout replier » ; l'en-tête non publié (« Unreleased », « Non publié ») est masqué quand il est vide. La carte Système de `SettingsHomePage` liste ces sections dans le même ordre |
| `/settings/categories/standard` | `CategoriesStandardGuidePage` | Guide imprimable de la structure de catégories standard (route flat, hors `SettingsLayout`) |
| `/settings/categories/migrate` | `CategoriesMigrationPage` | Flux de migration v1→v2 (route flat, hors `SettingsLayout`) |
| `/docs` | `DocsPage` | Redirige vers `/settings/users` (rétrocompatibilité bookmarks) |

View file

@ -11,7 +11,8 @@ interface SectionCard {
itemKeys: string[];
}
const SECTIONS: SectionCard[] = [
/** The three cards of the hub; each lists its page's sections, in the page's order. */
export const SECTIONS: SectionCard[] = [
{
to: "/settings/users",
titleKey: "settings.users.title",
@ -42,8 +43,8 @@ const SECTIONS: SectionCard[] = [
itemKeys: [
"settings.systems.sections.version",
"settings.systems.sections.update",
"settings.systems.sections.changelog",
"settings.systems.sections.logs",
"settings.systems.sections.changelog",
],
},
];

View file

@ -29,6 +29,7 @@ import { hookHarness } from "../../test/hookHarness";
import { logWarn } from "../../services/logService";
import ChangelogContent from "../../components/settings/ChangelogContent";
import SystemsSettingsPage from "./SystemsSettingsPage";
import { SECTIONS } from "./SettingsHomePage";
const harness = hookHarness();
@ -77,6 +78,17 @@ describe("SystemsSettingsPage — order of the sections (#372)", () => {
];
expect(order).toEqual([...order].sort((a, b) => a - b));
});
it("lists, on the System card of the Settings home, the page's sections in the page's order", () => {
harness.slots[0] = "0.17.2";
const html = renderToStaticMarkup(render());
const headings = [...html.matchAll(/<h2[^>]*>t\((settings\.systems\.sections\.[a-zA-Z]+)\)<\/h2>/g)].map(
(match) => match[1],
);
expect(headings).toHaveLength(4);
const card = SECTIONS.find((section) => section.to === "/settings/systems");
expect(card?.itemKeys).toEqual(headings);
});
});
describe("SystemsSettingsPage — the version history waits for the version (#372)", () => {