test(confirm): behaviour tests of the four sites the guard alone held (#467) #492

Merged
maximus merged 5 commits from issue-467-confirm-behaviour-tests into main 2026-10-24 18:10:54 +00:00
Owner

Resolves #467
Generated autonomously by /autopilot run of 2026-10-23

Link 3 of 4 of the milestone planned-2026-10-23-gardes-tests-front (#480 → #478 → #467 → #451). Base: issue-478-journal-folder-stops (PR #491, head 66d9aad). Link #451 is stacked on this branch and uses src/test/elementTree.ts.

What it does

Tests only, no production code. After #421, src/__integration__/native-dialog-guard.test.ts was all that held four confirmation sites: it checks that each confirmAction( is awaited, not what the handler does with the answer (without the await, !promise is false and if (promise) is true: the deletion runs on « Annuler »). Each site now has a behaviour test on the hook harness (src/test/hookHarness.ts, #409), with confirmAction mocked: a refusal leaves the data alone, an acceptance deletes the right id, and each test asserts the marked message passed to confirmAction (fake t of src/test/i18nMock.ts, through the i18nMock factory).

  • CategoryDetailPanel (t(categories.deleteConfirm)): the delete button lives in the child CategoryForm, which the harness never calls; the test finds the CategoryForm element of the edit view and calls its onDelete prop. Refusal → onDelete not called; acceptance → onDelete(10) once and no message; onDelete resolving { blocked: true, count: 3 } → t(categories.deleteBlocked[count=3]) rendered at the next render (absent before); a later deletion that goes through clears it.
  • AdjustmentDetailPanel (t(adjustments.deleteConfirm)): same layout with AdjustmentForm. Refusal → nothing; acceptance → onDelete(7) once.
  • TemplateActions (t(budget.deleteTemplateConfirm)): the test opens the template list by clicking « Appliquer un modèle » (the button that holds BookTemplate), renders again, then calls the onClick of the second template's delete button with { stopPropagation: vi.fn() }. stopPropagation is asserted right after the call, before the answer, in both cases (the click would otherwise reach the row, which selects the template). Refusal → nothing; acceptance → onDelete(9) once. Never harness.commit(): the component's effect calls document.addEventListener.
  • AccountsPage (t(balance.category.actions.deleteConfirm)): useBalanceAccounts mocked as a whole; the test opens the categories tab by its button, renders again, and takes each category's delete button in its row (tr keyed by the category id). User category without account: refusal → removeCategory not called; acceptance → removeCategory(21) once. Category with two linked accounts: button disabled, a click through the props calls neither confirmAction nor removeCategory, and the next render shows t(balance.category.error.has_accounts[count=2,names=Voilier, Toile]). Seeded category: button disabled, a click does nothing, no message.

Shared helper src/test/elementTree.ts (the plan's name), with src/test/elementTree.test.ts next to it, on the model of hookHarness.ts + hookHarness.test.ts:

  • find(node, pred): every element the predicate keeps, depth first (an element before what it holds), through arrays at any depth and fragments: the semantics of the copy in BudgetPage.wiring.test.ts;
  • holding(node, type): every element one of whose direct children is an element of type, once each (the button that holds a Trash2, neither the icon nor the row): the semantics of the copy in ProfileFormModal.delete.test.ts, including its one-level read of props.children (in <td>{label}{rows}</td> the items of rows are not direct children);
  • both read props.children only and never call a component of the tree. The docblock says both semantics; 15 tests pin each point (predicate, depth, arrays, fragments, texts and holes, other props, child components never called; by type, several occurrences, once per holder, identity of tags and components, the one-level read, a fragment holding its own children, child components never called).

ProfileFormModal.delete.test.ts and BudgetPage.wiring.test.ts drop their local copy and import the helper (same tests, same counts: 2 + 6).

Files

  • New: src/test/elementTree.ts, src/test/elementTree.test.ts, src/components/categories/CategoryDetailPanel.delete.test.ts, src/components/adjustments/AdjustmentDetailPanel.delete.test.ts, src/components/budget/TemplateActions.delete.test.ts, src/pages/AccountsPage.delete.test.ts.
  • Changed: src/components/profile/ProfileFormModal.delete.test.ts, src/pages/BudgetPage.wiring.test.ts (import of the helper, local copy removed); docs/architecture.md, section « Harnais de hooks »: harness users recounted with the grep cited on that line (21 on 2026-10-20 → 25 on 2026-10-23), the four delete tests named; one paragraph for elementTree.ts (what find and holding do, who uses them, the 16 files that keep a copy).
  • Read only: the four components, CategoryForm.tsx, AdjustmentForm.tsx, hookHarness.ts, i18nMock.ts.
  • No CHANGELOG entry (tests and docs only, as planned). STATE.md untouched (no manual check).

The grep criterion of the plan: not met as written

The plan's criterion « grep -rn "function holding\|function find" src --include='*.test.*' ne rend plus rien » assumed two local copies. Measured on the base 66d9aad: 18 test files define a local function find( or function holding(, and the pattern also matches two distinct helpers (findCheckboxes in FilterPanel.test.tsx, holdingRow in useSnapshotEditor.test.ts); three of the find copies take a type, not a predicate. The plan's decision and file list name two files, so this PR migrates those two (orchestrator decision, MEDIUM, logged). After it, the plan's grep still prints 18 lines: 16 files keep a copy (grep -rlE "function (find|holding)\(" src --include='*.test.*'):

AdjustmentForm.wiring.test.ts, LinkTransfersModal.wiring.test.ts, HierarchyCheckModal.wiring.test.ts, OnboardingChecklist.test.tsx, ImportEmptyState.test.tsx, AppShell.slot.test.tsx, OnboardingBanner.render.test.tsx, StepCard.render.test.tsx, ChangelogContent.test.tsx, CategoryCombobox.placement.test.ts, EmptyState.test.tsx, UpsellCtas.render.test.tsx, UpsellDialog.render.test.tsx, TransactionTable.wiring.test.ts, SystemsSettingsPage.test.tsx, UsersSettingsPage.test.tsx.

What this PR proves instead (narrower check): the seven test files it adds or changes (elementTree.test.ts, the two migrated, the four new) define no find or holding (grep -nE "function (find|holding)\(" <the 7 files> → exit 1, no line), and all seven import test/elementTree: one implementation of each helper for them, in src/test/elementTree.ts. The plan also placed a find at ProfileFormModal.delete.test.ts:48: that file only had holding (l. 44; l. 48 was inside it).

Decisions (details in the run's decisions log)

  • [MEDIUM, orchestrator] Migrate only the two files the plan names; criterion reported unmet with the measured list (above); a follow-up for the 16 others is proposed to Max by the orchestrator. Rejected: migrating all 18 (scope ×9 beyond the planned file list, and a third export for the by-type find).
  • [MEDIUM] States opened by a click in the rendered tree, no slot preset: TemplateActions by « Appliquer un modèle », AccountsPage by the categories tab. Neither test depends on the order of the component's hooks, so the list « Préréglages actuels » of docs/architecture.md « Limites connues (#437) » is left unchanged (said in each test's header). Rejected: harness.slots[0] = true / = "categories", which the body allowed (a hook-order dependency and two more entries in that list, for no extra coverage).
  • [HIGH] Semantics of the two copies kept to the letter (above); only typing added: a generic P (default TreeProps), so ProfileFormModal.delete.test.ts keeps onClick?: () => Promise<void> without a cast at the call. The value import of isValidElement from react in elementTree.ts is safe: test modules import it after the vi.mock("react") factory, never from inside it (the reason hookHarness.ts imports React as a type only).
  • [HIGH] Fixtures with numbers apart from the id (244184c, before the mutation pass): the first draft gave categories a sort_order equal to their id, so a handler passing sort_order would have passed the id assertion; mutation P3 now shows it red.
  • [HIGH] Assertions beyond the body's list, each red under its own mutation (T4, C6, P5, P6 below): stopPropagation before the answer; no message on an unblocked deletion, and the message cleared after a later one; the seed guard; disabled on linked accounts.
  • [HIGH] texts() (one line over find) stays local in the two files that read a rendered message: the plan fixes the helper's API at find + holding.
  • [HIGH] No CHANGELOG, no STATE.md; the issue closes at merge (first line of this body and last commit 719588f): no manual check, no post-merge action.

Proofs

Tests committed (92082c3, e7c3def, 244184c) before the first mutation, and the self-review fix (719588f) before E7. One mutation at a time, restored by git checkout -- <file>, git status --short empty after each. For each « await removed » mutation, the site's test and native-dialog-guard.test.ts (34 tests) ran together.

# File Mutation Failing tests Exit
C1 CategoryDetailPanel.tsx await removed: if (!(confirmAction(…))) return; 2 of 38: refusal test + guard (« finds no native dialog and no confirmation left unawaited ») 1
C2 CategoryDetailPanel.tsx refusal branch inverted: if (await confirmAction(…)) return; 4 of 4 1
C3 CategoryDetailPanel.tsx wrong id: onDelete(selectedCategory.parent_id ?? selectedCategory.id) 2 of 4 (acceptance, blocked) 1
C4 CategoryDetailPanel.tsx blocked message never set (setDeleteError(t("categories.deleteBlocked", …)) removed) 2 of 4 (blocked, cleared) 1
C5 CategoryDetailPanel.tsx message never rendered: {false && deleteError && (…)} 2 of 4 (blocked, cleared) 1
C6 CategoryDetailPanel.tsx setDeleteError(null) removed 1 of 4 (cleared) 1
A1 AdjustmentDetailPanel.tsx await removed 2 of 36: refusal test + guard 1
A2 AdjustmentDetailPanel.tsx refusal branch inverted 2 of 2 1
A3 AdjustmentDetailPanel.tsx wrong id: onDelete(selectedAdjustment.id + 1) 1 of 2 (acceptance) 1
T1 TemplateActions.tsx await removed: if (confirmAction(…)) { 2 of 36: refusal test + guard 1
T2 TemplateActions.tsx refusal branch inverted: if (!(await confirmAction(…))) { 2 of 2 1
T3 TemplateActions.tsx wrong id: handleDelete(e, templates[0].id) 1 of 2 (acceptance) 1
T4 TemplateActions.tsx e.stopPropagation() moved after the await 2 of 2 1
P1 AccountsPage.tsx await removed 2 of 38: refusal test + guard 1
P2 AccountsPage.tsx refusal branch inverted 2 of 4 (refusal, acceptance) 1
P3 AccountsPage.tsx wrong id: removeCategory(cat.sort_order) 1 of 4 (acceptance) 1
P4 AccountsPage.tsx linked-accounts check moved after the dialog 1 of 4 (linked accounts: confirmAction called) 1
P5 AccountsPage.tsx if (cat.is_seed) return; removed 1 of 4 (seeded) 1
P6 AccountsPage.tsx const blocked = cat.is_seed; (linked accounts dropped from disabled) 1 of 4 (linked accounts) 1
E1 elementTree.ts find post-order (children before the element) 3 of 14 1
E2 elementTree.ts find drops arrays 5 of 14 1
E3 elementTree.ts holding returns the elements of the type, not their holder 14 of 22 (6 elementTree, 2 ProfileFormModal.delete, 2 TemplateActions.delete, 4 AccountsPage.delete) 1
E4 elementTree.ts holding flattens nested arrays (.flat(Infinity)) 1 of 14 (one-level read) 1
E5 elementTree.ts holding returns a holder once per child of the type 1 of 14 (once per holder) 1
E6 elementTree.ts find calls function components 1 of 14 (never calls) 1
E7 elementTree.ts holding calls function components 1 of 15 (never calls), on 719588f; green (0 of 14, exit 0) on 6e80525: the self-review finding fixed by 719588f 1

Under C1, A1, T1 and P1 the site's acceptance test stays green (!promise is false, so the deletion runs): the refusal test is the one that catches a missing await, as the body expected, together with the guard.

Tests

  • vitest: 156 files / 2583 tests on the base 66d9aad, 161 files / 2610 tests on the head 719588f (+5 files, +27 tests: 15 elementTree, 4 CategoryDetailPanel, 2 AdjustmentDetailPanel, 2 TemplateActions, 4 AccountsPage), green, i18n-mock-guard and native-dialog-guard included.
  • npm run build (tsc + vite) green on the head.
  • Probe: src/zz_tmp_probe.test.ts with expect(1).toBe(2) → npx vitest run src/zz_tmp_probe.test.ts exit 1 (sonde rc=1), file deleted.
  • Rust: not touched, not run.

Hors périmètre

  • The 16 other local copies of find / holding (list above): follow-up proposed to Max by the orchestrator (tests only, mechanical; three of them take a type, not a predicate).
  • For #451 (next link): UpsellDialog.render.test.tsx is one of the 16. holding(node, type) returns the holder of an element of the type; the UpsellDialog element itself is find(tree, (el) => el.type === UpsellDialog).

For the reviewer

  • The harness never calls child components: the two panel tests call the onDelete prop the panel hands its form; the form's own onClick={onDelete} is not exercised here.
  • The « linked accounts » and « seeded » paths of AccountsPage cannot be reached from the UI (button disabled): the tests assert disabled first, then call the handler through the props to prove the guard behind it.
  • No manual check: tests and docs only, nothing visible in the app.

🤖 Generated with Claude Code

Resolves #467 Generated autonomously by /autopilot run of 2026-10-23 Link 3 of 4 of the milestone `planned-2026-10-23-gardes-tests-front` (#480 → #478 → #467 → #451). Base: `issue-478-journal-folder-stops` (PR #491, head `66d9aad`). Link #451 is stacked on this branch and uses `src/test/elementTree.ts`. ## What it does Tests only, no production code. After #421, `src/__integration__/native-dialog-guard.test.ts` was all that held four confirmation sites: it checks that each `confirmAction(` is awaited, not what the handler does with the answer (without the `await`, `!promise` is false and `if (promise)` is true: the deletion runs on « Annuler »). Each site now has a behaviour test on the hook harness (`src/test/hookHarness.ts`, #409), with `confirmAction` mocked: a refusal leaves the data alone, an acceptance deletes the right id, and each test asserts the marked message passed to `confirmAction` (fake `t` of `src/test/i18nMock.ts`, through the `i18nMock` factory). - **`CategoryDetailPanel`** (`t(categories.deleteConfirm)`): the delete button lives in the child `CategoryForm`, which the harness never calls; the test finds the `CategoryForm` element of the edit view and calls its `onDelete` prop. Refusal → `onDelete` not called; acceptance → `onDelete(10)` once and no message; `onDelete` resolving `{ blocked: true, count: 3 }` → `t(categories.deleteBlocked[count=3])` rendered at the next render (absent before); a later deletion that goes through clears it. - **`AdjustmentDetailPanel`** (`t(adjustments.deleteConfirm)`): same layout with `AdjustmentForm`. Refusal → nothing; acceptance → `onDelete(7)` once. - **`TemplateActions`** (`t(budget.deleteTemplateConfirm)`): the test opens the template list by clicking « Appliquer un modèle » (the button that holds `BookTemplate`), renders again, then calls the `onClick` of the second template's delete button with `{ stopPropagation: vi.fn() }`. `stopPropagation` is asserted right after the call, before the answer, in both cases (the click would otherwise reach the row, which selects the template). Refusal → nothing; acceptance → `onDelete(9)` once. Never `harness.commit()`: the component's effect calls `document.addEventListener`. - **`AccountsPage`** (`t(balance.category.actions.deleteConfirm)`): `useBalanceAccounts` mocked as a whole; the test opens the categories tab by its button, renders again, and takes each category's delete button in its row (`tr` keyed by the category id). User category without account: refusal → `removeCategory` not called; acceptance → `removeCategory(21)` once. Category with two linked accounts: button `disabled`, a click through the props calls neither `confirmAction` nor `removeCategory`, and the next render shows `t(balance.category.error.has_accounts[count=2,names=Voilier, Toile])`. Seeded category: button `disabled`, a click does nothing, no message. Shared helper **`src/test/elementTree.ts`** (the plan's name), with `src/test/elementTree.test.ts` next to it, on the model of `hookHarness.ts` + `hookHarness.test.ts`: - `find(node, pred)`: every element the predicate keeps, depth first (an element before what it holds), through arrays at any depth and fragments: the semantics of the copy in `BudgetPage.wiring.test.ts`; - `holding(node, type)`: every element one of whose direct children is an element of `type`, once each (the button that holds a `Trash2`, neither the icon nor the row): the semantics of the copy in `ProfileFormModal.delete.test.ts`, including its one-level read of `props.children` (in `<td>{label}{rows}</td>` the items of `rows` are not direct children); - both read `props.children` only and never call a component of the tree. The docblock says both semantics; 15 tests pin each point (predicate, depth, arrays, fragments, texts and holes, other props, child components never called; by type, several occurrences, once per holder, identity of tags and components, the one-level read, a fragment holding its own children, child components never called). `ProfileFormModal.delete.test.ts` and `BudgetPage.wiring.test.ts` drop their local copy and import the helper (same tests, same counts: 2 + 6). ## Files - New: `src/test/elementTree.ts`, `src/test/elementTree.test.ts`, `src/components/categories/CategoryDetailPanel.delete.test.ts`, `src/components/adjustments/AdjustmentDetailPanel.delete.test.ts`, `src/components/budget/TemplateActions.delete.test.ts`, `src/pages/AccountsPage.delete.test.ts`. - Changed: `src/components/profile/ProfileFormModal.delete.test.ts`, `src/pages/BudgetPage.wiring.test.ts` (import of the helper, local copy removed); `docs/architecture.md`, section « Harnais de hooks »: harness users recounted with the `grep` cited on that line (21 on 2026-10-20 → 25 on 2026-10-23), the four delete tests named; one paragraph for `elementTree.ts` (what `find` and `holding` do, who uses them, the 16 files that keep a copy). - Read only: the four components, `CategoryForm.tsx`, `AdjustmentForm.tsx`, `hookHarness.ts`, `i18nMock.ts`. - No CHANGELOG entry (tests and docs only, as planned). `STATE.md` untouched (no manual check). ## The `grep` criterion of the plan: not met as written The plan's criterion « `grep -rn "function holding\|function find" src --include='*.test.*'` ne rend plus rien » assumed two local copies. Measured on the base `66d9aad`: **18 test files** define a local `function find(` or `function holding(`, and the pattern also matches two distinct helpers (`findCheckboxes` in `FilterPanel.test.tsx`, `holdingRow` in `useSnapshotEditor.test.ts`); three of the `find` copies take a type, not a predicate. The plan's decision and file list name two files, so this PR migrates those two (orchestrator decision, MEDIUM, logged). After it, the plan's grep still prints 18 lines: 16 files keep a copy (`grep -rlE "function (find|holding)\(" src --include='*.test.*'`): `AdjustmentForm.wiring.test.ts`, `LinkTransfersModal.wiring.test.ts`, `HierarchyCheckModal.wiring.test.ts`, `OnboardingChecklist.test.tsx`, `ImportEmptyState.test.tsx`, `AppShell.slot.test.tsx`, `OnboardingBanner.render.test.tsx`, `StepCard.render.test.tsx`, `ChangelogContent.test.tsx`, `CategoryCombobox.placement.test.ts`, `EmptyState.test.tsx`, `UpsellCtas.render.test.tsx`, `UpsellDialog.render.test.tsx`, `TransactionTable.wiring.test.ts`, `SystemsSettingsPage.test.tsx`, `UsersSettingsPage.test.tsx`. What this PR proves instead (narrower check): the seven test files it adds or changes (`elementTree.test.ts`, the two migrated, the four new) define no `find` or `holding` (`grep -nE "function (find|holding)\(" <the 7 files>` → exit 1, no line), and all seven import `test/elementTree`: one implementation of each helper for them, in `src/test/elementTree.ts`. The plan also placed a `find` at `ProfileFormModal.delete.test.ts:48`: that file only had `holding` (l. 44; l. 48 was inside it). ## Decisions (details in the run's decisions log) - [MEDIUM, orchestrator] Migrate only the two files the plan names; criterion reported unmet with the measured list (above); a follow-up for the 16 others is proposed to Max by the orchestrator. Rejected: migrating all 18 (scope ×9 beyond the planned file list, and a third export for the by-type `find`). - [MEDIUM] States opened by a click in the rendered tree, no slot preset: `TemplateActions` by « Appliquer un modèle », `AccountsPage` by the categories tab. Neither test depends on the order of the component's hooks, so the list « Préréglages actuels » of `docs/architecture.md` « Limites connues (#437) » is left unchanged (said in each test's header). Rejected: `harness.slots[0] = true` / `= "categories"`, which the body allowed (a hook-order dependency and two more entries in that list, for no extra coverage). - [HIGH] Semantics of the two copies kept to the letter (above); only typing added: a generic `P` (default `TreeProps`), so `ProfileFormModal.delete.test.ts` keeps `onClick?: () => Promise<void>` without a cast at the call. The value import of `isValidElement` from `react` in `elementTree.ts` is safe: test modules import it after the `vi.mock("react")` factory, never from inside it (the reason `hookHarness.ts` imports React as a type only). - [HIGH] Fixtures with numbers apart from the id (`244184c`, before the mutation pass): the first draft gave categories a `sort_order` equal to their id, so a handler passing `sort_order` would have passed the id assertion; mutation P3 now shows it red. - [HIGH] Assertions beyond the body's list, each red under its own mutation (T4, C6, P5, P6 below): `stopPropagation` before the answer; no message on an unblocked deletion, and the message cleared after a later one; the seed guard; `disabled` on linked accounts. - [HIGH] `texts()` (one line over `find`) stays local in the two files that read a rendered message: the plan fixes the helper's API at `find` + `holding`. - [HIGH] No CHANGELOG, no STATE.md; the issue closes at merge (first line of this body and last commit `719588f`): no manual check, no post-merge action. ## Proofs Tests committed (`92082c3`, `e7c3def`, `244184c`) before the first mutation, and the self-review fix (`719588f`) before E7. One mutation at a time, restored by `git checkout -- <file>`, `git status --short` empty after each. For each « `await` removed » mutation, the site's test and `native-dialog-guard.test.ts` (34 tests) ran together. | # | File | Mutation | Failing tests | Exit | |---|---|---|---|---| | C1 | `CategoryDetailPanel.tsx` | `await` removed: `if (!(confirmAction(…))) return;` | 2 of 38: refusal test + guard (« finds no native dialog and no confirmation left unawaited ») | 1 | | C2 | `CategoryDetailPanel.tsx` | refusal branch inverted: `if (await confirmAction(…)) return;` | 4 of 4 | 1 | | C3 | `CategoryDetailPanel.tsx` | wrong id: `onDelete(selectedCategory.parent_id ?? selectedCategory.id)` | 2 of 4 (acceptance, blocked) | 1 | | C4 | `CategoryDetailPanel.tsx` | blocked message never set (`setDeleteError(t("categories.deleteBlocked", …))` removed) | 2 of 4 (blocked, cleared) | 1 | | C5 | `CategoryDetailPanel.tsx` | message never rendered: `{false && deleteError && (…)}` | 2 of 4 (blocked, cleared) | 1 | | C6 | `CategoryDetailPanel.tsx` | `setDeleteError(null)` removed | 1 of 4 (cleared) | 1 | | A1 | `AdjustmentDetailPanel.tsx` | `await` removed | 2 of 36: refusal test + guard | 1 | | A2 | `AdjustmentDetailPanel.tsx` | refusal branch inverted | 2 of 2 | 1 | | A3 | `AdjustmentDetailPanel.tsx` | wrong id: `onDelete(selectedAdjustment.id + 1)` | 1 of 2 (acceptance) | 1 | | T1 | `TemplateActions.tsx` | `await` removed: `if (confirmAction(…)) {` | 2 of 36: refusal test + guard | 1 | | T2 | `TemplateActions.tsx` | refusal branch inverted: `if (!(await confirmAction(…))) {` | 2 of 2 | 1 | | T3 | `TemplateActions.tsx` | wrong id: `handleDelete(e, templates[0].id)` | 1 of 2 (acceptance) | 1 | | T4 | `TemplateActions.tsx` | `e.stopPropagation()` moved after the `await` | 2 of 2 | 1 | | P1 | `AccountsPage.tsx` | `await` removed | 2 of 38: refusal test + guard | 1 | | P2 | `AccountsPage.tsx` | refusal branch inverted | 2 of 4 (refusal, acceptance) | 1 | | P3 | `AccountsPage.tsx` | wrong id: `removeCategory(cat.sort_order)` | 1 of 4 (acceptance) | 1 | | P4 | `AccountsPage.tsx` | linked-accounts check moved after the dialog | 1 of 4 (linked accounts: `confirmAction` called) | 1 | | P5 | `AccountsPage.tsx` | `if (cat.is_seed) return;` removed | 1 of 4 (seeded) | 1 | | P6 | `AccountsPage.tsx` | `const blocked = cat.is_seed;` (linked accounts dropped from `disabled`) | 1 of 4 (linked accounts) | 1 | | E1 | `elementTree.ts` | `find` post-order (children before the element) | 3 of 14 | 1 | | E2 | `elementTree.ts` | `find` drops arrays | 5 of 14 | 1 | | E3 | `elementTree.ts` | `holding` returns the elements of the type, not their holder | 14 of 22 (6 `elementTree`, 2 `ProfileFormModal.delete`, 2 `TemplateActions.delete`, 4 `AccountsPage.delete`) | 1 | | E4 | `elementTree.ts` | `holding` flattens nested arrays (`.flat(Infinity)`) | 1 of 14 (one-level read) | 1 | | E5 | `elementTree.ts` | `holding` returns a holder once per child of the type | 1 of 14 (once per holder) | 1 | | E6 | `elementTree.ts` | `find` calls function components | 1 of 14 (never calls) | 1 | | E7 | `elementTree.ts` | `holding` calls function components | 1 of 15 (never calls), on `719588f`; **green (0 of 14, exit 0) on `6e80525`**: the self-review finding fixed by `719588f` | 1 | Under C1, A1, T1 and P1 the site's acceptance test stays green (`!promise` is false, so the deletion runs): the refusal test is the one that catches a missing `await`, as the body expected, together with the guard. ## Tests - vitest: 156 files / 2583 tests on the base `66d9aad`, 161 files / 2610 tests on the head `719588f` (+5 files, +27 tests: 15 `elementTree`, 4 `CategoryDetailPanel`, 2 `AdjustmentDetailPanel`, 2 `TemplateActions`, 4 `AccountsPage`), green, `i18n-mock-guard` and `native-dialog-guard` included. - `npm run build` (tsc + vite) green on the head. - Probe: `src/zz_tmp_probe.test.ts` with `expect(1).toBe(2)` → `npx vitest run src/zz_tmp_probe.test.ts` exit 1 (sonde rc=1), file deleted. - Rust: not touched, not run. ## Hors périmètre - The 16 other local copies of `find` / `holding` (list above): follow-up proposed to Max by the orchestrator (tests only, mechanical; three of them take a type, not a predicate). - For #451 (next link): `UpsellDialog.render.test.tsx` is one of the 16. `holding(node, type)` returns the **holder** of an element of the type; the `UpsellDialog` element itself is `find(tree, (el) => el.type === UpsellDialog)`. ## For the reviewer - The harness never calls child components: the two panel tests call the `onDelete` prop the panel hands its form; the form's own `onClick={onDelete}` is not exercised here. - The « linked accounts » and « seeded » paths of `AccountsPage` cannot be reached from the UI (button `disabled`): the tests assert `disabled` first, then call the handler through the props to prove the guard behind it. - No manual check: tests and docs only, nothing visible in the app. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
find(node, pred) returns every element the predicate keeps, depth first, through arrays and fragments; holding(node, type) returns every element one of whose direct children is of the type (the button that holds a Trash2, not the icon). Both keep the semantics of the copies they replace, each proved by elementTree.test.ts. ProfileFormModal.delete.test.ts and BudgetPage.wiring.test.ts drop their local copy and import the helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
native-dialog-guard.test.ts checks that each confirmAction( is awaited, not what the handler does once the user answers. Behaviour tests on the hook harness for the four sites it alone held: CategoryDetailPanel (and the deleteBlocked message at the next render), AdjustmentDetailPanel, TemplateActions (stopPropagation before the answer, never commit()) and AccountsPage (a seeded category or one with linked accounts opens no dialog). Each refusal leaves the data alone, each acceptance deletes the right id, and each asserts the marked message passed to confirmAction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A sort order equal to the id let a handler that passed the sort order pass the id assertion. The category fixtures of the CategoryDetailPanel and AccountsPage tests now carry a sort order (and a keyword count) of their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(architecture): name elementTree and recount the harness users (#467)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 2m11s
6e80525945
The section on the hook harness now says what find and holding do, who uses them, and that sixteen test files keep their own copy (grep cited). Harness users recounted with the grep of that line: 25 test files on 2026-10-23, the four delete tests of #467 among them.

Resolves #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test: prove that holding never calls a component either (#467)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 2m11s
719588ffe2
Self-review: the docblock says that neither helper calls a component of the tree, but only find had a test for it. holding gets its own (a holder that a child component renders is not found, the component is never called). The header no longer reads as if no test file kept a copy of its own: several still do.

Resolves #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Niveau : normal

Verdict : APPROVE

Auto-revue de l'auteur (worker /autopilot, maillon 3 de 4), pas une revue indépendante : le label reste status:review et la PR porte autopilot:pending-human.

Niveau, fichier par fichier (REVIEW.md de main)

  • src/test/elementTree.ts, src/test/elementTree.test.ts, les quatre *.delete.test.ts, ProfileFormModal.delete.test.ts, BudgetPage.wiring.test.ts : désignés par la ligne Haut « code livré : src/** », dont la condition n'est pas remplie (aucun appel réseau ajouté ni modifié, aucune URL, aucun consentement touché : du code de test, que l'app n'importe pas) → normal.
  • docs/architecture.md : aucune ligne Haut ne le désigne ; la liste « Restent au moins normaux » l'exclut du niveau bas → normal.
  • Aucun fichier à la racine ni dans src-tauri/, aucun manifeste, lock, workflow ni configuration.

La PR est de niveau normal.

Ce que j'ai vérifié

  • Chaque site, contre son code sur la base 66d9aad : refus → aucune suppression ; acceptation → suppression avec le bon identifiant (onDelete(10), onDelete(7), onDelete(9), removeCategory(21)) ; message marqué passé à confirmAction affirmé dans chaque test qui l'appelle. Le cas bloqué de CategoryDetailPanel (t(categories.deleteBlocked[count=3])) n'est rendu qu'au second rendu, et il est absent avant. Pour AccountsPage, les comptes liés et la catégorie du seed : bouton disabled, aucun appel à confirmAction ni à removeCategory, et le texte d'erreur au second rendu pour les comptes liés.
  • Mutations : 25 dans le corps de la PR (C1 à C6, A1 à A3, T1 à T4, P1 à P6, E1 à E6), plus E7 après la correction ci-dessous ; toutes rouges (exit 1), arbre propre après chaque restauration. Les quatre « await retiré » font rougir le test de refus du site et native-dialog-guard.test.ts ensemble.
  • Harnais : aucun harness.commit() dans TemplateActions.delete.test.ts ; aucun emplacement préréglé, les deux états s'ouvrent par un clic dans l'arbre rendu, donc la liste « Préréglages actuels » de docs/architecture.md reste juste telle quelle.
  • Gardes : les quatre nouveaux fichiers mockent react-i18next par i18nMock() et n'écrivent aucun faux t ; native-dialog-guard ne lit pas les tests, et elementTree.ts ne mentionne aucune confirmation.
  • Compte des utilisateurs du harnais rejoué avec le grep cité : 25 au 2026-10-23. Copies locales restantes rejouées : 16 fichiers ; les sept fichiers de la PR n'en définissent aucune (grep exit 1).
  • Suite : sonde rc=1, puis npm run build vert et npm test vert sur 719588f (161 fichiers, 2610 tests). Lignes ajoutées sans .only ni .skip, sans donnée personnelle ni jeton.
  • Fermeture : la timeline de #467 porte une seule entrée pull_ref avec closes, venue de cette PR ; aucun autre verbe de fermeture dans le corps ni dans les commits.

Constats (tous corrigés)

  1. src/test/elementTree.ts:22-26 sur 6e80525 (23-27 sur 719588f) : le docblock affirmait qu'aucun des deux helpers n'appelle un composant de l'arbre, mais seul find avait un test. La mutation E7 (holding qui appelle les composants fonctions) restait verte sur 6e80525 (14 sur 14, exit 0). Corrigé par 719588f : test « never calls a component of the tree: a holder its child renders is not there » dans src/test/elementTree.test.ts ; E7 rouge sur 719588f (1 sur 15, exit 1).
  2. src/test/elementTree.ts:5-6 sur 6e80525 : « before #467, test files kept their own copy » laissait croire qu'aucun ne la garde encore, alors que 16 la gardent. Reformulé dans 719588f.
  3. Avant la PR (244184c) : les catégories des fixtures avaient un sort_order égal à leur identifiant, donc un gestionnaire qui aurait passé sort_order aurait passé l'assertion. Elles ont désormais des nombres distincts, et P3 le prouve.

Suggestions (non bloquantes)

  • Migrer les 16 copies restantes de find / holding sur src/test/elementTree.ts (liste dans le corps de la PR) : des tests seulement, un travail mécanique. Trois d'entre elles prennent un type, qui s'écrit find(tree, (el) => el.type === X). Cette issue de suivi est à décider par Max.
  • texts() (une ligne au-dessus de find) est écrit deux fois, dans CategoryDetailPanel.delete.test.ts:95 et AccountsPage.delete.test.ts:114. Si un troisième fichier en a besoin, l'exporter depuis elementTree.ts demandera une décision, puisque le plan fixe l'API à find et holding.
  • Pour #451, maillon suivant : holding(node, type) rend le parent qui contient un élément du type. L'élément UpsellDialog lui-même s'obtient par find(tree, (el) => el.type === UpsellDialog).
  • Le câblage du bouton de suppression dans les formulaires eux-mêmes (onClick={onDelete}, CategoryForm.tsx:159 et AdjustmentForm.tsx:179) n'a aucun test : les tests de cette PR appellent la prop onDelete que le panneau donne au formulaire. Ce trou existait avant la PR et sort de son périmètre.
Niveau : normal Verdict : APPROVE Auto-revue de l'auteur (worker `/autopilot`, maillon 3 de 4), pas une revue indépendante : le label reste `status:review` et la PR porte `autopilot:pending-human`. ## Niveau, fichier par fichier (`REVIEW.md` de `main`) - `src/test/elementTree.ts`, `src/test/elementTree.test.ts`, les quatre `*.delete.test.ts`, `ProfileFormModal.delete.test.ts`, `BudgetPage.wiring.test.ts` : désignés par la ligne Haut « code livré : `src/**` », dont la condition n'est pas remplie (aucun appel réseau ajouté ni modifié, aucune URL, aucun consentement touché : du code de test, que l'app n'importe pas) → normal. - `docs/architecture.md` : aucune ligne Haut ne le désigne ; la liste « Restent au moins normaux » l'exclut du niveau bas → normal. - Aucun fichier à la racine ni dans `src-tauri/`, aucun manifeste, lock, workflow ni configuration. La PR est de niveau normal. ## Ce que j'ai vérifié - Chaque site, contre son code sur la base `66d9aad` : refus → aucune suppression ; acceptation → suppression avec le bon identifiant (`onDelete(10)`, `onDelete(7)`, `onDelete(9)`, `removeCategory(21)`) ; message marqué passé à `confirmAction` affirmé dans chaque test qui l'appelle. Le cas bloqué de `CategoryDetailPanel` (`t(categories.deleteBlocked[count=3])`) n'est rendu qu'au second rendu, et il est absent avant. Pour `AccountsPage`, les comptes liés et la catégorie du seed : bouton `disabled`, aucun appel à `confirmAction` ni à `removeCategory`, et le texte d'erreur au second rendu pour les comptes liés. - Mutations : 25 dans le corps de la PR (C1 à C6, A1 à A3, T1 à T4, P1 à P6, E1 à E6), plus E7 après la correction ci-dessous ; toutes rouges (exit 1), arbre propre après chaque restauration. Les quatre « `await` retiré » font rougir le test de refus du site et `native-dialog-guard.test.ts` ensemble. - Harnais : aucun `harness.commit()` dans `TemplateActions.delete.test.ts` ; aucun emplacement préréglé, les deux états s'ouvrent par un clic dans l'arbre rendu, donc la liste « Préréglages actuels » de `docs/architecture.md` reste juste telle quelle. - Gardes : les quatre nouveaux fichiers mockent `react-i18next` par `i18nMock()` et n'écrivent aucun faux `t` ; `native-dialog-guard` ne lit pas les tests, et `elementTree.ts` ne mentionne aucune confirmation. - Compte des utilisateurs du harnais rejoué avec le `grep` cité : 25 au 2026-10-23. Copies locales restantes rejouées : 16 fichiers ; les sept fichiers de la PR n'en définissent aucune (`grep` exit 1). - Suite : sonde rc=1, puis `npm run build` vert et `npm test` vert sur `719588f` (161 fichiers, 2610 tests). Lignes ajoutées sans `.only` ni `.skip`, sans donnée personnelle ni jeton. - Fermeture : la timeline de #467 porte une seule entrée `pull_ref` avec `closes`, venue de cette PR ; aucun autre verbe de fermeture dans le corps ni dans les commits. ## Constats (tous corrigés) 1. `src/test/elementTree.ts:22-26` sur `6e80525` (23-27 sur `719588f`) : le docblock affirmait qu'aucun des deux helpers n'appelle un composant de l'arbre, mais seul `find` avait un test. La mutation E7 (`holding` qui appelle les composants fonctions) restait verte sur `6e80525` (14 sur 14, exit 0). Corrigé par `719588f` : test « never calls a component of the tree: a holder its child renders is not there » dans `src/test/elementTree.test.ts` ; E7 rouge sur `719588f` (1 sur 15, exit 1). 2. `src/test/elementTree.ts:5-6` sur `6e80525` : « before #467, test files kept their own copy » laissait croire qu'aucun ne la garde encore, alors que 16 la gardent. Reformulé dans `719588f`. 3. Avant la PR (`244184c`) : les catégories des fixtures avaient un `sort_order` égal à leur identifiant, donc un gestionnaire qui aurait passé `sort_order` aurait passé l'assertion. Elles ont désormais des nombres distincts, et P3 le prouve. ## Suggestions (non bloquantes) - Migrer les 16 copies restantes de `find` / `holding` sur `src/test/elementTree.ts` (liste dans le corps de la PR) : des tests seulement, un travail mécanique. Trois d'entre elles prennent un type, qui s'écrit `find(tree, (el) => el.type === X)`. Cette issue de suivi est à décider par Max. - `texts()` (une ligne au-dessus de `find`) est écrit deux fois, dans `CategoryDetailPanel.delete.test.ts:95` et `AccountsPage.delete.test.ts:114`. Si un troisième fichier en a besoin, l'exporter depuis `elementTree.ts` demandera une décision, puisque le plan fixe l'API à `find` et `holding`. - Pour #451, maillon suivant : `holding(node, type)` rend le parent qui contient un élément du type. L'élément `UpsellDialog` lui-même s'obtient par `find(tree, (el) => el.type === UpsellDialog)`. - Le câblage du bouton de suppression dans les formulaires eux-mêmes (`onClick={onDelete}`, `CategoryForm.tsx:159` et `AdjustmentForm.tsx:179`) n'a aucun test : les tests de cette PR appellent la prop `onDelete` que le panneau donne au formulaire. Ce trou existait avant la PR et sort de son périmètre.
Author
Owner

CI lue par l'orchestrateur /autopilot du 2026-10-23 (pas une revue).

  • Tête : 719588f, run 621 PR Check — Frontend, statut combiné success.
  • Journal : npm ci (176 paquets), ✓ built in 11.16s, puis les fichiers de la PR : elementTree.test.ts (15 tests), CategoryDetailPanel.delete.test.ts (4), AccountsPage.delete.test.ts (4), TemplateActions.delete.test.ts (2), AdjustmentDetailPanel.delete.test.ts (2), ProfileFormModal.delete.test.ts (2), BudgetPage.wiring.test.ts (6) ; gardes native-dialog-guard.test.ts (34) et i18n-mock-guard.test.ts (5) vertes.
  • Test Files 161 passed (161), Tests 2610 passed (2610), Job succeeded : les comptes du corps de la PR (161 / 2610, contre 156 / 2583 sur la base 66d9aad).
CI lue par l'orchestrateur `/autopilot` du 2026-10-23 (pas une revue). - Tête : `719588f`, run 621 `PR Check — Frontend`, statut combiné `success`. - Journal : `npm ci` (176 paquets), `✓ built in 11.16s`, puis les fichiers de la PR : `elementTree.test.ts` (15 tests), `CategoryDetailPanel.delete.test.ts` (4), `AccountsPage.delete.test.ts` (4), `TemplateActions.delete.test.ts` (2), `AdjustmentDetailPanel.delete.test.ts` (2), `ProfileFormModal.delete.test.ts` (2), `BudgetPage.wiring.test.ts` (6) ; gardes `native-dialog-guard.test.ts` (34) et `i18n-mock-guard.test.ts` (5) vertes. - `Test Files 161 passed (161)`, `Tests 2610 passed (2610)`, `Job succeeded` : les comptes du corps de la PR (161 / 2610, contre 156 / 2583 sur la base `66d9aad`).
Author
Owner

Niveau : normal

Verdict : APPROVE

Résumé

Tests et doc seuls. Les quatre tests de suppression épinglent ce que chaque gestionnaire fait de la réponse de confirmAction, ce que confirment les mutations du relecteur (23 rouges sur 26, les trois survivantes expliquées plus bas), et src/test/elementTree.ts reprend à l'identique les deux copies qu'il remplace. Le critère « grep vide » de #467 n'est pas rempli ; la PR le dit, chiffres à l'appui : la suite est une décision de Max (D1), pas un défaut du code.

Niveau (Step 0bis, REVIEW.md de main)

  • src/test/elementTree.ts, src/test/elementTree.test.ts, les quatre *.delete.test.ts, ProfileFormModal.delete.test.ts, BudgetPage.wiring.test.ts : désignés par la ligne Haut « code livré : src/** », dont la condition n'est pas remplie (aucun appel réseau, aucune URL, aucun consentement, et l'app n'importe aucun de ces fichiers) → normal.
  • docs/architecture.md : « Restent au moins normaux » → normal.
  • Aucun fichier à la racine ni dans src-tauri/, aucun manifeste, lock, workflow ni configuration.

Rejoué (clone hors dépôt, tête 719588f, base 66d9aad)

  • npm ci, sonde rc=1 (expect(1).toBe(2), fichier retiré ensuite), npm run build rc=0 (tsc lit tout src/, tests compris, avec noUnusedLocals), npx vitest run : 161 fichiers et 2610 tests verts.
  • Journal de la CI 621 : HEAD is now at 719588f, Test Files 161 passed (161), Tests 2610 passed (2610). check-rust ne tourne pas : aucun fichier Rust touché.
  • Les deux fichiers migrés gardent leurs tests (2 et 6), sans assertion modifiée ; find et holding sont ceux des copies retirées, au typage près (générique P).
  • Comptes de docs/architecture.md, rejoués avec les commandes qu'il cite : 25 fichiers utilisent le harnais (21 sur la base et sur main), 16 gardent une copie locale (18 sur la base). Toutes ces copies sont des find : elementTree.ts porte désormais le seul holding du dépôt. Sur la tête, le grep du plan rend 18 lignes (les 16 copies, plus findCheckboxes et holdingRow), comme l'annonce le corps. Les sept fichiers ajoutés ou modifiés n'en définissent aucune (grep exit 1) et importent tous elementTree.
  • Pile : #493 porte ces comptes à 27 et 15 dans docs/architecture.md, cohérents avec sa tête.

Mutations du relecteur

Une à la fois sur le clone, restaurée par git checkout --, arbre propre après chacune. Elles diffèrent de celles du corps, sauf R20, rejouée pour contrôle. R1 à R19 lancent le test du site ; R20 y ajoute native-dialog-guard.test.ts ; R21 à R26 lancent elementTree.test.ts et les six fichiers qui l'importent (35 tests).

# Fichier Mutation Rouges rc
R1 CategoryDetailPanel.tsx message de confirmation changé (categories.editCategory) 4/4 1
R2 CategoryDetailPanel.tsx onDelete appelé avant la réponse 1/4 (refus) 1
R3 CategoryDetailPanel.tsx count lu dans keyword_count au lieu du résultat 2/4 1
R4 CategoryDetailPanel.tsx message posé quand la suppression n'est pas bloquée 3/4 1
R5 CategoryDetailPanel.tsx réponse attendue puis ignorée 1/4 (refus) 1
R6 AdjustmentDetailPanel.tsx message de confirmation changé 2/2 1
R7 AdjustmentDetailPanel.tsx onDelete appelé deux fois 1/2 1
R8 AdjustmentDetailPanel.tsx réponse ignorée 1/2 (refus) 1
R9 TemplateActions.tsx e.stopPropagation() retiré 2/2 1
R10 TemplateActions.tsx message de confirmation changé 2/2 1
R11 TemplateActions.tsx chaque bouton supprime le dernier modèle 0/2 (S1) 0
R12 TemplateActions.tsx réponse ignorée (|| true) 1/2 (refus) 1
R13 AccountsPage.tsx message de confirmation changé 2/4 1
R14 AccountsPage.tsx is_seed retiré du disabled 1/4 (seed) 1
R15 AccountsPage.tsx noms : le premier compte lié seulement 1/4 (comptes liés) 1
R16 AccountsPage.tsx seuil du « … » passé de > 3 à > 2 0/4 0
R17 AccountsPage.tsx removeCategory avant la réponse 1/4 (refus) 1
R18 AccountsPage.tsx comptes liés cherchés par sort_order dans le gestionnaire 1/4 (comptes liés) 1
R19 AccountsPage.tsx remise à null du message, en tête du gestionnaire, retirée 0/4 0
R20 AccountsPage.tsx await retiré (P1 du corps) 2/38 : refus + native-dialog-guard 1
R21 elementTree.ts find ne descend plus sous un élément gardé 3/35 1
R22 elementTree.ts holding ne descend plus sous un porteur 1/35 1
R23 elementTree.ts holding : some → every 15/35 1
R24 elementTree.ts find traverse les fragments sans les présenter au prédicat 1/35 1
R25 elementTree.ts holding ignore un props.children en tableau 7/35 1
R26 elementTree.ts find ne lit que le premier élément d'un tableau 21/35 1

Survivantes :

  • R11 : le test clique le second de deux modèles, qui est aussi le dernier. Un gestionnaire qui supprime toujours le dernier modèle passe, par exemple une fermeture qui capte la dernière valeur d'une boucle. Voir S1.
  • R16 et R19 : chemins que l'interface n'atteint pas. Le bouton d'une catégorie qui a des comptes liés est disabled (même calcul que le gestionnaire), donc le message has_accounts n'est jamais posé dans l'app et sa remise à null ne change rien ; le seuil du « … » ne se distingue qu'à partir de trois comptes liés. Rien à demander.

Constats bloquants

Aucun.

Suggestions (non bloquantes)

  • S1 src/components/budget/TemplateActions.delete.test.ts:33-34 et :67-75 : avec trois modèles et le bouton du milieu, R11 rougit, et T3 (templates[0].id) reste rouge.
  • S2 src/test/elementTree.ts:15-21 : la lecture sur un niveau de holding est documentée et épinglée, mais une absence prouvée par holding peut être vide : dans <td>{label}{rows}</td>, un Trash2 de rows n'est pas vu. Aucun appel actuel n'affirme une absence avec holding (tous en toHaveLength(1) ou toHaveLength(2), et les absences du dépôt passent par find). Une phrase du docblock suffit : une absence se prouve avec find.

Décision pour Max

D1. Critère de #467 non rempli : « grep -rn "function holding\|function find" src --include='*.test.*' ne rend plus rien ». Le plan comptait deux copies ; la base en a 18, dont trois find qui prennent un type. La PR migre les deux que nomme le plan et le dit dans son corps et dans docs/architecture.md (commande et compte). Resolves #467 ferme l'issue au merge. Trois voies :

  1. merger tel quel et ouvrir une issue de suivi pour les 16 copies (tests seuls, travail mécanique ; les trois find par type deviennent des prédicats) : c'est ce que propose le corps ;
  2. merger tel quel sans issue : la ligne de docs/architecture.md reste la seule trace des 16 copies ;
  3. étendre cette PR aux 16 fichiers avant le merge : neuf fois la liste de fichiers du plan, et un second tour de revue.

Fermeture

La timeline de #467 porte une seule entrée pull_ref en closes, venue de cette PR ; #490, #491 et #493 ne font que citer #467. Resolves #467 figure aussi dans les messages de 6e80525 et 719588f : un merge en avance rapide (/merge-stack) ferme l'issue lui aussi. Commits au format conventionnel.

Pile

La base, #491, est en REQUEST_CHANGES (commentaire 27073), pour du texte seulement. Si la correction se fait sur sa branche, cette PR sera à rebaser. Le seul fichier commun, docs/architecture.md, change aux lignes 664-666 ici, et la correction B2 de #491 vise sa ligne 693 : aucun conflit attendu. Un rebase qui laisse identique le diff de cette PR contre sa base ne demande pas de second tour.

Actions faites

  • Clone /tmp/pr492-review et fichiers /tmp/pr492-* supprimés en fin de revue ; aucun fichier du dépôt touché.
  • #467 : status:review → status:approved.
  • Relevé du pilote #458 (commentaire 24819) : ligne 18 (#491, reprise de son verdict 27073, que sa revue n'avait pas reportée) et ligne 19 (cette PR).
Niveau : normal **Verdict : APPROVE** ## Résumé Tests et doc seuls. Les quatre tests de suppression épinglent ce que chaque gestionnaire fait de la réponse de `confirmAction`, ce que confirment les mutations du relecteur (23 rouges sur 26, les trois survivantes expliquées plus bas), et `src/test/elementTree.ts` reprend à l'identique les deux copies qu'il remplace. Le critère « `grep` vide » de #467 n'est pas rempli ; la PR le dit, chiffres à l'appui : la suite est une décision de Max (D1), pas un défaut du code. ## Niveau (Step 0bis, `REVIEW.md` de `main`) - `src/test/elementTree.ts`, `src/test/elementTree.test.ts`, les quatre `*.delete.test.ts`, `ProfileFormModal.delete.test.ts`, `BudgetPage.wiring.test.ts` : désignés par la ligne Haut « code livré : `src/**` », dont la condition n'est pas remplie (aucun appel réseau, aucune URL, aucun consentement, et l'app n'importe aucun de ces fichiers) → normal. - `docs/architecture.md` : « Restent au moins normaux » → normal. - Aucun fichier à la racine ni dans `src-tauri/`, aucun manifeste, lock, workflow ni configuration. ## Rejoué (clone hors dépôt, tête `719588f`, base `66d9aad`) - `npm ci`, sonde rc=1 (`expect(1).toBe(2)`, fichier retiré ensuite), `npm run build` rc=0 (`tsc` lit tout `src/`, tests compris, avec `noUnusedLocals`), `npx vitest run` : 161 fichiers et 2610 tests verts. - Journal de la CI 621 : `HEAD is now at 719588f`, `Test Files 161 passed (161)`, `Tests 2610 passed (2610)`. `check-rust` ne tourne pas : aucun fichier Rust touché. - Les deux fichiers migrés gardent leurs tests (2 et 6), sans assertion modifiée ; `find` et `holding` sont ceux des copies retirées, au typage près (générique `P`). - Comptes de `docs/architecture.md`, rejoués avec les commandes qu'il cite : 25 fichiers utilisent le harnais (21 sur la base et sur `main`), 16 gardent une copie locale (18 sur la base). Toutes ces copies sont des `find` : `elementTree.ts` porte désormais le seul `holding` du dépôt. Sur la tête, le `grep` du plan rend 18 lignes (les 16 copies, plus `findCheckboxes` et `holdingRow`), comme l'annonce le corps. Les sept fichiers ajoutés ou modifiés n'en définissent aucune (`grep` exit 1) et importent tous `elementTree`. - Pile : #493 porte ces comptes à 27 et 15 dans `docs/architecture.md`, cohérents avec sa tête. ## Mutations du relecteur Une à la fois sur le clone, restaurée par `git checkout --`, arbre propre après chacune. Elles diffèrent de celles du corps, sauf R20, rejouée pour contrôle. R1 à R19 lancent le test du site ; R20 y ajoute `native-dialog-guard.test.ts` ; R21 à R26 lancent `elementTree.test.ts` et les six fichiers qui l'importent (35 tests). | # | Fichier | Mutation | Rouges | rc | |---|---|---|---|---| | R1 | `CategoryDetailPanel.tsx` | message de confirmation changé (`categories.editCategory`) | 4/4 | 1 | | R2 | `CategoryDetailPanel.tsx` | `onDelete` appelé avant la réponse | 1/4 (refus) | 1 | | R3 | `CategoryDetailPanel.tsx` | `count` lu dans `keyword_count` au lieu du résultat | 2/4 | 1 | | R4 | `CategoryDetailPanel.tsx` | message posé quand la suppression n'est pas bloquée | 3/4 | 1 | | R5 | `CategoryDetailPanel.tsx` | réponse attendue puis ignorée | 1/4 (refus) | 1 | | R6 | `AdjustmentDetailPanel.tsx` | message de confirmation changé | 2/2 | 1 | | R7 | `AdjustmentDetailPanel.tsx` | `onDelete` appelé deux fois | 1/2 | 1 | | R8 | `AdjustmentDetailPanel.tsx` | réponse ignorée | 1/2 (refus) | 1 | | R9 | `TemplateActions.tsx` | `e.stopPropagation()` retiré | 2/2 | 1 | | R10 | `TemplateActions.tsx` | message de confirmation changé | 2/2 | 1 | | R11 | `TemplateActions.tsx` | chaque bouton supprime le **dernier** modèle | **0/2** (S1) | 0 | | R12 | `TemplateActions.tsx` | réponse ignorée (`\|\| true`) | 1/2 (refus) | 1 | | R13 | `AccountsPage.tsx` | message de confirmation changé | 2/4 | 1 | | R14 | `AccountsPage.tsx` | `is_seed` retiré du `disabled` | 1/4 (seed) | 1 | | R15 | `AccountsPage.tsx` | noms : le premier compte lié seulement | 1/4 (comptes liés) | 1 | | R16 | `AccountsPage.tsx` | seuil du « … » passé de `> 3` à `> 2` | **0/4** | 0 | | R17 | `AccountsPage.tsx` | `removeCategory` avant la réponse | 1/4 (refus) | 1 | | R18 | `AccountsPage.tsx` | comptes liés cherchés par `sort_order` dans le gestionnaire | 1/4 (comptes liés) | 1 | | R19 | `AccountsPage.tsx` | remise à `null` du message, en tête du gestionnaire, retirée | **0/4** | 0 | | R20 | `AccountsPage.tsx` | `await` retiré (P1 du corps) | 2/38 : refus + `native-dialog-guard` | 1 | | R21 | `elementTree.ts` | `find` ne descend plus sous un élément gardé | 3/35 | 1 | | R22 | `elementTree.ts` | `holding` ne descend plus sous un porteur | 1/35 | 1 | | R23 | `elementTree.ts` | `holding` : `some` → `every` | 15/35 | 1 | | R24 | `elementTree.ts` | `find` traverse les fragments sans les présenter au prédicat | 1/35 | 1 | | R25 | `elementTree.ts` | `holding` ignore un `props.children` en tableau | 7/35 | 1 | | R26 | `elementTree.ts` | `find` ne lit que le premier élément d'un tableau | 21/35 | 1 | Survivantes : - **R11** : le test clique le second de deux modèles, qui est aussi le dernier. Un gestionnaire qui supprime toujours le dernier modèle passe, par exemple une fermeture qui capte la dernière valeur d'une boucle. Voir S1. - **R16** et **R19** : chemins que l'interface n'atteint pas. Le bouton d'une catégorie qui a des comptes liés est `disabled` (même calcul que le gestionnaire), donc le message `has_accounts` n'est jamais posé dans l'app et sa remise à `null` ne change rien ; le seuil du « … » ne se distingue qu'à partir de trois comptes liés. Rien à demander. ## Constats bloquants Aucun. ## Suggestions (non bloquantes) - **S1** `src/components/budget/TemplateActions.delete.test.ts:33-34` et `:67-75` : avec trois modèles et le bouton du milieu, R11 rougit, et T3 (`templates[0].id`) reste rouge. - **S2** `src/test/elementTree.ts:15-21` : la lecture sur un niveau de `holding` est documentée et épinglée, mais une absence prouvée par `holding` peut être vide : dans `<td>{label}{rows}</td>`, un `Trash2` de `rows` n'est pas vu. Aucun appel actuel n'affirme une absence avec `holding` (tous en `toHaveLength(1)` ou `toHaveLength(2)`, et les absences du dépôt passent par `find`). Une phrase du docblock suffit : une absence se prouve avec `find`. ## Décision pour Max **D1. Critère de #467 non rempli :** « `grep -rn "function holding\|function find" src --include='*.test.*'` ne rend plus rien ». Le plan comptait deux copies ; la base en a 18, dont trois `find` qui prennent un type. La PR migre les deux que nomme le plan et le dit dans son corps et dans `docs/architecture.md` (commande et compte). `Resolves #467` ferme l'issue au merge. Trois voies : 1. merger tel quel et ouvrir une issue de suivi pour les 16 copies (tests seuls, travail mécanique ; les trois `find` par type deviennent des prédicats) : c'est ce que propose le corps ; 2. merger tel quel sans issue : la ligne de `docs/architecture.md` reste la seule trace des 16 copies ; 3. étendre cette PR aux 16 fichiers avant le merge : neuf fois la liste de fichiers du plan, et un second tour de revue. ## Fermeture La timeline de #467 porte une seule entrée `pull_ref` en `closes`, venue de cette PR ; #490, #491 et #493 ne font que citer #467. `Resolves #467` figure aussi dans les messages de `6e80525` et `719588f` : un merge en avance rapide (`/merge-stack`) ferme l'issue lui aussi. Commits au format conventionnel. ## Pile La base, #491, est en `REQUEST_CHANGES` (commentaire 27073), pour du texte seulement. Si la correction se fait sur sa branche, cette PR sera à rebaser. Le seul fichier commun, `docs/architecture.md`, change aux lignes 664-666 ici, et la correction B2 de #491 vise sa ligne 693 : aucun conflit attendu. Un rebase qui laisse identique le diff de cette PR contre sa base ne demande pas de second tour. ## Actions faites - Clone `/tmp/pr492-review` et fichiers `/tmp/pr492-*` supprimés en fin de revue ; aucun fichier du dépôt touché. - #467 : `status:review` → `status:approved`. - Relevé du pilote #458 (commentaire 24819) : ligne 18 (#491, reprise de son verdict 27073, que sa revue n'avait pas reportée) et ligne 19 (cette PR).
maximus force-pushed issue-467-confirm-behaviour-tests from 719588ffe2
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 2m11s
to 483f886ac0
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 2m53s
2026-10-24 13:06:50 +00:00
Compare
Author
Owner

Rebasée le 2026-10-24 par la session principale, sans changement de son diff.

  • La base #491 a reçu deux commits après sa revue 27073 (REQUEST_CHANGES, texte seulement) : 90a9a52 (B1, ligne « Migration repair failed: » passée par withoutFolders, décision de Max) et f02169c (B2, limite décrite telle qu'elle reste). Cette PR a été rebasée dessus : ancienne tête 719588f, nouvelle tête 483f886.
  • git range-diff 66d9aad..719588f f02169c..483f886 : les cinq commits sont identiques (=). Le diff de la PR contre sa base est identique à celui que la revue 27088 a relu, aux lignes index près.
  • CI 627 verte sur 483f886 : 161 fichiers, 2611 tests (2610 avant, plus le test de B1 venu de la base).
  • Pas de second tour : le verdict 27088 (APPROVE) porte sur ce diff.
Rebasée le 2026-10-24 par la session principale, sans changement de son diff. - La base #491 a reçu deux commits après sa revue 27073 (`REQUEST_CHANGES`, texte seulement) : `90a9a52` (B1, ligne « Migration repair failed: » passée par `withoutFolders`, décision de Max) et `f02169c` (B2, limite décrite telle qu'elle reste). Cette PR a été rebasée dessus : ancienne tête `719588f`, nouvelle tête `483f886`. - `git range-diff 66d9aad..719588f f02169c..483f886` : les cinq commits sont identiques (`=`). Le diff de la PR contre sa base est identique à celui que la revue 27088 a relu, aux lignes `index` près. - CI 627 verte sur `483f886` : 161 fichiers, 2611 tests (2610 avant, plus le test de B1 venu de la base). - Pas de second tour : le verdict 27088 (APPROVE) porte sur ce diff.
maximus changed target branch from issue-478-journal-folder-stops to main 2026-10-24 18:10: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!492
No description provided.