Skip to content

Commit 97f273e

Browse files
committed
PR_26174_ALFA_022-idea-board-status-dropdown-fix
1 parent 825b252 commit 97f273e

10 files changed

Lines changed: 208 additions & 267 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Branch Validation
2+
3+
PR: PR_26174_ALFA_022-idea-board-status-dropdown-fix
4+
5+
Status: PASS with documented legacy-lane warning
6+
7+
## Checks
8+
9+
- PASS: Current branch is `pr/26174-ALFA-022-idea-board-status-dropdown-fix`.
10+
- PASS: Started from the current stacked Alfa branch.
11+
- PASS: No main merge was performed.
12+
- PASS: Work stayed inside the requested Idea Board status dropdown/filter, targeted tests, and required report scope.
13+
- PASS: Generated required reports and ZIP artifact.
14+
15+
## Warning
16+
17+
- WARN: The touched Toolbox launch-route check reached the updated Idea Board status option assertions, then failed on the existing `500 /api/game-journey/completion-metrics` request.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Manual Validation Notes
2+
3+
- Confirmed the code has separate editable and filter status option lists.
4+
- Confirmed editable dropdown expectations include only New, Exploring, Refining, and Ready.
5+
- Confirmed filter expectations include New, Exploring, Refining, Ready, Project, and Archived.
6+
- Confirmed the touched launch-route test reached the new status option assertions before the existing completion-metrics warning.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# PR_26174_ALFA_022-idea-board-status-dropdown-fix
2+
3+
## Summary
4+
5+
Split Idea Board status choices into explicit editable and filter option lists.
6+
7+
## Changes
8+
9+
- Added `editableStatusOptions` with New, Exploring, Refining, and Ready.
10+
- Added `filterStatusOptions` with New, Exploring, Refining, Ready, Project, and Archived.
11+
- Updated editable status dropdown rendering to use only editable statuses.
12+
- Updated status filter rendering and Select All behavior to use filter statuses.
13+
- Updated targeted Playwright coverage for filter options and editable dropdown options.
14+
15+
## Notes
16+
17+
- No unrelated cleanup was performed.
18+
- Project and Archived remain available for filtering but do not appear in editable Status dropdowns.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Requirement Checklist
2+
3+
- PASS: Created `editableStatusOptions` with New, Exploring, Refining, and Ready.
4+
- PASS: Created `filterStatusOptions` with New, Exploring, Refining, Ready, Project, and Archived.
5+
- PASS: Editable Status dropdown uses `editableStatusOptions`.
6+
- PASS: Status Filter accordion uses `filterStatusOptions`.
7+
- PASS: Project does not appear in editable Status dropdowns.
8+
- PASS: Archived does not appear in editable Status dropdowns.
9+
- PASS: Project remains available for filtering.
10+
- PASS: Archived remains available for filtering.
11+
- PASS: Targeted Playwright tests updated.
12+
- PASS: No unrelated cleanup performed.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Validation Lane
2+
3+
## PASS
4+
5+
- `node --check toolbox/idea-board/index.js`
6+
- `git diff --check`
7+
- `npx playwright test tests/playwright/tools/IdeaBoardTableNotes.spec.mjs --workers=1`
8+
9+
## WARN
10+
11+
- `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --workers=1 --grep "Idea Board launches"` reached the updated Idea Board status option assertions, then failed because the page recorded `500 http://127.0.0.1:51166/api/game-journey/completion-metrics`.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
assets/theme-v2/css/tables.css
2-
tests/playwright/tools/IdeaBoardTableNotes.spec.mjs
1+
tests/playwright/tools/IdeaBoardTableNotes.spec.mjs
32
tests/playwright/tools/ToolboxRoutePages.spec.mjs
4-
toolbox/idea-board/index.html
53
toolbox/idea-board/index.js

docs_build/dev/reports/codex_review.diff

Lines changed: 122 additions & 242 deletions
Large diffs are not rendered by default.

tests/playwright/tools/IdeaBoardTableNotes.spec.mjs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import { isBrowserExtensionNoise } from "../../helpers/browserExtensionNoise.mjs
55
import { createGameJourneyCompletionMetricsPostgresClientStub } from "../../helpers/gameJourneyCompletionMetricsPostgresClientStub.mjs";
66
import { startRepoServer } from "../../helpers/playwrightRepoServer.mjs";
77

8+
const EDITABLE_STATUS_OPTIONS = ["New", "Exploring", "Refining", "Ready"];
9+
const FILTER_STATUS_OPTIONS = ["New", "Exploring", "Refining", "Ready", "Project", "Archived"];
10+
const DEFAULT_VISIBLE_STATUS_OPTIONS = ["New", "Exploring", "Refining", "Ready", "Project"];
11+
812
function restoreEnvValue(key, value) {
913
if (value === undefined) {
1014
delete process.env[key];
@@ -213,7 +217,7 @@ test("Idea Board uses accordion table ideas and notes", async ({ page }) => {
213217
await expect(statusFilterAccordion.locator("summary")).toHaveText("Status Filter");
214218
await expect(statusFilterAccordion.locator("[data-idea-board-filter-select-all]")).toHaveText("Select All");
215219
await expect(statusFilterAccordion.locator("[data-idea-board-filter-clear-all]")).toHaveText("Clear All");
216-
await expect(statusFilterAccordion.locator("[data-idea-board-status-filter-option]")).toHaveCount(6);
220+
await expect(statusFilterAccordion.locator("[data-idea-board-status-filter-option]")).toHaveCount(FILTER_STATUS_OPTIONS.length);
217221
const statusFilterTheme = await statusFilterAccordion.locator("[data-idea-board-status-filter-option][value='New']").evaluate((input) => ({
218222
accentColor: getComputedStyle(input).accentColor,
219223
toolGroupColor: getComputedStyle(input.closest(".control-lab")).getPropertyValue("--tool-group-color").trim(),
@@ -222,18 +226,11 @@ test("Idea Board uses accordion table ideas and notes", async ({ page }) => {
222226
accentColor: "rgb(255, 45, 45)",
223227
toolGroupColor: "#ff2d2d",
224228
});
225-
await expect(statusFilterAccordion.locator(".idea-board-show-filter__option")).toHaveText([
226-
"New",
227-
"Exploring",
228-
"Refining",
229-
"Ready",
230-
"Project",
231-
"Archived",
232-
]);
229+
await expect(statusFilterAccordion.locator(".idea-board-show-filter__option")).toHaveText(FILTER_STATUS_OPTIONS);
233230
const checkedStatuses = await page.locator("[data-idea-board-status-filter-option]:checked").evaluateAll((inputs) => (
234231
inputs.map((input) => input.value)
235232
));
236-
expect(checkedStatuses).toEqual(["New", "Exploring", "Refining", "Ready", "Project"]);
233+
expect(checkedStatuses).toEqual(DEFAULT_VISIBLE_STATUS_OPTIONS);
237234
await expect(page.locator("[data-idea-board-status-filter-option][value='Archived']")).not.toBeChecked();
238235
await expect(page.getByText(/another/i)).toHaveCount(0);
239236
await expect(page.locator("[data-idea-board-notes-chevron]")).toHaveCount(0);
@@ -330,12 +327,7 @@ test("Idea Board uses accordion table ideas and notes", async ({ page }) => {
330327
const ideaInputRow = page.locator("[data-idea-board-idea-input-row]").last();
331328
await expect(ideaInputRow.locator("[data-idea-board-idea-action]")).toHaveText(["Save", "Cancel"]);
332329
await expect(ideaInputRow.locator("[data-idea-board-idea-status-input]")).toHaveCount(1);
333-
await expect(ideaInputRow.locator("[data-idea-board-idea-status-input] option")).toHaveText([
334-
"New",
335-
"Exploring",
336-
"Refining",
337-
"Ready",
338-
]);
330+
await expect(ideaInputRow.locator("[data-idea-board-idea-status-input] option")).toHaveText(EDITABLE_STATUS_OPTIONS);
339331
await expect(ideaInputRow.locator("td").nth(2)).toHaveText("0 Notes");
340332
await page.locator("[data-idea-board-idea-input]").fill("Lantern Reef");
341333
await page.locator("[data-idea-board-pitch-input]").fill("Guide light through a reef that rearranges at dusk.");
@@ -355,6 +347,7 @@ test("Idea Board uses accordion table ideas and notes", async ({ page }) => {
355347
await page.locator("[data-idea-board-idea-row='lantern-reef'] [data-idea-board-idea-action='edit']").click();
356348
await expect(page.locator("[data-idea-board-idea-input-row] [data-idea-board-idea-action]")).toHaveText(["Save", "Cancel"]);
357349
await expect(page.locator("[data-idea-board-idea-status-input]")).toHaveCount(1);
350+
await expect(page.locator("[data-idea-board-idea-status-input] option")).toHaveText(EDITABLE_STATUS_OPTIONS);
358351
await page.locator("[data-idea-board-idea-status-input]").selectOption("Ready");
359352
await page.locator("[data-idea-board-idea-action='save']").click();
360353
await expect(page.locator("[data-idea-board-idea-row='lantern-reef'] td").nth(1)).toHaveText("Ready");

tests/playwright/tools/ToolboxRoutePages.spec.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { isBrowserExtensionNoise } from "../../helpers/browserExtensionNoise.mjs
44
import { startRepoServer } from "../../helpers/playwrightRepoServer.mjs";
55
import { workspaceV2CoverageReporter } from "../../helpers/workspaceV2CoverageReporter.mjs";
66

7+
const IDEA_BOARD_EDITABLE_STATUS_OPTIONS = ["New", "Exploring", "Refining", "Ready"];
8+
const IDEA_BOARD_FILTER_STATUS_OPTIONS = ["New", "Exploring", "Refining", "Ready", "Project", "Archived"];
9+
710
const TOOL_ROUTE_SMOKE_CASES = [
811
{ heading: "Game Journey", route: "/tools/game-journey/index.html" },
912
{ heading: "Idea Board", route: "/tools/idea-board/index.html" },
@@ -319,6 +322,8 @@ test("Idea Board launches from Toolbox with accordion table notes model", async
319322
]);
320323
await expect(page.locator("[data-idea-board-table]")).toBeVisible();
321324
await expect(page.locator("[data-idea-board-table] > thead th[scope='col']")).toHaveText(["Idea", "Pitch", "Status", "Notes", "Actions"]);
325+
await expect(page.locator("[data-idea-board-status-filter-option]")).toHaveCount(IDEA_BOARD_FILTER_STATUS_OPTIONS.length);
326+
await expect(page.locator(".idea-board-show-filter__option")).toHaveText(IDEA_BOARD_FILTER_STATUS_OPTIONS);
322327
await expect(page.locator("[data-idea-board-idea-row]")).toHaveCount(3);
323328
await expect(page.locator("[data-idea-board-expanded-row]")).toHaveCount(0);
324329
await expect(page.locator("[data-idea-board-add-idea]")).toHaveText("Add Idea");
@@ -360,6 +365,7 @@ test("Idea Board launches from Toolbox with accordion table notes model", async
360365
await page.locator("[data-idea-board-add-idea]").click();
361366
await page.locator("[data-idea-board-idea-input]").fill("Launch Tile");
362367
await page.locator("[data-idea-board-pitch-input]").fill("Turn a polished board idea into a project.");
368+
await expect(page.locator("[data-idea-board-idea-status-input] option")).toHaveText(IDEA_BOARD_EDITABLE_STATUS_OPTIONS);
363369
await page.locator("[data-idea-board-idea-status-input]").selectOption("Ready");
364370
await page.locator("[data-idea-board-idea-action='save']").click();
365371
await expect(page.locator("[data-idea-board-idea-row='launch-tile'] [data-idea-board-idea-action]")).toHaveText(["Edit", "Create Project", "Delete"]);

toolbox/idea-board/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { createServerRepositoryClient } from "../../src/api/server-api-client.js";
22
import { getSessionCurrent } from "../../src/api/session-api-client.js";
33

4-
const statusOptions = Object.freeze(["New", "Exploring", "Refining", "Ready", "Project", "Archived"]);
4+
const editableStatusOptions = Object.freeze(["New", "Exploring", "Refining", "Ready"]);
5+
const filterStatusOptions = Object.freeze(["New", "Exploring", "Refining", "Ready", "Project", "Archived"]);
56
const defaultVisibleStatuses = Object.freeze(["New", "Exploring", "Refining", "Ready", "Project"]);
67
const userId = "user-1";
78
const gameHubRoute = "toolbox/game-hub/index.html";
@@ -123,7 +124,7 @@ function visibleIdeas() {
123124
}
124125

125126
function previousStatusForRestore(record) {
126-
return statusOptions.includes(record.previousStatus) && record.previousStatus !== "Archived"
127+
return filterStatusOptions.includes(record.previousStatus) && record.previousStatus !== "Archived"
127128
? record.previousStatus
128129
: "Refining";
129130
}
@@ -168,7 +169,7 @@ function renderStatusFilter(root) {
168169
const options = root.querySelector("[data-idea-board-status-options]");
169170
if (!options) return;
170171
options.replaceChildren();
171-
for (const status of statusOptions) {
172+
for (const status of filterStatusOptions) {
172173
const label = document.createElement("label");
173174
label.className = "idea-board-show-filter__option";
174175
const input = document.createElement("input");
@@ -195,8 +196,7 @@ function statusSelect(value) {
195196
const select = document.createElement("select");
196197
select.setAttribute("aria-label", "Idea status");
197198
select.dataset.ideaBoardIdeaStatusInput = "true";
198-
for (const optionValue of statusOptions) {
199-
if (optionValue === "Project" || optionValue === "Archived") continue;
199+
for (const optionValue of editableStatusOptions) {
200200
const option = document.createElement("option");
201201
option.value = optionValue;
202202
option.textContent = optionValue;
@@ -756,7 +756,7 @@ function handleNoteAction(root, actionControl) {
756756

757757
function handleFilterAction(root, actionControl) {
758758
if (actionControl.matches("[data-idea-board-filter-select-all]")) {
759-
state.visibleStatuses = new Set(statusOptions);
759+
state.visibleStatuses = new Set(filterStatusOptions);
760760
updateStatus(root, "Showing all statuses.");
761761
} else if (actionControl.matches("[data-idea-board-filter-clear-all]")) {
762762
state.visibleStatuses = new Set();

0 commit comments

Comments
 (0)