jsonresume-theme-wintermuted 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,6 +21,52 @@ npm install jsonresume-theme-wintermuted
21
21
  ```
22
22
 
23
23
  The shared `@wintermuted/ui-theme` package is installed automatically as a dependency of this theme.
24
+ It is pinned to the official `2.2.1` GitHub release tarball, with its integrity
25
+ recorded in `package-lock.json`. Installation requires access to GitHub release
26
+ assets rather than npm registry metadata for this dependency. To upgrade it,
27
+ select a versioned asset from the upstream release and regenerate the lockfile;
28
+ do not use a local tarball path or a moving release URL.
29
+ The automated dependency updater recognizes this pin for version comparisons;
30
+ it still requires npm publication verification before proposing a newer registry
31
+ version. It does not silently fall back to another source.
32
+
33
+ ### Shared presentation contracts
34
+
35
+ The `ui-theme@2.2.1` release asset was retrieved and checked against its official
36
+ SHA-256 digest:
37
+ `d6fea52ca63cbc2c2f07a04f192f33ef7bda29029456528f03b94bbe04a56797`.
38
+ The installed public CSS and packaged consumer guide, not unreleased upstream
39
+ source, define the contracts consumed here:
40
+
41
+ - Navigation uses `.wm-side-nav-nested`, its group/sublist/subitem/sublink/label
42
+ slots, and `.wm-side-nav-end` for the existing right-side setting.
43
+ Adjacent anchors supply `aria-expanded` and unique `aria-controls`; one link
44
+ supplies `aria-current="location"`. Scroll tracking and focus recovery before
45
+ automatic collapse remain resume-owned.
46
+ - Project media uses `.wm-gallery-lightbox-viewer`, shared header/title/meta,
47
+ content/image/SVG, navigation/icon, close and status/caption/counter slots.
48
+ `.wm-active`, `aria-hidden` and direct-media `hidden` state are synchronized
49
+ by the local controller, which also owns focus trapping/return, background
50
+ inertness, keyboard navigation, scroll locking and Mermaid rendering.
51
+ - Entry rows use `.wm-entry-header` from the public `layout.css` sheet, whose
52
+ other layout selectors are opt-in and do not match the resume shell. Local
53
+ `role-header` hooks retain heading margins and mobile layout; date typography,
54
+ helpers, nowrap and print policy are unchanged. Shared date/meta typography
55
+ is deliberately not applied.
56
+
57
+ The nested navigation has brighter secondary labels/sublinks and shared CSS
58
+ chevrons. The viewer intentionally has brighter wrapping metadata/captions,
59
+ non-overlapping mobile controls and a full-stage, aspect-preserving SVG surface.
60
+ Small local compatibility rules preserve the resume backdrop/image treatment,
61
+ bound intrinsic media tracks and stretch the stage within its grid row, and
62
+ make visibility immediate for reliable modal focus entry. Gallery captions can
63
+ break unbroken references. Application spacing, sticky/mobile placement, print,
64
+ summary/detail behavior, scrolling and Game of Life remain local.
65
+
66
+ Heading permalinks and editorial labels remain local: neither
67
+ `.wm-heading-anchor` nor `.wm-editorial-label` exists in the verified `2.2.1`
68
+ artifact, and no newer official theme release was available at adoption time.
69
+ Do not reference those APIs until a retrievable release is verified.
24
70
 
25
71
  For local development before publish:
26
72
 
@@ -99,6 +145,19 @@ them. The print button is observed via a `window.print` spy; print CSS is
99
145
  emulated and an A4 PDF retained as pagination evidence, **not** a PDF comparison
100
146
  or a test of the native print dialog.
101
147
 
148
+ Additional behavioral cases cover nested-navigation expansion/current-location
149
+ ARIA, unique controls, collapsed keyboard order, explicit hidden state, focus
150
+ recovery and persisted end alignment; shared entry-header layout; and modal
151
+ image/SVG navigation, focus/inert/scroll restoration, stage bounds and control
152
+ separation. Directional navigation skips unrendered or invalid diagrams without
153
+ changing direct-open rejection; screenshot preview labels fall back to visible
154
+ captions when alternative text is empty or missing. Viewer image/SVG captures
155
+ are retained as evidence, not baselines.
156
+ On Windows, `npx playwright test --ignore-snapshots` exercises these assertions
157
+ without comparing or rewriting the Linux baselines. It does not establish that
158
+ the Linux visual gate passes: intentional visual changes require the CI
159
+ capture/review procedure below before merging.
160
+
102
161
  `scripts/browser/server.mjs` renders the bundled Alex Winter sample directly,
103
162
  adding work/project keywords, a linked work project, languages/interests and an
104
163
  inline SVG image for representative tags and media. No production template,
@@ -107,10 +166,14 @@ context; persistence assertions reload within that context rather than seeding
107
166
  the expected UI state.
108
167
 
109
168
  Google Fonts CSS is replaced with an empty sheet: screenshots exercise the
110
- pinned Linux system-font fallback, not downloaded Inter. The external Mermaid
111
- module gets an initialization-only stub whose render method throws if invoked;
112
- the fixture contains no Mermaid diagrams. Other external requests and browser
113
- script errors fail. This does **not** verify CDN availability, real Mermaid,
169
+ pinned Linux system-font fallback, not downloaded Inter. The default fixture
170
+ contains no Mermaid diagrams. The additional `/?viewer` fixture uses long
171
+ metadata/captions and deterministic SVGs supplied by a Mermaid-module stub to
172
+ exercise dimension/viewBox normalization, containment and theme refresh.
173
+ `/?viewer-feedback` additionally covers caption-based labels and consecutive
174
+ unpreviewable diagrams between valid media in both navigation directions. This
175
+ checks the consumer controller, not the real Mermaid renderer. Other external
176
+ requests and browser script errors fail. This does **not** verify CDN availability, real Mermaid,
114
177
  remote project assets, Firefox/WebKit, physical phones, accessibility compliance,
115
178
  Game of Life, or animation timing. Decorative randomness is seeded without
116
179
  removing its DOM. Reduced motion is requested, and Playwright finishes CSS
@@ -132,6 +195,16 @@ The first proof-runner rejected the missing image correctly but then failed on
132
195
  its own wording check; that check was corrected to Playwright's observed error.
133
196
  The committed images must also pass an ordinary **no-capture** CI run.
134
197
 
198
+ The six desktop navigation baselines (light/dark summary and detailed, plus
199
+ focused left/right) were subsequently reviewed from
200
+ [CI capture 46728598044](https://github.com/wintermuted/jsonresume-theme-wintermuted/actions/runs/46728598044)
201
+ at `a0c2efb395b8f1725b944c4cc86a8efa9f76454e` on the same pinned renderer.
202
+ Changes were confined to the intended shared navigation text spacing and
203
+ chevrons at the configured visual threshold; all nine other baselines still
204
+ passed unchanged. Only those six desktop candidates were committed. Capture,
205
+ strict comparison and all failure probes passed with 24 behavioral cases and
206
+ eight intentional matrix exclusions.
207
+
135
208
  `npm run test:browser` defaults to **no updates**, locally and in CI. Missing
136
209
  baselines fail without being written; changed screenshots fail at zero differing
137
210
  pixels after Playwright's per-pixel 0.2 color threshold. No retries are used.
@@ -246,11 +319,11 @@ authenticate using OIDC, even with `id-token: write` and `--provenance`.
246
319
  Release flow:
247
320
 
248
321
  1. Merge or push changes to `main`.
249
- 2. The `Publish And Release` workflow selects the higher of the next patch after the latest `v*` tag and the explicit `package.json` version (canonical stable `major.minor.patch`). Without a tag, the automatic baseline is `0.1.0`.
250
- 3. The workflow updates `package.json` and `package-lock.json`, creates a local version commit, and publishes the package to npm.
251
- 4. It verifies the exact version's registry SHA-512 integrity against the local package, then pushes the version commit to `main`.
252
- 5. The workflow creates and pushes the matching `v<version>` tag.
253
- 6. The workflow creates the corresponding GitHub release.
322
+ 2. The serialized `Publish And Release` workflow checks out current `main`, even for queued pushes or manual recovery, installs dependencies and runs `npm test`.
323
+ 3. It reads stable versions directly from `registry.npmjs.org` and canonical `v<major.minor.patch>` tags. It selects the next patch above both, or an explicit higher `package.json` version. With neither tags nor published versions, the baseline is `0.1.0`. Prereleases and unrelated tags are ignored.
324
+ 4. It updates `package.json` and both lockfile root versions, commits them, and atomically pushes `main` and the matching tag **before** publication. The tag reserves immutable source; it is not proof of npm publication. A concurrent `main` update rejects both pushes and stops publishing; a fresh dispatch then includes the newer source. The bot's `[skip ci]` commit uses `GITHUB_TOKEN` and does not recursively trigger publishing.
325
+ 5. It packs one real tarball with lifecycle scripts disabled, checks its exact version and SHA-512 integrity on npm, and publishes that same tarball using OIDC.
326
+ 6. Only after the public registry reports identical package contents does it create the GitHub release. It compares the version with fresh npm metadata and published stable GitHub releases, using `--latest=false` for an older recovered version so Latest never moves backwards. Drafts, prereleases and unrelated tags do not participate. An existing release is left intact.
254
327
 
255
328
  No long-lived `NPM_TOKEN` secret is required. A package maintainer must verify
256
329
  the npm package's **Settings > Trusted publishing** connection: GitHub user
@@ -260,7 +333,16 @@ The connection must allow direct `npm publish`, not just staging. An unvalidated
260
333
  connection expires after two days; recreate it if expired. These private
261
334
  package-side settings cannot be verified or repaired in repository code.
262
335
 
263
- Only `main` runs the release job, including manual dispatches. Pre-publication
336
+ The workflow needs `contents: write` for its version commit and tag reservation,
337
+ and `id-token: write` for npm. Branch rules must permit the Actions bot's
338
+ fast-forward version push; no force push, PAT, or new secret is used. Current
339
+ `Protect Main` rules prohibit deletion/non-fast-forward pushes but do not require
340
+ a PR for this bot commit. If that policy changes, a maintainer must permit the
341
+ release actor or switch the repository to a reviewed version-PR process.
342
+
343
+ Only `main` runs the release job, including manual dispatches. Version selection
344
+ fails closed on registry errors or malformed metadata; only 404 means a new
345
+ package. Pre-publication exact-version
264
346
  lookup remains a single request (30-second timeout); only HTTP 404 permits
265
347
  publication. After publication (or a matching skip), HTTP 404 is retried up to
266
348
  12 requests, 10 seconds apart, with a 10-second timeout per request including
@@ -268,51 +350,51 @@ the response body. The total request-and-wait budget is at most 230 seconds
268
350
  (3 minutes 50 seconds), plus scheduling overhead. Retry progress goes to stderr;
269
351
  exhaustion fails without success output. HTTP errors other than 404, network
270
352
  errors/timeouts, invalid metadata, and integrity mismatches fail immediately,
271
- without retries. An existing version is
353
+ without retries. An existing reserved version is
272
354
  skipped only when its SHA-512 integrity matches the local packed contents.
273
355
  After publication (or a matching skip), verification must succeed before the
274
- version commit, tag, or release is pushed. No credentials are tested with
356
+ GitHub release is created. The reservation remains available for recovery if
357
+ publication or verification fails. No credentials are tested with
275
358
  `npm whoami`, which does not validate OIDC permissions.
276
359
 
277
- The [2026-11-30 release run](https://github.com/wintermuted/jsonresume-theme-wintermuted/actions/runs/46482915509)
278
- successfully submitted `0.1.1` with provenance, then failed on an immediate
279
- registry 404 while npm reported processing the package. Authentication succeeded;
280
- do not change account settings to address this propagation delay. Version `0.1.1`
281
- may already be published and is immutable. No version commit, tag, or GitHub
282
- release was pushed by that run.
283
-
284
- The subsequent [release run](https://github.com/wintermuted/jsonresume-theme-wintermuted/actions/runs/46491052255)
285
- confirmed that npm's `0.1.1` contents differ from the current packed release and
286
- correctly refused release markers. The manifests are manually advanced to
287
- `0.1.2` to leave the immutable `0.1.1` package untouched; no historical source
288
- tag is reconstructed. The version selector preserves this explicit higher
289
- version instead of resetting it to `0.1.1` from the last tag, `v0.1.0`.
290
-
291
- For an immutable-version collision, inspect the exact public npm registry
292
- metadata and GitHub refs, choose an unused higher stable version, then run:
293
-
294
- ```powershell
295
- npm version 0.1.2 --no-git-tag-version --ignore-scripts
296
- ```
360
+ ### Publication gap diagnosed on 2026-12-01
361
+
362
+ The [successful `0.1.4` run](https://github.com/wintermuted/jsonresume-theme-wintermuted/actions/runs/46520397230)
363
+ published to the public npm registry and verified identical contents before
364
+ creating its GitHub release. A local `npm view` reporting only `0.1.0` used
365
+ `packagefeedproxy.microsoft.io`, not the authoritative registry. Check explicit
366
+ public npm metadata before concluding GitHub releases were never published.
297
367
 
298
- Substitute the chosen unused version; commit both `package.json` and
299
- `package-lock.json`. Merging to `main` triggers publishing at that version.
300
- The workflow does not blindly skip occupied versions: name, version and
301
- integrity checks still fail closed on different published contents. Do not
302
- republish the occupied version, invent its source tag, or bypass those checks.
303
- After the new release is tagged, ordinary changes again advance one patch.
368
+ The [`0.1.5` run](https://github.com/wintermuted/jsonresume-theme-wintermuted/actions/runs/46712206696)
369
+ reported publication success but exhausted the registry propagation wait, leaving
370
+ no version commit or tag. The [next source-change run](https://github.com/wintermuted/jsonresume-theme-wintermuted/actions/runs/46730639178)
371
+ selected `0.1.5` again from `v0.1.4`, found different immutable contents on npm,
372
+ and correctly stopped. This stranded subsequent source updates.
373
+ Registry-aware selection now advances past occupied versions without inventing
374
+ historical tags or overwriting packages. Reservation before publication prevents
375
+ the same unrecorded-source failure for future releases. Packing only once also
376
+ ensures the artifact checked is the artifact actually submitted.
304
377
 
305
378
  Do not rerun a failed historical run: it retains the old workflow.
306
- If publication succeeds but verification or a later
307
- push fails, inspect npm metadata and GitHub refs before manually dispatching the
308
- current workflow on `main`. Recovery can skip an identical published package;
309
- a different package at that immutable version fails rather than producing a
310
- misleading release. If the tag already exists but the GitHub release is missing,
311
- reconcile that specific release manually; a new dispatch computes the next patch.
379
+ If publication, verification, or GitHub release creation fails, manually dispatch
380
+ the current workflow on `main`. If `HEAD` is still the reserved tag's commit,
381
+ recovery checks live remote `main` still equals `HEAD`, then uses that same
382
+ version: it publishes if absent, skips an identical
383
+ published tarball, and completes a missing GitHub release without another bump.
384
+ Changed source on `main` gets a new patch above every reservation and published
385
+ stable version instead. A reservation missing from npm but older than an already
386
+ published version fails rather than moving `latest` backwards.
387
+ Different contents at an existing reservation always fail closed: inspect the
388
+ package/refs, then commit a corrected higher version to both manifests to start
389
+ a new reservation. Never move/delete a published tag or overwrite npm contents.
390
+ Queued pushes may coalesce into the newest `main` source rather than releasing
391
+ each intermediate commit individually.
392
+
312
393
  No live publication, tag/release mutation, or publishing rerun is needed for
313
394
  development validation. `npm test` covers offline registry failures, integrity
314
- mismatches, recovery, automatic/manual version selection, and the
315
- publication-before-marker ordering.
395
+ mismatches, numeric registry-aware selection, local-bare-repository atomic pushes,
396
+ concurrent source changes during new reservation and recovery, clean-clone
397
+ recovery, monotonic Latest selection and workflow step ordering.
316
398
 
317
399
  ## Shared theme dependency updates
318
400
 
package/helpers/css.js CHANGED
@@ -11,6 +11,7 @@ const stylesheets = [
11
11
  'styles/components/list.css',
12
12
  'styles/components/separator.css',
13
13
  'styles/components/side-nav.css',
14
+ 'styles/components/layout.css',
14
15
  'styles/components/gallery.css',
15
16
  ];
16
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsonresume-theme-wintermuted",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Wintermuted JSON Resume theme extracted from the CV project.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -45,7 +45,7 @@
45
45
  "@playwright/test": "1.58.2"
46
46
  },
47
47
  "dependencies": {
48
- "@wintermuted/ui-theme": "0.21.4",
48
+ "@wintermuted/ui-theme": "https://github.com/wintermuted/wintermuted-ui/releases/download/ui-theme%402.2.1/wintermuted-ui-theme-2.2.1.tgz",
49
49
  "handlebars": "^4.7.8"
50
50
  }
51
51
  }
@@ -3,7 +3,7 @@
3
3
  <h2>Awards</h2>
4
4
  {{#each resume.awards}}
5
5
  <div class="award-entry" id="award-{{slugify title}}">
6
- <div class="role-header">
6
+ <div class="wm-entry-header role-header">
7
7
  <h4>{{ title }}</h4>
8
8
  {{#if date}}<span class="date">{{MY date}}</span>{{/if}}
9
9
  </div>
@@ -3,7 +3,7 @@
3
3
  <h2>Education</h2>
4
4
  {{#each resume.education}}
5
5
  <div class="education-entry" id="education-{{slugify institution}}">
6
- <div class="role-header">
6
+ <div class="wm-entry-header role-header">
7
7
  <h4>
8
8
  {{#if url}}<a href="{{ url }}">{{ institution }}</a>{{else}}{{ institution }}{{/if}}
9
9
  </h4>
@@ -7,7 +7,7 @@
7
7
  <h3 class="projects-subheading">Work-Related Projects</h3>
8
8
  {{#each workProjects}}
9
9
  <div class="project-entry" id="project-{{slugify name}}">
10
- <div class="role-header">
10
+ <div class="wm-entry-header role-header">
11
11
  <h4>
12
12
  {{#if url}}<a href="{{ url }}">{{ name }}</a>{{else}}{{ name }}{{/if}}
13
13
  </h4>
@@ -90,7 +90,7 @@
90
90
  <h3 class="projects-subheading">Open Source Projects</h3>
91
91
  {{#each openSourceProjects}}
92
92
  <div class="project-entry" id="project-{{slugify name}}">
93
- <div class="role-header">
93
+ <div class="wm-entry-header role-header">
94
94
  <h4>
95
95
  {{#if url}}<a href="{{ url }}">{{ name }}</a>{{else}}{{ name }}{{/if}}
96
96
  </h4>
@@ -157,21 +157,25 @@
157
157
  </section>
158
158
 
159
159
  <!-- Lightbox overlay for project screenshots -->
160
- <div class="wm-gallery-lightbox-overlay lightbox-overlay" id="lightbox-overlay" role="dialog" aria-modal="true" aria-label="Image preview">
161
- <div class="lightbox-header" id="lightbox-header">
162
- <span class="lightbox-project-name" id="lightbox-project-name"></span>
163
- <span class="lightbox-project-date" id="lightbox-project-date"></span>
160
+ <div class="wm-gallery-lightbox-overlay wm-gallery-lightbox-viewer lightbox-overlay" id="lightbox-overlay" role="dialog" aria-modal="true" aria-label="Image preview" aria-hidden="true">
161
+ <div class="wm-gallery-lightbox-header" id="lightbox-header">
162
+ <span class="wm-gallery-lightbox-title" id="lightbox-project-name"></span>
163
+ <span class="wm-gallery-lightbox-meta" id="lightbox-project-date"></span>
164
164
  </div>
165
- <button class="wm-gallery-lightbox-close lightbox-close" aria-label="Close preview">&times;</button>
166
- <button class="lightbox-nav lightbox-prev" id="lightbox-prev" aria-label="Previous image">
167
- <span class="lightbox-nav-icon lightbox-nav-icon--prev" aria-hidden="true"></span>
165
+ <button class="wm-gallery-lightbox-close lightbox-close" type="button" aria-label="Close preview">&times;</button>
166
+ <button class="wm-gallery-lightbox-nav wm-gallery-lightbox-nav-prev" id="lightbox-prev" type="button" aria-label="Previous image">
167
+ <span class="wm-gallery-lightbox-nav-icon" aria-hidden="true"></span>
168
168
  </button>
169
- <button class="lightbox-nav lightbox-next" id="lightbox-next" aria-label="Next image">
170
- <span class="lightbox-nav-icon lightbox-nav-icon--next" aria-hidden="true"></span>
169
+ <button class="wm-gallery-lightbox-nav wm-gallery-lightbox-nav-next" id="lightbox-next" type="button" aria-label="Next image">
170
+ <span class="wm-gallery-lightbox-nav-icon" aria-hidden="true"></span>
171
171
  </button>
172
- <img class="wm-gallery-lightbox-img lightbox-img" id="lightbox-img" src="" alt="" />
173
- <div class="lightbox-svg" id="lightbox-svg"></div>
174
- <p class="lightbox-caption" id="lightbox-caption"></p>
175
- <span class="lightbox-counter" id="lightbox-counter"></span>
172
+ <div class="wm-gallery-lightbox-content">
173
+ <img class="wm-gallery-lightbox-img lightbox-img" id="lightbox-img" alt="" hidden />
174
+ <div class="wm-gallery-lightbox-svg lightbox-svg" id="lightbox-svg" hidden></div>
175
+ </div>
176
+ <div class="wm-gallery-lightbox-status" aria-live="polite" aria-atomic="true">
177
+ <p class="wm-gallery-lightbox-caption" id="lightbox-caption" hidden></p>
178
+ <span class="wm-gallery-lightbox-counter" id="lightbox-counter"></span>
179
+ </div>
176
180
  </div>
177
181
  {{/if}}
@@ -3,7 +3,7 @@
3
3
  <h2>Volunteer</h2>
4
4
  {{#each resume.volunteer}}
5
5
  <div class="volunteer-entry" id="volunteer-{{slugify organization}}">
6
- <div class="role-header">
6
+ <div class="wm-entry-header role-header">
7
7
  <h4>
8
8
  {{#if url}}<a href="{{ url }}">{{ organization }}</a>{{else}}{{ organization }}{{/if}}
9
9
  </h4>
package/partials/work.hbs CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  {{#each items}}
19
19
  <div class="work-role" id="role-{{slugify ../name}}-{{slugify position}}-{{@index}}">
20
- <div class="role-header">
20
+ <div class="wm-entry-header role-header">
21
21
  {{#if position}}<h4>{{ position }}</h4>{{/if}}
22
22
  <span class="date">
23
23
  {{#if startDate}}{{MY startDate}}{{/if}}
package/resume.hbs CHANGED
@@ -173,6 +173,8 @@
173
173
  function updateNavPosLabel() {
174
174
  var current = html.getAttribute('data-nav');
175
175
  navPosBtn.innerHTML = current === 'right' ? '&#8592; Nav' : 'Nav &#8594;';
176
+ var list = document.querySelector('#side-nav > .wm-side-nav');
177
+ if (list) list.classList.toggle('wm-side-nav-end', current === 'right');
176
178
  }
177
179
  updateNavPosLabel();
178
180
  navPosBtn.addEventListener('click', function () {
@@ -355,7 +357,26 @@
355
357
  function setExpandedSection(sectionId, expanded) {
356
358
  var li = sectionListItems[sectionId];
357
359
  if (!li) return;
358
- li.classList.toggle('is-expanded', expanded);
360
+ var link = sectionLinks[sectionId];
361
+ if (!link.hasAttribute('aria-expanded')) return;
362
+ var subList = link.nextElementSibling;
363
+ if (!expanded && subList.contains(document.activeElement)) {
364
+ link.focus({ preventScroll: true });
365
+ }
366
+ link.setAttribute('aria-expanded', String(expanded));
367
+ }
368
+
369
+ function syncCurrentLocation() {
370
+ var current = subItemLinks.find(function (entry) {
371
+ return entry.link.classList.contains('active');
372
+ });
373
+ var currentLink = current ? current.link : Object.values(sectionLinks).find(function (link) {
374
+ return link.classList.contains('active');
375
+ });
376
+ nav.querySelectorAll('a').forEach(function (link) {
377
+ if (link === currentLink) link.setAttribute('aria-current', 'location');
378
+ else link.removeAttribute('aria-current');
379
+ });
359
380
  }
360
381
 
361
382
  function setActiveSection(sectionId) {
@@ -367,6 +388,7 @@
367
388
  setExpandedSection(id, id === sectionId);
368
389
  }
369
390
  });
391
+ syncCurrentLocation();
370
392
  }
371
393
 
372
394
  function setActiveSubItem(activeId) {
@@ -385,17 +407,19 @@
385
407
  }
386
408
  }
387
409
  });
410
+ syncCurrentLocation();
388
411
  }
389
412
 
390
413
  // Build nav links from rendered sections
391
414
  var ul = document.createElement('ul');
392
- ul.className = 'wm-side-nav';
415
+ ul.className = 'wm-side-nav wm-side-nav-nested';
416
+ ul.classList.toggle('wm-side-nav-end', html.getAttribute('data-nav') === 'right');
393
417
  sections.forEach(function (section) {
394
418
  var h2 = section.querySelector('h2');
395
419
  if (!h2) return;
396
420
 
397
421
  var li = document.createElement('li');
398
- li.className = 'side-nav-group';
422
+ li.className = 'wm-side-nav-group';
399
423
  sectionListItems[section.id] = li;
400
424
 
401
425
  var a = document.createElement('a');
@@ -418,26 +442,30 @@
418
442
  if (EXPANDABLE_SECTION_IDS[section.id]) {
419
443
  var subItems = getSectionSubItems(section.id);
420
444
  if (subItems.length) {
421
- li.classList.add('has-children');
422
445
  var subList = document.createElement('ul');
423
- subList.className = 'side-nav-sublist';
446
+ subList.className = 'wm-side-nav-sublist';
447
+ var subListId = section.id + '-nav-links';
448
+ while (document.getElementById(subListId)) subListId += '-nested';
449
+ subList.id = subListId;
450
+ a.setAttribute('aria-controls', subListId);
451
+ a.setAttribute('aria-expanded', 'false');
424
452
 
425
453
  subItems.forEach(function (subItem) {
426
454
  if (subItem.type === 'group-label') {
427
455
  var labelLi = document.createElement('li');
428
- labelLi.className = 'side-nav-subgroup-label';
456
+ labelLi.className = 'wm-side-nav-subgroup-label';
429
457
  labelLi.textContent = subItem.label;
430
458
  subList.appendChild(labelLi);
431
459
  return;
432
460
  }
433
461
 
434
462
  var subLi = document.createElement('li');
435
- subLi.className = 'side-nav-subitem';
463
+ subLi.className = 'wm-side-nav-subitem';
436
464
 
437
465
  var subLink = document.createElement('a');
438
466
  subLink.href = '#' + subItem.id;
439
467
  subLink.textContent = subItem.label;
440
- subLink.className = 'side-nav-sublink';
468
+ subLink.className = 'wm-side-nav-sublink';
441
469
 
442
470
  subLink.addEventListener('click', function (e) {
443
471
  e.preventDefault();
@@ -921,68 +949,124 @@
921
949
  });
922
950
 
923
951
  var currentIndex = -1;
952
+ var returnFocus = null;
953
+ var inertElements = [];
954
+ var previousOverflow = '';
924
955
 
925
956
  function showItem(index) {
926
- if (index < 0 || index >= items.length) return;
927
- currentIndex = index;
957
+ if (index < 0 || index >= items.length) return false;
958
+ var focusedControl = document.activeElement;
928
959
  var el = items[index];
929
960
  var cap = el.querySelector('figcaption');
930
961
  var capText = cap ? cap.textContent : '';
931
962
 
932
963
  if (el.classList.contains('project-screenshot')) {
933
964
  var thumb = el.querySelector('img');
934
- svgContainer.style.display = 'none';
965
+ svgContainer.hidden = true;
935
966
  svgContainer.innerHTML = '';
936
- img.style.display = '';
967
+ img.hidden = false;
937
968
  img.src = thumb.src;
938
969
  img.alt = thumb.alt;
939
970
  } else {
940
971
  var svg = el.querySelector('.mermaid svg');
941
- if (!svg) return;
942
- img.style.display = 'none';
943
- img.src = '';
944
- svgContainer.innerHTML = '';
972
+ if (!svg) return false;
945
973
  var clone = svg.cloneNode(true);
974
+ if (!clone.hasAttribute('viewBox')) {
975
+ var width = clone.getAttribute('width') || '';
976
+ var height = clone.getAttribute('height') || '';
977
+ if (!/^\d+(?:\.\d+)?(?:px)?$/.test(width) ||
978
+ !/^\d+(?:\.\d+)?(?:px)?$/.test(height) ||
979
+ !Number.isFinite(parseFloat(width)) || !Number.isFinite(parseFloat(height)) ||
980
+ parseFloat(width) <= 0 || parseFloat(height) <= 0) {
981
+ console.error('Cannot preview diagram without a viewBox or positive dimensions');
982
+ return false;
983
+ }
984
+ clone.setAttribute('viewBox', '0 0 ' + parseFloat(width) + ' ' + parseFloat(height));
985
+ }
946
986
  clone.removeAttribute('style');
947
987
  clone.removeAttribute('width');
948
988
  clone.removeAttribute('height');
989
+ clone.setAttribute('preserveAspectRatio', 'xMidYMid meet');
990
+ img.hidden = true;
991
+ img.removeAttribute('src');
992
+ svgContainer.innerHTML = '';
949
993
  svgContainer.appendChild(clone);
950
- svgContainer.style.display = 'block';
994
+ svgContainer.hidden = false;
951
995
  }
952
996
 
997
+ currentIndex = index;
953
998
  caption.textContent = capText;
954
- caption.style.display = capText ? 'block' : 'none';
999
+ caption.hidden = !capText;
955
1000
  var proj = itemProjects[index];
956
1001
  projectName.textContent = proj.name;
957
1002
  projectDate.textContent = proj.date;
958
1003
  counter.textContent = items.length > 1 ? (index + 1) + ' / ' + items.length : '';
959
1004
  prevBtn.disabled = index === 0;
960
1005
  nextBtn.disabled = index === items.length - 1;
961
- prevBtn.style.display = items.length > 1 ? '' : 'none';
962
- nextBtn.style.display = items.length > 1 ? '' : 'none';
1006
+ prevBtn.hidden = items.length <= 1;
1007
+ nextBtn.hidden = items.length <= 1;
1008
+ if ((focusedControl === prevBtn && prevBtn.disabled) ||
1009
+ (focusedControl === nextBtn && nextBtn.disabled)) {
1010
+ overlay.querySelector('.lightbox-close').focus({ preventScroll: true });
1011
+ }
1012
+ return true;
1013
+ }
1014
+
1015
+ function moveItem(step) {
1016
+ for (var index = currentIndex + step; index >= 0 && index < items.length; index += step) {
1017
+ if (showItem(index)) return;
1018
+ }
963
1019
  }
964
1020
 
965
1021
  function openLightbox(index) {
966
- showItem(index);
967
- overlay.classList.add('active');
1022
+ if (!showItem(index)) return;
1023
+ returnFocus = items[index];
1024
+ previousOverflow = document.body.style.overflow;
1025
+ overlay.classList.add('wm-active');
1026
+ overlay.setAttribute('aria-hidden', 'false');
1027
+ overlay.querySelector('.lightbox-close').focus({ preventScroll: true });
1028
+ var branch = overlay;
1029
+ while (branch !== document.body) {
1030
+ Array.from(branch.parentElement.children).forEach(function (sibling) {
1031
+ if (sibling !== branch && sibling instanceof HTMLElement && !sibling.inert) {
1032
+ sibling.inert = true;
1033
+ inertElements.push(sibling);
1034
+ }
1035
+ });
1036
+ branch = branch.parentElement;
1037
+ }
968
1038
  document.body.style.overflow = 'hidden';
969
1039
  }
970
1040
 
971
1041
  // Attach click handlers to each gallery item
972
1042
  items.forEach(function (el, i) {
1043
+ el.tabIndex = 0;
1044
+ el.setAttribute('role', 'button');
1045
+ var thumbnail = el.querySelector('img');
1046
+ var figcaption = el.querySelector('figcaption');
1047
+ var label = (thumbnail ? thumbnail.alt.trim() : '') ||
1048
+ (figcaption ? figcaption.textContent.trim() : '') ||
1049
+ (thumbnail ? 'image' : 'diagram');
1050
+ el.setAttribute('aria-label', 'Preview ' + label);
973
1051
  el.addEventListener('click', function () {
974
1052
  openLightbox(i);
975
1053
  });
1054
+ el.addEventListener('keydown', function (e) {
1055
+ if (e.key === 'Enter' || e.key === ' ') {
1056
+ e.preventDefault();
1057
+ openLightbox(i);
1058
+ }
1059
+ });
976
1060
  });
977
1061
 
978
1062
  prevBtn.addEventListener('click', function (e) {
979
1063
  e.stopPropagation();
980
- if (currentIndex > 0) showItem(currentIndex - 1);
1064
+ moveItem(-1);
981
1065
  });
982
1066
 
983
1067
  nextBtn.addEventListener('click', function (e) {
984
1068
  e.stopPropagation();
985
- if (currentIndex < items.length - 1) showItem(currentIndex + 1);
1069
+ moveItem(1);
986
1070
  });
987
1071
 
988
1072
  overlay.querySelector('.lightbox-close').addEventListener('click', closeLightbox);
@@ -990,18 +1074,36 @@
990
1074
  if (e.target === overlay) closeLightbox();
991
1075
  });
992
1076
  document.addEventListener('keydown', function (e) {
993
- if (!overlay.classList.contains('active')) return;
1077
+ if (!overlay.classList.contains('wm-active')) return;
994
1078
  if (e.key === 'Escape') closeLightbox();
995
- if (e.key === 'ArrowLeft' && currentIndex > 0) showItem(currentIndex - 1);
996
- if (e.key === 'ArrowRight' && currentIndex < items.length - 1) showItem(currentIndex + 1);
1079
+ if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
1080
+ e.preventDefault();
1081
+ moveItem(e.key === 'ArrowLeft' ? -1 : 1);
1082
+ }
1083
+ if (e.key === 'Tab') {
1084
+ var buttons = Array.from(overlay.querySelectorAll('button:not(:disabled):not([hidden])'));
1085
+ var first = buttons[0];
1086
+ var last = buttons[buttons.length - 1];
1087
+ if (e.shiftKey && document.activeElement === first) {
1088
+ e.preventDefault();
1089
+ last.focus();
1090
+ } else if (!e.shiftKey && document.activeElement === last) {
1091
+ e.preventDefault();
1092
+ first.focus();
1093
+ }
1094
+ }
997
1095
  });
998
1096
 
999
1097
  function closeLightbox() {
1000
- overlay.classList.remove('active');
1001
- document.body.style.overflow = '';
1002
- img.src = '';
1003
- img.style.display = '';
1004
- svgContainer.style.display = 'none';
1098
+ overlay.classList.remove('wm-active');
1099
+ inertElements.forEach(function (el) { el.inert = false; });
1100
+ inertElements = [];
1101
+ document.body.style.overflow = previousOverflow;
1102
+ if (returnFocus && returnFocus.isConnected) returnFocus.focus({ preventScroll: true });
1103
+ overlay.setAttribute('aria-hidden', 'true');
1104
+ img.removeAttribute('src');
1105
+ img.hidden = true;
1106
+ svgContainer.hidden = true;
1005
1107
  svgContainer.innerHTML = '';
1006
1108
  currentIndex = -1;
1007
1109
  }
package/style.css CHANGED
@@ -360,14 +360,6 @@ p {
360
360
  }
361
361
 
362
362
  /* --- Role / Entry Headers --- */
363
- .role-header {
364
- display: flex;
365
- justify-content: space-between;
366
- align-items: baseline;
367
- flex-wrap: wrap;
368
- gap: 0.25rem 1rem;
369
- }
370
-
371
363
  .role-header h4 {
372
364
  margin: 0;
373
365
  }
@@ -615,111 +607,26 @@ ul.role-projects-list li a.project-ref:hover {
615
607
  overflow-y: auto;
616
608
  }
617
609
 
618
- .side-nav ul {
619
- list-style: none;
620
- padding: 0;
621
- margin: 0;
622
- }
623
-
624
- .side-nav-group {
625
- margin-bottom: 0.18rem;
626
- }
627
-
628
- .side-nav-group.has-children > a {
629
- position: relative;
630
- padding-right: 1.1rem;
631
- }
632
-
633
- .side-nav-group.has-children > a::after {
634
- content: "▾";
635
- position: absolute;
636
- right: 0.45rem;
637
- top: 50%;
638
- transform: translateY(-50%) rotate(-90deg);
639
- color: var(--color-text-faint);
640
- font-size: 0.62rem;
641
- line-height: 1;
642
- transition: transform 0.16s ease, color 0.16s ease;
643
- }
644
-
645
- .side-nav-group.has-children.is-expanded > a::after {
646
- transform: translateY(-50%) rotate(0deg);
647
- color: var(--color-text-muted);
648
- }
649
-
650
- .side-nav ul.side-nav-sublist {
651
- display: none;
652
- margin: 0.08rem 0 0.45rem;
653
- padding-left: 0.9rem;
654
- position: relative;
655
- }
656
-
657
- .side-nav ul.side-nav-sublist::before {
658
- content: "";
659
- position: absolute;
660
- left: 0.32rem;
661
- top: 0.18rem;
662
- bottom: 0.18rem;
663
- width: 1px;
664
- background: var(--color-border);
665
- }
666
-
667
- .side-nav-group.is-expanded > .side-nav-sublist {
668
- display: block;
669
- }
670
-
671
- .side-nav-subitem {
672
- margin-bottom: 0.08rem;
673
- }
674
-
675
- .side-nav-subgroup-label {
676
- margin: 0.4rem 0 0.15rem;
677
- padding: 0.08rem 0.6rem;
678
- font-size: 0.54rem;
679
- font-weight: 600;
680
- text-transform: uppercase;
681
- letter-spacing: 0.08em;
682
- color: var(--color-text-faint);
683
- }
684
-
685
- .side-nav-subgroup-label:first-child {
686
- margin-top: 0.02rem;
687
- }
688
-
689
- .side-nav a {
610
+ .side-nav > .wm-side-nav > .wm-side-nav-group > a {
690
611
  padding: 0.5rem 0.6rem;
691
612
  font-size: var(--section-label-font-size);
692
613
  font-weight: var(--section-label-font-weight);
693
614
  line-height: var(--section-label-line-height);
694
615
  letter-spacing: var(--section-label-letter-spacing);
695
- }
696
-
697
- .side-nav > ul > .side-nav-group > a {
698
616
  position: relative;
699
617
  top: -2px;
700
618
  }
701
619
 
702
- .side-nav a.side-nav-sublink {
703
- padding: 0.2rem 0.6rem;
620
+ .side-nav .wm-side-nav-sublink {
704
621
  font-size: 0.66rem;
705
- font-weight: 400;
706
- text-transform: none;
707
- letter-spacing: 0.02em;
708
- color: var(--color-text-faint);
709
- border-left: 2px solid var(--color-border);
710
- border-radius: 0 3px 3px 0;
711
622
  }
712
623
 
713
- .side-nav a.side-nav-sublink:hover {
714
- color: var(--color-text-muted);
715
- border-left-color: var(--color-text-faint);
716
- background: var(--color-tag-bg);
624
+ .side-nav > .wm-side-nav-nested > .wm-side-nav-group > a[aria-expanded] {
625
+ padding-inline-end: 1.4rem;
717
626
  }
718
627
 
719
- .side-nav a.side-nav-sublink.active {
720
- color: var(--color-text);
721
- border-left-color: var(--color-text);
722
- background: var(--color-tag-bg);
628
+ .side-nav > .wm-side-nav-end > .wm-side-nav-group > a[aria-expanded] {
629
+ padding-inline: 1.4rem 0.6rem;
723
630
  }
724
631
 
725
632
  /* Right-side nav position */
@@ -727,52 +634,6 @@ ul.role-projects-list li a.project-ref:hover {
727
634
  flex-direction: row-reverse;
728
635
  }
729
636
 
730
- [data-nav="right"] .side-nav a {
731
- border-left: none;
732
- border-right: 2px solid transparent;
733
- border-radius: 3px 0 0 3px;
734
- text-align: right;
735
- }
736
-
737
- [data-nav="right"] .side-nav a.active {
738
- border-right-color: var(--color-text);
739
- }
740
-
741
- [data-nav="right"] .side-nav ul.side-nav-sublist {
742
- padding-left: 0;
743
- padding-right: 0.9rem;
744
- }
745
-
746
- [data-nav="right"] .side-nav ul.side-nav-sublist::before {
747
- left: auto;
748
- right: 0.32rem;
749
- }
750
-
751
- [data-nav="right"] .side-nav a.side-nav-sublink {
752
- border-left: none;
753
- border-right: 2px solid var(--color-border);
754
- border-radius: 3px 0 0 3px;
755
- text-align: right;
756
- }
757
-
758
- [data-nav="right"] .side-nav-subgroup-label {
759
- text-align: right;
760
- }
761
-
762
- [data-nav="right"] .side-nav a.side-nav-sublink.active {
763
- border-right-color: var(--color-text);
764
- }
765
-
766
- [data-nav="right"] .side-nav-group.has-children > a {
767
- padding-right: 0.6rem;
768
- padding-left: 1.1rem;
769
- }
770
-
771
- [data-nav="right"] .side-nav-group.has-children > a::after {
772
- right: auto;
773
- left: 0.45rem;
774
- }
775
-
776
637
  /* --- Theme Toggle --- */
777
638
  .theme-toggle .icon-sun,
778
639
  .theme-toggle .icon-moon {
@@ -904,6 +765,7 @@ ul.role-projects-list li a.project-ref:hover {
904
765
  color: var(--color-text-muted);
905
766
  border-top-color: var(--color-border);
906
767
  background: transparent;
768
+ overflow-wrap: anywhere;
907
769
  }
908
770
 
909
771
  /* --- Project Mermaid Diagrams (inside .project-gallery grid) --- */
@@ -918,138 +780,32 @@ ul.role-projects-list li a.project-ref:hover {
918
780
 
919
781
  /* --- Lightbox Overlay --- */
920
782
  .lightbox-overlay {
921
- flex-direction: column;
922
783
  background: rgba(0, 0, 0, 0.85);
923
- padding: 0;
784
+ /* Visibility must change synchronously for modal focus entry. */
785
+ transition-property: opacity;
924
786
  }
925
787
 
926
- .lightbox-overlay.active {
927
- opacity: 1;
928
- visibility: visible;
788
+ /* Bound the grid's intrinsic image track as well as the media element. */
789
+ .lightbox-overlay .wm-gallery-lightbox-content {
790
+ grid-template: minmax(0, 1fr) / minmax(0, 1fr);
791
+ height: auto;
792
+ align-self: stretch;
929
793
  }
930
794
 
931
795
  .lightbox-img {
932
- max-width: 90vw;
933
- max-height: 80vh;
934
796
  border-radius: var(--wm-radius-base, 8px);
935
797
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
936
798
  border: none;
937
799
  }
938
800
 
939
801
  .lightbox-svg {
940
- max-width: 90vw;
941
- max-height: 80vh;
942
- border-radius: var(--wm-radius-base, 8px);
943
- box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
944
802
  background: var(--color-tag-bg, #f8f8f8);
945
- border: 1px solid var(--color-border, #e0e0e0);
946
- padding: 1.5rem;
947
- display: none;
948
- }
949
-
950
- .lightbox-svg svg {
951
- display: block;
952
- width: auto;
953
- height: auto;
954
- min-width: 60vw;
955
- max-width: 85vw;
956
- max-height: 72vh;
957
- }
958
-
959
- .lightbox-header {
960
- position: absolute;
961
- top: 1.25rem;
962
- left: 50%;
963
- transform: translateX(-50%);
964
- text-align: center;
965
- z-index: 1001;
966
- white-space: nowrap;
967
- }
968
-
969
- .lightbox-project-name {
970
- color: rgba(255, 255, 255, 0.9);
971
- font-size: 0.95rem;
972
- font-weight: 500;
973
- letter-spacing: -0.01em;
974
- }
975
-
976
- .lightbox-project-date {
977
- color: rgba(255, 255, 255, 0.45);
978
- font-size: 0.8rem;
979
- margin-left: 0.75rem;
803
+ border-color: var(--color-border, #e0e0e0);
980
804
  }
981
805
 
982
- .lightbox-nav {
983
- position: absolute;
984
- top: 50%;
985
- transform: translateY(-50%);
986
- display: inline-flex;
987
- align-items: center;
988
- justify-content: center;
989
- background: rgba(255, 255, 255, 0.15);
990
- border: 1px solid rgba(255, 255, 255, 0.25);
991
- color: #fff;
992
- font-size: 0;
993
- line-height: 0;
994
- width: 3rem;
995
- height: 3rem;
996
- padding: 0;
997
- border-radius: 50%;
998
- cursor: pointer;
999
- opacity: 0.7;
1000
- transition: opacity 0.15s ease, background 0.15s ease;
1001
- z-index: 1001;
1002
- }
1003
-
1004
- .lightbox-nav:hover {
1005
- opacity: 1;
1006
- background: rgba(255, 255, 255, 0.25);
1007
- }
1008
-
1009
- .lightbox-nav[disabled] {
1010
- opacity: 0.2;
1011
- cursor: default;
1012
- pointer-events: none;
1013
- }
1014
-
1015
- .lightbox-prev {
1016
- left: 1.25rem;
1017
- }
1018
-
1019
- .lightbox-next {
1020
- right: 1.25rem;
1021
- }
1022
-
1023
- .lightbox-nav-icon {
1024
- width: 0.95rem;
1025
- height: 0.95rem;
1026
- border-top: 2.4px solid currentColor;
1027
- border-right: 2.4px solid currentColor;
1028
- display: block;
1029
- }
1030
-
1031
- .lightbox-nav-icon--prev {
1032
- transform: translateX(-0.045rem) rotate(-135deg);
1033
- margin-left: 0;
1034
- }
1035
-
1036
- .lightbox-nav-icon--next {
1037
- transform: translateX(0.045rem) rotate(45deg);
1038
- margin-right: 0;
1039
- }
1040
-
1041
- .lightbox-caption {
1042
- color: rgba(255, 255, 255, 0.8);
1043
- font-size: 0.85rem;
1044
- margin-top: 0.75rem;
1045
- text-align: center;
1046
- max-width: 60ch;
1047
- }
1048
-
1049
- .lightbox-counter {
1050
- color: rgba(255, 255, 255, 0.5);
1051
- font-size: 0.75rem;
1052
- margin-top: 0.25rem;
806
+ .project-gallery [role="button"]:focus-visible {
807
+ outline: 2px solid var(--wm-color-accent);
808
+ outline-offset: 3px;
1053
809
  }
1054
810
 
1055
811
  /* =========================================================