Skip to content

Commit 11098af

Browse files
committed
Polish Admin Notes legend layout and root return link - PR_26156_188-admin-notes-legend-and-return-polish
1 parent 2a83946 commit 11098af

6 files changed

Lines changed: 100 additions & 67 deletions

File tree

admin/notes.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,17 @@ <h2 id="admin-notes-title" data-admin-notes-title>index.txt</h2>
5050
<span class="status" role="status" data-admin-notes-status>Loading admin notes.</span>
5151
</div>
5252
</div>
53-
<a href="admin/notes.html" data-admin-notes-return hidden>Return to index.txt</a>
5453
<div class="content-stack" data-admin-notes-content aria-live="polite"></div>
55-
<nav class="callout" aria-labelledby="admin-notes-directory-title" data-admin-notes-directory hidden>
56-
<h3 id="admin-notes-directory-title">Current Folder</h3>
54+
<nav class="callout" aria-labelledby="admin-notes-directory-title" data-admin-notes-directory>
55+
<div class="content-cluster">
56+
<h3 id="admin-notes-directory-title">Current Folder</h3>
57+
<a class="btn btn--compact primary" href="admin/notes.html" data-admin-note-link="index" data-admin-notes-root-link>Return to root index</a>
58+
</div>
5759
<div class="action-group action-group--tight" data-admin-notes-directory-links></div>
5860
</nav>
59-
<section class="callout content-stack" aria-labelledby="admin-notes-legend-title" data-admin-notes-legend>
60-
<h3 id="admin-notes-legend-title">Status Legend</h3>
61-
<ul data-admin-notes-legend-list></ul>
61+
<section class="callout action-group action-group--tight" aria-label="Status Legend" data-admin-notes-legend>
62+
<strong>Status Legend</strong>
63+
<span class="action-group action-group--tight" data-admin-notes-legend-list></span>
6264
</section>
6365
</div>
6466
</article>

admin/notes.js

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class AdminNotesViewer {
4444
this.historyRef = historyRef;
4545
this.surface = documentRef.querySelector("[data-admin-notes-viewer]");
4646
this.title = documentRef.querySelector("[data-admin-notes-title]");
47-
this.returnLink = documentRef.querySelector("[data-admin-notes-return]");
4847
this.status = documentRef.querySelector("[data-admin-notes-status]");
4948
this.content = documentRef.querySelector("[data-admin-notes-content]");
5049
this.directory = documentRef.querySelector("[data-admin-notes-directory]");
@@ -67,11 +66,6 @@ class AdminNotesViewer {
6766
}
6867
this.openNote(link.dataset.adminNoteLink || DEFAULT_NOTE, true);
6968
});
70-
71-
this.returnLink?.addEventListener("click", (event) => {
72-
event.preventDefault();
73-
this.openNote(DEFAULT_NOTE, true);
74-
});
7569
}
7670

7771
start() {
@@ -113,12 +107,12 @@ class AdminNotesViewer {
113107
this.clearContent();
114108
const title = NOTE_INDEX_FILE;
115109
this.setTitle(title);
116-
this.setReturnVisible(normalizedNoteName !== DEFAULT_NOTE);
117110

118111
if (!this.validNoteName(normalizedNoteName)) {
119112
this.renderError(
120113
`Rejected note path "${noteName}". Use a bracket note name containing only letters, numbers, underscores, or hyphens.`
121114
);
115+
await this.renderDirectoryLinks(NOTES_DIRECTORY, "");
122116
return;
123117
}
124118

@@ -138,12 +132,12 @@ class AdminNotesViewer {
138132
const normalizedFilePath = this.rootRelativeTextPathFromValue(filePath);
139133
this.clearContent();
140134
this.setTitle(normalizedFilePath ? this.fileNameForPath(normalizedFilePath) : "linked file");
141-
this.setReturnVisible(true);
142135

143136
if (!normalizedFilePath) {
144137
this.renderError(
145138
`Rejected linked file path "${filePath}". Use a repository-root text file path without traversal.`
146139
);
140+
await this.renderDirectoryLinks(NOTES_DIRECTORY, "");
147141
return;
148142
}
149143

@@ -163,6 +157,7 @@ class AdminNotesViewer {
163157
const response = await fetch(filePath, { cache: "no-store" });
164158
if (!response.ok) {
165159
this.renderError(missingMessage);
160+
await this.renderDirectoryLinks(this.folderPathForFile(currentFilePath), currentFilePath);
166161
return;
167162
}
168163
const text = await response.text();
@@ -226,9 +221,6 @@ class AdminNotesViewer {
226221
clearContent() {
227222
this.content?.replaceChildren();
228223
this.directoryLinks?.replaceChildren();
229-
if (this.directory) {
230-
this.directory.hidden = true;
231-
}
232224
}
233225

234226
setTitle(value) {
@@ -243,12 +235,6 @@ class AdminNotesViewer {
243235
}
244236
}
245237

246-
setReturnVisible(visible) {
247-
if (this.returnLink) {
248-
this.returnLink.hidden = !visible;
249-
}
250-
}
251-
252238
renderError(message) {
253239
this.setStatus("Admin note error.");
254240
const errorMessage = this.documentRef.createElement("p");
@@ -267,19 +253,9 @@ class AdminNotesViewer {
267253
.sort((left, right) => left.label.localeCompare(right.label));
268254

269255
this.directoryLinks?.replaceChildren();
270-
if (!safeEntries.length) {
271-
if (this.directory) {
272-
this.directory.hidden = true;
273-
}
274-
return;
275-
}
276-
277256
safeEntries.forEach((entry) => {
278257
this.directoryLinks?.append(this.directoryLink(entry));
279258
});
280-
if (this.directory) {
281-
this.directory.hidden = false;
282-
}
283259
}
284260

285261
async directoryEntriesForFolder(folderPath) {
@@ -352,11 +328,10 @@ class AdminNotesViewer {
352328
renderLegend() {
353329
this.legendList?.replaceChildren();
354330
Object.values(STATUS_MARKERS).forEach((marker) => {
355-
const item = this.documentRef.createElement("li");
356-
item.title = marker.title;
331+
const item = this.documentRef.createElement("span");
332+
item.dataset.adminNotesLegendItem = marker.name;
357333
const icon = this.documentRef.createElement("span");
358334
icon.dataset.adminNotesLegendIcon = marker.name;
359-
icon.title = marker.title;
360335
icon.textContent = marker.icon;
361336
item.append(icon);
362337
item.append(this.documentRef.createTextNode(` ${marker.label}`));
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# PR_26156_188 Admin Notes Legend And Return Polish Report
2+
3+
## Result
4+
PASS
5+
6+
## Summary
7+
- Changed Status Legend from a vertical list to one side-by-side Theme V2 action row.
8+
- Removed legend hover/title attributes while preserving status marker icon rendering.
9+
- Removed the old top `Return to index.txt` link.
10+
- Added `Return to root index` to the Current Folder header row.
11+
- Kept Current Folder file/folder links below the rendered note content.
12+
13+
## Scope Controls
14+
- No archived V1/V2 files changed.
15+
- No `start_of_day` files changed.
16+
- No page-local CSS, inline styles, `<style>` blocks, inline event handlers, or inline `<script>` blocks added.
17+
- No new CSS was added; existing Theme V2/Admin classes are used.
18+
- No full samples smoke was run.
19+
20+
## Latest Admin Notes Context
21+
- Built on the current Admin Notes directory-link and legend implementation from PR_26156_187.
22+
- Preserved simple subnote links, labeled root-relative file links, orange note links, current-folder links, traversal rejection, and visible missing-file errors.
23+
24+
## Runtime Behavior Verified
25+
- Status Legend appears side by side on one row: PASS.
26+
- Legend has no hover/title behavior: PASS.
27+
- Old top `Return to index.txt` element is removed: PASS.
28+
- `Return to root index` appears to the right of the Current Folder H3: PASS.
29+
- `Return to root index` appears on root, subnote, linked-file, missing-file, and rejected-path views: PASS.
30+
- `Return to root index` opens the root `docs_build/dev/admin-notes/index.txt`: PASS.
31+
- Status markers `[ ]`, `[.]`, `[x]`, `[!]`, and `[?]` still render as icons: PASS.
32+
- Current-folder links still render and open folder/text targets: PASS.
33+
- Traversal attempts are rejected before fetch: PASS.
34+
35+
## Notes
36+
- Parser status icons retain their existing title/ARIA behavior; only legend hover/title behavior was removed per BUILD.
37+
- The Current Folder section remains visible even when a folder has no additional file/folder links so the root return is always available.

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ Exercised tool entry points detected:
1717
(80%) Theme V2 Shared JS - exercised 1 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(100%) admin/notes.js - executed lines 452/452; executed functions 46/46
20+
(100%) admin/notes.js - executed lines 430/430; executed functions 44/44
2121

2222
Files with executed line/function counts where available:
2323
(80%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 206/206; executed functions 16/20
24-
(100%) admin/notes.js - executed lines 452/452; executed functions 46/46
24+
(100%) admin/notes.js - executed lines 430/430; executed functions 44/44
2525

2626
Uncovered or low-coverage changed JS files:
2727
(100%) none - no low-coverage changed runtime JS files
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PR_26156_187 Testing Lane Execution Report
1+
# PR_26156_188 Testing Lane Execution Report
22

33
## Result
44
PASS
@@ -8,33 +8,32 @@ PASS
88
- PASS
99
- `node --check tests/playwright/tools/AdminNotesViewer.spec.mjs`
1010
- PASS
11-
- `node -e "JSON.parse(require('fs').readFileSync('docs_build/dev/admin-notes/directory-index.json','utf8'))"`
12-
- PASS
1311
- `Select-String -Path admin/notes.html -Pattern '<style|\sstyle\s*=|\son[a-zA-Z]+\s*=|<script(?![^>]*\bsrc=)'`
1412
- PASS, no matches
1513
- `node node_modules/@playwright/test/cli.js test tests/playwright/tools/AdminNotesViewer.spec.mjs --project=playwright --workers=1 --reporter=list`
1614
- PASS, 3 tests
1715
- `npm run test:playwright:static`
1816
- PASS
19-
- `git diff --check -- admin/notes.html admin/notes.js docs_build/dev/admin-notes/index.txt docs_build/dev/admin-notes/quick-reference.txt docs_build/dev/admin-notes/directory-index.json docs_build/dev/reports/playwright_v8_coverage_report.txt docs_build/dev/reports/testing_lane_execution_report.md tests/playwright/tools/AdminNotesViewer.spec.mjs`
17+
- `git diff --check -- admin/notes.html admin/notes.js docs_build/dev/reports/playwright_v8_coverage_report.txt docs_build/dev/reports/testing_lane_execution_report.md tests/playwright/tools/AdminNotesViewer.spec.mjs`
2018
- PASS with Git line-ending warnings for touched files
21-
- `node -e "<trailing whitespace and merge marker check for new PR files>"`
19+
- `node -e "<trailing whitespace and merge marker check for PR188 files>"`
2220
- PASS
2321

2422
## Runtime/UI Coverage
2523
- Admin Notes page loads `docs_build/dev/admin-notes/index.txt`: PASS.
26-
- Placeholder sections Ideas, Things to Fix, and Undecided Questions render: PASS.
27-
- Status markers `[ ]`, `[.]`, `[!]`, `[?]`, and `[x]` parse into the requested emoji icons: PASS.
24+
- Status markers `[ ]`, `[.]`, `[!]`, `[?]`, and `[x]` still parse into emoji icons: PASS.
2825
- Top-level bullets and nested sub-bullets render as lists: PASS.
2926
- `[other]` opens `docs_build/dev/admin-notes/other/index.txt`: PASS.
30-
- Subnote Return to `index.txt` link returns to the main index note: PASS.
31-
- Current-folder directory links render below note content: PASS.
27+
- Old top `Return to index.txt` link is removed: PASS.
28+
- `Return to root index` appears to the right of H3 Current Folder: PASS.
29+
- `Return to root index` appears on all exercised Admin Notes page states and opens root `index.txt`: PASS.
30+
- Current-folder directory links remain below note content: PASS.
3231
- Folder directory links open folder `index.txt` files: PASS.
3332
- Supported text file directory links open and display the linked file: PASS.
3433
- The current `index.txt` is not duplicated in directory links: PASS.
3534
- H2 shows `index.txt`, and the loaded path appears to the right on the same header row: PASS.
36-
- Bottom status legend displays `⬜ Not Started`, `🟡 In Progress`, `✅ Complete`, `⛔ Blocker`, and `❓ Decide`: PASS.
37-
- `[?]` parser and legend hover/title text matches the requested Decide description: PASS.
35+
- Status Legend displays side by side in one row: PASS.
36+
- Legend has no hover/title attributes: PASS.
3837
- `[HERE, docs_build\tools-images-generated\achievements.txt]` displays `HERE` and opens the target file: PASS.
3938
- Forward slash and backslash custom file paths both resolve: PASS.
4039
- Missing note and linked text files display visible actionable errors: PASS.
@@ -48,13 +47,13 @@ PASS
4847

4948
## Skipped Lanes
5049
- Full samples smoke: SKIP by BUILD instruction.
51-
- Broader tool lanes: SKIP because PR_26156_187 changes are confined to Admin Notes page/parser runtime/UI, note fixtures, directory manifest data, and the targeted Admin Notes spec.
50+
- Broader tool lanes: SKIP because PR_26156_188 changes are confined to Admin Notes page/parser runtime/UI, return navigation placement, legend rendering, and the targeted Admin Notes spec.
5251
- Engine lane: SKIP because no engine/core files changed.
5352

5453
## Notes
5554
- Static validation generated companion reports during execution. Non-required companion report updates were restored so the PR remains scoped to requested artifacts.
5655
- The missing-path tests intentionally trigger 404 fetches for missing text files and verify the page renders actionable errors.
57-
- Directory links are manifest-backed because browser JavaScript cannot enumerate static repo folders from the existing test server.
56+
- Parser status icons retain existing title/ARIA behavior; legend hover/title behavior was removed.
5857

5958
## Coverage Artifact
6059
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`

0 commit comments

Comments
 (0)