VOOZH about

URL: https://bugzilla.mozilla.org/show_bug.cgi?id=2039394

⇱ 2039394 - Game Widget POC


Open Bug 2039394 Opened 1 month ago Updated 1 day ago

Game Widget POC

Game Widget POC
Firefox
New Tab Page
unspecified
Unspecified
Unspecified
task
Points:
---
ASSIGNED
ASSIGNED
---
Iteration:
---
a11y-review
Accessibility Severity
Performance Impact
Webcompat Priority
Webcompat Score
Tracking Status
relnote-firefox
firefox-esr115
firefox-esr140
firefox-esr153
firefox152
firefox153
firefox154
---
QA Whiteboard:
---
Has STR:
---
Change Request:
---
Bug Flags:
Signature:
None
This bug is publicly visible.

 
Assignee

Description

1 month ago
No description provided.
Assignee

Updated

1 month ago
Assignee: nobody → dgrant
Status: NEW → ASSIGNED
Assignee

Comment 1

26 days ago

Lands the Nova-only Games widget infrastructure without any actual games
registered, as the first patch in a stack that will add games one per
follow-up commit.

What ships in this shell:

  • Widget registry entry (id "games") with validSizes: ["large"], plus
    PREF_WIDGETS_GAMES_ENABLED, PREF_GAMES_SIZE, and
    PREF_WIDGETS_SYSTEM_GAMES_ENABLED. resolveWidgetSize() now respects
    validSizes for all widgets.
  • PREFS_CONFIG entries for widgets.games.{enabled,size,interaction,
    highScores,popoutOnly} and widgets.system.games.enabled, plus matching
    AboutPreferences wiring.
  • Games widget container (Games.jsx) with game selection, popout
    (window.name "games-popout"), context menu, high-score map, and
    celebration. With an empty GAME_REGISTRY it renders the welcome state.
  • GameEndOverlay shared component for per-game use later.
  • GamesSizePromptToast: shown when the user tries to shrink Games
    below its valid sizes; offers a pop-out action. Animation duration
    bumped to 12s so the user can read and act.
  • Customize menu Games toggle (Nova WidgetsManagementPanel) gated on
    mayHaveGamesWidget, with a WIDGET_GAMES telemetry event source.
  • Nimbus + trainhop wiring in Base.jsx (mayHaveGamesWidget,
    enabledWidgets.gamesEnabled), propagated through CustomizeMenu and
    ContentSection.
  • newtab.ftl: shell + generic gameplay strings only. preferences.ftl:
    home-prefs-games-header.
  • Tests: WidgetsRegistry order, Widgets render-and-toggle, and
    WidgetsManagementPanel toggle behaviour extended for "games".

Out of scope (follow-up commits, one per game): the 10 game modules
under Games/titles/, the per-game l10n strings, the mozmatch asset
folder, and the per-game SCSS @imports.

Assignee

Comment 2

26 days ago

Adds the first game to the Games widget: MozTacToe, a 3x3 tic-tac-toe
against a CPU opponent. No high score.

  • Adds Games/titles/MozTacToe/ with the React component, SCSS, and
    game-logic module.
  • Registers it in Games/titles/index.mjs (first GAME_REGISTRY entry).
  • Re-introduces the per-game SCSS @import in _Games.scss.
  • Adds per-game l10n strings (game label + win/loss/draw).

Parent: Bug 2039394 Games widget shell.

Attachment #9589022 - Attachment description: WIP: Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers → Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers
Attachment #9589030 - Attachment description: WIP: Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers → Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers
Assignee

Comment 3

20 days ago

Adds the second game to the Games widget: Mozong, a small Pong-style
game played against a CPU opponent. First to 5 points wins. No
persistent high score.

  • Adds Games/titles/Mozong/ with the React component, SCSS, and
    game-logic module.
  • Registers it in Games/titles/index.mjs.
  • Adds the per-game SCSS @import in _Games.scss.
  • Adds per-game l10n strings (game label, canvas aria-label, win/loss).

Parent: Bug 2039394 Add MozTacToe game.

Assignee

Comment 4

20 days ago

Adds the third game to the Games widget: MozFour, a Connect Four-style
game played against a CPU opponent on a 7x6 board. No persistent high
score.

  • Adds Games/titles/MozFour/ with the React component, SCSS, and
    game-logic module.
  • Registers it in Games/titles/index.mjs.
  • Adds the per-game SCSS @import in _Games.scss.
  • Adds per-game l10n strings (game label, win/loss/draw).

Parent: Bug 2039394 Add Mozong game.

Assignee

Comment 5

20 days ago

Adds the fourth game to the Games widget: MozBattle, a Battleship-style
fog-of-war game against a CPU opponent. 7x7 board with three small
ships (1x3, 1x2, 1x2). Player only sees their shots on the CPU grid;
remaining ship counts are shown for both sides above the board. No
persistent high score.

  • Adds Games/titles/MozBattle/ with the React component, SCSS, and
    game-logic module (auto-placement, pure shot reducers, hunt-and-
    target CPU AI).
  • Registers it in Games/titles/index.mjs.
  • Adds the per-game SCSS @import in _Games.scss and includes the
    game in the shared position-relative selector list.
  • Adds per-game l10n strings (game label, fleet labels, status
    messages for player/CPU miss/hit/sunk, win/loss).

Parent: Bug 2039394 Add MozFour game.

Attachment #9589022 - Attachment description: Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers → WIP: Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers
Attachment #9589030 - Attachment description: Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers → WIP: Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers
Attachment #9590787 - Attachment description: Bug 2039394 - Add Mozong game r?#home-newtab-reviewers → WIP: Bug 2039394 - Add Mozong game r?#home-newtab-reviewers
Attachment #9590788 - Attachment description: Bug 2039394 - Add MozFour game r?#home-newtab-reviewers → WIP: Bug 2039394 - Add MozFour game r?#home-newtab-reviewers
Attachment #9590789 - Attachment description: Bug 2039394 - Add MozBattle game r?#home-newtab-reviewers → WIP: Bug 2039394 - Add MozBattle game r?#home-newtab-reviewers
Attachment #9589022 - Attachment description: WIP: Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers → Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers
Attachment #9589030 - Attachment description: WIP: Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers → Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers
Attachment #9590787 - Attachment description: WIP: Bug 2039394 - Add Mozong game r?#home-newtab-reviewers → Bug 2039394 - Add Mozong game r?#home-newtab-reviewers
Attachment #9590788 - Attachment description: WIP: Bug 2039394 - Add MozFour game r?#home-newtab-reviewers → Bug 2039394 - Add MozFour game r?#home-newtab-reviewers
Attachment #9590789 - Attachment description: WIP: Bug 2039394 - Add MozBattle game r?#home-newtab-reviewers → Bug 2039394 - Add MozBattle game r?#home-newtab-reviewers
Assignee

Comment 6

20 days ago

Lays the foundation for card-based games in the Games widget (War,
Blackjack, Poker). No new game is added in this commit; this is pure
scaffolding.

  • Adds Games/deck.mjs with createDeck/shuffle/deal helpers and shared
    suit/rank constants. Random is injectable for deterministic tests.
  • Adds Games/Card.jsx — a small renderer for a single playing card,
    with face-up and face-down (diagonal-hatch back) variants.
  • Adds Games/_cards.scss — shared card visual treatment used by all
    card-based games (border, shadow, corner labels, big center pip,
    red/black colors based on suit).
  • Adds GameRegistryEntry.hasDifficulty (typedef in titles/types.mjs)
    so games whose CPU makes no decisions (e.g. War) can suppress the
    Difficulty submenu.
  • Wires Games.jsx to gate the Difficulty submenu by activeGame's
    hasDifficulty (default true preserves existing behavior).
  • Adds the Card.jsx karma coverage override matching the pattern used
    by other Games .jsx files.

Parent: Bug 2039394 Add MozBattle game.

Assignee

Comment 7

20 days ago

Adds the fifth game to the Games widget: MozWar, a classic two-player
card game where higher rank wins both cards, with the "war" tie-break
when both players draw the same rank. No CPU strategy — outcomes are
fully determined by the shuffled deck — so the widget's Difficulty
submenu is hidden while MozWar is active.

  • Adds Games/titles/MozWar/ with the React component, SCSS, and pure
    game-logic module (createInitialState, playRound, getStatusId).
  • War declaration is a separate click: ties pause in a "warPending"
    phase and show "WAR!" before the player clicks "Declare war" to
    resolve the 3-face-down + 1-face-up tribute.
  • Registers MozWar with hasDifficulty: false in titles/index.mjs.
  • Adds the per-game SCSS @import in _Games.scss.
  • Adds per-game l10n strings (game label, status messages, button
    labels for the war-declared state).
  • Adds MozWar.test.jsx covering createInitialState, playRound for
    both idle and warPending phases (including war chains and
    insufficient-cards edge cases), wasWar, and getStatusId.
  • Adds the MozWar.jsx karma coverage override matching the pattern
    used by other Games .jsx files.

Parent: Bug 2039394 Add card-game shared infrastructure.

Attachment #9589022 - Attachment description: Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers
Attachment #9589030 - Attachment description: Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers
Attachment #9590787 - Attachment description: Bug 2039394 - Add Mozong game r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add Mozong game r?#home-newtab-reviewers
Attachment #9590788 - Attachment description: Bug 2039394 - Add MozFour game r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add MozFour game r?#home-newtab-reviewers
Attachment #9590789 - Attachment description: Bug 2039394 - Add MozBattle game r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add MozBattle game r?#home-newtab-reviewers
Attachment #9591261 - Attachment description: Bug 2039394 - Add card-game shared infrastructure r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add card-game shared infrastructure r?#home-newtab-reviewers
Attachment #9591262 - Attachment description: Bug 2039394 - Add MozWar game r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add MozWar game r?#home-newtab-reviewers
Attachment #9589022 - Attachment description: Proof of concept, not for merging - Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers → Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers
Attachment #9589022 - Attachment description: Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add Games widget shell r?#home-newtab-reviewers
Attachment #9589030 - Attachment description: Proof of concept, not for merging - Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers → WIP: Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers
Attachment #9590787 - Attachment description: Proof of concept, not for merging - Bug 2039394 - Add Mozong game r?#home-newtab-reviewers → WIP: Bug 2039394 - Add Mozong game r?#home-newtab-reviewers
Attachment #9590788 - Attachment description: Proof of concept, not for merging - Bug 2039394 - Add MozFour game r?#home-newtab-reviewers → WIP: Bug 2039394 - Add MozFour game r?#home-newtab-reviewers
Attachment #9590789 - Attachment description: Proof of concept, not for merging - Bug 2039394 - Add MozBattle game r?#home-newtab-reviewers → WIP: Bug 2039394 - Add MozBattle game r?#home-newtab-reviewers
Attachment #9591261 - Attachment description: Proof of concept, not for merging - Bug 2039394 - Add card-game shared infrastructure r?#home-newtab-reviewers → WIP: Bug 2039394 - Add card-game shared infrastructure r?#home-newtab-reviewers
Attachment #9591262 - Attachment description: Proof of concept, not for merging - Bug 2039394 - Add MozWar game r?#home-newtab-reviewers → WIP: Bug 2039394 - Add MozWar game r?#home-newtab-reviewers
Attachment #9591262 - Attachment description: WIP: Bug 2039394 - Add MozWar game r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add MozWar game r?#home-newtab-reviewers
Attachment #9591261 - Attachment description: WIP: Bug 2039394 - Add card-game shared infrastructure r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add card-game shared infrastructure r?#home-newtab-reviewers
Attachment #9590789 - Attachment description: WIP: Bug 2039394 - Add MozBattle game r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add MozBattle game r?#home-newtab-reviewers
Attachment #9590788 - Attachment description: WIP: Bug 2039394 - Add MozFour game r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add MozFour game r?#home-newtab-reviewers
Attachment #9590787 - Attachment description: WIP: Bug 2039394 - Add Mozong game r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add Mozong game r?#home-newtab-reviewers
Attachment #9589030 - Attachment description: WIP: Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers → Proof of concept, not for merging - Bug 2039394 - Add MozTacToe game r?#home-newtab-reviewers
You need to log in before you can comment on or make changes to this bug.