Skip to content

feat: Film pick history - #68

Merged
Nacchofer31 merged 11 commits into
masterfrom
feature/history-picks
Aug 13, 2026
Merged

feat: Film pick history#68
Nacchofer31 merged 11 commits into
masterfrom
feature/history-picks

Conversation

@Nacchofer31

Copy link
Copy Markdown
Owner

Description

Adds a History screen where users can review every random film pick, with the ability to favorite movies, filter by favorites, and clear the whole history.

Every successful pick (submit or reroll) is now persisted locally with its full search context (users, search mode and selected genres), so the list shows exactly what led to that result.

Changes

Persistence

  • Rename UsernameDatabaseRandomBoxdDatabase (v1 → v2) with a migration that adds the film_history_entry table, preserving existing usernames on upgrade
  • New FilmHistoryDao, FilmHistoryEntry entity and FilmPick domain model
  • New FilmHistoryRepository + impl with CSV mappers and an injected Clock
  • Migration test covering v1 → v2 data preservation

UI

  • New History route + HistoryScreen with pick cards, relative timestamps (Today / Yesterday / N days ago), favorites-only filter, and a clear-confirmation dialog
  • History button added to the Random Film header
  • Localized strings for all 13 supported languages

Integration

  • RandomFilmViewModel snapshots the search context at submit time and saves each successful extraction fire-and-forget (storage failures never break the pick flow)
  • New kotlinx-datetime dependency; Room room-testing added for migration tests

Commits

  • chore(build): upgrade AGP and Gradle toolchain
  • feat(history): add film history persistence layer
  • feat(history): add history screen UI
  • feat(random-film): persist picks to history

Testing

  • Unit tests: HistoryViewModelTest, FilmHistoryRepositoryImplTest, FilmHistoryMappersTest, TimestampFormatterTest, plus RandomFilmViewModelTest coverage for the save hooks
  • Instrumented: MigrationTest (v1 → v2)

Bump AGP to 9.3.1 and Gradle to 9.5.0, and enable the Foojay toolchain resolver with daemon JVM 21.
Rename UsernameDatabase to RandomBoxdDatabase and migrate it to version 2, adding the film_history_entry table, FilmHistoryDao, and the FilmHistoryRepository with CSV mappers and kotlinx clock injection.
Add the History screen with pick list, favorites filter, clear confirmation dialog, and relative timestamp display. Wire it into navigation from the Random Film header and register the viewmodel in DI.
Save every successful submit and reroll extraction to the film history, snapshotting the search context (users, mode, genres) at submit time. The save is fire-and-forget so storage failures never break the pick flow.
@Nacchofer31 Nacchofer31 self-assigned this Aug 12, 2026
Cover HistoryCard, HistoryScreen, header, empty states, favorites filter, footer and clear dialog, previously at 0% coverage.
Advance the test scheduler so the updateFavorite coroutine runs and its lines are covered.
The chip label is conditionally hidden based on screen width (BoxWithConstraints), so CI's narrower AVD failed to find the text node. Expose the chip via a testTag instead.
@Nacchofer31
Nacchofer31 merged commit 337ae3d into master Aug 13, 2026
6 of 7 checks passed
@Nacchofer31
Nacchofer31 deleted the feature/history-picks branch August 13, 2026 11:11
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