Repository navigation
refactor(skills): vendor one diagram viewer into two skills - #90
Merged
Merged
Conversation
…k-form
Both skills carried a copy of the same enlarge() dialog. Replace them
with the diagram-zoom core v0.1.0 (Lightbridge-KS/quarto-diagram-zoom,
MIT), copied unchanged into each skill because skills are packaged
independently:
- rich-document: assets/vendor/diagram-zoom.{js,css}, embedded before
viewer.js. viewer.js keeps rendering and its own opener and calls
DiagramZoom.enlarge after insertion. Theme selectors move from
.rd-dialog to .dz-dialog; --dz-* map to the --document-* tokens.
VIEWER_VERSION 2026-10-10.
- ask-form: static/vendor/diagram-zoom.{js,css}, loaded before rich.js
under the existing CSP. onClose keeps the theme-change guard; --dz-*
map to the glass tokens.
The viewer gains wheel and pinch zoom at the pointer, touch pan, and a
Fit control. Version and sha256 are recorded in each skill's tracker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Intent: rich-document and ask-form share one Enlarge viewer — the
diagram-zoomcore — instead of two hand-copiedenlarge()dialogs.Summary
diagram-zoom.js/.cssv0.1.0 from Lightbridge-KS/quarto-diagram-zoom (MIT) are copied unchanged into each skill (rich-document/assets/vendor/,ask-form/static/vendor/), because the packager zips skills independently. Both copies are byte-identical to that repo'smainatc35c0a4; version and sha256 are recorded as Confirmed contracts in each skill's tracker.enlarge()and its dialog CSS are removed.viewer.jskeeps rendering and its own opener and callsDiagramZoom.enlargeafter insertion (no observer, as ADR-0001 requires). Mermaid theme selectors move from.rd-dialogto.dz-dialog;--dz-*map to the--document-*tokens onbody.rd_core.pyembeds the vendored files beforeviewer.js;VIEWER_VERSION→ 2026-10-10.enlarge()becomes a five-line wrapper whoseonClosekeeps the theme-change guard (no re-render while the SVG is in the dialog). The vendored files load beforerich.jsunder the unchanged CSP (script-src 'self');--dz-*map to the glass tokens, and the toolbar keeps its pill buttons. The superseded "copy, no shared module" decision is marked in v2.md..rd-dialog/.rd-viewport→.dz-dialog/.dz-viewport); the label "Close", SVG-before-opener restore, and focus return are unchanged.Verification
just test— all suites OK (test_rich_document.py18 tests,test_ask_form.py38 tests among them).uv run bin/validate.py— 50 skills valid.just test-rich-document-browser, Chromium):#rd-test-resultPASS, 45/45, including "enlargement moves completed SVG", "keyboard zoom", "keyboard reset", "close restores SVG and focus", and the theme-colour checks inside the dialog; dialog background resolves to--document-bgin dark mode.--base; a theme change while open leaves the diagram untouched and re-renders it after close.mainatc35c0a4.Open questions