Skip to content

Commit 8c0395f

Browse files
committed
Create missing dev-only Admin Notes viewer page - PR_26158_045-admin-notes-viewer-page-fix
1 parent 4ad73d1 commit 8c0395f

3 files changed

Lines changed: 103 additions & 23 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# PR_26158_045 Admin Notes Viewer Page Fix Report
2+
3+
## Summary
4+
5+
Verified the dev-only Admin Notes viewer page at `src/dev-runtime/admin/admin-notes.html`, strengthened boundary coverage for its external JavaScript wiring, and confirmed the local-only Admin menu link targets that viewer. The viewer loads `docs_build/dev/admin-notes/index.txt` by default, lists folders/files, and opens selected `.txt` notes.
6+
7+
## Requirement Checklist
8+
9+
| Requirement | Evidence | Status |
10+
| --- | --- | --- |
11+
| Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` first. | Read before validation/build work. | PASS |
12+
| Create the missing dev-only Admin Notes viewer page at `src/dev-runtime/admin/admin-notes.html`. | Page exists in the current stack and is included in the PR045 ZIP artifact. | PASS |
13+
| Create required external JavaScript under `src/dev-runtime/admin/`. | `src/dev-runtime/admin/admin-notes-viewer.js`, `admin-notes-directory.mjs`, and `admin-notes-menu.mjs` exist under dev-runtime admin. | PASS |
14+
| Do not use inline script, inline style, or inline event handlers. | AdminNotesBoundary static test validates `admin-notes.html` has none. | PASS |
15+
| Viewer loads `docs_build/dev/admin-notes/index.txt` by default. | AdminNotesLocalViewer Playwright validates loaded status and content. | PASS |
16+
| Viewer lists folders and file names from `docs_build/dev/admin-notes/`. | Playwright validates `notes/`, `other/`, `quick-reference.txt`, and `sample.txt`. | PASS |
17+
| Selecting a `.txt` note displays its content. | Playwright opens `quick-reference.txt` and `other/index.txt` and validates content. | PASS |
18+
| Admin menu local-only link targets the created viewer page. | LoginSessionMode Playwright validates `href` ending in `/src/dev-runtime/admin/admin-notes.html`. | PASS |
19+
| Keep Admin Notes dev-only and out of UAT/PROD. | Static exposure/import audits over public/prod candidate paths returned no matches. | PASS |
20+
| Do not modify `assets/theme-v2/partials/header-nav.html` with a production-visible link. | Header partial remains clean; no PR045 change to the partial. | PASS |
21+
| Do not modify `start_of_day` folders. | `git diff --name-only \| rg "(^|/)start_of_day(/|$)"` returned no matches. | PASS |
22+
| Run changed-file syntax checks. | `node --check` lane passed. | PASS |
23+
| Run AdminNotesLocalViewer Playwright proving page exists/index loads/folders-files list/selected content displays. | Scoped Playwright run passed, 2/2. | PASS |
24+
| Run Admin menu local-only validation. | LoginSessionMode Playwright and AdminNotesBoundary node test passed. | PASS |
25+
| Verify UAT/PROD paths do not expose or import `src/dev-runtime/admin/`. | Static import audit returned no matches. | PASS |
26+
27+
## Changed Files
28+
29+
| File | Purpose |
30+
| --- | --- |
31+
| `tests/dev-runtime/AdminNotesBoundary.test.mjs` | Adds static validation for the viewer page's external JavaScript wiring and inline HTML restrictions. |
32+
| `docs_build/dev/reports/admin-notes-viewer-page-fix-report.md` | PR045 requirement checklist and validation evidence. |
33+
| `docs_build/dev/reports/testing_lane_execution_report.md` | PR045 executed validation lanes. |
34+
| `docs_build/dev/reports/codex_review.diff` | Generated review diff. |
35+
| `docs_build/dev/reports/codex_changed_files.txt` | Generated changed-file summary. |
36+
37+
## Viewer Files Included In ZIP
38+
39+
| File | Reason |
40+
| --- | --- |
41+
| `src/dev-runtime/admin/admin-notes.html` | Dev-only viewer page requested by PR045. |
42+
| `src/dev-runtime/admin/admin-notes-viewer.js` | External viewer runtime. |
43+
| `src/dev-runtime/admin/admin-notes-directory.mjs` | Local/dev folder listing handler. |
44+
| `src/dev-runtime/admin/admin-notes-menu.mjs` | Local-only Admin menu link target source. |
45+
| `src/dev-runtime/server/local-api-server.mjs` | Local server wiring for the viewer/menu support. |
46+
| `tests/helpers/playwrightRepoServer.mjs` | Playwright local server wiring for validation. |
47+
| `tests/playwright/tools/AdminNotesLocalViewer.spec.mjs` | Runtime/UI validation for the viewer page. |
48+
| `tests/playwright/tools/LoginSessionMode.spec.mjs` | Local-only Admin menu validation. |
49+
50+
## Validation Evidence
51+
52+
| Validation | Result |
53+
| --- | --- |
54+
| Changed-file `node --check` lane | PASS |
55+
| `node --test tests/dev-runtime/AdminNotesBoundary.test.mjs` | PASS, 5/5 |
56+
| `npx playwright test tests/playwright/tools/AdminNotesLocalViewer.spec.mjs tests/playwright/tools/LoginSessionMode.spec.mjs --grep "Admin Notes local viewer loads\|Local users unlock" --workers=1` | PASS, 2/2 |
57+
| Public navigation exposure audit | PASS, no matches |
58+
| UAT/PROD dev-runtime admin import audit | PASS, no matches |
59+
| `Test-Path admin/notes.html` | PASS, returned `False` |
60+
| `git diff --check` | PASS, line-ending warnings only |
61+
62+
## Playwright Impact
63+
64+
Playwright impacted: Yes. This PR validates the dev-only Admin Notes viewer page and local Admin menu link behavior. Expected pass behavior is that the page loads `index.txt`, lists folders/files, opens selected `.txt` note content, and the local Admin menu link points at the viewer. Expected fail behavior is a missing viewer page, inline page code, missing default note content, missing folder/file links, broken selected note rendering, or production/public Admin Notes exposure.
65+
66+
## Manual Test Notes
67+
68+
1. Start the API-backed local server.
69+
2. Open `/src/dev-runtime/admin/admin-notes.html`.
70+
3. Confirm `index.txt` loads by default.
71+
4. Click `quick-reference.txt` and `other/`; each should display selected note content.
72+
5. Log in as Admin locally and confirm `Admin Notes (Local Dev)` opens `/src/dev-runtime/admin/admin-notes.html`.
73+
74+
## Skipped Lanes
75+
76+
- Full samples smoke: skipped because samples and game runtime were not touched.
77+
- Full Playwright suite: skipped because targeted Admin Notes viewer and local Admin menu lanes cover the changed behavior.
Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
# PR_26158_044 Testing Lane Execution Report
1+
# PR_26158_045 Testing Lane Execution Report
22

33
## Lanes Run
44

55
| Lane | Command | Result |
66
| --- | --- | --- |
7-
| Changed-file syntax checks | `node --check src/dev-runtime/admin/admin-notes-directory.mjs`; `node --check src/dev-runtime/admin/admin-notes-menu.mjs`; `node --check src/dev-runtime/admin/admin-notes-viewer.js`; `node --check src/dev-runtime/server/local-api-server.mjs`; `node --check tests/helpers/playwrightRepoServer.mjs`; `node --check tests/dev-runtime/AdminNotesBoundary.test.mjs`; `node --check tests/playwright/tools/AdminNotesLocalViewer.spec.mjs`; `node --check tests/playwright/tools/LoginSessionMode.spec.mjs`; `node --check assets/theme-v2/js/gamefoundry-partials.js` | PASS |
8-
| Admin Notes boundary/local menu validation | `node --test tests/dev-runtime/AdminNotesBoundary.test.mjs` | PASS, 4/4 |
9-
| Admin Notes local viewer Playwright | `npx playwright test tests/playwright/tools/AdminNotesLocalViewer.spec.mjs` | PASS |
10-
| Login/Admin local menu Playwright | `npx playwright test tests/playwright/tools/LoginSessionMode.spec.mjs --grep "Local users unlock their allowed Account and Admin pages"` | PASS |
11-
| Combined scoped Playwright and V8 coverage | `npx playwright test tests/playwright/tools/AdminNotesLocalViewer.spec.mjs tests/playwright/tools/LoginSessionMode.spec.mjs --grep "Admin Notes local viewer loads\|Local users unlock" --workers=1` | PASS, 2/2 |
7+
| Changed-file syntax checks | `node --check src/dev-runtime/admin/admin-notes-directory.mjs`; `node --check src/dev-runtime/admin/admin-notes-menu.mjs`; `node --check src/dev-runtime/admin/admin-notes-viewer.js`; `node --check src/dev-runtime/server/local-api-server.mjs`; `node --check tests/helpers/playwrightRepoServer.mjs`; `node --check tests/dev-runtime/AdminNotesBoundary.test.mjs`; `node --check tests/playwright/tools/AdminNotesLocalViewer.spec.mjs`; `node --check tests/playwright/tools/LoginSessionMode.spec.mjs`; `node --test tests/dev-runtime/AdminNotesBoundary.test.mjs` | PASS, AdminNotesBoundary 5/5 |
8+
| Admin Notes local viewer Playwright | `npx playwright test tests/playwright/tools/AdminNotesLocalViewer.spec.mjs tests/playwright/tools/LoginSessionMode.spec.mjs --grep "Admin Notes local viewer loads\|Local users unlock" --workers=1` | PASS, 2/2 |
129
| Public navigation exposure audit | `rg -n "docs_build/dev/admin-notes\|docs_build\\dev\\admin-notes\|admin-notes-dev\|data-admin-notes-local-menu\|Admin Notes" account admin assets toolbox src/engine src/shared --glob '!archive/v1-v2/**' --glob '!tmp/**'` | PASS, no matches |
1310
| UAT/PROD dev-runtime admin import audit | `rg -n "src/dev-runtime/admin\|src\\dev-runtime\\admin" account admin assets toolbox src/engine src/shared --glob '!archive/v1-v2/**' --glob '!tmp/**'` | PASS, no matches |
1411
| Production route absence check | `Test-Path admin/notes.html` | PASS, returned `False` |
@@ -19,31 +16,25 @@
1916

2017
| Check | Evidence | Result |
2118
| --- | --- | --- |
22-
| Admin Notes appears in the Admin menu when served from the local/dev server. | `tests/playwright/tools/LoginSessionMode.spec.mjs` asserts `data-admin-notes-local-menu` is visible for Admin. | PASS |
23-
| Admin Notes link targets `/src/dev-runtime/admin/admin-notes.html`. | LoginSessionMode Playwright validates the link `href`. | PASS |
24-
| Non-admin users do not see the Admin Notes menu link. | LoginSessionMode Playwright validates the link is hidden when the Admin menu is hidden. | PASS |
25-
| `assets/theme-v2/partials/header-nav.html` does not contain a production-visible Admin Notes hardcoded link. | AdminNotesBoundary node test and static `rg` exposure audit. | PASS |
26-
| Local injection is dev-runtime owned. | `src/dev-runtime/admin/admin-notes-menu.mjs` injects only the served header copy in the local/test server. | PASS |
27-
| `/admin/notes.html` was not added or required. | `Test-Path admin/notes.html` returned `False`. | PASS |
28-
| UAT/PROD candidate paths do not expose or import Admin Notes. | Static exposure/import audits returned no matches. | PASS |
29-
| Admin Notes viewer behavior remains intact. | AdminNotesLocalViewer Playwright still loads `index.txt` and opens folder/file notes. | PASS |
30-
31-
## Retry Note
32-
33-
| Command | Result | Disposition |
34-
| --- | --- | --- |
35-
| Initial parallel run of AdminNotesLocalViewer and LoginSessionMode Playwright lanes | LoginSessionMode hit Playwright artifact-copy `ENOENT` while parallel artifact writers were active. | Infrastructure artifact contention. The same LoginSessionMode lane passed when rerun alone, and both scoped tests passed together with `--workers=1`. |
19+
| `src/dev-runtime/admin/admin-notes.html` exists. | AdminNotesBoundary node test validates the page exists. | PASS |
20+
| Viewer page uses external JavaScript only. | AdminNotesBoundary validates no inline script/style/event handlers and external `./admin-notes-viewer.js`. | PASS |
21+
| `docs_build/dev/admin-notes/index.txt` loads by default. | AdminNotesLocalViewer Playwright validates title/status/content. | PASS |
22+
| Folders and files from `docs_build/dev/admin-notes/` list for selection. | AdminNotesLocalViewer Playwright validates `notes/`, `other/`, `quick-reference.txt`, and `sample.txt`. | PASS |
23+
| Selecting a `.txt` note displays its content. | AdminNotesLocalViewer Playwright opens `quick-reference.txt` and `other/index.txt`. | PASS |
24+
| Admin menu local-only link targets the viewer page. | LoginSessionMode Playwright validates `/src/dev-runtime/admin/admin-notes.html`. | PASS |
25+
| Checked-in Theme V2 header partial has no production-visible Admin Notes link. | Static audit and AdminNotesBoundary test. | PASS |
26+
| UAT/PROD candidate paths do not import `src/dev-runtime/admin/`. | Static import audit returned no matches. | PASS |
3627

3728
## Skipped Lanes
3829

3930
| Lane | Decision | Reason |
4031
| --- | --- | --- |
4132
| Full samples smoke | SKIP | No sample loader/framework, game runtime, or sample data changed. |
42-
| Full Playwright suite | SKIP | PR scope is limited to local/dev Admin menu injection and existing Admin Notes local viewer behavior; targeted viewer/menu lanes passed. |
43-
| Full Node suite | SKIP | Targeted syntax checks and AdminNotesBoundary node test cover the changed dev-runtime/static boundary. |
33+
| Full Playwright suite | SKIP | PR scope is limited to the dev-only Admin Notes viewer and local-only Admin menu validation; targeted lanes passed. |
34+
| Playwright V8 coverage regeneration as a deliverable | SKIP | PR045 did not change runtime JavaScript; Playwright coverage files were not included as PR045 deliverables. |
4435

4536
## Notes
4637

38+
- The viewer page already existed in the current stacked tree; this PR added explicit static validation that it has no inline script/style/event handlers and confirmed the page behavior with Playwright.
4739
- `git diff --check` emitted line-ending warnings only.
4840
- Playwright emitted existing SQLite experimental and seed-only audit fallback warnings; they did not fail the targeted lanes.
49-
- Runtime coverage is advisory; server-side dev-runtime handlers are listed as uncovered by browser V8 because they execute in Node, not Chromium.

tests/dev-runtime/AdminNotesBoundary.test.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ test("Admin Notes implementation is isolated under src/dev-runtime/admin", () =>
9797
);
9898
});
9999

100+
test("Admin Notes local viewer page uses external dev-runtime JavaScript only", () => {
101+
const viewerSource = fs.readFileSync(repoPath("src/dev-runtime/admin/admin-notes.html"), "utf8");
102+
assert.doesNotMatch(viewerSource, /<script(?![^>]*\bsrc=)/i, "viewer page must not contain inline scripts");
103+
assert.doesNotMatch(viewerSource, /<style\b/i, "viewer page must not contain style blocks");
104+
assert.doesNotMatch(viewerSource, /\son[a-z]+\s*=/i, "viewer page must not contain inline event handlers");
105+
assert.match(
106+
viewerSource,
107+
/<script type="module" src="\.\/admin-notes-viewer\.js"><\/script>/,
108+
"viewer page loads its external dev-runtime viewer script",
109+
);
110+
});
111+
100112
test("production-facing paths do not link to dev Admin Notes files or implementation", () => {
101113
const headerSource = fs.readFileSync(repoPath("assets/theme-v2/partials/header-nav.html"), "utf8");
102114
assert.doesNotMatch(headerSource, /docs_build\/dev\/admin-notes|admin-notes-dev|data-admin-notes-local-menu|Admin Notes/);

0 commit comments

Comments
 (0)