Skip to content

Commit 921b22b

Browse files
committed
Restore Admin Owner Notes to read docs_build/dev/admin-notes as the source of truth - PR_26169_028-admin-owner-notes-source
1 parent ad27a42 commit 921b22b

15 files changed

Lines changed: 1465 additions & 231 deletions
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# PR_26169_028 Admin Owner Notes Source
2+
3+
## Summary
4+
5+
Corrected Owner Notes so it uses the existing Admin Notes viewer pattern and `docs_build/dev/admin-notes/` as the source of truth. The previous Owner placeholder content was replaced with a directory-backed reader, while the existing dev-runtime Admin Notes route remains available.
6+
7+
## Requirement Checklist
8+
9+
| Requirement | Status | Evidence |
10+
| --- | --- | --- |
11+
| Notes use `docs_build/dev/admin-notes/` as source of truth. | PASS | `owner/notes.html` loads the shared viewer; Playwright verifies `index.txt` and `sample.txt` content from the directory. |
12+
| Do not create or use a second notes storage location. | PASS | No new notes directory or copied note content was added. |
13+
| Notes available from Owner menu. | PASS | Existing Owner navigation SSoT still points `Notes` to `owner/notes.html`; targeted navigation tests pass. |
14+
| Admin menu exposure based on existing behavior. | PASS | Current shared Admin menu remains operations-only; existing local Admin viewer route remains available at `/admin/admin-notes.html`. |
15+
| UI lists available note files. | PASS | Playwright validates root folder/file links from `docs_build/dev/admin-notes/`. |
16+
| UI reads selected note content. | PASS | Playwright opens `sample.txt` and `other/index.txt` from the source folder. |
17+
| Preserve existing note files/content. | PASS | No files under `docs_build/dev/admin-notes/` were changed. |
18+
| Convert/remove duplicate placeholder. | PASS | `owner/notes.html` was converted from the Game Journey placeholder into the correct viewer route. |
19+
| No duplicated note content in HTML/JS constants. | PASS | HTML/JS contain only path labels/status text, not copied note bodies. |
20+
| Do not move/rename `docs_build/dev/admin-notes/`. | PASS | Directory location unchanged. |
21+
| Restrict reads to `docs_build/dev/admin-notes/`. | PASS | API handler rejects traversal and non-admin-notes folders. |
22+
| Missing directory visible diagnostic. | PASS | Playwright negative-path test verifies the visible missing-directory message. |
23+
| Empty directory empty state. | PASS | Playwright verifies the empty-state message with no folder/file links. |
24+
| Deterministic sorted list. | PASS | Node handler test verifies alphabetical ordering. |
25+
26+
## Implementation Notes
27+
28+
- Added a read-only `/api/dev/admin-notes/directory?folder=...` route backed by the existing Admin Notes directory handler.
29+
- Kept the legacy `?adminNotesDirectory=1` route working for the existing local Admin Notes viewer behavior.
30+
- Updated the viewer to resolve directory listings through the configured browser-safe API URL, while continuing to load selected `.txt` files by root-relative path.
31+
- Updated the viewer link generation so Owner route navigation stays under `/owner/notes.html`.
32+
- Converted `owner/notes.html` into an Owner-protected Admin/Owner Notes viewer shell with the existing Owner menu.
33+
34+
## Validation
35+
36+
| Command | Result |
37+
| --- | --- |
38+
| `git branch --show-current` | PASS, `main`. |
39+
| `node --check src/dev-runtime/admin/admin-notes-directory.mjs` | PASS |
40+
| `node --check src/dev-runtime/admin/admin-notes-viewer.js` | PASS |
41+
| `node --check src/dev-runtime/server/local-api-router.mjs` | PASS |
42+
| `node --check src/dev-runtime/server/local-api-server.mjs` | PASS |
43+
| `node --check tests/helpers/playwrightRepoServer.mjs` | PASS |
44+
| `node --check tests/dev-runtime/AdminNotesBoundary.test.mjs` | PASS |
45+
| `node --check tests/playwright/tools/AdminNotesLocalViewer.spec.mjs` | PASS |
46+
| `node --check tests/playwright/tools/AdminOwnerNavigationBoundary.spec.mjs` | PASS |
47+
| `node --test tests/dev-runtime/AdminNotesBoundary.test.mjs` | PASS, 8/8 |
48+
| `node --test tests/dev-runtime/ApiMenuPathCleanup.test.mjs` | PASS, 6/6 |
49+
| `npx playwright test tests/playwright/tools/AdminNotesLocalViewer.spec.mjs tests/playwright/tools/AdminOwnerNavigationBoundary.spec.mjs --workers=1` | PASS, 9/9 after updating the expected console noise for the intentional 404 diagnostic case. |
50+
| `git diff --check` | PASS, CRLF notices only. |
51+
52+
## Coverage
53+
54+
Playwright V8 coverage was generated in `docs_build/dev/reports/playwright_v8_coverage_report.txt`.
55+
56+
- `src/dev-runtime/admin/admin-notes-viewer.js`: 96%, executed lines 533/533.
57+
- Node server modules changed for the directory API are advisory warnings in browser V8 coverage because they are not browser-collected runtime scripts.
58+
59+
## Files Changed
60+
61+
- `docs_build/pr/BUILD_PR_26169_028-admin-owner-notes-source.md`
62+
- `docs_build/dev/reports/PR_26169_028-admin-owner-notes-source.md`
63+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
64+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
65+
- `owner/notes.html`
66+
- `src/dev-runtime/admin/admin-notes-directory.mjs`
67+
- `src/dev-runtime/admin/admin-notes-viewer.js`
68+
- `src/dev-runtime/server/local-api-router.mjs`
69+
- `src/dev-runtime/server/local-api-server.mjs`
70+
- `tests/dev-runtime/AdminNotesBoundary.test.mjs`
71+
- `tests/helpers/playwrightRepoServer.mjs`
72+
- `tests/playwright/tools/AdminNotesLocalViewer.spec.mjs`
73+
- `tests/playwright/tools/AdminOwnerNavigationBoundary.spec.mjs`
74+
75+
## Notes
76+
77+
- Full samples smoke was not run, per BUILD scope.
78+
- Existing note files in `docs_build/dev/admin-notes/` were left untouched.
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# git status --short
2-
M docs_build/dev/reports/PR_26169_027-owner-notes-restoration.md
3-
M docs_build/dev/reports/playwright_v8_coverage_report.txt
4-
M tests/playwright/tools/AdminOwnerNavigationBoundary.spec.mjs
5-
6-
# git ls-files --others --exclude-standard
7-
(no output)
8-
9-
# git diff --stat
10-
.../PR_26169_027-owner-notes-restoration.md | 1 +
11-
.../dev/reports/playwright_v8_coverage_report.txt | 6 +--
12-
.../tools/AdminOwnerNavigationBoundary.spec.mjs | 50 ++++++++++++++++++++++
13-
3 files changed, 53 insertions(+), 4 deletions(-)
1+
docs_build/dev/reports/codex_changed_files.txt
2+
docs_build/dev/reports/codex_review.diff
3+
docs_build/dev/reports/coverage_changed_js_guardrail.txt
4+
docs_build/dev/reports/playwright_v8_coverage_report.txt
5+
docs_build/dev/reports/PR_26169_028-admin-owner-notes-source.md
6+
docs_build/pr/BUILD_PR_26169_028-admin-owner-notes-source.md
7+
owner/notes.html
8+
src/dev-runtime/admin/admin-notes-directory.mjs
9+
src/dev-runtime/admin/admin-notes-viewer.js
10+
src/dev-runtime/server/local-api-router.mjs
11+
src/dev-runtime/server/local-api-server.mjs
12+
tests/dev-runtime/AdminNotesBoundary.test.mjs
13+
tests/helpers/playwrightRepoServer.mjs
14+
tests/playwright/tools/AdminNotesLocalViewer.spec.mjs
15+
tests/playwright/tools/AdminOwnerNavigationBoundary.spec.mjs

0 commit comments

Comments
 (0)