Skip to content

Commit 8b674eb

Browse files
committed
Polish Project Journey DB tables and migrate mock keys to ULID style - PR_26157_007-project-journey-ulid-db-table-polish
1 parent fa91c19 commit 8b674eb

11 files changed

Lines changed: 378 additions & 191 deletions

File tree

admin/db-viewer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ class AdminDbViewer {
3838
return record.itemId || record.templateId || record.id || record.name || "record";
3939
}
4040

41+
shortKey(record) {
42+
const key = String(this.recordId(record));
43+
return key.length > 8 ? key.slice(-8) : key;
44+
}
45+
4146
formatValue(value) {
4247
if (Array.isArray(value)) {
4348
return value.join(", ");
@@ -80,13 +85,14 @@ class AdminDbViewer {
8085
className: "table-wrapper",
8186
});
8287
const table = this.createElement("table", {
83-
className: "data-table",
88+
className: "data-table data-table--preserve-casing",
8489
});
8590
table.setAttribute("aria-label", `${tableName} records`);
8691

8792
const fields = this.tableFields(records);
8893
const head = this.createElement("thead");
8994
const headerRow = this.createElement("tr");
95+
headerRow.append(this.createElement("th", { text: "Key" }));
9096
fields.forEach((field) => {
9197
headerRow.append(this.createElement("th", { text: field }));
9298
});
@@ -96,6 +102,9 @@ class AdminDbViewer {
96102
records.forEach((record) => {
97103
const row = this.createElement("tr");
98104
row.dataset.adminDbRecord = this.recordId(record);
105+
const keyCell = this.createElement("td", { text: this.shortKey(record) });
106+
keyCell.title = this.recordId(record);
107+
row.append(keyCell);
99108
fields.forEach((field) => {
100109
row.append(this.createElement("td", { text: this.formatValue(record[field]) }));
101110
});

assets/theme-v2/css/panels.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,18 @@ body.tool-focus-mode .tool-display-mode__badge {
418418
color: var(--gold)
419419
}
420420

421+
.mini-stat--inline {
422+
align-items: center;
423+
display: inline-flex;
424+
gap: var(--space-8);
425+
justify-content: flex-start;
426+
white-space: nowrap
427+
}
428+
429+
.mini-stat--inline strong {
430+
display: inline
431+
}
432+
421433
.tool-stat-divider {
422434
border-top: var(--border-standard);
423435
grid-column: 1 / -1;

assets/theme-v2/css/tables.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ td {
4545
letter-spacing: var(--letter-spacing-brand)
4646
}
4747

48+
.data-table--preserve-casing th {
49+
letter-spacing: 0;
50+
text-transform: none
51+
}
52+
4853
.tool-form-table {
4954
table-layout: fixed;
5055
width: 100%

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,24 @@ Note: entry percentages use function coverage when available, otherwise line cov
1212
Note: coverage entries are aggregated across every page/tool where coverageReporter.start(page) and coverageReporter.stop(page) ran.
1313

1414
Exercised tool entry points detected:
15-
(85%) Toolbox Index - exercised 6 runtime JS files
15+
(86%) Toolbox Index - exercised 6 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
1717
(74%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(94%) toolbox/project-journey/project-journey-mock-repository.js - executed lines 882/882; executed functions 74/79
21-
(96%) toolbox/project-journey/project-journey.js - executed lines 815/815; executed functions 81/84
20+
(95%) toolbox/project-journey/project-journey-mock-repository.js - executed lines 960/960; executed functions 76/80
21+
(96%) toolbox/project-journey/project-journey.js - executed lines 805/805; executed functions 79/82
2222

2323
Files with executed line/function counts where available:
2424
(67%) assets/theme-v2/js/tool-display-mode.js - executed lines 201/201; executed functions 10/15
2525
(71%) toolbox/project-workspace/project-workspace.js - executed lines 264/264; executed functions 17/24
2626
(73%) toolbox/tools-page-accordions.js - executed lines 826/826; executed functions 55/75
2727
(76%) toolbox/project-workspace/project-workspace-mock-repository.js - executed lines 402/402; executed functions 26/34
2828
(80%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 207/207; executed functions 16/20
29-
(84%) toolbox/toolRegistry.js - executed lines 1788/1788; executed functions 31/37
30-
(94%) toolbox/project-journey/project-journey-mock-repository.js - executed lines 882/882; executed functions 74/79
31-
(96%) toolbox/project-journey/project-journey.js - executed lines 815/815; executed functions 81/84
29+
(86%) toolbox/toolRegistry.js - executed lines 1788/1788; executed functions 32/37
30+
(95%) toolbox/project-journey/project-journey-mock-repository.js - executed lines 960/960; executed functions 76/80
31+
(96%) toolbox/project-journey/project-journey.js - executed lines 805/805; executed functions 79/82
32+
(98%) admin/db-viewer.js - executed lines 221/221; executed functions 40/41
3233

3334
Uncovered or low-coverage changed JS files:
3435
(100%) none - no low-coverage changed runtime JS files
@@ -38,5 +39,6 @@ Changed JS files considered:
3839
(0%) tests/playwright/tools/AdminDbViewer.spec.mjs - changed JS file not collected as browser runtime coverage
3940
(0%) tests/playwright/tools/AdminNotesViewer.spec.mjs - changed JS file not collected as browser runtime coverage
4041
(0%) tests/playwright/tools/ProjectJourneyTool.spec.mjs - changed JS file not collected as browser runtime coverage
41-
(94%) toolbox/project-journey/project-journey-mock-repository.js - changed JS file with browser V8 coverage
42+
(95%) toolbox/project-journey/project-journey-mock-repository.js - changed JS file with browser V8 coverage
4243
(96%) toolbox/project-journey/project-journey.js - changed JS file with browser V8 coverage
44+
(98%) admin/db-viewer.js - changed JS file with browser V8 coverage
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Project Journey ULID DB Table Polish Report
2+
3+
PR: PR_26157_007-project-journey-ulid-db-table-polish
4+
5+
## Scope
6+
- Updated Project Journey Statistics mini-stats so each value and label render inline.
7+
- Removed Project Journey-only Status Legend callout markup and `statusLegend` runtime code.
8+
- Preserved Admin Notes legend behavior; Admin Notes files were not modified.
9+
- Updated Project Journey DB Viewer tables to preserve actual field casing and show a short `Key` column with full-key hover titles.
10+
- Migrated Project Journey mock DB primary keys and relationship keys to ULID-style IDs.
11+
12+
## Implementation Notes
13+
- Added reusable Theme V2 `.mini-stat--inline` for inline value/label mini-stat layout.
14+
- Added reusable Theme V2 `.data-table--preserve-casing` because DB dump tables need exact field names such as `createdAt`, not uppercase headings.
15+
- Project Journey mock records now use ULID-style primary keys for notes, note types, items, templates, activity, and the Project Journey project relationship key.
16+
- Human-readable note/type/template descriptors are stored separately as names, `noteKey`, `typeKey`, or `templateKey`, not as primary keys.
17+
- `demo-project` remains only as the Project Workspace route alias so existing workspace handoff URLs still work; Project Journey table `projectId` values use the ULID-style Project Journey key.
18+
- Generated user note, note type, item, activity, and diagnostic records now receive ULID-style IDs.
19+
20+
## Verification
21+
- Statistics tiles render `strong` and `span` on one row with no status/pill styling inside the tile.
22+
- Project Journey Status Legend callout and `data-journey-status-legend` are removed from Project Journey.
23+
- Admin Notes legend remains outside this PR scope and was not changed.
24+
- DB Viewer headers display exact field casing.
25+
- Every DB Viewer table has a `Key` column; the Key cell shows the last 8 characters and its `title` contains the complete primary key.
26+
- Full primary key/id fields remain visible in each DB Viewer table.
27+
- Project Journey mock primary keys match the ULID-style pattern and no seeded Project Journey primary key uses `activity-*`, `demo-project`, `note-*`, `item-*`, `template-*`, or `custom-type-*`.
28+
- Relationship checks still report no missing links and no table bleed.
29+
30+
## Validation
31+
- `node --check toolbox/project-journey/project-journey-mock-repository.js`
32+
- `node --check toolbox/project-journey/project-journey.js`
33+
- `node --check admin/db-viewer.js`
34+
- `node --check tests/playwright/tools/ProjectJourneyTool.spec.mjs`
35+
- `node --check tests/playwright/tools/AdminDbViewer.spec.mjs`
36+
- `npx playwright test tests/playwright/tools/ProjectJourneyTool.spec.mjs tests/playwright/tools/AdminDbViewer.spec.mjs --reporter=list --workers=1` - PASS, 12 passed.
37+
- `npm run test:playwright:static -- --static-report docs_build/dev/reports/static_validation_report.md` - PASS.
38+
39+
## Skipped
40+
- Full samples smoke was not run because this PR only affects Project Journey, Admin DB Viewer, targeted Theme V2 classes, and targeted tests.
Lines changed: 29 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,36 @@
11
# Testing Lane Execution Report
22

3-
Generated: 2026-06-06
3+
PR: PR_26157_007-project-journey-ulid-db-table-polish
44

5-
Status: PASS
6-
7-
## Lanes
8-
9-
- Project Journey runtime/UI lane: PASS.
10-
- Admin Notes parser/UI lane: PASS.
11-
- Admin DB Viewer relationship-count check: PASS because Project Journey mock DB seed counts changed.
12-
- Changed-file/static validation: PASS.
13-
- Full samples smoke: SKIP per PR instructions.
5+
## Lanes Run
6+
- Project Journey runtime/UI lane.
7+
- Project Journey DB Viewer UI lane.
8+
- Changed-file/static validation lane.
9+
- Runtime JavaScript syntax checks for changed JS/test files.
1410

1511
## Commands
16-
17-
| Command | Result | Notes |
18-
| --- | --- | --- |
19-
| `node --check toolbox/project-journey/project-journey.js` | PASS | Project Journey runtime syntax passed. |
20-
| `node --check toolbox/project-journey/project-journey-mock-repository.js` | PASS | Project Journey mock DB syntax passed. |
21-
| `node --check admin/notes.js` | PASS | Admin Notes parser syntax passed. |
22-
| `node --check tests/playwright/tools/ProjectJourneyTool.spec.mjs` | PASS | Project Journey Playwright spec syntax passed. |
23-
| `node --check tests/playwright/tools/AdminNotesViewer.spec.mjs` | PASS | Admin Notes Playwright spec syntax passed. |
24-
| `npx playwright test tests/playwright/tools/ProjectJourneyTool.spec.mjs tests/playwright/tools/AdminNotesViewer.spec.mjs tests/playwright/tools/AdminDbViewer.spec.mjs --reporter=list` | PASS | 16 passed in 39.0s. |
25-
| `npm run test:playwright:static -- --static-report docs_build/dev/reports/static_validation_report.md` | PASS | Static-only lane runner completed; auxiliary static cache report churn was restored out of the PR diff. |
26-
27-
## Targeted Runtime Coverage
28-
29-
- Verified Project Journey Summary Table sorted column is visually distinct and shows asc/desc arrows.
30-
- Verified every sortable Summary Table column still toggles asc/desc.
31-
- Verified reusable `.btn.btn--compact` minimum width increased through Theme V2 button CSS.
32-
- Verified Skipped appears after Complete in Project Journey navigation, summary headers, statistics, dropdowns, and legend.
33-
- Verified Skipped does not count as Open and does count in Total.
34-
- Verified Summary Table displays Skipped after Complete and before Open.
35-
- Verified Skipped filter returns the expected release note with Skipped counts.
36-
- Verified Admin Notes parses `[-]` as Skipped and shows `[-] ⏭️ Skipped` in the status legend.
37-
- Verified Project Journey manual Status Legend layout remains intact while receiving the new Skipped entry from the existing renderer.
38-
39-
## Coverage Notes
40-
41-
- `docs_build/dev/reports/playwright_v8_coverage_report.txt` was regenerated by the targeted Playwright run.
42-
- Project Journey changed runtime JS was collected by V8 coverage.
43-
- `admin/notes.js` is listed by the coverage reporter as not collected browser runtime coverage, but the Admin Notes parser/UI lane executed and passed.
12+
- `node --check toolbox/project-journey/project-journey-mock-repository.js`
13+
- `node --check toolbox/project-journey/project-journey.js`
14+
- `node --check admin/db-viewer.js`
15+
- `node --check tests/playwright/tools/ProjectJourneyTool.spec.mjs`
16+
- `node --check tests/playwright/tools/AdminDbViewer.spec.mjs`
17+
- `npx playwright test tests/playwright/tools/ProjectJourneyTool.spec.mjs tests/playwright/tools/AdminDbViewer.spec.mjs --reporter=list --workers=1`
18+
- `npm run test:playwright:static -- --static-report docs_build/dev/reports/static_validation_report.md`
19+
20+
## Results
21+
- Syntax checks: PASS.
22+
- Targeted Playwright: PASS, 12 passed.
23+
- Static validation: PASS.
24+
- V8 coverage report: generated at `docs_build/dev/reports/playwright_v8_coverage_report.txt`.
25+
26+
## Behavior Covered
27+
- Project Journey Statistics mini-stat value/label inline layout.
28+
- Project Journey Status Legend removal.
29+
- Summary Table sorting, Skipped status, Open/Total formulas, System Generated filter, system template SSoT, and ownership fields.
30+
- User-created generated note/type/item IDs remain ULID-style and editable/deletable as scoped.
31+
- System-created items remain template-backed and non-deletable.
32+
- DB Viewer field casing, Key column, full-key hover titles, read-only behavior, relationship summaries, and no table bleed diagnostics.
4433

4534
## Skipped Lanes
46-
47-
- Full samples smoke was skipped because samples were explicitly out of scope.
48-
- Broad runtime lanes were skipped because the targeted Project Journey, Admin Notes, DB Viewer count, and static lanes covered the changed surfaces.
35+
- Full samples smoke: SKIP. Samples are not in scope and the PR does not modify sample manifests or game runtime.
36+
- Broad workspace/samples lanes: SKIP. Existing Project Workspace handoff coverage in the targeted Project Journey spec validates the active project route boundary needed for this PR.

tests/playwright/tools/AdminDbViewer.spec.mjs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { expect, test } from "@playwright/test";
2+
import { PROJECT_JOURNEY_IDS } from "../../../toolbox/project-journey/project-journey-mock-repository.js";
23
import { startRepoServer } from "../../helpers/playwrightRepoServer.mjs";
34
import { clearPlaywrightStorage, installPlaywrightStorageIsolation } from "../../helpers/playwrightStorageIsolation.mjs";
45
import { workspaceV2CoverageReporter } from "../../helpers/workspaceV2CoverageReporter.mjs";
56

7+
const ULID_PATTERN = /^[0-9A-HJKMNP-TV-Z]{26}$/;
8+
69
test.beforeEach(async ({ page }) => {
710
await installPlaywrightStorageIsolation(page, {
811
lane: "admin-db-viewer",
@@ -72,7 +75,21 @@ test("Admin DB Viewer shows read-only mock DB tables and diagnostics", async ({
7275
await expect(page.locator("[data-admin-db-table='project_journey_note_types']")).toBeVisible();
7376
await expect(page.locator("[data-admin-db-table='project_journey_activity']")).toBeVisible();
7477

78+
for (const tableName of [
79+
"project_journey_activity",
80+
"project_journey_items",
81+
"project_journey_note_types",
82+
"project_journey_notes",
83+
"project_journey_templates",
84+
]) {
85+
await expect(page.locator(`[data-admin-db-table="${tableName}"] thead th`).first()).toHaveText("Key");
86+
const keyCell = page.locator(`[data-admin-db-table="${tableName}"] tbody tr`).first().locator("td").first();
87+
await expect(keyCell).toHaveText(/^[0-9A-HJKMNP-TV-Z]{6,8}$/);
88+
await expect(keyCell).toHaveAttribute("title", ULID_PATTERN);
89+
}
90+
7591
const itemHeaders = await page.locator("[data-admin-db-table='project_journey_items'] thead th").allTextContents();
92+
expect(itemHeaders[0]).toBe("Key");
7693
expect(itemHeaders).toEqual(expect.arrayContaining([
7794
"itemId",
7895
"projectId",
@@ -86,8 +103,14 @@ test("Admin DB Viewer shows read-only mock DB tables and diagnostics", async ({
86103
"updatedByType",
87104
"templateId",
88105
]));
89-
await expect(page.locator("[data-admin-db-table='project_journey_items']")).toContainText("item-design-1");
90-
await expect(page.locator("[data-admin-db-table='project_journey_templates']")).toContainText("template-palette-affordance");
106+
expect(itemHeaders).not.toEqual(expect.arrayContaining(["CREATEDAT", "UPDATEDAT", "CREATEDBYTYPE", "UPDATEDBYTYPE"]));
107+
const createdAtHeader = page.locator("[data-admin-db-table='project_journey_items'] thead th", { hasText: "createdAt" });
108+
await expect(createdAtHeader).toHaveCSS("text-transform", "none");
109+
const designItemRow = page.locator(`[data-admin-db-record="${PROJECT_JOURNEY_IDS.items.designAffordance}"]`);
110+
await expect(designItemRow.locator("td").first()).toHaveText(PROJECT_JOURNEY_IDS.items.designAffordance.slice(-8));
111+
await expect(designItemRow.locator("td").first()).toHaveAttribute("title", PROJECT_JOURNEY_IDS.items.designAffordance);
112+
await expect(page.locator("[data-admin-db-table='project_journey_items']")).toContainText(PROJECT_JOURNEY_IDS.items.designAffordance);
113+
await expect(page.locator("[data-admin-db-table='project_journey_templates']")).toContainText(PROJECT_JOURNEY_IDS.templates.paletteAffordance);
91114
await expect(page.locator("[data-admin-db-table='project_journey_note_types']")).toContainText("Design");
92115
await expect(page.locator("[data-admin-db-table='project_journey_activity']")).toContainText("Palette and Input Density updated by Designer");
93116

0 commit comments

Comments
 (0)