Repository navigation
Annotations and Scenarios
Brook Li edited this page Oct 16, 2026
·
1 revision
prototype/notes.snapshot.js contains exactly one assignment:
window.__PROTOTYPE_NOTES__ = { ...JSON... };Minimum contract enforced by runtime/server/snapshot.mjs (validateSnapshot):
schemaVersion: 2-
header.titlestring -
scenarios: non-empty object keyed by id, or non-empty array of{ id, state? };statemust be an object if present -
cards[]: each has stringidandtargetwith a non-emptyanchoror aselectorstring; optionalwhenobject (scalar / array / nested object values, depth ≤ 8)
The server rewrites the file atomically with a canonical header comment. The screenshot CLI parses it as JSON only and refuses executable code.
-
state.jsexposes the singlePrototypeViewersstate source; the active scenario syncs to?scene=<id>. -
model.jsevaluates cardwhenagainst state (pure matching) and scenario metadata. -
viewer.jsrenders the right-rail cards and SVG connectors. -
display-mode.js:?product-only=1addspa-product-onlyand hides annotations, Mark, collapse control and interaction badges.collapsed=1collapses the rail.
Business adapters in prototype.js restore DOM state for each scenario. Details: product-annotations.md, generation contract §3–§5.
Editing cards is done in the Author Tools Notes editor.
Getting started
Concepts
Authoring
UI packs
Reference