Skip to content

Commit a1186b6

Browse files
committed
Fix fullscreen scrolling audit fallbacks and Colors tag help - PR_26159_052-fullscreen-scroll-audit-tags-help
1 parent 69ba4ce commit a1186b6

13 files changed

Lines changed: 306 additions & 72 deletions

assets/theme-v2/css/layout.css

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ body.tool-focus-mode .tool-workspace {
206206
grid-template-rows: auto minmax(var(--space-0), 1fr);
207207
gap: var(--space-10);
208208
padding: var(--space-10);
209-
align-items: stretch
209+
align-items: stretch;
210+
overflow: hidden;
211+
min-height: var(--space-0)
210212
}
211213

212214
body.tool-focus-mode .tool-workspace.is-left-collapsed {
@@ -230,9 +232,19 @@ body.tool-focus-mode .tool-display-mode {
230232
margin: var(--space-0)
231233
}
232234

233-
body.tool-focus-mode .tool-column,
234-
body.tool-focus-mode .tool-center-panel {
235+
body.tool-focus-mode .tool-workspace>* {
236+
min-height: var(--space-0)
237+
}
238+
239+
body.tool-focus-mode .tool-column {
235240
height: calc(100vh - var(--space-20));
241+
max-height: calc(100vh - var(--space-20));
242+
overflow: auto
243+
}
244+
245+
body.tool-focus-mode .tool-center-panel {
246+
height: 100%;
247+
max-height: 100%;
236248
overflow: auto
237249
}
238250

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ Missing changed runtime JS files are WARN, not FAIL.
66
Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
77

88
Changed runtime JS files considered:
9+
(0%) src/dev-runtime/guest-seeds/palette-source-mock-db.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10+
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
911
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10-
(86%) toolbox/colors/colors.js - executed lines 2136/2136; executed functions 183/212
11-
(92%) assets/theme-v2/js/account-controls.js - executed lines 47/47; executed functions 12/13
12+
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
13+
(86%) toolbox/colors/colors.js - executed lines 2147/2147; executed functions 185/214
1214

1315
Guardrail warnings:
16+
(0%) src/dev-runtime/guest-seeds/palette-source-mock-db.js - WARNING: changed runtime JS file missing from coverage; advisory only
17+
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file missing from coverage; advisory only
1418
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: changed runtime JS file missing from coverage; advisory only
19+
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# PR_26159_052 Fullscreen Scroll, Audit Fallback, And Tags Help Report
2+
3+
## Branch Guard
4+
5+
| Check | Status | Evidence |
6+
| --- | --- | --- |
7+
| Current branch is `main` before build | PASS | `git branch --show-current` returned `main`. |
8+
9+
## Requirement Checklist
10+
11+
| Requirement | Status | Evidence |
12+
| --- | --- | --- |
13+
| Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` first | PASS | Read before edits and before branch validation. |
14+
| Hard stop if current branch is not `main` | PASS | Branch was `main`; build continued. |
15+
| Fix fullscreen center-column scrollbar overflow globally | PASS | `assets/theme-v2/css/layout.css` now lets the center panel use its assigned grid-row height instead of a full viewport height. |
16+
| Apply fullscreen fix as shared Theme V2/tool shell behavior | PASS | Only shared `layout.css` changed for fullscreen layout; no per-tool fullscreen patch. |
17+
| Center column stays within viewport in fullscreen | PASS | `ToolCenterFullscreenAccordion.spec.mjs` and `ToolDisplayModeNavigation.spec.mjs` assert center bottom is within `window.innerHeight`. |
18+
| Left, center, and right columns scroll inside available viewport area | PASS | Fullscreen Playwright assertions check left/center/right overflow behavior and viewport bounds. |
19+
| No page body overflow required in fullscreen | PASS | Fullscreen Playwright assertions check `body` overflow is hidden and document overflow is within tolerance. |
20+
| Preserve H2/description hidden behavior from PR_26159_051 | PASS | `ToolDisplayModeNavigation.spec.mjs` still asserts center H2/description hide in fullscreen and restore on exit. |
21+
| Investigate seed-only audit fallback startup messages | PASS | Root cause identified in `mock-db-store.js` fallback normalization plus server snapshot rows missing explicit audit fields. |
22+
| Remove silent audit fallback behavior | PASS | Removed `allowSeedAuditFallback`, `seedFallbackContext`, and `seed-only audit fallback` handling from active dev-runtime source. |
23+
| Seed/snapshot records have explicit valid audit ownership | PASS | `palette-source-mock-db.js` now emits audit fields; `mock-api-router.mjs` maps workspace/design/config snapshots with explicit `createdBy`/`updatedBy`. |
24+
| Missing audit ownership fails visibly/actionably | PASS | `AdminDbViewer.spec.mjs` asserts missing audit ownership throws `Add explicit createdBy and updatedBy values...`; invalid persisted audit users still show DB Viewer diagnostics. |
25+
| Fix listed startup warnings | PASS | Listed tables now normalize without fallback warnings: `palette_source_swatches`, `workspace_projects`, `workspace_progress`, `game_design_documents`, `game_configuration_validation_items`, `game_configuration_records`. |
26+
| Add Colors `?` help control beside Tags input | PASS | `toolbox/colors/index.html` adds a Theme V2 `details` help control beside `paletteTagsInput`. |
27+
| Help control shows full `SUGGESTED_TAGS` list | PASS | `colors.js` renders `SUGGESTED_TAGS` into `[data-palette-tags-help-list]`; Playwright asserts 64 suggestions including `UI` and `16-Bit`. |
28+
| Suggested tags are not activated unless selected/added | PASS | Playwright opens help and asserts tag filter count is unchanged before explicit tag input. |
29+
| Preserve typeahead behavior | PASS | Existing typeahead assertion for `Player` still passes in `PaletteToolMockRepository.spec.mjs`. |
30+
| No inline style/script/event handlers added | PASS | `rg --pcre2` scan for inline script/style/event handlers returned no matches in changed active files. |
31+
| No console errors | PASS | Targeted Playwright lanes collect browser console errors and passed. |
32+
| Playwright impacted | PASS | Targeted Colors, Admin DB Viewer, Tool Display Mode, and Tool Center Fullscreen lanes passed. |
33+
34+
## Fallback Root Cause
35+
36+
`src/dev-runtime/persistence/mock-db-store.js` still supported a seed-only fallback path that silently replaced missing or invalid `createdBy`/`updatedBy` values with `forge-bot` when callers passed `allowSeedAuditFallback`. Server snapshot adapters in `src/dev-runtime/server/mock-api-router.mjs` were using that option because several translated tool tables did not provide explicit audit fields.
37+
38+
The noisy startup warnings were the visible symptom:
39+
40+
- `palette_source_swatches createdBy/updatedBy`: palette source seed rows lacked audit ownership before DB normalization.
41+
- `workspace_projects createdBy/updatedBy`: workspace snapshot rows were mapped from project repository records without audit ownership.
42+
- `workspace_progress createdBy/updatedBy`: generated progress snapshot row lacked audit ownership.
43+
- `game_design_documents createdBy/updatedBy`: game design document snapshots relied on fallback ownership.
44+
- `game_configuration_validation_items createdBy/updatedBy`: generated validation rows lacked audit ownership.
45+
- `game_configuration_records createdBy/updatedBy`: configuration snapshot rows relied on fallback ownership.
46+
47+
Fixes:
48+
49+
- Removed the fallback branch from `normalizeUserKey` so missing audit ownership throws an actionable error.
50+
- Removed fallback options from seed and server snapshot normalization.
51+
- Added explicit forge-bot audit fields to palette source seed rows.
52+
- Added explicit user/forge-bot ownership when server snapshots translate workspace, game design, game configuration, and invalid palette source diagnostic rows.
53+
54+
## Validation Evidence
55+
56+
| Lane | Status | Evidence |
57+
| --- | --- | --- |
58+
| Changed JS syntax | PASS | `node --check` passed for changed runtime/test JS files. |
59+
| Audit smoke | PASS | Node API/repository smoke printed `audit-smoke-pass`; no `seed-only audit fallback` output. |
60+
| Fullscreen tool shell | PASS | `npx playwright test tests/playwright/tools/ToolCenterFullscreenAccordion.spec.mjs tests/playwright/tools/ToolDisplayModeNavigation.spec.mjs` -> 6 passed. |
61+
| Colors runtime/tags | PASS | `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs -g "Colors adds\|Palette Tool batch tags"` -> 2 passed. |
62+
| DB Viewer audit normalization | PASS | `npx playwright test tests/playwright/tools/AdminDbViewer.spec.mjs -g "Local Mem DB audit normalization\|Palette and Asset raw Local Mem DB tables"` -> 2 passed. |
63+
| DB Viewer live Local Mem snapshot | PASS | `npx playwright test tests/playwright/tools/AdminDbViewer.spec.mjs -g "Admin DB Viewer shows current read-only Local Mem"` -> 1 passed. |
64+
| DB Viewer invalid audit diagnostic | PASS | `npx playwright test tests/playwright/tools/AdminDbViewer.spec.mjs -g "invalid persisted audit users"` -> 1 passed. |
65+
| Combined impacted Playwright pass | PASS | `npx playwright test tests/playwright/tools/ToolCenterFullscreenAccordion.spec.mjs tests/playwright/tools/ToolDisplayModeNavigation.spec.mjs tests/playwright/tools/PaletteToolMockRepository.spec.mjs tests/playwright/tools/AdminDbViewer.spec.mjs` -> 22 passed. |
66+
| Playwright V8 coverage | PASS | `docs_build/dev/reports/playwright_v8_coverage_report.txt` includes `toolbox/colors/colors.js` at 86%; dev-runtime server files are server-side and reported as advisory browser coverage warnings. |
67+
| Static fallback string check | PASS | `rg` for `seed-only audit fallback`, `allowSeedAuditFallback`, and `seedFallbackContext` returned no matches in active source/tests. |
68+
| Static inline check | PASS | `rg --pcre2` inline script/style/event handler scan returned no matches in changed active files. |
69+
| Diff whitespace | PASS | `git diff --check` passed with line-ending warnings only. |
70+
71+
## Skipped Lanes
72+
73+
- Full samples validation: skipped per request.
74+
- Broad repo-wide Playwright: skipped because this PR touched shared tool fullscreen CSS, Colors tag UI, and dev-runtime audit normalization; targeted lanes covered those exact surfaces.

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,35 @@ Exercised tool entry points detected:
1717
(77%) Theme V2 Shared JS - exercised 3 runtime JS files
1818

1919
Changed runtime JS files covered:
20+
(0%) src/dev-runtime/guest-seeds/palette-source-mock-db.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21+
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2022
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(86%) toolbox/colors/colors.js - executed lines 2136/2136; executed functions 183/212
22-
(92%) assets/theme-v2/js/account-controls.js - executed lines 47/47; executed functions 12/13
23+
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
24+
(86%) toolbox/colors/colors.js - executed lines 2147/2147; executed functions 185/214
2325

2426
Files with executed line/function counts where available:
2527
(58%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 11/19
2628
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 201/201; executed functions 9/14
2729
(76%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 525/525; executed functions 35/46
2830
(78%) toolbox/tool-registry-api-client.js - executed lines 148/148; executed functions 21/27
29-
(86%) toolbox/colors/colors.js - executed lines 2136/2136; executed functions 183/212
31+
(86%) toolbox/colors/colors.js - executed lines 2147/2147; executed functions 185/214
3032
(92%) assets/theme-v2/js/account-controls.js - executed lines 47/47; executed functions 12/13
3133
(100%) toolbox/colors/palette-api-client.js - executed lines 19/19; executed functions 4/4
3234

3335
Uncovered or low-coverage changed JS files:
36+
(0%) src/dev-runtime/guest-seeds/palette-source-mock-db.js - WARNING: uncovered changed runtime JS file; advisory only
37+
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: uncovered changed runtime JS file; advisory only
3438
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: uncovered changed runtime JS file; advisory only
39+
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: uncovered changed runtime JS file; advisory only
3540

3641
Changed JS files considered:
42+
(0%) src/dev-runtime/guest-seeds/palette-source-mock-db.js - changed JS file not collected as browser runtime coverage
43+
(0%) src/dev-runtime/persistence/mock-db-store.js - changed JS file not collected as browser runtime coverage
3744
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - changed JS file not collected as browser runtime coverage
45+
(0%) src/dev-runtime/server/mock-api-router.mjs - changed JS file not collected as browser runtime coverage
46+
(0%) tests/playwright/tools/AdminDbViewer.spec.mjs - changed JS file not collected as browser runtime coverage
3847
(0%) tests/playwright/tools/GameConfigurationMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
3948
(0%) tests/playwright/tools/PaletteToolMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
49+
(0%) tests/playwright/tools/ToolCenterFullscreenAccordion.spec.mjs - changed JS file not collected as browser runtime coverage
4050
(0%) tests/playwright/tools/ToolDisplayModeNavigation.spec.mjs - changed JS file not collected as browser runtime coverage
4151
(86%) toolbox/colors/colors.js - changed JS file with browser V8 coverage
42-
(92%) assets/theme-v2/js/account-controls.js - changed JS file with browser V8 coverage

src/dev-runtime/guest-seeds/palette-source-mock-db.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import {
2+
MOCK_DB_KEYS,
3+
createMockDbAuditFields
4+
} from "../persistence/mock-db-store.js";
5+
16
const MOCK_DB_SOURCE_GROUPS = Object.freeze([
27
{
38
label: "8-color set",
@@ -917,7 +922,9 @@ function tagForLabel(label) {
917922
}
918923

919924
export function createPaletteSourceMockDbRows() {
925+
let auditIndex = 0;
920926
return MOCK_DB_SOURCE_GROUPS.flatMap((definition) => definition.swatches.map(([hex, name], index) => ({
927+
...createMockDbAuditFields(auditIndex += 1, MOCK_DB_KEYS.users.forgeBot),
921928
hex,
922929
id: `${definition.source}-source-swatch-${index + 1}`,
923930
name,

src/dev-runtime/persistence/mock-db-store.js

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -457,37 +457,13 @@ export function setMockDbSessionUser(userKey, options = {}) {
457457
return clone(sessionUser);
458458
}
459459

460-
function defaultAuditUserKey(options = {}) {
461-
return options.userKey || MOCK_DB_SYSTEM_USER.userKey;
462-
}
463-
464-
const seedFallbackDiagnostics = new Set();
465-
466-
function emitSeedAuditFallbackDiagnostic(message, options = {}) {
467-
if (Array.isArray(options.diagnostics)) {
468-
options.diagnostics.push(message);
469-
}
470-
if (typeof console !== "undefined" && !seedFallbackDiagnostics.has(message)) {
471-
seedFallbackDiagnostics.add(message);
472-
console.warn(message);
473-
}
474-
}
475-
476460
function normalizeUserKey(value, fieldName, options = {}) {
477461
const key = String(value || "");
478462
if (isUlidKey(key)) {
479463
return key;
480464
}
481-
if (options.allowSeedAuditFallback && isUlidKey(options.fallbackUserKey)) {
482-
const context = options.seedFallbackContext || `${options.ownerId || "mock DB"} seed normalization`;
483-
emitSeedAuditFallbackDiagnostic(
484-
`${context}: ${options.tableName || "record"} ${fieldName} used seed-only audit fallback.`,
485-
options,
486-
);
487-
return options.fallbackUserKey;
488-
}
489465
throw new Error(
490-
`Invalid mock DB audit user key for ${options.tableName || "record"}.${fieldName}: ${key || "(empty)"}.`,
466+
`Invalid mock DB audit user key for ${options.tableName || "record"}.${fieldName}: ${key || "(empty)"}. Add explicit createdBy and updatedBy values that reference users.key.`,
491467
);
492468
}
493469

@@ -520,17 +496,14 @@ function normalizeRecord(tableName, record, index, options = {}) {
520496
tableName,
521497
record && typeof record === "object" && !Array.isArray(record) ? record : {},
522498
);
523-
const fallbackUserKey = defaultAuditUserKey(options);
524499
const createdAt = source.createdAt || timestampForIndex(index);
525500
const updatedAt = source.updatedAt || createdAt;
526501
const createdBy = normalizeUserKey(source.createdBy, "createdBy", {
527502
...options,
528-
fallbackUserKey,
529503
tableName,
530504
});
531505
const updatedBy = normalizeUserKey(source.updatedBy, "updatedBy", {
532506
...options,
533-
fallbackUserKey: createdBy,
534507
tableName,
535508
});
536509
return {
@@ -586,12 +559,7 @@ function ensureKnownTables(state) {
586559

587560
export function loadMockDbTables(ownerId, seedTables = {}, options = {}) {
588561
const state = readStoredState(options);
589-
const normalizedSeeds = normalizeTables(seedTables, {
590-
...options,
591-
allowSeedAuditFallback: true,
592-
ownerId,
593-
seedFallbackContext: `${ownerId} seed table initialization`,
594-
});
562+
const normalizedSeeds = normalizeTables(seedTables, { ...options, ownerId });
595563
const tableNames = Object.keys(normalizedSeeds);
596564
const persisted = tableNames.some((tableName) => Object.hasOwn(state.tables, tableName));
597565
let changed = false;
@@ -671,11 +639,7 @@ export function clearMockDbTables(options = {}) {
671639
export function seedMockDbTables(options = {}) {
672640
const state = emptyState();
673641
Object.entries(getStandaloneMockDbSeedTables()).forEach(([tableName, rows]) => {
674-
state.tables[tableName] = normalizeTableRows(tableName, rows, {
675-
...options,
676-
allowSeedAuditFallback: true,
677-
seedFallbackContext: "standalone seed table initialization",
678-
});
642+
state.tables[tableName] = normalizeTableRows(tableName, rows, options);
679643
state.owners[tableName] = "standalone";
680644
});
681645
writeStoredState(state, options);

0 commit comments

Comments
 (0)