Skip to content

feat: add puzzle board themes and skins (#464) - #493

Merged
Mkalbani merged 1 commit into
MindFlowInteractive:mainfrom
AwesomeuncleB:feat/464-board-themes
Nov 20, 2026
Merged

Mkalbani merged 1 commit into
MindFlowInteractive:mainfrom
AwesomeuncleB:feat/464-board-themes

Conversation

@AwesomeuncleB

Copy link
Copy Markdown
Contributor

Closes #464

What does this PR do?

Adds selectable puzzle board themes (skins) with a theme catalog, per-player ownership of locked themes, and a saved theme choice per player.

Why?

Closes #464

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing behavior to change)
  • Refactor (no behavior change)
  • Docs / CI / tooling

How was it tested?

  • Unit tests added/updated
  • E2E test added/updated
  • Manual verification steps below

npx jest src/board-themes: 26 tests pass.

What's included

New module src/board-themes/:

  • Theme schema (board_themes): slug, name, description, free/locked flag, unlock hint, sort order, and an asset bundle (board image, piece set, preview, colour tokens).
  • Asset versioning: assetVersion goes up whenever a theme's assets change. Asset URLs are served with ?v=<assetVersion>, so clients and CDNs fetch the new files.
  • Ownership (player_board_theme_unlocks, unique per player and theme): granting is idempotent.
  • Selection (player_board_theme_selections, one row per player): a locked theme can only be selected if the player owns it. If nothing is selected, or the selected theme is disabled or no longer owned, the default free theme is returned.
Method Path Access
GET /board-themes Public catalog with metadata
GET /board-themes/:themeId Public
GET /board-themes/me Player: catalog with owned / locked / selected flags
GET /board-themes/me/selection Player: current theme
PUT /board-themes/me/selection Player: choose a theme
POST /board-themes Admin: create
PATCH /board-themes/:themeId Admin: update
POST /board-themes/:themeId/grant Admin: give a locked theme to a player

Checklist

  • npm run lint passes for the new files
  • npm run format:check passes
  • npm run typecheck: no new errors (main already has 149 existing errors; this PR adds none)
  • npm test passes for the new suite
  • I added/updated tests for the change
  • I updated relevant docs (README, JSDoc, comments)
  • I added a changeset / migration if schema changed
  • I read CONTRIBUTING.md

Risk & rollout

Additive only: new tables and new routes, with no changes to existing modules other than registering the module in AppModule. The tables are created by synchronize outside production. Production needs a migration, like the other recent feature modules.

Closes #464

- Add BoardTheme entity with metadata, free/locked flag, unlock hint,
  sort order and versioned asset bundle (board image, piece set,
  preview, colour tokens)
- Add PlayerBoardThemeUnlock (unique per player and theme) to record
  ownership of locked themes
- Add PlayerBoardThemeSelection to persist each player's chosen theme
- BoardThemesService:
  - catalog create/update; changing assets bumps assetVersion
  - asset URLs served with ?v=<assetVersion> for cache busting
  - per-player catalog with owned / locked / selected flags
  - idempotent grant of locked themes
  - selection gated by ownership; falls back to the default free
    theme if the selected one is disabled or no longer owned
- BoardThemesController: public catalog, JWT player routes for
  listing and selecting, admin-only create/update/grant
- Register BoardThemesModule in AppModule
- 26 unit tests

Closes MindFlowInteractive#464
@drips-wave

drips-wave Bot commented Nov 19, 2026

Copy link
Copy Markdown

@AwesomeuncleB Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Mkalbani
Mkalbani merged commit d0935b2 into MindFlowInteractive:main Nov 20, 2026
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.

Puzzle Themes and Board Skins

2 participants