From 41f3b15f4d90809bffe87d2753beeb7eb5055f85 Mon Sep 17 00:00:00 2001 From: le king fu Date: Sat, 24 Oct 2026 09:09:36 -0400 Subject: [PATCH 1/4] test: pin four cases the reviews of the stack left unpinned Non-blocking suggestions of the independent reviews of PRs #490 to #493, applied in a follow-up link above #493 (Max's decision of 2026-10-24): - locales.keys.test.ts: a variable name that differs by its case only is a gap (`{{version}}` against `{{Version}}`, review 27037, H8); the header says that `{{- name}}` and `{{name}}` render alike with `escapeValue: false`. - db.test.ts: a `)` glued to a word ends no path (`C:\Users\jean\Projet(2024)final\x.db`, review 27073, R10). - TemplateActions.delete.test.ts: three templates, the middle one deleted, so a handler bound to the first or the last fails (review 27088, R11). - ProfileSwitcher.wiring.test.ts: a locked profile that has a PIN opens the upsell, never the PIN entry; in Base it asks for the PIN (review 27084, R5). - elementTree.ts: an absence is proved with `find`, never with `holding` (review 27088, S2). Co-Authored-By: Claude Opus 5.5 --- .../budget/TemplateActions.delete.test.ts | 12 ++++--- .../profile/ProfileSwitcher.wiring.test.ts | 32 ++++++++++++++++++- src/i18n/locales.keys.test.ts | 9 +++++- src/services/db.test.ts | 8 +++-- src/test/elementTree.ts | 3 +- 5 files changed, 53 insertions(+), 11 deletions(-) diff --git a/src/components/budget/TemplateActions.delete.test.ts b/src/components/budget/TemplateActions.delete.test.ts index 76c629e..9de57b5 100644 --- a/src/components/budget/TemplateActions.delete.test.ts +++ b/src/components/budget/TemplateActions.delete.test.ts @@ -32,6 +32,7 @@ const harness = hookHarness(); const SUMMER: BudgetTemplate = { id: 4, name: "Été", created_at: "" }; const WINTER: BudgetTemplate = { id: 9, name: "Hiver", created_at: "" }; +const SPRING: BudgetTemplate = { id: 6, name: "Printemps", created_at: "" }; const CONFIRM = "t(budget.deleteTemplateConfirm)"; @@ -41,7 +42,7 @@ let onDelete = vi.fn<(templateId: number) => void>(); const render = () => harness.render(() => TemplateActions({ - templates: [SUMMER, WINTER], + templates: [SUMMER, WINTER, SPRING], onApply: vi.fn(), onApplyAllMonths: vi.fn(), onSave: vi.fn(), @@ -60,13 +61,14 @@ function openList() { type FakeEvent = { stopPropagation: ReturnType }; /** - * Clicks the delete button of the second template and waits for the handler. - * The event's propagation must stop before the answer: the click would - * otherwise reach the row, which selects the template. + * Clicks the delete button of the middle template of three and waits for the + * handler: a handler bound to the first or to the last template would delete + * another one. The event's propagation must stop before the answer: the click + * would otherwise reach the row, which selects the template. */ async function clickDeleteOfWinter(): Promise { const buttons = holding(openList(), Trash2); - expect(buttons).toHaveLength(2); + expect(buttons).toHaveLength(3); const event: FakeEvent = { stopPropagation: vi.fn() }; const handled = (buttons[1].props.onClick as (e: FakeEvent) => Promise)(event); expect(event.stopPropagation).toHaveBeenCalledTimes(1); diff --git a/src/components/profile/ProfileSwitcher.wiring.test.ts b/src/components/profile/ProfileSwitcher.wiring.test.ts index 2799c39..f86f8cf 100644 --- a/src/components/profile/ProfileSwitcher.wiring.test.ts +++ b/src/components/profile/ProfileSwitcher.wiring.test.ts @@ -10,7 +10,9 @@ // switcher's hooks. No effect is run: `commit()` would add the switcher's // mousedown listener to a `document` the node environment does not have. // UpsellDialog stays an element, never called: what it renders (UpsellGate, -// Escape) is proved by UpsellDialog.render.test.tsx. +// Escape) is proved by UpsellDialog.render.test.tsx. A locked profile that has +// a PIN opens the dialog, never the PIN entry: the lock is checked first, or +// the right PIN would switch to a locked profile. import { describe, it, expect, vi, beforeEach } from "vitest"; import type { ReactNode } from "react"; @@ -21,6 +23,7 @@ const ctx = vi.hoisted(() => ({ profiles: [ { id: "default", name: "Principal", color: "#4A90A4", pin_hash: null, db_filename: "simpl_resultat.db", created_at: "" }, { id: "second", name: "Second", color: "#C17767", pin_hash: null, db_filename: "profile_second.db", created_at: "" }, + { id: "third", name: "Troisième", color: "#8E7CC3", pin_hash: "a-pin-hash", db_filename: "profile_third.db", created_at: "" }, ], /** What `useEntitlement("multi-profile")` returns: Free by default. */ gate: { allowed: false, ready: true }, @@ -40,6 +43,7 @@ import { ChevronDown } from "lucide-react"; import { hookHarness } from "../../test/hookHarness"; import { find, holding } from "../../test/elementTree"; import ProfileSwitcher from "./ProfileSwitcher"; +import PinDialog from "./PinDialog"; import UpsellDialog from "../shared/UpsellDialog"; import UpsellGate from "../shared/UpsellGate"; @@ -61,6 +65,7 @@ const profileButtons = (tree: ReactNode, id: string) => const dialogs = (tree: ReactNode) => find(tree, (el) => el.type === UpsellDialog); const gates = (tree: ReactNode) => find(tree, (el) => el.type === UpsellGate); +const pins = (tree: ReactNode) => find(tree, (el) => el.type === PinDialog); beforeEach(() => { harness.clear(); @@ -106,4 +111,29 @@ describe("ProfileSwitcher — the upsell of a locked profile (#451)", () => { expect(ctx.switchProfile).toHaveBeenCalledWith("second"); expect(dialogs(render())).toHaveLength(0); }); + + it("Free: a locked profile that has a PIN opens the dialog, never the PIN entry", () => { + openMenu(); + const menu = profileButtons(render(), "third"); + expect(menu).toHaveLength(1); + (menu[0].props.onClick as () => void)(); + + const opened = render(); + expect(dialogs(opened)).toHaveLength(1); + expect(pins(opened)).toHaveLength(0); + expect(ctx.switchProfile).not.toHaveBeenCalled(); + }); + + it("Base: a profile that has a PIN asks for it, no dialog", () => { + ctx.gate = { allowed: true, ready: true }; + openMenu(); + (profileButtons(render(), "third")[0].props.onClick as () => void)(); + + const opened = render(); + const asked = pins(opened); + expect(asked).toHaveLength(1); + expect(asked[0].props.profileName).toBe("Troisième"); + expect(dialogs(opened)).toHaveLength(0); + expect(ctx.switchProfile).not.toHaveBeenCalled(); + }); }); diff --git a/src/i18n/locales.keys.test.ts b/src/i18n/locales.keys.test.ts index 702658b..013aa81 100644 --- a/src/i18n/locales.keys.test.ts +++ b/src/i18n/locales.keys.test.ts @@ -22,7 +22,10 @@ // leaf both files hold carries one set of tokens, format options included. // Neither file nests a key (`$t(…)`) or writes the unescaped form (`{{- …}}`) // yet: a nested key would not be compared, and `{{- name}}` would read as the -// token `- name`, a gap against `{{name}}`. +// token `- name`, a gap against `{{name}}`. With `escapeValue: false` +// (src/i18n/config.ts), both forms render the same text in this app: such a +// gap would be conservative, like a format name written in another case, not +// an escaping defect. import { describe, it, expect } from "vitest"; import fr from "./locales/fr.json"; @@ -245,6 +248,10 @@ describe("locale values: the variable comparison (#480)", () => { expect(gaps({ x: "{{count}} in {{folder}}" }, { x: "{{count}} in {{dir}}" })).toEqual([ "x: {{count}}, {{folder}} in a; {{count}}, {{dir}} in b", ]); + // A name that differs by its case only is another variable: i18next looks + // `{{Version}}` up as written, and shows it raw, braces included, when the + // call passes `version`. + expect(gaps({ x: "{{version}}" }, { x: "{{Version}}" })).toEqual(["x: {{version}} in a; {{Version}} in b"]); }); it("names a variable missing on either side", () => { diff --git a/src/services/db.test.ts b/src/services/db.test.ts index 90b35cf..88c9d5b 100644 --- a/src/services/db.test.ts +++ b/src/services/db.test.ts @@ -758,8 +758,9 @@ describe("describePreparation (#390)", () => { expect(cleaned).not.toMatch(/Jean|Dupont|marie|claire|Users|home|Program|server/); }); - // A folder name may hold `;`, `|`, a backtick, or a `)` followed by a word: - // none of them ends a path, so no word of that folder stays (#478). + // A folder name may hold `;`, `|`, a backtick, or a `)` followed by a word + // or glued to one (`Projet(2024)final`): none of them ends a path, so no + // word of that folder stays (#478). it.each([ ["C:\\Users\\Jean (Work) Smith\\AppData\\x.db", "x.db"], ["C:\\Users\\jean\\My;Docs\\x.db", "x.db"], @@ -767,10 +768,11 @@ describe("describePreparation (#390)", () => { ["C:\\Users\\jean\\My`Docs\\x.db", "x.db"], ["unable to open C:\\Users\\Jean (Work) Smith\\AppData\\x.db: disk I/O error", "unable to open x.db: disk I-O error"], ["/home/jean (work)/x.db", "x.db"], + ["C:\\Users\\jean\\Projet(2024)final\\x.db", "x.db"], ])("withoutFolders keeps no word of a folder that holds a former stop: %s (#478)", (input, expected) => { const cleaned = withoutFolders(input); expect(cleaned).toBe(expected); - expect(cleaned).not.toMatch(/Users|Jean|jean|Work|work|Smith|AppData|My|Docs|home/); + expect(cleaned).not.toMatch(/Users|Jean|jean|Work|work|Smith|AppData|My|Docs|home|Projet|final/); }); it("withoutFolders ends a path at sentence punctuation and at the next path", () => { diff --git a/src/test/elementTree.ts b/src/test/elementTree.ts index fe4c378..02b40c0 100644 --- a/src/test/elementTree.ts +++ b/src/test/elementTree.ts @@ -18,7 +18,8 @@ // is an item of `props.children`, an array there being read one level deep: // in `{rows}` the items of `rows` are direct children of the cell, // in `{label}{rows}` they are not. A fragment holds its own -// children, not its parent. +// children, not its parent. An absence is proved with `find`, never with +// `holding`: its one-level read would miss an element nested deeper. // // Both read `props.children` only: an element passed in another prop // (`icon={}`) is not reached. A component in the tree is an element, -- 2.52.0 From b998fd7c14841c588fb7c536d1fd4469fe675967 Mon Sep 17 00:00:00 2001 From: le king fu Date: Sat, 24 Oct 2026 09:09:36 -0400 Subject: [PATCH 2/4] docs: listener replaced on a new onClose, unlock screen named as the app does MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggestions of the review of PR #493 (comment 27084): the UpsellDialog row of docs/architecture.md says the Escape listener is also replaced when `onClose` changes, and points to the focus follow-up (#494); the release check of #451 in STATE.md no longer calls the window « édition requise », a label no screen shows. Co-Authored-By: Claude Opus 5.5 --- STATE.md | 2 +- docs/architecture.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/STATE.md b/STATE.md index aa86ae7..48df3f7 100644 --- a/STATE.md +++ b/STATE.md @@ -134,7 +134,7 @@ vitest 137/2297 → 156/2560, Rust 267 → 269. `[Unreleased]` porte des Added, - Import : carte Transactions d'un profil vide, trois erreurs du dossier d'exemple traduites, bandeau effacé par « Actualiser » ; - aide du tableau de bord à huit étapes, textes FR/EN de #475, point du bandeau, avertissement des fichiers à la racine après un changement de dossier ; - aide d'import (#371, PR #489) : bloc BMO en FR et en EN, statut confirmé, bouton « Télécharger », trois points « Non vérifié ». - - Fenêtre « édition requise » (#451, PR #493), en édition Gratuite, en FR et en EN, thèmes clair et sombre : Transactions → bouton Répartition verrouillé → la fenêtre se ferme avec Échap ; sélecteur de profil → profil verrouillé → la même fenêtre (titre « Fonctionnalité Base », le X la ferme, Échap aussi, « J'ai déjà une clé » la ferme et ouvre la carte Licence, « Obtenir Base » la laisse ouverte, un clic sur le voile ne fait rien) ; lecteur d'écran (Orca, Narrateur), une fois la fenêtre atteinte (le focus n'y entre pas à l'ouverture, hors périmètre) : lue comme une boîte de dialogue avec son nom, le X lu « Fermer » ; en Base, le sélecteur change toujours de profil. + - Écran de déverrouillage en fenêtre (#451, PR #493), en édition Gratuite, en FR et en EN, thèmes clair et sombre : Transactions → bouton Répartition verrouillé → la fenêtre se ferme avec Échap ; sélecteur de profil → profil verrouillé → la même fenêtre (titre « Fonctionnalité Base », le X la ferme, Échap aussi, « J'ai déjà une clé » la ferme et ouvre la carte Licence, « Obtenir Base » la laisse ouverte, un clic sur le voile ne fait rien) ; lecteur d'écran (Orca, Narrateur), une fois la fenêtre atteinte (le focus n'y entre pas à l'ouverture, hors périmètre) : lue comme une boîte de dialogue avec son nom, le X lu « Fermer » ; en Base, le sélecteur change toujours de profil. - **Le paiement est live : « aucun tag avant le go-live » n'a plus de raison d'être, et la release desktop qu'attendait le go-live est publiée (v0.16.0, 2026-10-03).** Bascule live le 2026-09-29 (Product et Price live à 19 $ CAD, webhook, variables Stripe de production, redeploy `3673d09` de maximus-api, URL `cs_live_` vérifiée), puis achat réel de contrôle le 2026-09-30 : clé sur `/merci` et par courriel, activation dans l'app, remboursement complet et licence révoquée par `charge.refunded`. **Volet serveur clos le 2026-10-03** (derniers commentaires relus le 2026-10-04) : maximus-api#62 fermée, tous critères cochés (maximus-api 0.4.2 en prod, secrets en runtime seul), avec la milestone `spec-paiements` de maximus-api (12/12) ; la-compagnie-maximus#150 (Link dans les textes légaux) livrée et fermée le 2026-10-01. **Go-live clos : la-compagnie-maximus#141** fermée le 2026-10-10 sur décision de Max, l'updater vérifié (Free refuse et invite à acheter, Base accepte ; confirmé le même jour). Restent pour mémoire, sans issue : le Dashboard Stripe (logo, paramètres Checkout, reçus automatiques, alertes d'échec de webhook) et les relevés du commentaire de fermeture. la-compagnie-maximus#184 (politique de confidentialité : données d'activation, contrôle au démarrage) est en `status:review` ; sa PR reste en brouillon jusqu'au déploiement de maximus-api#85 (commentaire du 2026-10-03). Les deux textes des suites de licence (contrôle à la saisie, retrait de la clé) y sont postés depuis le 2026-10-05 (commentaire 19724). **Vérifications manuelles sur la release publiée, toutes faites** : #365 le 2026-10-03, #346 et #350 le 2026-10-04 (voir Décisions). L'étape 10 sous Windows est faite (Michel, confirmée le 2026-10-10). - Backlog ouvert : **vague `planned-2026-09-24-paiements` close 3/3** (milestone fermée le 2026-09-30) : #270 (PR #359) et #346 (PR #362) mergées le 2026-09-27, #347 (PR #364, ferme aussi #360) mergée le 2026-09-30 ; volet site **clos** (maximus/la-compagnie-maximus#153, redirection de `/simpl-resultat` en prod). **#365 fermée le 2026-10-03** après sa vérification manuelle. **Milestone `planned-2026-10-03-suites-licence` fermée 3/3 le 2026-10-05** (#373, #370, #367 mergées, voir Décisions ; suivi #389 en `status:triage`). Hors milestone : **#369** (réserver le fractionnement de transactions à l'édition Base) **fermée le 2026-10-17** (PR #452, voir Décisions) ; **#372** (la liste complète des versions repousse le Journal en bas de Paramètres → Systèmes) reste en `status:ready`. **#350 fermée le 2026-10-04** (étape 3 vérifiée en production, voir Décisions) ; #363 fermée le 2026-10-10 sur décision de Max (ses tests, absorbés par #347, sont livrés dans la v0.16.0) ; réglés côté serveur et site : maximus-api#63 (clés de 100 ans) et maximus-api#70 (réactivation d'une machine désactivée), fermées et contenues dans `3673d09`, le commit déployé à la bascule du 2026-09-29, et la-compagnie-maximus#157, fermée, dont les CGV sont publiées en tronc commun plus annexe Simpl-Résultat (annexe relue en production le 2026-09-30, plus aucune durée de 10 ans) ; côté serveur, `/v1/prices` ne vérifie pas qu'une machine est encore active (une machine désactivée garde les cours jusqu'à l'expiration de son jeton), issue maximus-api à ouvrir ; suites de #350 ouvertes le 2026-10-01 : maximus-api#82 (`status:triage` : identifiants machine bruts déjà stockés, lignes désactivées comprises ; à rehacher avant l'expiration des premiers jetons bruts, sinon une réactivation crée une seconde ligne) et la-compagnie-maximus#184 (`status:review`, voir ci-dessus) ; go-live clos (la-compagnie-maximus#141 fermée le 2026-10-10, maximus-api#62 le 2026-10-03) ; `spec-paiements` fermée ici 5/5 ; onboarding phase 2 (parcours guidé) **mergée** : milestone `planned-2026-10-06-onboarding-parcours-guide` fermée 6/6 le 2026-10-08 (#396 à #401, `ee17f31`), suivis **#408** et **#409** (`status:triage`) ; onboarding phase 1 **livrée** : milestone `planned-2026-10-03-onboarding-phase1` fermée 7/7 le 2026-10-04 (#351 à #357, mergées en avance rapide, `667e058`) ; suivis ouverts : **#384** (`status:ready`, suivis non bloquants des revues) ; **#371** fermée le 2026-10-23 (PR #489, bloc BMO confirmé sur compte réel), la signature d'import BMO suit en **#488** (`status:blocked` : lignes aux valeurs fictives, préambule éventuel et en-tête d'un compte de dépôt à fournir par Max) ; analyse d'origine dans `docs/analyse-onboarding-2026-09.md`, plan détaillé dans les `spec-*-onboarding-phase1.md` locaux, ignorés par git ; #271 absorbé par #301, livré ; `spec-ci-build-optimization` **fermée 4/4** le 2026-10-05 (#232 livrée le 2026-07-27 ; #234 close le 2026-10-05 avec ses quatre preuves : dispatch run 464, PR #386 run 480, run planifié 488, `actcache` à 999 Mo) ; **#376** fermée le 2026-10-12 (Node 24, PR #414). Le suivi « glob `src-tauri/**` non prouvé » ouvert avec #232 est **levé** : la PR #344 est le cas test isolé attendu (`Cargo.lock` + 2 `.md` seulement) — `check-rust` a bien tourné, `check-frontend` a bien été sauté par sa denylist. - Suivis des advisories : **#312, #313 et #315 fermées le 2026-08-15** (PRs #321/#322 mergées). **#314 fermée le 2026-08-15, prémisse infirmée** — elle affirmait « zéro run `schedule` », or `audit.yml` tire tous les jours à 06:00 UTC (**19 runs `schedule` verts** du 07-28 au 08-15, sans trou) ; elle a été écrite le 07-27 vers 23:56Z, ~6 h avant le premier tir programmé possible, et décrivait donc une fenêtre trop courte, pas un scheduler en panne. Ces 19 runs confirment au passage que `.cargo/audit.toml` est bien lu en conteneur **sur `main`** — l'ADR 0018 ne l'avait vérifié que par un `workflow_dispatch` sur une branche. **#343 fermée le 2026-09-04** (PR #344) — RUSTSEC-2026-0258 sur `h2`, la seule vulnérabilité qui rougissait l'audit depuis le 08-19 ; l'audit est de nouveau vert sur `main`, prouvé par `workflow_dispatch` (run 393) et non déduit du run de PR. **#348 fermée le 2026-09-21** (PR #349) — RUSTSEC-2026-0285 sur `rustls`, seule vulnérabilité rougissant l'audit depuis le 09-15 (7 runs, 405→411) ; vert reprouvé par `workflow_dispatch` sur `main` (run 414 : 666 paquets, zéro vulnérabilité, 12 warnings autorisés). Deux advisories en cinq semaines sur le même chemin, celui de la mise à jour automatique. **#447 fermée le 2026-10-16** (PR #448, run 556 vert), quatre avis `rustls` sur ce même chemin ; le Défenseur n'audite pas le Rust (agent-defenseurs#186), `audit.yml` reste le seul canal pour les avis RustSec. **#455 fermée le 2026-10-18** (PR #459, run 564 vert), trois avis `zip` sur ce même chemin, retirés avec la feature `zip` de l'updater plutôt que supprimés. **#317** fermée le 2026-10-12 par la PR #417 (#358). Reste **#319** (déclencheur de retrait pour `rsa`, désormais **seule** entrée de `.cargo/audit.toml` — le garde-fou est passé à 2 vérifications). **#345** fermée le 2026-10-12 (PR #415) : garde `Verify windows-sys pinning` dans `check-rust.yml` et ADR 0023, qui portent la mesure, le coût (3 contre 5 versions compilées pour Windows) et la condition de sortie. Côté npm, **#358** fermée le 2026-10-12 (PR #417) : lock régénéré par `npm@11.21.0` dans les bornes de `package.json`, `npm audit` 8 → 0 au 2026-10-10. diff --git a/docs/architecture.md b/docs/architecture.md index 034dee5..65611fc 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -431,7 +431,7 @@ Depuis le chantier #297-#301, l'accès aux modules est gaté par l'édition de l | Cadenas navigation | `Sidebar.tsx` (`NavLock`) + `ReportsPage` (tuiles du hub) | Badge verrou affiché si `ready && !allowed` ; les items restent **cliquables** (la route montre l'upsell — verrouillé visible, jamais masqué). `NAV_ITEMS[].feature?` porté par `budget` / `adjustments` / `balance` uniquement (invariant testé : `reports` n'est jamais gaté, le hub est Free) | | Gate multi-profils | `src/shared/profileGate.ts` | Prédicats purs `isProfileSwitchLocked` / `isProfileCreationLocked` (`multi-profile`, Base+) : le profil **actif** n'est jamais verrouillé, la création est gatée au point unique `ProfileFormModal` (mode upsell, qui réutilise `UpsellGate`) ; `ProfileSelectionPage` marque l'entrée « Créer » sans verrouiller les tuiles. Non destructif : aucune donnée supprimée, un upgrade fait tout réapparaître | | Gate de la Répartition | `src/shared/splitGate.ts`, `src/components/transactions/SplitButton.tsx` | `splitAccessFor(gate)` → `open` / `locked` / `pending` sur `useEntitlement("adjustments")`, lu par `TransactionsPage` et passé à `TransactionTable` en prop obligatoire (#369). `locked` : cadenas sur le bouton et `UpsellDialog` au lieu de la fenêtre de répartition, pour toute ligne ; `pending` (licence pas `ready`, chargement ou erreur) : ni cadenas ni fenêtre, bouton inactif, `allowed` ne court-circuitant pas `ready`. La fenêtre de répartition n'est rendue que hors `locked`, l'incitation que hors `open`. Non destructif : les répartitions existantes restent comptées et gardent leur icône orange | -| `UpsellDialog` | `src/components/shared/UpsellDialog.tsx` | `UpsellGate` dans une fenêtre (`role="dialog"`, `aria-modal`, nom accessible `upsell.title`), pour une action gatée hors d'une route verrouillée : l'ouvrent le bouton Répartition de `TransactionTable` (#369) et un profil verrouillé de `ProfileSwitcher` (#451). `onNavigate` ferme la fenêtre après « J'ai déjà une clé » ; le bouton X et Échap la ferment aussi (écouteur `keydown` sur `document`, posé au montage, retiré au démontage, #451), un clic sur le voile non ; le bouton d'achat la laisse ouverte. Elle ne prend pas le focus à l'ouverture | +| `UpsellDialog` | `src/components/shared/UpsellDialog.tsx` | `UpsellGate` dans une fenêtre (`role="dialog"`, `aria-modal`, nom accessible `upsell.title`), pour une action gatée hors d'une route verrouillée : l'ouvrent le bouton Répartition de `TransactionTable` (#369) et un profil verrouillé de `ProfileSwitcher` (#451). `onNavigate` ferme la fenêtre après « J'ai déjà une clé » ; le bouton X et Échap la ferment aussi (écouteur `keydown` sur `document`, posé au montage, retiré au démontage et remplacé quand `onClose` change, #451), un clic sur le voile non ; le bouton d'achat la laisse ouverte. Elle ne prend pas le focus à l'ouverture (suivi #494) | | Rust | `src-tauri/src/commands/entitlements.rs` | `FEATURE_TIERS` réduit à `auto-update` → Base+ (la matrice UI vit en TS) ; `check_entitlement` = matrice OU `features[]` signés avec court-circuit Free (même CWE-863), entitlements résolus par `license_commands::current_entitlements` | Modules Free — jamais gatés, aucune `FeatureKey` : Dashboard, Import, Transactions, Catégories, hub `/reports` + `/reports/trends`, Export/Import, Paramètres, Changelog, docs. Seule exception à l'intérieur d'une page Free : le bouton Répartition de la page Transactions, gaté par `adjustments` (#369). Le déclassement d'édition est **non destructif** : les données des modules verrouillés restent en base et redeviennent accessibles avec une clé valide. -- 2.52.0 From 5d26fae932457cd7c9c8eeb99a3a107a77ca1dda Mon Sep 17 00:00:00 2001 From: le king fu Date: Sat, 24 Oct 2026 13:28:39 -0400 Subject: [PATCH 3/4] test(db): refuse any raw console line that carries a folder in connectToProfile The test of the migration repair line (B1 of PR #491) only watched the mocked logService: a raw console.error of the same error, added next to the cleaned line, would put the full path back in the Journal (initLogCapture captures console.error and console.warn) with every test green (mutation R6 of review 27245). Each test of the connectToProfile block now spies on both and refuses a line that holds a `/` or a `\`. Pinned in the follow-up link at Max's request (2026-10-24, preamble of /pr-brief 491), like R3. Co-Authored-By: Claude Opus 5.5 --- src/services/db.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/services/db.test.ts b/src/services/db.test.ts index 88c9d5b..73b36ad 100644 --- a/src/services/db.test.ts +++ b/src/services/db.test.ts @@ -531,11 +531,33 @@ function catchUp(overrides: Partial> } describe("a profile is prepared before the plugin opens it (#390)", () => { + // db.ts writes to the Journal through logService, mocked here. A raw + // console.error or console.warn would reach the Journal too (initLogCapture + // captures both), so none may carry a folder: each test of this block ends + // by refusing such a line (review 27245 of PR #491, R6). + let consoleLines: string[] = []; + let consoleSpies: Array<{ mockRestore: () => void }> = []; + beforeEach(() => { vi.mocked(invoke).mockClear(); vi.mocked(Database.load).mockClear(); vi.mocked(logInfo).mockClear(); vi.mocked(logError).mockClear(); + consoleLines = []; + const text = (a: unknown): string => + typeof a === "string" ? a : a instanceof Error ? a.message : (JSON.stringify(a) ?? String(a)); + const record = (...args: unknown[]) => { + consoleLines.push(args.map(text).join(" ")); + }; + consoleSpies = [ + vi.spyOn(console, "error").mockImplementation(record), + vi.spyOn(console, "warn").mockImplementation(record), + ]; + }); + + afterEach(() => { + consoleSpies.forEach((spy) => spy.mockRestore()); + expect(consoleLines.filter((line) => /[\\/]/.test(line))).toEqual([]); }); it("prepares after the checksum repair and before Database.load", async () => { -- 2.52.0 From 8b1f3158ac59cdc8c60c9eadc17164ce18eee057 Mon Sep 17 00:00:00 2001 From: le king fu Date: Sat, 24 Oct 2026 13:46:37 -0400 Subject: [PATCH 4/4] test(db): watch every channel to the Journal in the connectToProfile block The pin of 5d26fae refused a folder in raw console.error and console.warn lines only. Three other channels still let one through with every test green (review 27373 of PR #496): logWarn, whose lines go with a feedback report, logInfo (both mocked in this file, so they never reached the console spies), and console.log, which initLogCapture captures at the info level. The block now also spies on console.log and reads the calls of the mocked logInfo, logWarn and logError, and refuses a line holding a `/` or a `\` whatever its channel. Applied in the follow-up link by Max's decision of 2026-10-24. Co-Authored-By: Claude Opus 5.5 --- src/services/db.test.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/services/db.test.ts b/src/services/db.test.ts index 73b36ad..9d83b30 100644 --- a/src/services/db.test.ts +++ b/src/services/db.test.ts @@ -531,33 +531,40 @@ function catchUp(overrides: Partial> } describe("a profile is prepared before the plugin opens it (#390)", () => { - // db.ts writes to the Journal through logService, mocked here. A raw - // console.error or console.warn would reach the Journal too (initLogCapture - // captures both), so none may carry a folder: each test of this block ends - // by refusing such a line (review 27245 of PR #491, R6). + // Every line db.ts writes may reach the Journal: through logInfo, logWarn + // and logError (mocked here, so their calls are read), or through a raw + // console.log, console.warn or console.error (initLogCapture captures all + // three). None may carry a folder: each test of this block ends by refusing + // such a line, whatever its channel (reviews 27245 of PR #491 and 27373 of + // PR #496). let consoleLines: string[] = []; let consoleSpies: Array<{ mockRestore: () => void }> = []; + const text = (a: unknown): string => + typeof a === "string" ? a : a instanceof Error ? a.message : (JSON.stringify(a) ?? String(a)); beforeEach(() => { vi.mocked(invoke).mockClear(); vi.mocked(Database.load).mockClear(); vi.mocked(logInfo).mockClear(); + vi.mocked(logWarn).mockClear(); vi.mocked(logError).mockClear(); consoleLines = []; - const text = (a: unknown): string => - typeof a === "string" ? a : a instanceof Error ? a.message : (JSON.stringify(a) ?? String(a)); const record = (...args: unknown[]) => { consoleLines.push(args.map(text).join(" ")); }; consoleSpies = [ vi.spyOn(console, "error").mockImplementation(record), vi.spyOn(console, "warn").mockImplementation(record), + vi.spyOn(console, "log").mockImplementation(record), ]; }); afterEach(() => { consoleSpies.forEach((spy) => spy.mockRestore()); - expect(consoleLines.filter((line) => /[\\/]/.test(line))).toEqual([]); + const journal = [logInfo, logWarn, logError].flatMap((fn) => + vi.mocked(fn).mock.calls.map((call) => call.map(text).join(" ")), + ); + expect([...consoleLines, ...journal].filter((line) => /[\\/]/.test(line))).toEqual([]); }); it("prepares after the checksum repair and before Database.load", async () => { -- 2.52.0