Skip to content

feat(gallery): detail-page navigation, code ergonomics, image polish - #300

Merged
TMHSDigital merged 1 commit into
mainfrom
feat/gallery-detail-nav
Sep 27, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
feat/gallery-detail-nav

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Summary

PR 1 of 3 in the website QoL pass (gallery first, then landing).

  • Navigation: prev/next within kind (examples ↔ examples, showcase ↔ showcase, no wrap) at the top and foot of every detail page; ←/→ keys page (disabled while typing or while the lightbox is open); tag list linking to ../#tag=<t>; a Related strip of 3 entries ranked by shared topic tags (showcase excluded), ties broken by gallery order.
  • Code: line-number gutter (separate aria-hidden pre; highlight_python untouched); listings > 120 lines collapse with "Show all N lines" (JS-only; no-JS renders in full); copy button on every README and source block via one copyText() with an execCommand fallback and a visible "Copy failed" state; README h1–h3 get deduped slug ids + hover # anchors, with ids reserved against page ids.
  • Images: cards carry width/height (+ height:auto) so the grid reserves space before load; first 4 cards eager; detail hero fetchpriority="high"; lightbox closes on backdrop / Close / Esc only, image click toggles native size.

Evidence

Proven by live run (local python -m http.server -d docs, Playwright/Chromium):

  • build_gallery.py run twice → diff -rq identical (deterministic; the validate.yml drift gate will hold).
  • bmesh-gear: 372-line source collapsed, 2 copy buttons injected, anchors run, exit-codes, pager driver-wave ← → shader-node-group, related = uv-layer-grid, collision-hull-proxy, mesh-hygiene-audit.
  • Lightbox: opens; image click toggles .native without closing; backdrop click closes; Close button closes. Copy → "Copied".
  • ArrowRight on bmesh-gear navigated to shader-node-group.
  • 375px: scrollWidth 360 ≤ 375 (no horizontal overflow); key hint hidden.
  • Index: all 88 card images measure 188px tall at 1440px before and after load; exactly 4 eager.
  • Caught and fixed during the run: the height attribute overrode aspect-ratio (cards rendered 720px tall) until height:auto was added.

By inspection only: the execCommand fallback path (requires a non-secure origin); showcase edge pagers (shipping-crate has no prev, book-trolley no next) read from generated HTML.

🤖 Generated with Claude Code

Detail pages were dead ends: a reader who finished one example had to go
back to the grid to find the next. They now page within their own kind
(prev/next, arrow keys), list their tags as links back to the filtered
index, and end with three related entries chosen by shared topic tags.

Source listings gain a line-number gutter and collapse past 120 lines;
every code block gets a copy button with a non-secure-context fallback
and a visible failure state; README headings get stable anchors.

Card images carry intrinsic dimensions so the grid no longer shifts as
they load, and the lightbox only closes on backdrop, button or Esc --
clicking the image toggles native size instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: TMHSDigital <[email protected]>
@TMHSDigital
TMHSDigital merged commit 06187b9 into main Sep 27, 2026
10 of 11 checks passed
@TMHSDigital
TMHSDigital deleted the feat/gallery-detail-nav branch September 27, 2026 13:39
TMHSDigital added a commit that referenced this pull request Sep 27, 2026
gh pr diff --name-only downloads the whole diff first and fails with HTTP 406 past 20,000 lines; a full docs/gallery regeneration crossed that on #300 and left the PR red on a check that only needed file paths. The paginated files endpoint returns paths alone and has no diff-size limit.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: TMHSDigital <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant