fix(import): name a source after its subfolder, read-only (#426) #441
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#441
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-426-source-name-folder"
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 4 of 8). Stacked on #440 (issue-427-root-files-warning).Issue #426: the closing keyword is in the last commit only.
What
A source was saved under the name typed in its configuration, but the next import looks the source, and its imported files, up by the subfolder name. A renamed source therefore looked new: its format was guessed again (against ADR 0019), every file was pre-checked, and a second source was created under the folder name.
SourceConfigPanel: the editable "Source name" field becomesSourceNameDisplay, a read-only display ofsource.folder_namewith the hintimport.config.sourceNameHint.executeImport: the guard at the top is nowif (!state.duplicateResult || !state.selectedSource) return;, and the saved name isstate.selectedSource.folder_name, on create and on update, whateverconfig.nameholds.state.selectedSourcewas added to the callback deps.config.namestays in place for its other readers (set to the folder name at its three write points).onboarding.card.import.sourceConfig: "Vérifiez les fichiers cochés, puis cliquez « {{button}} »." / "Check the selected files, then click “{{button}}”."docs.import.tipsentry and guide tip: "Le nom d'une source est celui de son sous-dossier" / "A source is named after its subfolder".No migration (v1→v17 unchanged), no Rust change, no new network call, no Journal line.
Files
src/components/import/SourceNameDisplay.tsx(new) andSourceNameDisplay.test.tsx(new)src/components/import/SourceConfigPanel.tsx,SourceConfigPanel.test.tsx(new)src/hooks/useImportWizard.ts,src/hooks/useImportWizard.executeImport.test.tssrc/i18n/locales/fr.json,src/i18n/locales/en.jsonCHANGELOG.md,CHANGELOG.fr.md(Fixed / Corrigé)docs/guide-utilisateur.md,docs/architecture.md,docs/qa-onboarding.html(casesv0171-import-source-name,v0171-import-source-reopen)Decisions
<span>and the name is a<p>: no<input>at all, even disabled or read-only, as the issue asks.SourceConfigPanelrender test is added (beyond the plan), so the panel wiring is pinned and not only the small component.docs/architecture.md: the import components count goes 16 → 18 (it was already off by one on the base, #427 did not bump it forRootFilesWarning); the global "61 composants" total, already drifted, is left as is.Proofs (one mutation at a time, restored by
git checkout --)createSource({ name: config.name })updateSource(id, { name: config.name })if (!state.duplicateResult) return;<input>inSourceNameDisplaySourceConfigPanelValidation in the worktree:
npm run buildgreen,npx vitest run127 files / 2119 tests green. No Rust touched.For the reviewer
getSourceByName(source.folder_name),importedFilesBySourcekeyed byimport_sources.name); the lookup path itself is unchanged and is checked by hand in the QA casev0171-import-source-reopen.🤖 Generated with Claude Code
Self-review (autopilot worker, not an independent review): APPROVE
Diff read against
issue-427-root-files-warning(13 files).Acceptance criteria
SourceConfigPanelrendersSourceNameDisplay(source.folder_namein a<p>, label as<span>, hintimport.config.sourceNameHint). Pinned bySourceNameDisplay.test.tsx(no<input>/<textarea>/contenteditable) andSourceConfigPanel.test.tsx(the configured nameMon compte chèquesappears nowhere; mutation M6, old input restored, goes red).selectedSource.folder_nameon create and update (M1, M2 red), the same key asgetSourceByName(source.folder_name)andimportedFilesBySource. The lookup path is unchanged; the end-to-end reopening is the manual QA casev0171-import-source-reopen.!state.selectedSource: nothing written, no dispatch (M3 red).state.selectedSourceadded to the callback deps.npm run buildgreen, vitest 127 files / 2119 tests green. No Rust touched.Checks
{{button}}throughStepCardText.labelswith « » / “ ”;onboardingPath.locales.test.tsstays green.[Unreleased].docs.import.tipslast entry (after #427's), architecture (component count,executeImportwrite), two QA cases.For the human reviewer
Ahad been renamedBand a folderBnow exists,getSourceByName("B")returns that old source as the existing source of folderB(same behaviour as before this PR; testers only).config.nameis still filled (at its three write points) and read byImportPage; it is no longer written to the database.CI lue par l'orchestrateur sur la tête
e177a75: PR Check — Frontend run 547 vert (build OK, vitest 127 fichiers / 2119 tests, comptes égaux à ceux du worker). Pas de job Rust attendu.Generated autonomously by /autopilot run of 2026-10-13
Verdict : APPROVE
Résumé. Le correctif tient :
executeImportécritselectedSource.folder_nameà la création comme à la mise à jour, le champ éditable disparaît au profit deSourceNameDisplay, et la clé d'écriture devient celle de la recherche (getSourceByName(source.folder_name),importedFilesBySource.get(folder_name)). Les autres lecteurs deconfig.name(bouton Suivant désactivé,sourceNamede la confirmation,applyConfigTemplate) reçoivent toujours le nom du dossier :freshle pose,restoredreprendexisting.name, égal au dossier par construction de la recherche.Preuves rejouées par le relecteur (copie hors dépôt de
e177a75, supprimée)tsc --noEmitvert,vitest run: 127 fichiers, 2119 tests verts. CI de la tête :PR Check — Frontendensuccess(statut agrégé).SourceNameDisplay folderName={config.name}dans le panneauSourceConfigPanel.test.tsx)sourceName = state.existingSource?.name ?? state.sourceConfig.nameexistingSource.namevaut le dossier par la recherchesourceNameHintretiré deen.jsonSuggestions (non bloquantes)
import.config.sourceNameHintdeen.jsonlaisse les 2119 tests verts (le fauxtmarqué rend la clé, pas sa valeur). Défaut préexistant, hors périmètre ; une garde de parité des clés FR/EN serait un suivi possible (#437 ou issue dédiée).pull_refencloses; seul le commite177a75(« Resolves #426 ») la fermera, à son arrivée surmain. Cohérent avec le merge ff de la pile ; à vérifier après le merge.<span>du libellé n'est rattaché à rien (pas de<label for>possible sans champ) ; unaria-describedbyn'apporte rien sur du texte statique, rien à faire, constat seulement.Hors périmètre (annoncé par la PR, confirmé)
Une source déjà renommée dans une base existante n'est plus retrouvée : le prochain import en crée une seconde sous le nom du dossier. Touche les testeurs seulement.
Actions faites
status:review→status:approved.maximus referenced this pull request2026-10-16 00:38:40 +00:00