feat(categories): categories standard guide page (#117) #129
No reviewers
Labels
No labels
source:analyste
source:defenseur
source:human
source:medic
status:approved
status:blocked
status:in-progress
status:needs-fix
status:ready
status:review
status:triage
type:bug
type:feature
type:infra
type:refactor
type:schema
type:security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: maximus/Simpl-Resultat#129
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-117-categories-standard-guide"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #117
Summary
Livraison 1 of the IPC category refactor — a read-only Settings page that exposes the full v1 IPC taxonomy.
Checklist from issue
/settings/categories/standardadded insrc/App.tsx(English-style path to stay consistent with the rest of the router —/settings,/categories,/changelog, ...)src/pages/CategoriesStandardGuidePage.tsxcreatedwindow.print()+ dedicated@media printrule that forces every branch expanded and hides toolbar/back linkCategoriesCardcomponent wired intoSettingsPagecategoriesSeed.guidePage.*andsettings.categoriesCard.*[Unreleased]/AddedNotes
useCategoryTaxonomy()hook from #116.CategoryTaxonomyTreecomponent factored undersrc/components/categories/for reuse by future Livraison 2 (migration wizard Step 1).Test plan
npx tsc --noEmit— cleannpx vitest run— 148/148 passingnpx vite build— clean buildAdds a read-only Settings subpage at /settings/categories/standard that exposes the full v1 IPC category taxonomy: - Recursive tree with per-root expand/collapse (chevron buttons), clickable only via the disclosure caret — no destructive actions anywhere on the page. - Live counter banner: roots / subcategories / leaves / total, computed from the bundled categoryTaxonomyV1 JSON. - Accent- and case-insensitive full-text search over translated names; matching nodes keep their ancestor chain visible, non-matching branches are pruned from the visible tree. - Hover tooltips (native `title`) showing i18n_key, type (income / expense / transfer — translated) and numeric id of each node — useful for power-users cross-referencing the consolidated schema. - Export as PDF button that triggers window.print(); a dedicated @media print rule in styles.css forces every branch to render fully expanded during printing regardless of the on-screen collapse state, and hides the toolbar / back-link. - All labels resolve via t(node.i18n_key, { defaultValue: node.name }) to be forward-compatible with future user-created taxonomy rows that have no i18n_key. Also: - New CategoriesCard in Settings that links to the page (FolderTree icon, consistent with the userGuide / changelog card pattern). - i18n keys added under categoriesSeed.guidePage.* and settings.categoriesCard.* (FR + EN). - CHANGELOG.md + CHANGELOG.fr.md updated under [Unreleased] / Added. Route uses the English-style `/settings/categories/standard` to match the rest of the app (/settings, /categories, /changelog, ...). The original spec mentions a French-accented path but the existing router is English-only; documenting here so reviewers can see the decision. No SQL migration, no schema change, no write to the database — this is strictly a read-only view on the TS-side taxonomy bundle. Type-check clean (tsc --noEmit), 148/148 vitest tests pass, vite build succeeds.Self-review — APPROVE
Security
dangerouslySetInnerHTML. All user-facing text is rendered as React text children (auto-escaped). Nativetitleattribute for tooltips (string, not HTML).window.open, nofetch, no Tauri invoke.window.print()is the only browser API call, which is benign.src-tauri/changes).Correctness
collectVisibleIdspass.t(node.i18n_key, { defaultValue: node.name })ensures no crash / empty render if a translation key is ever missing.countNodestraverses root → subcategory → leaf explicitly (matches v1 taxonomy shape). Edge case of a direct leaf under a root is handled.Print
@media printoverride flips.taxonomy-children-collapsed { display: block !important; }so every branch is fully expanded on paper regardless of the screen collapse state.print:hidden, matching the DocsPage pattern.print:hiddentoo — clean PDF output, no stray carets.break-inside: avoidapplied to.taxonomy-nodereduces awkward breaks mid-branch.Quality
countNodes,collectAllIds,normalize,collectVisibleIds) are pure and testable in isolation.CategoryTaxonomyTreeis decoupled from the page shell — directly reusable by Livraison 2 (migration wizard, Step 1 Discover).--card,--border,--muted,--primary, etc.). Icons come from the already-importedlucide-react.categoriesSeed.guidePage.*andsettings.categoriesCard.*. Key shapes verified symmetric.Data
src/data/categoryTaxonomyV1.json. ✅Tests
npx tsc --noEmit: clean.npx vitest run: 148/148 passing (no regression on pre-existing suites).npx vite build: 2555 modules transformed, clean build.Minor nits (non-blocking)
collectVisibleIds/normalize(pure helpers), but out of scope for Livraison 1 and easy to add later./paramètres/categories/standard. I used/settings/categories/standardto stay consistent with the rest of the router (all paths are English). Noted in the PR description.Conclusion: merge-ready.