Cultures: crop edit + delete, status feedback, dynamic variety title#88
Merged
Conversation
Pre-prod feedback on the Cultures screen: a created crop couldn't be edited (no affordance), and adding a variety appeared to do nothing (the required harvest-DOY fields were left empty — the 220/280 are placeholders — and the error wasn't obvious). - **Crop edit + delete** (mirrors the task-types pattern): each crop row now has Modifier / Supprimer buttons; Modifier loads the crop into the form (edit mode: dynamic title + Save/Cancel), Supprimer routes through the shared confirmation dialog (#61). App layer gains `update_crop`, `delete_crop` (FK-guarded: blocked when a variety is planted, surfaced as a localized "crop in use"), and `get_crop_for_edit`; `CropRow.in_use` disables Delete when the crop has a planted variety. - **Dynamic variety form title**: "Nouvelle variété annuelle/pluriannuelle" now follows the selected crop instead of being hardcoded to "annuelle". - The crop form's submit/cancel + new i18n keys (fr/en). Tests: update/delete/get_for_edit + the delete-refused-when-planted guard; workspace green (330), clippy + fmt clean. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-production feedback on the Cultures screen.
Problems reported
220/280shown are placeholders, not values — so creation failed validation. (The status banner is wired, but the message wasn't noticed; the form title also wrongly said "annuelle".)Neither is related to #86.
Changes
update_crop,delete_crop(FK-guarded — blocked when a variety is planted, surfaced as a localized "culture utilisée"),get_crop_for_edit.CropRow.in_usedisables Delete when the crop has a planted variety.Verification
cargo test --workspace(330),cargo clippy --workspace --all-targets,cargo fmt --check— all green.🤖 Generated with Claude Code