feat(web): hidden Swiss Grid style guide via double-click on the theme selector - #36
Conversation
…e selector Adds an internal design-system reference for the Swiss Grid theme, rendered by the viewer itself (like Changelog/Readme) from src/web-style-guide.md. Documents the Swiss Grid tokens, typography, markdown elements and chrome — Swiss Grid only. Deliberately hidden: reached only by double-clicking the theme selector, which also forces the Swiss Grid theme so the guide shows in its intended skin. Not linked, not in the footer, not searchable — "für mich, keiner soll suchen." - src/web-style-guide.md — the guide (base64-embedded via __STYLE_GUIDE_B64__) - src/web-app.js — STYLE_GUIDE const + dblclick trigger on #themeMenuBtn - build.sh — inject the payload (mirrors the CHANGELOG embed) - test/web-smoke.sh — assert payload embedded + trigger wired + extend placeholder guard - test/e2e/controls.spec.ts — double-click opens it in Swiss Grid - web/index.html — rebuilt (0-deletion diff: only the new handler) No CHANGELOG entry on purpose: the footer renders CHANGELOG.md live, so a bullet would reveal the hidden feature. Uses the sanctioned skip-changelog label instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nfbt26KeSjCNMbN85njRBE
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe web build now embeds a Swiss Grid style guide, provides a standalone themed guide page, and adds hidden theme-button gestures for rendering or navigating to the guide. Smoke and end-to-end tests cover the build payload, gestures, page content, and metadata. ChangesSwiss Grid style guide
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ThemeMenuButton
participant WebApp
participant RenderedViewer
participant StyleGuidePage
ThemeMenuButton->>WebApp: Double-click or triple-click
WebApp->>WebApp: Close menu and apply swiss theme
WebApp->>RenderedViewer: Render STYLE_GUIDE as style-guide.md
WebApp->>StyleGuidePage: Navigate to /style-guide
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Adds web/style-guide.html — a proper standalone HTML design-system reference for the Swiss Grid theme: colour swatches (both light + dark palettes), the IBM Plex type scale, and the real chrome components as specimens (button states, open dropdown, collapsed red divider, grid rail, ◆ footer). The things a rendered Markdown view can't show. noindex, self-hosted fonts. Two hidden gestures now share the theme selector, disambiguated by the native click-count (e.detail) with a 260ms settle timer so a triple never first fires the double: - double-click → the Markdown style-guide demo (rendered in the viewer) - triple-click → the HTML style-guide page (/style-guide) - web/style-guide.html — new standalone page - src/web-app.js — dblclick handler replaced by the detail-based dual-gesture router - test/web-smoke.sh — assert the HTML page (present, noindex, heading) + both routes - test/e2e/controls.spec.ts — double-click (MD), triple-click (nav), HTML page loads - web/index.html — rebuilt Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nfbt26KeSjCNMbN85njRBE
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/e2e/controls.spec.ts (1)
65-69: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winTriple-click test only checks the URL, not that the destination actually renders.
window.location.hrefnavigation still lands on the target URL even for a 404/error response, so this test doesn't prove/style-guideserves the standalone page — it only proves the URL changed. Consider asserting page content (e.g., theh1text) after navigation, the same way the standalone-page test does.✅ Suggested strengthening
test("hidden gesture — triple-click the theme selector navigates to the HTML style guide", async ({ page }) => { await page.click("`#themeMenuBtn`", { clickCount: 3 }); await page.waitForURL(/\/style-guide$/); expect(page.url()).toMatch(/\/style-guide$/); + await expect(page.locator("h1")).toContainText("Swiss Grid — Style Guide"); });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/e2e/controls.spec.ts` around lines 65 - 69, The triple-click test should verify that the destination page renders, not only that navigation reaches /style-guide. In the test “hidden gesture — triple-click the theme selector navigates to the HTML style guide”, retain the URL assertion and add an assertion for the expected standalone style-guide content, such as the page’s h1 text, matching the existing standalone-page test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/e2e/controls.spec.ts`:
- Around line 65-69: The triple-click test should verify that the destination
page renders, not only that navigation reaches /style-guide. In the test “hidden
gesture — triple-click the theme selector navigates to the HTML style guide”,
retain the URL assertion and add an assertion for the expected standalone
style-guide content, such as the page’s h1 text, matching the existing
standalone-page test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6c604a64-3206-401f-be7f-5eb037514a07
📒 Files selected for processing (5)
src/web-app.jstest/e2e/controls.spec.tstest/web-smoke.shweb/index.htmlweb/style-guide.html
Was
Ein interner Style Guide für das Swiss Grid-Theme des md-viewer — gerendert vom Viewer selbst (wie Changelog/Readme) aus
src/web-style-guide.md. Er dokumentiert die Swiss-Grid-Tokens (Light + Dark), Typografie, Markdown-Elemente und die Chrome-Komponenten. Nur Swiss Grid, wie gewünscht.Trigger — versteckt
Erreichbar nur über einen Doppelklick auf die Theme-Auswahl (die „Swiss Grid"-Dropdown). Der Doppelklick erzwingt zusätzlich das Swiss-Grid-Theme, damit der Guide in seiner gedachten Optik erscheint. Kein Link, kein Footer-Eintrag, nicht suchbar — „für mich, keiner soll suchen."
Warum kein CHANGELOG-Eintrag
Der Footer-„Changelog"-Button rendert
CHANGELOG.mdlive im Viewer auf md.neckarshore.ai. Ein[Unreleased]-Bullet würde das versteckte Feature also öffentlich verraten. Deshalb der sanktionierteskip-changelog-Bypass (AD-42) statt eines Eintrags.Dateien
src/web-style-guide.md__STYLE_GUIDE_B64__)src/web-app.jsSTYLE_GUIDE-Const + dblclick-Trigger auf#themeMenuBtnbuild.shtest/web-smoke.shtest/e2e/controls.spec.tsweb/index.htmlVerifikation (lokal grün)
./test/web-smoke.sh— PASSED, inkl. 4-theme×mode-block-Invariant (base64 schirmt die verbatim Token-Doku ab)npm run test:e2e— 17 passed (16 + der neue Trigger-Test)./build.sh+git diff— nurweb/index.htmlchurnt (viewer.htmlbyte-identisch)🤖 Generated with Claude Code
https://claude.ai/code/session_01Nfbt26KeSjCNMbN85njRBE
Summary by CodeRabbit