Skip to content

Edit the distance of an entry - #101

Merged
SamiPr0 merged 2 commits into
mainfrom
feat/edit-entry-distance
Oct 9, 2026
Merged

SamiPr0 merged 2 commits into
mainfrom
feat/edit-entry-distance

Conversation

@SamiPr0

@SamiPr0 SamiPr0 commented Oct 9, 2026

Copy link
Copy Markdown
Owner

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 ktfmtCheck is 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

SamiPr0 and others added 2 commits October 9, 2026 23:31
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>
@SamiPr0
SamiPr0 merged commit 3ff942e into main Oct 9, 2026
3 checks passed
@SamiPr0 SamiPr0 mentioned this pull request Oct 9, 2026
@SamiPr0
SamiPr0 deleted the feat/edit-entry-distance branch October 9, 2026 22:29
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