Repository navigation
Edit the distance of an entry - #101
Merged
Merged
Conversation
Starts from the logged distance, keeps only digits within the allowed length, and saves through the existing record-distance call. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A pencil in the top bar opens a dialog with a numeric field, prefilled with the current distance; Save is disabled until it is a valid number. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merged
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.
What
A pencil button in the top bar of the entry details opens an Edit distance dialog: a numeric field prefilled with the current distance (empty if none was logged). Save is disabled until it is a valid whole number of metres (same rule as logging a swim: 1 to 50 000); Cancel changes nothing. It also works for entries that have no distance yet.
It goes through the existing
recordSwimDistance, so the change is backed up like any other.Tests
View-model tests (start value, digits-only and length limit, validity, save replaces only the loaded entry, add to an entry without one, invalid input and cancel change nothing) and screen tests for the dialog.
./gradlew check ktfmtCheckis green locally and I tried it on an emulator (700 m → 750 m).Not in this PR
Editing the date/time or the swim duration. The entry's timestamp is part of its identity (and its backup id), so changing it needs more care.
🤖 Generated with Claude Code