Skip to content

feat(lobby): mark the real last-played game on the lobby#58

Merged
netqo merged 1 commit into
devfrom
feat/lobby-last-played
Jun 24, 2026
Merged

feat(lobby): mark the real last-played game on the lobby#58
netqo merged 1 commit into
devfrom
feat/lobby-last-played

Conversation

@netqo

@netqo netqo commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Wires the lobby's existing LAST PLAYED card design to real data: the badge now sits on the game the user actually played last, instead of the static preview default.

Rationale

The GameCard already renders the LAST PLAYED badge + highlight from a isLastPlayed flag; it was just driven by static preview data (pinned to Crash). The new LobbyViewModel reads the Room-backed game_round ledger (newest first) and exposes the most recent round's game; the lobby nav entry maps it onto the games grid (isLastPlayed = card.key == lastPlayed). No round played yet -> no card marked.

Verification

  • ./gradlew testDebugUnitTest detekt ktlintCheck assembleDebug compileDebugAndroidTestKotlin green locally (JDK 17).
  • New test: LobbyViewModelTest (last played is the most recent round's game; null with no rounds).
  • Installed on a physical device: after playing Blackjack, the LAST PLAYED badge moved from the static Crash card to Blackjack.

Test plan

  • After playing a game, its lobby card shows the LAST PLAYED badge.
  • A fresh account (no rounds) marks no card.

Checklist

  • Commit messages follow Conventional Commits (see CONTRIBUTING.md).
  • Branch name follows the naming convention (feat/, fix/, chore/, etc.).
  • The change is scoped: no unrelated edits sneaked into this PR.
  • If user-visible behavior changed, CHANGELOG.md has been updated under [Unreleased].
  • If a new dependency was added, it is justified in the PR description. (No new dependencies.)

Add a LobbyViewModel that reads the most recent round from the Room
game_round ledger and expose its game as lastPlayedGame. The lobby maps
it onto the games grid so the actual last-played game carries the LAST
PLAYED badge (the card design already existed), replacing the static
preview default; no rounds yet means no card is marked.

Covered by LobbyViewModelTest.
@netqo netqo merged commit d9cd53c into dev Jun 24, 2026
3 checks passed
@netqo netqo deleted the feat/lobby-last-played branch June 24, 2026 11:42
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