Skip to content

feat(ux): wave 2 residual UX — gallery SSG, learn dates, retry, 404 - #18

Merged
Bissbert merged 4 commits into
mainfrom
feature/wave2-residual-ux
May 5, 2026
Merged

Bissbert merged 4 commits into
mainfrom
feature/wave2-residual-ux

Conversation

@Bissbert

@Bissbert Bissbert commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Wave 2 of the 2026-05-05 UX review fixes. Built on top of the wave 1 lock-gate removal (#17).

  • Gallery SSG — pre-renders the 159 mineral families and filter dropdowns via db-server at build time, so the first paint no longer blocks on the 8 MB minerals.db + sql.js wasm. The DB only loads client-side once the user actually types in the search or applies a filter. Net: gallery ships in ~415 KB gzipped HTML with 12 cards visible immediately.
  • Article last-updated — LearnSchema now emits datePublished / dateModified in the LearningResource+Article JSON-LD; learn/[...slug] derives the value from data.reviewedAt with a fall-back to the source YAML's git-commit timestamp (preserved by sync-knowledge), and surfaces it as an unconditional "Last updated …" line in the article header for E-E-A-T.
  • Playground retry — the CDL preview's error state gets a Retry button so transient render-API failures recover with one click rather than forcing a page reload.
  • Hero mobile spacing (F-VIS-08) — the dangling CDL code badge no longer bursts out of the hero card on narrow viewports.
  • 404 polish (F-VIS-13) — replaces the muted "404" with a crystal-lattice SVG and "Lost in the lattice" heading, fixes the H3-before-H1 hierarchy, and adds a Learn CTA.

Test plan

  • npm run build passes (912 pages built, no SSR errors)
  • Gallery HTML contains 12 SSR-rendered family cards and 159 families in initial state
  • learn/.../index.html renders both "dateModified" JSON-LD and a visible <time> element
  • Manual: gallery loads instantly, search/filter still works (lazy-loads sql.js)
  • Manual: kill the render API → playground shows Retry, click recovers
  • Manual: hero on 375px viewport — code badge stays inside the card
  • Manual: navigate to /does-not-exist → new 404 layout renders

Bissbert added 4 commits May 5, 2026 17:53
- LearnSchema accepts datePublished/dateModified and emits them in
  LearningResource+Article JSON-LD when present.
- learn/[...slug].astro derives dateModified from data.reviewedAt with
  a fall-back to source YAML mtime, then renders an unconditional
  "Last updated <time>" line in the article header for trust/E-E-A-T.
- sync-knowledge stamps each copied YAML with its git-commit timestamp
  so the mtime fall-back surfaces the real edit date instead of the
  build wall-clock time.
The gallery used to block its first paint on the 8 MB minerals.db +
sql.js wasm bundle. Now the family list and filter dropdowns are
fetched at build time via db-server and passed to the React Gallery
component as initial props.

- gallery/index.astro fetches getAllFamilies / getCrystalSystems /
  getOrigins / getMineralGroups during SSG.
- useFamilies / useFilters accept initial data and skip the wasm-DB
  fetch on mount when provided. Reset/clear-filter paths replay the
  cached SSG data instead of re-hitting the DB.
- sanitize-svg short-circuits on the server (no window) and trusts our
  own crystal-renderer SVG output during SSG.
- Adds getOrigins() to db-server.

Net: gallery ships in ~415 KB gzipped HTML with 12 cards visible
immediately; the 8 MB DB only downloads when the user actually filters
or searches.
- CDLPreview surfaces a Retry button in its error state; Playground
  passes generatePreview as the handler so transient render-API
  failures recover with one click.
- Hero CDL badge no longer overflows narrow viewports — pinned closer
  to the panel on small screens, padding scales up on sm+, and the
  code label truncates with ellipsis instead of bursting out of the
  card.
- 404 page replaces the muted "404" with a crystal lattice SVG and a
  more thematic "Lost in the lattice" heading, fixes the H3-before-H1
  hierarchy, and adds a third CTA (Learn) for users who landed on a
  bad article URL.
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

🚀 Preview deployed to: https://098bde78.gemmology-dev.pages.dev

@Bissbert
Bissbert merged commit 08a08a5 into main May 5, 2026
3 of 4 checks passed
Bissbert added a commit that referenced this pull request May 11, 2026
)

* feat(seo): article dateModified + visible Last updated line

- LearnSchema accepts datePublished/dateModified and emits them in
  LearningResource+Article JSON-LD when present.
- learn/[...slug].astro derives dateModified from data.reviewedAt with
  a fall-back to source YAML mtime, then renders an unconditional
  "Last updated <time>" line in the article header for trust/E-E-A-T.
- sync-knowledge stamps each copied YAML with its git-commit timestamp
  so the mtime fall-back surfaces the real edit date instead of the
  build wall-clock time.

* perf(gallery): SSG-render families, lazy-load sql.js on first filter

The gallery used to block its first paint on the 8 MB minerals.db +
sql.js wasm bundle. Now the family list and filter dropdowns are
fetched at build time via db-server and passed to the React Gallery
component as initial props.

- gallery/index.astro fetches getAllFamilies / getCrystalSystems /
  getOrigins / getMineralGroups during SSG.
- useFamilies / useFilters accept initial data and skip the wasm-DB
  fetch on mount when provided. Reset/clear-filter paths replay the
  cached SSG data instead of re-hitting the DB.
- sanitize-svg short-circuits on the server (no window) and trusts our
  own crystal-renderer SVG output during SSG.
- Adds getOrigins() to db-server.

Net: gallery ships in ~415 KB gzipped HTML with 12 cards visible
immediately; the 8 MB DB only downloads when the user actually filters
or searches.

* feat(ux): playground retry, hero mobile spacing, 404 polish

- CDLPreview surfaces a Retry button in its error state; Playground
  passes generatePreview as the handler so transient render-API
  failures recover with one click.
- Hero CDL badge no longer overflows narrow viewports — pinned closer
  to the panel on small screens, padding scales up on sm+, and the
  code label truncates with ellipsis instead of bursting out of the
  card.
- 404 page replaces the muted "404" with a crystal lattice SVG and a
  more thematic "Lost in the lattice" heading, fixes the H3-before-H1
  hierarchy, and adds a third CTA (Learn) for users who landed on a
  bad article URL.

This branch was successfully deployed

1 active deployment
gemmology-dev (Preview) — c5d27400 Deployed May 5, 2026 by github-actions[bot]
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