Skip to content

Add adaptive themed website diagrams - #1

Open
AMDphreak wants to merge 7 commits into
mainfrom
feat/themed-diagram-assets
Open

AMDphreak wants to merge 7 commits into
mainfrom
feat/themed-diagram-assets

Conversation

@AMDphreak

Copy link
Copy Markdown
Contributor

Summary

The checklist and feature-tabs images were fixed-color drawings with no editable diagram source. This PR replaces them with reproducible Mermaid diagrams that remain readable as ordinary images and progressively inherit the website palette when JavaScript is available.

This PR:

  • preserves the original assets byte-for-byte as .fixed.svg
  • adds Mermaid sources and explicit Themed SVG v1 manifests
  • generates standalone-adaptive canonical SVGs and .host.svg siblings with the pinned published packages
  • opts the image examples into the sanitized Themed SVG runtime
  • checks freshness, safety, accessibility, contrast, and light/dark delivery during the website build
  • records the change in the owned changelog

The existing /examples/images route currently encounters a Solid hydration mismatch from its client-only resource setup. Direct browser checks of both generated SVGs passed, but that pre-existing route issue prevents an end-to-end runtime-upgrade smoke test in this PR.

Happy to adjust the diagram wording or palette mapping if another representation fits the project better.

Visual review

Preserved fixed artwork

Original checklist artwork

Original feature-tabs artwork

Adaptive replacements

Adaptive checklist diagram

Adaptive feature-tabs diagram

Verification

  • pnpm install
  • pnpm run build in website
  • pnpm --filter @centrmark/cmk-renderer test
  • pnpm --dir website run diagrams:check
  • fixed-asset blob comparison against origin/main
  • browser light/dark media emulation for both adaptive SVGs

AMDphreak and others added 2 commits September 8, 2026 06:39
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation review — adaptive themed website diagrams

Reviewed PR #1 against the repository documentation standards. The feature work is solid: changelog entries, reproducible generation, CI freshness checks, and renderer/runtime wiring are in place.

Gaps found in this PR

Area Finding
Maintainer runbook No guide for website/diagrams/, generate-diagrams.mjs, or @image[themed=true] workflow
Spec surface @image with themed property not documented in spec/informal.adoc
Website README website/README.adoc still contained Food Truck Nerdz boilerplate unrelated to CentrMark
Docs index New subsystem not linked from /docs navigation
Root README Missing Docs | Dev-Centr badge; Website section lacked diagram commands
Published changelog website/public/docs/changelog.adoc was missing several entries present in root changelog.adoc

Companion documentation PR

Addressed in branch cursor/documentation-automation-system-01ed (companion PR):

  • website/public/docs/adaptive-themed-diagrams.adoc — maintainer guide covering Mermaid sources, Themed SVG manifests, diagrams:generate / diagrams:check, safety verification, host token wiring, and troubleshooting
  • Wired into /docs/adaptive-themed-diagrams site routes
  • Fixed website/README.adoc for the CentrMark SolidStart site
  • Documented @image[themed=true] in spec/informal.adoc and @centrmark/cmk-renderer README
  • Added Docs badge and Website pointers in root README.adoc
  • Synced published changelog with root source

Codepaths covered

  • website/scripts/generate-diagrams.mjs — generation, contrast, SVG safety, freshness
  • website/diagrams/* — Mermaid + theme manifest authoring
  • website/src/entry-client.tsx + app.css — runtime upgrade and host tokens
  • packages/cmk-renderer/src/html.ts@image / data-themed-svg rendering
  • examples/images.cmk — CMK author usage

Note on Antora

This repository publishes docs through the SolidStart site (website/public/docs/), not a separate Antora playbook. No Antora/Valentus migration is required for this change set.

Open in Web View Automation 

Sent by Cursor Automation: Generate docs

@@ -0,0 +1,182 @@
import { spawnSync } from "node:child_process";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition — the generation script encodes the full maintainer contract (Mermaid render → themed dual output → contrast + SVG safety + freshness checks). This was the main documentation gap: the PR ships the pipeline but did not previously explain how to extend or troubleshoot it. See companion branch cursor/documentation-automation-system-01ed for website/public/docs/adaptive-themed-diagrams.adoc.

const props = parseDirectiveProps(node.propsRaw);
const src = typeof props.src === "string" ? props.src : "";
const alt = typeof props.alt === "string" ? props.alt : "";
const themed = props.themed === true ? " data-themed-svg" : "";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The themed=truedata-themed-svg contract is the author-facing hook for progressive enhancement. Consider cross-linking from spec/informal.adoc (companion docs PR adds @image documentation) so CMK authors know when to opt in.

@@ -1,3 +1,12 @@
import { mount, StartClient } from "@solidjs/start/client";
import { upgradeThemedSvgImages } from "@dev-centr/themed-svg/runtime";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runtime upgrade via upgradeThemedSvgImages + MutationObserver is easy to miss when debugging theme mismatches. The new maintainer guide documents the host-token wiring in app.css that this depends on.

AMDphreak and others added 5 commits September 8, 2026 07:12
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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