feat(import): warn about the CSV files placed directly in the import folder (#427) #440
No reviewers
Labels
No labels
autopilot:pending-human
source:analyste
source:defenseur
source:human
source:medic
status:approved
status:blocked
status:in-progress
status:needs-clarification
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#440
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-427-root-files-warning"
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?
Generated autonomously by /autopilot run of 2026-10-13
Milestone
planned-2026-10-12-retours-onboarding-v0171, link 3 of 8 (T3). Stacked on #439 (issue-422-import-per-account).What
A CSV/TXT file placed directly in the import folder was skipped without a word. The scan now returns those files, and the Import page names them in a warning.
scan_import_folderreturnsImportFolderScan { sources, root_files }.root_fileslists the non-hidden files at the root with acsv/txtextension (any case, the samehas_statement_extensionrule as the subfolders), sorted by name. The command is now documented.ImportFolderScan;SET_SCANNED_SOURCEStakes the whole scan and setsscannedSourcesandrootFilestogether;RESETkeeps both (review caveat of the plan); a new scan replaces both. Exposed asstate.rootFiles.formatRootFiles(names, max = 5)→{ shown, more }(src/utils/rootFiles.ts).RootFilesWarning:AlertTriangle(aria-hidden), no live region, messageimport.rootFiles.message_one/_otherwith{{folder}}= last segment of the folder (never the path) and{{names}}= five names thenimport.rootFiles.more.ImportPage: above the source list when there are sources, under the "no source" empty state otherwise, never without a folder, never on the wizard steps, never before the folder is read.docs.import.tips(FR/EN) + guide (Import tips),architecture.md(command line,useImportWizardrow), three QA cases in the "Retours de la v0.17.1" section ofdocs/qa-onboarding.html. CHANGELOG Added / Ajouté in both files.Files
src-tauri/src/commands/fs_commands.rs(command + 5 tests),src/shared/types/index.ts,src/hooks/useImportWizard.ts+.test.ts+.mount.test.ts,src/utils/rootFiles.ts+ test,src/components/import/RootFilesWarning.tsx+.test.tsx+.locales.test.tsx,src/pages/ImportPage.tsx+.render.test.tsx,src/i18n/locales/fr.json,en.json,docs/architecture.md,docs/guide-utilisateur.md,docs/qa-onboarding.html,CHANGELOG.md,CHANGELOG.fr.md.Decisions
rootFilesexposed throughstate, likescannedSources.has_statement_extension, shared by root and subfolders.RootFilesWarning.locales.test.tsx): the marked faketcannot see the_one/_otherresolution nor the quotes.### Addedsection, first under [Unreleased].Acceptance criteria → proof
a.csvat root +visa/→ source + warning naminga.csvlists_the_root_statement_files_sorted_by_name;ImportPage.render"with sources"ImportPage.render"without source"root_files.sort()removedignores_other_extensions_and_hidden_files_at_the_rootroot_filesrootFilesformatRootFiles0/1/5/7; warning testsmore_othercollapsed to singularlogInfoof the root files addedValidation:
npm run buildgreen,npm test125 files / 2112 tests,cargo test267 passed (1 ignored). No migration, no network call.🤖 Generated with Claude Code
scan_import_folder now returns ImportFolderScan { sources, root_files }: the CSV/TXT files at the root, which no source reads, are named in a warning on the Import page (above the source list, or under the "no source" empty state). One action sets sources and root files, RESET keeps both. Names stay on screen, never in the Journal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Self-review (autopilot worker, not an independent review) — verdict: APPROVE
Diff read in full against
issue-422-import-per-account(head2de4d9d).Acceptance criteria
a.csvat the root +visa/: sourcevisaand the warning naminga.csv, above the list (Rust test +ImportPage.render, mutation M5 red).RESET("Cancel", "Done") keeps both (reducer tests, M1/M2 red).cargo test(267 passed, 1 ignored),npm run build,npm test(125 files / 2112 tests) green.Security — names and folder stay on screen;
{{folder}}isfolderNameFromPath, never the path (render test assertsfolder=/homeis absent). No new Tauri command, no new capability, no network call. The scan error text (with the path) still goes to the on-screen error banner, unchanged from before.Correctness / regressions — single caller of
scan_import_folder(scanFolderInternal), updated; the reducer test fixtures of #356/#384 moved to the new payload shape with no assertion changed. The extension rule is one function for root and subfolders, so the case rule cannot drift. Sorting is byte order, as for the sources.i18n — four keys FR/EN word for word from the plan, plural forms checked through the real locales (
RootFilesWarning.locales.test.tsx, M8 red onmore_other);docs.import.tipsappended last in both locales and the same tip in the guide.CHANGELOG / docs — Added / Ajouté in both files;
architecture.mdcommand line as worded in the plan +useImportWizardrow; three QA cases appended to "Retours de la v0.17.1". No migration touched.For the reviewer — the warning uses the accent border of the duplicate-rows notice rather than the error banner's negative border (nothing failed); under the empty state it is wrapped in
mt-4. The Rust sort test relies onread_dirorder differing from name order to prove the sort (R1 went red on ext4 here).CI lue par l'orchestrateur sur la tête
2de4d9d:windows-sys9 vérifications à 0,cargo test267 passés et 1 ignoré (comptes égaux à ceux du worker).Generated autonomously by /autopilot run of 2026-10-13
/pr-review — APPROVE
Résumé : le scan rend les CSV/TXT de la racine, une seule action pose sources et
rootFiles,RESETgarde les deux, et l'avertissement s'affiche aux deux endroits prévus, avec le dernier segment du dossier et sans rien écrire au Journal. Conforme au corps de #427, textes FR/EN mot pour mot.Exécuté par le relecteur (worktree
npm cipropre sur2de4d9d)vitest run: 125 fichiers, 2112 tests verts.cargo test --lib scan_import_folder_tests: 5 verts. CI de la tête verte (frontend et rust, statut agrégésuccess).count= nombre de noms affichés au lieu du totalfolderNamelogInfodes noms de la racine après le scanlogInfodu chemin du dossier après le scanroot_filespath.is_file()retiré de la garde de la racine!path.is_dir(), seul un lien cassé ou une entrée spéciale la distingueUne première version de la mutation du Journal appelait
logWarn, non importé : l'erreur partait dans lecatchet le test restait vert. Refaite aveclogInfo, déjà importé : rouge. Le test du Journal tient donc.Suggestions (non bloquantes)
Resolves #427n'est que dans le message du commit2de4d9d, pas dans le corps de la PR ; la timeline de #427 porteref_action: "none"pour cette PR. Un merge ff (commits poussés surmain) fermera l'issue ; l'ajouter au corps rend la fermeture indépendante du chemin de merge.SET_ERRORgarde lesrootFilesdu scan précédent, alors queimportFoldera déjà changé, donc l'avertissement peut nommer d'anciens fichiers sous le nom du nouveau dossier. Même comportement quescannedSourcesavant cette PR, et le test « a scan error leaves the root files of the last scan in place » l'épingle exprès : à garder en tête plutôt qu'à corriger ici.Aucune migration, aucun secret, pas de
skip/only, commits au format conventionnel.maximus referenced this pull request2026-10-16 00:38:40 +00:00