Skip to content

Lieux: edit a location (fix typos / dimensions / parent)#90

Merged
guycorbaz merged 1 commit into
mainfrom
feat/location-edit
Jun 9, 2026
Merged

Lieux: edit a location (fix typos / dimensions / parent)#90
guycorbaz merged 1 commit into
mainfrom
feat/location-edit

Conversation

@guycorbaz

Copy link
Copy Markdown
Owner

Follow-up to the location-delete work (#89). A location couldn't be corrected after creation — e.g. a name typo. This adds editing, mirroring the crop edit form (#88).

Changes

  • Each location row gets a Modifier button → loads the location into the form (edit mode: title "Modifier le lieu", Enregistrer / Annuler). Save updates the existing location instead of creating a new one.
  • App: update_location (reuses Location::new validation, keeps the original id) and get_location_for_edit. Reparenting under a descendant is rejected by the repository's existing cycle check and surfaced as a localized message (error-location-cycle).
  • New i18n keys (fr/en): edit section title, "updated" status, cycle error.

Verification

  • App tests: update_location_changes_name, update_location_rejects_parent_cycle.
  • cargo test --workspace (337) green, cargo clippy --workspace --all-targets + cargo fmt --check clean.

🤖 Generated with Claude Code

Follow-up to the location-delete work: a location couldn't be corrected
after creation (e.g. a name typo). Add edit, mirroring the crop edit form.

- Each location row gets a Modifier button; it loads the location into the
  form (edit mode: title "Modifier le lieu", Save / Cancel). Save updates the
  existing location instead of creating a new one.
- App: `update_location` (reuses `Location::new` validation, keeps the id) and
  `get_location_for_edit`. Reparenting under a descendant is rejected by the
  repo's cycle check and surfaced as a localized message
  (`error-location-cycle`).
- New i18n keys (fr/en): edit section title, updated status, cycle error.

Tests: `update_location_changes_name`, `update_location_rejects_parent_cycle`.
Workspace green (337), clippy + fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@guycorbaz guycorbaz merged commit ce39c2a into main Jun 9, 2026
5 checks passed
@guycorbaz guycorbaz deleted the feat/location-edit branch June 9, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant