Skip to content

Add past entries from the History screen - #71

Merged
SamiPr0 merged 3 commits into
mainfrom
feat/import-history
Oct 6, 2026
Merged

SamiPr0 merged 3 commits into
mainfrom
feat/import-history

Conversation

@SamiPr0

@SamiPr0 SamiPr0 commented Oct 6, 2026

Copy link
Copy Markdown
Owner

What

Lets the user back-fill pool entries they forgot to log, from a new Add past entry button on the History screen.

  • One bottom sheet: Today / Yesterday shortcuts, a day picker (future days disabled) and a time picker.
  • Inline error in the sheet if the time hasn't happened yet or an entry already exists at that exact time.
  • On success the sheet closes and an Entry added · Undo snackbar appears.
  • The sheet remembers the last day and time used, so adding several entries from one day is quick.
  • The list leaves room under the button so it never covers the last row.
  • The entry is linked to the subscription that was valid at that time (added by then, not yet expired).

HistoryViewModel now also takes a SubscriptionRepository (interface, defaulting to the provider), so no Firebase import is added.

Tests

  • ViewModel: add, subscription linking, future refused, duplicate refused, result cleared.
  • Robolectric UI: sheet opens, entry added + snackbar, undo, inline duplicate error.
  • Instrumented HistoryScreenTest: sheet opens (not run here: no emulator was driven from this session).
  • ./gradlew check and ktfmtCheck pass locally.

Not in this PR

Importing a whole history from the provider's "Historique de la consommation" PDF will follow as a separate PR, as it needs a PDF text-reading library.

🤖 Generated with Claude Code

SamiPr0 and others added 3 commits October 6, 2026 22:27
Back-fill an entry that was forgotten at the time. Refuse future times
and exact duplicates, and link the entry to the subscription that was
valid then, reporting the outcome so the UI can offer an undo.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
One sheet with Today/Yesterday shortcuts, a day and a time picker
(future days disabled), inline errors, and an Undo snackbar. It
remembers the last day and time used.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Give the instrumented test its own subscription repository now that
the ViewModel needs one, and check the add button opens the sheet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@SamiPr0
SamiPr0 merged commit c0634fe into main Oct 6, 2026
3 checks passed
@SamiPr0 SamiPr0 mentioned this pull request Oct 6, 2026
@SamiPr0
SamiPr0 deleted the feat/import-history branch October 7, 2026 21:57
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