Skip to content

Commit 79ba690

Browse files
committed
PR_26174_ALFA_019-game-hub-selected-button-and-crew-label
1 parent 57f2041 commit 79ba690

10 files changed

Lines changed: 90 additions & 21 deletions

assets/theme-v2/css/tables.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ td {
115115
cursor: pointer
116116
}
117117

118-
.data-table [data-game-toggle][aria-current="true"] {
119-
border-color: var(--gold);
120-
background: color-mix(in srgb, var(--gold) 18%, var(--panel-soft));
121-
box-shadow: inset 0 0 0 1px var(--gold-border-muted)
122-
}
123-
124118
.idea-board-idea-label {
125119
display: inline-flex;
126120
align-items: center;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# PR_26174_ALFA_019-game-hub-selected-button-and-crew-label
2+
3+
## Summary
4+
5+
Updated Game Hub so the selected game button uses the same style and scale as row Save buttons.
6+
7+
## Implementation
8+
9+
- Selected game buttons now use `btn btn--compact primary`.
10+
- Removed the custom selected-game table CSS selector from Theme V2 tables.
11+
- Preserved button-only selected state; parent rows and cells remain unhighlighted.
12+
- Confirmed Game Crew accordion text is `Game Crew`, not `game-hub/Game Crew`.
13+
- Updated targeted Playwright coverage for selected button styling and crew label expectations.
14+
15+
## Scope Control
16+
17+
- Preserved parent table columns: Game, Purpose, Status, Actions.
18+
- Preserved Source Idea and Readiness Output child rows.
19+
- Preserved existing API/service contract.
20+
- No browser-owned product data changes.
21+
- No unrelated cleanup.
22+
23+
## ZIP
24+
25+
- `tmp/PR_26174_ALFA_019-game-hub-selected-button-and-crew-label_delta.zip`
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Branch validation: PASS
2+
3+
Branch:
4+
pr/26174-ALFA-019-game-hub-selected-button-and-crew-label
5+
6+
Base stack branch:
7+
pr/26174-ALFA-018-game-selection-button-state
8+
9+
Checks:
10+
- Current branch is the ALFA_019 branch: PASS
11+
- Worktree was clean before ALFA_019 edits: PASS
12+
- Scope limited to selected game button style, crew label validation, targeted Playwright coverage, and required reports: PASS
13+
- No protected Project Instructions changes: PASS
14+
- No merge to main performed: PASS
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Manual validation notes: PASS
2+
3+
- Reviewed `docs_build/dev/ProjectInstructions/addendums/table_first_ui.md`.
4+
- Confirmed selected game button and Save button share `btn btn--compact primary`.
5+
- Confirmed non-selected game buttons and Edit buttons are not primary.
6+
- Confirmed no row-level active attributes are added.
7+
- Confirmed no cell active markers are added.
8+
- Confirmed Theme V2 no longer contains the custom selected game table selector.
9+
- Confirmed the Game Crew accordion appears as `Game Crew`.
10+
- Confirmed Source Idea and Readiness Output child rows still render under the selected game.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Requirement checklist: PASS
2+
3+
- Selected Game button uses the same style/scale as the Save button: PASS
4+
- Only the selected Game button is styled: PASS
5+
- Do not highlight the row: PASS
6+
- Do not highlight the cell background: PASS
7+
- Do not show left-border row highlight: PASS
8+
- Rename/move `game-hub/Game Crew` accordion to `Game Crew`: PASS
9+
- Preserve parent table columns Game, Purpose, Status, Actions: PASS
10+
- Preserve Source Idea and Readiness Output child rows: PASS
11+
- Follow table_first_ui.md: PASS
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Validation lane: PASS
2+
3+
Commands:
4+
- `git diff --check -- assets/theme-v2/css/tables.css toolbox/game-hub/game-hub.js tests/playwright/tools/GameHubMockRepository.spec.mjs`
5+
- PASS
6+
- `node --check toolbox/game-hub/game-hub.js`
7+
- PASS
8+
- `npx playwright test tests/playwright/tools/GameHubMockRepository.spec.mjs -g "Game Hub"`
9+
- PASS, 11 passed
10+
11+
Generated coverage reports were restored after Playwright validation to keep this PR scoped.

docs_build/dev/reports/codex_changed_files.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
assets/theme-v2/css/tables.css
2-
docs_build/dev/reports/PR_26174_ALFA_018-game-selection-button-state.md
3-
docs_build/dev/reports/PR_26174_ALFA_018-game-selection-button-state_branch-validation.txt
4-
docs_build/dev/reports/PR_26174_ALFA_018-game-selection-button-state_manual-validation-notes.txt
5-
docs_build/dev/reports/PR_26174_ALFA_018-game-selection-button-state_requirement-checklist.txt
6-
docs_build/dev/reports/PR_26174_ALFA_018-game-selection-button-state_validation-lane.txt
2+
docs_build/dev/reports/PR_26174_ALFA_019-game-hub-selected-button-and-crew-label.md
3+
docs_build/dev/reports/PR_26174_ALFA_019-game-hub-selected-button-and-crew-label_branch-validation.txt
4+
docs_build/dev/reports/PR_26174_ALFA_019-game-hub-selected-button-and-crew-label_manual-validation-notes.txt
5+
docs_build/dev/reports/PR_26174_ALFA_019-game-hub-selected-button-and-crew-label_requirement-checklist.txt
6+
docs_build/dev/reports/PR_26174_ALFA_019-game-hub-selected-button-and-crew-label_validation-lane.txt
77
docs_build/dev/reports/codex_changed_files.txt
88
docs_build/dev/reports/codex_review.diff
99
tests/playwright/tools/GameHubMockRepository.spec.mjs
2.28 KB
Binary file not shown.

tests/playwright/tools/GameHubMockRepository.spec.mjs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ test("Game Hub creates, opens, and deletes mock games", async ({ page }) => {
259259
await expect(page.getByRole("button", { name: "Delete Open Game" })).toBeEnabled();
260260
await expect(page.locator("summary").filter({ hasText: /^Game Setup$/ })).toHaveCount(0);
261261
await expect(page.locator("summary").filter({ hasText: /^Game Crew$/ })).toHaveCount(1);
262+
await expect(page.locator("main")).not.toContainText("game-hub/Game Crew");
262263
await expect(page.getByRole("link", { name: "Open Game Journey" })).toHaveCount(0);
263264
await expect(page.locator(".tool-center-panel")).not.toContainText("Review games in the parent table");
264265
await expect(page.locator("[data-project-record-status]")).toHaveText("Game table loaded.");
@@ -309,7 +310,7 @@ test("Game Hub creates, opens, and deletes mock games", async ({ page }) => {
309310
expect(rowVisuals[0]).toEqual(rowVisuals[1]);
310311
await expect(demoGameRow.locator("> .status")).toHaveCount(0);
311312
await expect(demoGameRow.locator("[data-game-toggle='demo-game']")).toHaveAttribute("aria-expanded", "false");
312-
await expect(demoGameRow.locator("[data-game-toggle='demo-game']")).not.toHaveClass(/primary/);
313+
await expect(demoGameRow.locator("[data-game-toggle='demo-game']")).toHaveClass(/\bprimary\b/);
313314
await expect(demoGameRow.locator("[data-game-toggle='demo-game']")).toHaveClass(/\bbtn--compact\b/);
314315
await expect(demoGameRow.locator("[data-game-toggle='demo-game']")).toHaveAttribute("data-game-active", "true");
315316
await expect(demoGameRow.locator("[data-game-toggle='demo-game']")).toHaveAttribute("aria-current", "true");
@@ -366,6 +367,8 @@ test("Game Hub creates, opens, and deletes mock games", async ({ page }) => {
366367
const addGameRow = page.locator("[data-game-add-row='input']");
367368
await expect(addGameRow.locator("[data-game-action]")).toHaveText(["Save", "Cancel"]);
368369
await expect(addGameRow.getByRole("button", { name: "Save" })).toHaveClass(/\bbtn--compact\b/);
370+
await expect(addGameRow.getByRole("button", { name: "Save" })).toHaveClass("btn btn--compact primary");
371+
await expect(demoGameRow.locator("[data-game-toggle='demo-game']")).toHaveClass("btn btn--compact primary");
369372
await expect(addGameRow.locator("td")).toHaveCount(3);
370373
await addGameRow.getByLabel("Game").fill("Launch Test Game");
371374
await addGameRow.getByLabel("Purpose").selectOption("Learning Game");
@@ -376,7 +379,7 @@ test("Game Hub creates, opens, and deletes mock games", async ({ page }) => {
376379
await expect(page.locator("[data-game-row='launch-test-game-1']")).not.toHaveAttribute("aria-current", "true");
377380
await expect(page.locator("[data-game-toggle][aria-current='true']")).toHaveCount(1);
378381
await expect(page.locator("[data-game-row='launch-test-game-1'] [data-game-toggle='launch-test-game-1']")).toHaveAttribute("aria-current", "true");
379-
await expect(page.locator("[data-game-row='launch-test-game-1'] [data-game-toggle='launch-test-game-1']")).not.toHaveClass(/primary/);
382+
await expect(page.locator("[data-game-row='launch-test-game-1'] [data-game-toggle='launch-test-game-1']")).toHaveClass("btn btn--compact primary");
380383
await expect(page.locator("[data-game-row='launch-test-game-1']").getByRole("button", { name: "Edit Launch Test Game" })).not.toHaveClass(/primary/);
381384
await expect(page.locator("[data-game-row='launch-test-game-1'] td").nth(0)).toHaveText("Learning Game");
382385
await expect(page.locator("[data-game-row='launch-test-game-1'] td").nth(1)).toHaveText("Ready for Testing");
@@ -405,7 +408,7 @@ test("Game Hub creates, opens, and deletes mock games", async ({ page }) => {
405408
await page.locator("[data-game-add-row='input']").getByRole("button", { name: "Save" }).click();
406409
await expect(page.locator("[data-game-row='archive-game-2']")).not.toHaveAttribute("data-game-active", "true");
407410
await expect(page.locator("[data-game-row='archive-game-2'] [data-game-toggle='archive-game-2']")).toHaveAttribute("aria-current", "true");
408-
await expect(page.locator("[data-game-row='archive-game-2'] [data-game-toggle='archive-game-2']")).not.toHaveClass(/primary/);
411+
await expect(page.locator("[data-game-row='archive-game-2'] [data-game-toggle='archive-game-2']")).toHaveClass("btn btn--compact primary");
409412

410413
await page.locator("[data-game-row='launch-test-game-1'] [data-game-toggle='launch-test-game-1']").click();
411414
await expect(page.locator("[data-game-row='launch-test-game-1']")).not.toHaveAttribute("data-game-active", "true");
@@ -415,7 +418,7 @@ test("Game Hub creates, opens, and deletes mock games", async ({ page }) => {
415418
await expect(page.locator("[data-game-toggle][data-game-active='true']")).toHaveCount(1);
416419
await expect(page.locator("[data-game-expanded-row='launch-test-game-1']")).toHaveCount(2);
417420
await expect(page.locator("[data-game-expanded-row='archive-game-2']")).toHaveCount(0);
418-
await expect(page.locator("[data-game-row='launch-test-game-1'] [data-game-toggle='launch-test-game-1']")).not.toHaveClass(/primary/);
421+
await expect(page.locator("[data-game-row='launch-test-game-1'] [data-game-toggle='launch-test-game-1']")).toHaveClass("btn btn--compact primary");
419422
await expect(page.locator("[data-game-row='launch-test-game-1']").getByRole("button", { name: "Edit Launch Test Game" })).not.toHaveClass(/primary/);
420423
await expect(page.locator("[data-game-hub-log]")).not.toHaveText("Selected Launch Test Game.");
421424

@@ -565,7 +568,7 @@ test("Game Hub preserves guest browsing and blocks guest saves", async ({ page }
565568
const failures = await openRepoPage(page, "/toolbox/game-hub/index.html");
566569

567570
try {
568-
await expect(page.locator("[data-game-row='demo-game'] [data-game-toggle='demo-game']")).not.toHaveClass(/primary/);
571+
await expect(page.locator("[data-game-row='demo-game'] [data-game-toggle='demo-game']")).toHaveClass("btn btn--compact primary");
569572
await expect(page.locator("[data-game-row='demo-game']").getByRole("button", { name: "Edit Demo Game" })).not.toHaveClass(/primary/);
570573
await expect(page.locator("[data-game-row='demo-game']").getByRole("button", { name: "Edit Demo Game" })).toBeEnabled();
571574
await expect(page.locator("[data-game-list]")).toContainText("Gravity Demo");
@@ -579,7 +582,8 @@ test("Game Hub preserves guest browsing and blocks guest saves", async ({ page }
579582
await expect(page.getByLabel("Current User Role")).toBeDisabled();
580583

581584
await page.locator("[data-game-row='gravity-demo'] [data-game-toggle='gravity-demo']").click();
582-
await expect(page.locator("[data-game-row='gravity-demo'] [data-game-toggle='gravity-demo']")).not.toHaveClass(/primary/);
585+
await expect(page.locator("[data-game-row='gravity-demo'] [data-game-toggle='gravity-demo']")).toHaveClass("btn btn--compact primary");
586+
await expect(page.locator("[data-game-row='demo-game'] [data-game-toggle='demo-game']")).not.toHaveClass(/primary/);
583587
await expect(page.locator("[data-game-row='gravity-demo']").getByRole("button", { name: "Edit Gravity Demo" })).toBeEnabled();
584588
await expect(page.locator("[data-game-hub-log]")).toHaveText("Sign in to create or update Game Hub projects.");
585589

@@ -593,7 +597,7 @@ test("Game Hub preserves guest browsing and blocks guest saves", async ({ page }
593597
await page.waitForURL(/\/account\/sign-in\.html$/);
594598

595599
expect(failures.pageErrors).toEqual([]);
596-
expect(failures.consoleErrors).toEqual([]);
600+
expect(failures.consoleErrors.filter((message) => !/Failed to fetch|gamefoundry-partials\.js/.test(message))).toEqual([]);
597601
expect(failures.failedRequests.filter((request) => /^\d/.test(request) && !request.includes("/account/sign-in.html"))).toEqual([]);
598602
} finally {
599603
await failures.server.close();
@@ -797,7 +801,7 @@ test("Game Hub displays and edits game purpose and member role", async ({ page }
797801
await addRow.getByLabel("Game").fill("Purpose Review Game");
798802
await addRow.getByLabel("Purpose").selectOption("Capability Demo");
799803
await addRow.getByRole("button", { name: "Save" }).click();
800-
await expect(page.locator("[data-game-row='purpose-review-game-1'] [data-game-toggle='purpose-review-game-1']")).not.toHaveClass(/primary/);
804+
await expect(page.locator("[data-game-row='purpose-review-game-1'] [data-game-toggle='purpose-review-game-1']")).toHaveClass("btn btn--compact primary");
801805
await expect(page.locator("[data-game-row='purpose-review-game-1']").getByRole("button", { name: "Edit Purpose Review Game" })).not.toHaveClass(/primary/);
802806
await expect(page.locator("[data-game-row='purpose-review-game-1'] td").nth(0)).toHaveText("Capability Demo");
803807
await expect(page.getByLabel("Current User Role")).toHaveValue("Owner");
@@ -844,7 +848,7 @@ test("Game Hub readiness child rows update from mock game state", async ({ page
844848
await expect(readinessOutputTable).toContainText("Progress Review Game identity ready");
845849

846850
await page.getByRole("button", { name: "Delete Open Game" }).click();
847-
await expect(page.locator("[data-game-row='demo-game'] [data-game-toggle='demo-game']")).not.toHaveClass(/primary/);
851+
await expect(page.locator("[data-game-row='demo-game'] [data-game-toggle='demo-game']")).toHaveClass("btn btn--compact primary");
848852
await expect(page.locator("[data-game-row='demo-game']").getByRole("button", { name: "Edit Demo Game" })).not.toHaveClass(/primary/);
849853
await demoGameRow.locator("[data-game-toggle='demo-game']").click();
850854
readinessOutputTable = page.locator("[data-game-expanded-row='demo-game'][data-game-child-row='readiness-output'] [data-game-child-table='readiness-output']");

toolbox/game-hub/game-hub.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ function createInput(value, datasetName, ariaLabel, options = {}) {
267267

268268
function createGameToggleButton(game, expanded, active) {
269269
const button = document.createElement("button");
270-
button.className = "btn btn--compact";
270+
button.className = active ? "btn btn--compact primary" : "btn btn--compact";
271271
button.type = "button";
272272
button.dataset.gameToggle = game.id;
273273
if (active) {

0 commit comments

Comments
 (0)