feat: Film pick history - #68
Merged
Merged
Conversation
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.
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.
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.
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
UsernameDatabase→RandomBoxdDatabase(v1 → v2) with a migration that adds thefilm_history_entrytable, preserving existing usernames on upgradeFilmHistoryDao,FilmHistoryEntryentity andFilmPickdomain modelFilmHistoryRepository+ impl with CSV mappers and an injectedClockUI
Historyroute +HistoryScreenwith pick cards, relative timestamps (Today / Yesterday / N days ago), favorites-only filter, and a clear-confirmation dialogIntegration
RandomFilmViewModelsnapshots the search context at submit time and saves each successful extraction fire-and-forget (storage failures never break the pick flow)kotlinx-datetimedependency; Roomroom-testingadded for migration testsCommits
chore(build): upgrade AGP and Gradle toolchainfeat(history): add film history persistence layerfeat(history): add history screen UIfeat(random-film): persist picks to historyTesting
HistoryViewModelTest,FilmHistoryRepositoryImplTest,FilmHistoryMappersTest,TimestampFormatterTest, plusRandomFilmViewModelTestcoverage for the save hooksMigrationTest(v1 → v2)