decklight 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +2 -0
- package/PLATFORM.md +61 -3
- package/README.md +58 -28
- package/SPEC.md +1326 -85
- package/cli/agent-review.mjs +5 -4
- package/cli/agents.mjs +148 -18
- package/cli/bundle-audio.mjs +10 -3
- package/cli/bundle-module.mjs +95 -0
- package/cli/bundle.mjs +125 -7
- package/cli/cast.mjs +86 -19
- package/cli/check-fixes.mjs +194 -0
- package/cli/check-watch.mjs +151 -0
- package/cli/check.mjs +491 -75
- package/cli/code-editor.mjs +287 -0
- package/cli/commands.mjs +13 -2
- package/cli/commit-flow.mjs +7 -3
- package/cli/commit-message.mjs +35 -8
- package/cli/commit-split.mjs +125 -25
- package/cli/deck-refs.mjs +8 -3
- package/cli/decklight.mjs +11 -1
- package/cli/design-system-edit.mjs +37 -1
- package/cli/design-system-refs.mjs +263 -6
- package/cli/design-system.mjs +82 -14
- package/cli/edit-address.mjs +184 -0
- package/cli/edit-git.mjs +23 -6
- package/cli/edit-handover.mjs +257 -40
- package/cli/edit-look.mjs +293 -6
- package/cli/edit-open.mjs +143 -0
- package/cli/edit-slides.mjs +1043 -67
- package/cli/edit-translate.mjs +243 -0
- package/cli/edit.mjs +3680 -319
- package/cli/editor-support.mjs +286 -0
- package/cli/enhance.mjs +157 -27
- package/cli/find-replace.mjs +142 -0
- package/cli/fix-review.mjs +368 -0
- package/cli/git.mjs +13 -0
- package/cli/init.mjs +101 -22
- package/cli/keep-awake.mjs +68 -0
- package/cli/marketplace-autocheck.mjs +200 -0
- package/cli/marketplace.mjs +250 -13
- package/cli/migrate-writing.mjs +214 -0
- package/cli/narrate.mjs +121 -5
- package/cli/open.mjs +53 -15
- package/cli/outside-edit.mjs +257 -0
- package/cli/paste.mjs +92 -0
- package/cli/pdf.mjs +88 -10
- package/cli/pptx-export.mjs +10 -5
- package/cli/publish.mjs +24 -3
- package/cli/record.mjs +86 -15
- package/cli/remote.mjs +32 -6
- package/cli/rewrite.mjs +265 -0
- package/cli/runtime-link.mjs +218 -17
- package/cli/serve.mjs +9 -6
- package/cli/setup.mjs +2 -2
- package/cli/skill-content.mjs +251 -10
- package/cli/skills/slide-writing.md +333 -0
- package/cli/skills/voiceover.md +423 -0
- package/cli/skills.mjs +282 -15
- package/cli/starter-full.mjs +353 -0
- package/cli/supervise.mjs +14 -0
- package/cli/theme-refs.mjs +14 -2
- package/cli/theme.mjs +3 -2
- package/cli/translate-core.mjs +466 -0
- package/cli/translate-files.mjs +149 -0
- package/cli/translate.mjs +458 -0
- package/cli/units.mjs +75 -7
- package/cli/util.mjs +25 -0
- package/cli/vocabulary-docs.mjs +138 -0
- package/dist/decklight.css +2506 -113
- package/dist/decklight.js +385 -175
- package/dist/decklight.js.map +4 -4
- package/docs/GLOSSARY.md +9 -2
- package/docs/WRITING_RESEARCH.md +327 -0
- package/package.json +5 -3
- package/themes/coastal.css +3 -0
- package/themes/metropolis.css +2 -0
- package/themes/reveal-blood.css +3 -0
- package/themes/reveal-league.css +2 -0
- package/themes/reveal-moon.css +2 -0
- package/themes/reveal-serif.css +1 -0
- package/themes/reveal-sky.css +1 -0
- package/themes/reveal-solarized.css +4 -0
- package/tools/brand-palette.mjs +6 -1
- package/tools/build-groups.mjs +28 -8
- package/tools/cdp.mjs +176 -0
- package/tools/chart-spec.mjs +242 -0
- package/tools/click-match.mjs +70 -0
- package/tools/code-options.mjs +174 -0
- package/tools/conversation.mjs +49 -0
- package/tools/deck-family.mjs +101 -0
- package/tools/deck-html.mjs +212 -15
- package/tools/design-system-format.mjs +40 -1
- package/tools/design-system-migrations.mjs +207 -0
- package/tools/diagram-shapes.mjs +221 -0
- package/tools/elevenlabs-tts.mjs +62 -53
- package/tools/exec.mjs +10 -2
- package/tools/face-clip.mjs +96 -0
- package/tools/face-layout.mjs +94 -0
- package/tools/gemini-tts.mjs +1 -1
- package/tools/invisible-in-print.mjs +27 -0
- package/tools/lipsync-auto.mjs +197 -0
- package/tools/lipsync-config.mjs +16 -0
- package/tools/lipsync-engines.mjs +22 -4
- package/tools/lipsync-server.mjs +8 -5
- package/tools/lipsync.mjs +122 -30
- package/tools/local-voice.mjs +1 -1
- package/tools/mouth-file.mjs +26 -0
- package/tools/mouth.mjs +320 -0
- package/tools/narration-manifest.mjs +100 -6
- package/tools/narration-synth.mjs +96 -76
- package/tools/recording-impact.mjs +16 -1
- package/tools/sentences.mjs +7 -1
- package/tools/site-clip.mjs +114 -0
- package/tools/starters.mjs +402 -0
- package/tools/steps.mjs +118 -0
- package/tools/take-check.mjs +146 -0
- package/tools/template-theme.mjs +3 -1
- package/tools/test-impact.mjs +36 -12
- package/tools/theme-check.mjs +196 -1
- package/tools/tone-cue.mjs +108 -0
- package/tools/tts-cache.mjs +9 -3
- package/tools/tts-engines.mjs +100 -11
- package/tools/video-cache.mjs +93 -0
- package/tools/video-live.mjs +349 -0
- package/tools/video-options.mjs +11 -0
- package/tools/video.mjs +825 -117
- package/tools/viseme-fit.mjs +27 -0
- package/tools/viseme-match.mjs +77 -0
- package/tools/vocabulary.mjs +397 -0
- package/tools/voice-renumber.mjs +605 -0
- package/tools/voiceover-server.mjs +42 -11
- package/tools/voiceover.mjs +48 -20
- package/dist/build-info.json +0 -1
package/SPEC.md
CHANGED
|
@@ -15,16 +15,18 @@ being moved, and it says what it points at.
|
|
|
15
15
|
| `DECK_ANATOMY` · `SLIDE_DENSITY` · `COMPARISON_SLIDES` | how a deck and a slide are put together |
|
|
16
16
|
| `BUILDS` · `BUILD_AUTHORING` · `BUILD_SEMANTICS` · `BUILD_ENTRANCES` · `BUILD_PROVIDER_API` | progressive reveals |
|
|
17
17
|
| `SVG_DIAGRAMS` · `CHARTS` | diagrams and data |
|
|
18
|
-
| `MOTION` · `SLIDE_TRANSITIONS` · `AUTO_ANIMATE` · `ELEMENT_ANIMATIONS` | movement |
|
|
18
|
+
| `MOTION` · `SLIDE_TRANSITIONS` · `AUTO_ANIMATE` · `ELEMENT_ANIMATIONS` · `LETTER_BY_LETTER` | movement |
|
|
19
19
|
| `THEMING` · `THEME_DISTRIBUTION` | the token contract, and sharing a theme |
|
|
20
20
|
| `CODE_AND_MATH` | code blocks and LaTeX |
|
|
21
21
|
| `TERMINAL_RECORDINGS` · `RECORDER_CLI` · `CAST_FORMAT` · `TERMINAL_PLAYER` · `ASCIICAST_INTEROP` | truthful terminals |
|
|
22
|
-
| `PRESENTING` · `PRESENTING_NAVIGATION` · `PRESENTING_CHROME` · `PRESENTING_LOOK` · `PRESENTING_MODES` · `PRESENTING_EDITING` · `PRESENTING_VOICE` · `PRESENTING_FIT` · `PRESENTING_OUTPUT` | moving through a deck, the presenter's chrome, themes, write and no-trust mode, editing, the voice, keeping a slide on the slide, and print and export |
|
|
22
|
+
| `PRESENTING` · `PRESENTING_NAVIGATION` · `PRESENTING_CHROME` · `PRESENTING_LOOK` · `PRESENTING_MODES` · `PRESENTING_EDITING` · `PRESENTING_WRITING` · `PRESENTING_VOICE` · `PRESENTING_BROWSER_VOICE` · `FACE_LAYOUT` · `PRESENTING_FIT` · `PRESENTING_OUTPUT` | moving through a deck, the presenter's chrome, themes, write and no-trust mode, editing, the writing tools, the voice, the browser's own voice when no bridge answers, keeping a slide on the slide, and print and export |
|
|
23
23
|
| `REVIEW` | reviewer comments on a deck, anchored to slides and carried by git |
|
|
24
|
+
| `TRANSLATIONS` · `TRANSLATION_UNITS` · `TRANSLATION_RECORD` · `TRANSLATE_CLI` · `TRANSLATE_PANEL` · `TRANSLATION_VOICE` · `TRANSLATION_SWITCH` | a deck in several languages, each a file generated from the source deck and a record of its translated text, with its own voice, captions and video |
|
|
24
25
|
| `JS_API` · `DECK_IMPORT` | the public API, and bringing a deck across |
|
|
25
26
|
| `MARKETPLACE_REGISTRY` · `VOICE_UNITS` · `AGENT_UNITS` · `ENGINE_UNITS` · `ENGINE_PREREQUISITES` · `UNIT_COMPAT` · `UNIT_PINNING` · `UNIT_VERSIONS` · `EXTENSIONS_TRANSFORMS` · `EXTENSIONS_CHECK` · `EXTENSIONS_ADAPTERS` | **in [`PLATFORM.md`](PLATFORM.md)**: catalogs of themes, templates, skills and engines, registered not fetched; the unit library, its pins, gates and calling conventions; voices, agents and engines as units |
|
|
26
|
-
| `DESIGN_SYSTEMS` · `BRAND_PALETTE` · `DESIGN_SYSTEM_ROLES` | a company's tokens, art and slide templates, published once and referenced by every deck built on it; its palette, and the themes drawn from it; its roles, which each theme sets |
|
|
27
|
+
| `DESIGN_SYSTEMS` · `BRAND_PALETTE` · `DESIGN_SYSTEM_ROLES` · `DESIGN_SYSTEM_MIGRATIONS` | a company's tokens, art and slide templates, published once and referenced by every deck built on it; its palette, and the themes drawn from it; its roles, which each theme sets; what each major version renamed, and the deck that took an older one |
|
|
27
28
|
| `FONTS` | a typeface's files and licence, from a marketplace, referenced by a deck so its faces travel with it |
|
|
29
|
+
| `MARKETPLACES_SCREEN` | every registered marketplace on one screen, while authoring: which are out of date, updating them, what's new, and adding one |
|
|
28
30
|
| `REPO_LAYOUT` · `NON_GOALS` | for contributors |
|
|
29
31
|
|
|
30
32
|
---
|
|
@@ -58,6 +60,7 @@ being moved, and it says what it points at.
|
|
|
58
60
|
|
|
59
61
|
- Slides are `<section>` children of `.decklight`. Flat list (no vertical nesting in v1).
|
|
60
62
|
- **Two shapes of one deck** (#517, #520). The shape you *author* is **data**: the slides, plus one configuration block (`<script type="application/json" data-decklight-config>{ "decklight": "0.8.1", "theme": "aurora", … }</script>`) and nothing in the file that executes: no runtime, no `Decklight.init` call. `decklight init` and `import` write exactly that; `open`, `--no-trust` and every render reference the installed runtime, its stylesheet and the block's theme into the page on the way out (`PRESENT`), the engine boots itself from the block, the runtime is always the installed one, and a git history of the deck is a history of slides. The block holds everything `init` takes (below), as JSON; `decklight` is the version the deck was written for (the one key that is the file's, not the engine's) and `theme` (default `aurora`) is **the theme the deck opens on**: the server links it into a deck that has no theme of its own, and the runtime selects it among a deck's inline `<style data-theme>` blocks, its own or added ones. The runtime's order is `?gen=`, then `?theme=`, then the pick saved in this browser, then `theme`, then the first block (a deck held to a design system's brand holds the last three to the brand's themes: BRAND_PALETTE); the configured theme is applied without being saved, so it stays a default rather than becoming somebody's pick. Before #547 nothing read it on a deck whose themes are inline blocks (every `upgrade --link` deck, which the server never gives a theme link) so such a deck, and every render of it, opened on its first block whatever the block said. The example above, with its own references and its own `init` call, is the same deck written by hand and is served untouched: a deck that carries the runtime, by reference or embedded, is never given a second one, and `Decklight.init(config)` stays the JS API's escape hatch for a deck that scripts against the engine (`JS_API`). The shape you *hand over* is self-contained: `bundle` and `publish` embed the runtime, stylesheet and themes at that moment, so the file opens from disk, mails, and still plays in ten years, pinned to the version that embedded it, signed and audited as those bytes (`INTEGRITY`). `init --inline` and `import --inline` write the self-contained shape directly for anyone who needs a file that double-clicks; `upgrade --link` turns one back into data. The cost of the data shape is pinning: it runs whatever is installed, which is why behavioural change stays behind the configuration and `--no-trust --audit` says when the deck's recorded version and the served runtime differ by a major.
|
|
63
|
+
- **A deck is a standards-mode page** (#1190). A file written as only its slides (`<div class="decklight">` and its sections, no `<!doctype html>`) would be parsed in quirks mode, where a `<table>` takes neither the colour nor the size of the text around it: dark cells on a dark theme. So everything that serves or renders a deck puts `<!doctype html>` in front when the file has none (after a byte-order mark; one already there, in any case and after comments or whitespace, is kept and never doubled), in the same step that references the runtime: `decklight <deck>` in write mode and `--no-trust`, `pdf`, `pptx`, `video` and the screenshot tool. `bundle` writes it into the file it hands over, since that file is served by whatever serves it next. The runtime's table rule inherits the colour and the size too, so a deck opened some other way still reads: the table is the size of the text it sits in, and its cells and caption set the smaller text (0.82em), so a table reads the same with or without a doctype. A table sized inline (`style="font-size: …"`) gives its cells that size. `decklight check` gives a **hint** (`no-doctype`, never a failed run) on a deck file without one, and `init`, `import` and the authoring skill's skeleton start with it.
|
|
61
64
|
- **Markdown slides were removed in 0.3.0.** `data-markdown` + a `<script type="text/template">` body was a second authoring surface for the same DOM, and it earned its bundle: `marked`, a `::: build` directive, a parallel notes syntax, a `` ```chart `` fence that existed only because a nested `</script>` cannot live in a template, and a math path that had to extract every span *before* the parse so TeX underscores would not become emphasis. HTML is the one surface now. A deck still carrying `data-markdown` sections would render them EMPTY (the template is a `<script>` no browser paints) so the engine recognises the attribute for exactly long enough to refuse out loud: it marks the section `data-markdown-removed` (assertable headlessly) and warns per slide, naming the slide number. It parses nothing.
|
|
62
65
|
- Speaker notes: `<aside class="notes">`. Two markers inside them are timing, never words: `[click]` cuts the notes into beats, one per build step (BUILDS), and `[pause]` holds a let-it-sink-in beat where it stands (PRESENTING); `[long pause]` is two of them, and `[short pause]` (ElevenLabs' own spelling) is one. **Who holds a pause depends on the voice:** one that acts on audio tags (ElevenLabs v3/v4, `audioTags`) is sent it as `[pause]` / `[long pause]` inside the sentence and holds it in its own breath, in one clip; for every other engine decklight holds it itself: cuts the sentence there and joins the pieces with silence, live and in a recording. A beat of nothing but pauses has no words to send, so decklight holds it on every engine. **Square brackets are the form decklight writes** (the scaffold, the notes editor's text and its save, a recording's `.txt` script), the way a script for a voice is written. **Any spelling a person writes is the same marker**: `[click]`, `<click>`, `⟨CLICK⟩`, `[pause]`, `<pause>`, `⟨PAUSE⟩`, in any case, typed as text, escaped (`<pause>`), or written as an element in the deck's HTML (which the runtime reads as the marker, not as the nothing `textContent` sees); so is a marker whose brackets are entities (`⟨CLICK⟩`). `[slow]` is not a marker (decklight does not pace the voice itself) but an audio tag like any other, below; `<slow>` and `⟨SLOW⟩` read as that tag, and a closing `[/slow]` as nothing, never read aloud. Only those exact words match: `[1]`, `[ ]` and `<script>` in a note stay prose. The canonical forms read, and hash, exactly as they always have: the hash is taken over the marker, never its spelling, so rewriting `⟨CLICK⟩` as `[click]` re-voices nothing; a spelling that used to be spoken aloud is now the marker, so a recorded slide that carried one is stale once. Any other square-bracketed words (`[whispers]`, `[laughs]`, `[nervous laugh]`, `[door slams]`) are an **audio tag**: direction for a voice that can act on one (ElevenLabs `eleven_v3`, `eleven_v4`, `eleven_v4_turbo`; an engine says so as `audioTags`), sent to it as written; **any other engine never hears it**: the live bridge and the recorder take it out, and a beat or slide that is nothing but tags and pauses has no take on any engine. A tag is never a caption or a subtitle, and the speaker view shows it as a cue. Brackets around anything but letters (`[1]`, `[2024]`) are not a tag.
|
|
63
66
|
- **Module markers** (optional): `data-module="<title>"` on a section marks the
|
|
@@ -70,6 +73,39 @@ being moved, and it says what it points at.
|
|
|
70
73
|
slide finder shows the deck as a foldable outline of them (`PRESENTING`), and the
|
|
71
74
|
palette navigates between them. A marked section is still an ordinary slide;
|
|
72
75
|
it is shown, numbered and presented like any other.
|
|
76
|
+
- **Runs of steps** (optional, #1188): a walkthrough spread over several slides
|
|
77
|
+
shows where it is. `data-steps="Foundation, Fresh context, Tools, The agent"`
|
|
78
|
+
on the slide a run starts on names its groups, in order (or a
|
|
79
|
+
`<nav class="steps"><ol><li>Foundation</li>…</ol></nav>` on that slide: the
|
|
80
|
+
list is the declaration, never shown on the slide); every slide after it says
|
|
81
|
+
which group it is in with `data-step="Fresh context"` (any case), or
|
|
82
|
+
continues the group of the slide before when it says nothing. The run ends at
|
|
83
|
+
the next chapter marker (`data-module`), at the next run, or at a slide marked
|
|
84
|
+
`data-steps-end`, which is the first slide after it. `data-steps-count` on the
|
|
85
|
+
first slide numbers the run: *3 of 7*, counted over the slides an audience
|
|
86
|
+
sees (a hidden slide keeps its group and takes no number).
|
|
87
|
+
**The runtime draws the strip** on every slide of the run (`src/core/steps.js`
|
|
88
|
+
over `tools/steps.mjs`, the one reading the strip, the finder and the check
|
|
89
|
+
share): the groups in order, the slide's own in `--steps-ink` (the accent
|
|
90
|
+
unless the theme sets its own, THEMING) and bold, the ones done in `--muted`,
|
|
91
|
+
the ones to come in `--fg`, then the count. Nothing is typed per slide, so a
|
|
92
|
+
slide inserted, split, moved or hidden renumbers the run on the next sync, and
|
|
93
|
+
`?print`, a still (`?capture`) and the overview show it as the slide does.
|
|
94
|
+
It sits in the middle of the slide's top padding (12 design px down, the
|
|
95
|
+
middle 60% of the width), above where a pinned title starts and clear of the
|
|
96
|
+
corner chrome, and it takes no click: no content can reach it, so the fit
|
|
97
|
+
guardrail (PRESENTING_FIT) never sees it, and a slide with only a title is not
|
|
98
|
+
pinned because of it. A group name too long for the room is cut short (…),
|
|
99
|
+
never the slide's own. A theme or a design system places it with
|
|
100
|
+
`--steps-top`, `--steps-bottom`, `--steps-inset` (each side, 20% by default)
|
|
101
|
+
and `--steps-align`, and sizes it with `--steps-size` (19px); a slide
|
|
102
|
+
template with an empty `data-slot="steps"` holds it in that slot instead
|
|
103
|
+
(DESIGN_SYSTEMS). The strip is the engine's, like the background layer: it is
|
|
104
|
+
never written to the file, never selected, counted or searched as the slide's
|
|
105
|
+
words. The slide finder lists a run's slides under their group names
|
|
106
|
+
(PRESENTING_NAVIGATION), and `decklight check` names a `data-step` that is
|
|
107
|
+
none of its run's groups, or that sits on a slide in no run (`step-group`, a
|
|
108
|
+
warning: the strip shows such a slide as still in the group before).
|
|
73
109
|
- **Sources** (`SLIDE_SOURCES`, optional): `<aside class="sources">`, a sibling
|
|
74
110
|
of the notes aside, holding what the slide is standing on: a `<dl>` of named
|
|
75
111
|
facts (owner, last reviewed, the document a claim came from) and a `<ul>` of
|
|
@@ -111,9 +147,44 @@ being moved, and it says what it points at.
|
|
|
111
147
|
- **Rehearse notes** (optional, build-time authored): a condensed cue-card variant of the notes for the speaker view's rehearse mode (PRESENTING): a few words per segment instead of full prose, with **exactly the same ⟨CLICK⟩ segmentation** as the notes so build-step highlighting aligns. `<aside class="rehearse">` as a sibling of the notes aside. Slides without a rehearse aside fall back to the full notes in rehearse mode.
|
|
112
148
|
- **Subtitle**: the `<p>` immediately following a slide's leading `h1`/`h2` is auto-marked `.subtitle` and gets one canonical look (muted, 0.72em). Opt out per slide with `data-subtitle="none"` on the section; an author-placed `class="subtitle"` is respected as-is. Don't bake subtitle text into diagram SVGs; author it as this `<p>` so it themes and scales with the deck.
|
|
113
149
|
- **Background media**: `data-background-image="hero.jpg"` on a section renders the image full-bleed behind the slide's content: `data-background-size="cover|contain"` (default cover), `data-background-position` (default center). `data-background-dim="0.5"` lays a canvas-colored (`--bg`) overlay between the media and the content so text stays readable over arbitrary photos. `data-background-video="clip.mp4"` plays a muted looping `playsinline` clip while the slide is active: play/pause is driven from the engine's slide event, so a deactivated slide's video is *paused*, not merely hidden; `data-background-poster="poster.jpg"` is its stand-in still (required for print, PRESENTING). The engine injects the layer as an idempotent `.slide-bg` first child on `sync()`: absolutely positioned below the content, so backgrounds never count against the overflow guardrail (PRESENTING) and transitions/auto-animate carry them for free. `class="full-bleed"` on an `<img>` gives a *content* image the same cover-the-slide treatment (absolute inset-0, object-fit cover, under the in-flow text); images inside split layouts (PRESENTING) are capped (object-fit contain, max-height) so a tall photo can't blow the slide. `decklight bundle` inlines `data-background-image`/`data-background-poster` as data: URIs like `<img src>`; background videos stay external with a CLI notice (PRESENTING).
|
|
150
|
+
- **Video and sound on a slide**: a `<video>` or `<audio>` the author puts in a section (not a background, above) is driven by the engine as a background clip is, because every slide is in the page at once and the browser would otherwise play an `autoplay` clip on slide 9 from load, with its sound, while slide 1 is on screen (`src/core/slide-media.js`). A clip **never plays while its slide is not the current one**; **leaving its slide pauses it and returns it to its start**; and it **plays on arrival only when the author wrote `autoplay`**, which the engine takes off the element at boot and keeps as that ask. Its own `controls` play it as usual, and a click on them never advances the slide (`OWN_CLICKS`). A page that only shows plays none of them: print and the PDF made from it (PRESENTING), a capture for a video or a picture, and an embedded preview such as the speaker view's next slide. There a clip shows its `poster`, or its first frame once that has loaded (the engine asks for the data so it can), so give a clip that matters in print a `poster`.
|
|
114
151
|
- **Bleed** (#643): a slide's background art fills the **screen**, not just the stage. The stage keeps its design size (`width`×`height`, 1280×720) and is scaled to fit without changing shape, so a 16:9 deck on a 16:10 laptop or a 4:3 projector has bands above and below (66 px a side at 1512×982); and art painted inside the slide used to stop at the stage's edge, the bands showing the theme's `--bg`. Now one layer behind the stage (`.decklight-bleed`, `src/core/bleed.js`), covering the viewport, paints the **current** slide's art: its background media (the image with its own size and position resolved against the viewport (`cover`, centred, by default) or a muted clone of its video, the on-stage clip paused) or a slide template's art (the element its template marks `data-ds-bleed`, `DESIGN_SYSTEMS`: its computed background, resolved against the viewport). While a slide bleeds it carries `data-bled` and its on-stage copy of the art is hidden: never drawn twice at two scales; overview and finder thumbnails, being clones elsewhere, keep theirs. The **content** stays on the stage: titles, pins, splits, slots and the overflow guardrail measure exactly as before, and at 16:9 nothing moves. The layer cross-fades with the slide transition; a slide with no art clears it. Never in print, `?print`, `pdf`, `pptx` or `video` (16:9 frames, nothing to fill), nor in an embedded preview (the theme picker's, the speaker view's panes); `"bleed": false` in the config keeps the hard letterbox edge for a deck that wants it.
|
|
115
152
|
|
|
116
|
-
**
|
|
153
|
+
**Figures** (`FIGURES`, #1181): when one number carries a slide, the number is the slide. A **figure** is a block: one oversized value, a short label under it, optionally a line of context.
|
|
154
|
+
|
|
155
|
+
```html
|
|
156
|
+
<div class="figure" data-build>
|
|
157
|
+
<p data-figure data-count>94%</p>
|
|
158
|
+
<p>of requests never reach the database</p>
|
|
159
|
+
<small>cache hit rate since March</small>
|
|
160
|
+
</div>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
- **The value** is the `<p data-figure>`: a number and its sign or unit, a few characters (`94%`, `$1.2M`, `3×`, `1,500`). It is set at the theme's `--figure-size` (4.5 times the body size when the theme leaves it unset, THEMING) in `--figure-ink` (the accent unless the theme sets its own; a design system maps the accent to one of its roles, DESIGN_SYSTEM_ROLES), the heading face and weight, tabular figures, on one line. **It never overflows its column**: the figure is sized by its column, the runtime gives each value its length, and the value is set at the smaller of the theme's size and the size at which it fits, alone on a slide, in a split column or three in a row. The **label** under it is the body size, and a `<small>` under that is muted.
|
|
164
|
+
- **Alone on a slide it is centred**, title or not: a section of one figure is the Big number slide (PRESENTING_EDITING). In a `split` slide it is a normal block, so two figures are the two columns.
|
|
165
|
+
- **A row of figures** is one container, `<div class="figures">`, holding two or three: laid out evenly across the slide, sharing a top edge, every value of the row at one size (the longest one's) so the labels share a line. With `data-build` the row builds **one figure a click** (BUILDS); a lone figure with `data-build` arrives as **one step**, value and label together, never a click each. For density (SLIDE_DENSITY) a figure, or a row of them, counts as one paragraph.
|
|
166
|
+
- **Counting up**: `data-count` on the value counts it from 0, or from `data-count-from` (a plain number), to the value as written when its step arrives: its build step, or the slide itself for a figure that does not build, arriving forwards. The prefix, suffix, sign, decimals and separators are kept as written (`$0.6M` on the way to `$1.2M`, `750` to `1,500`): one point or a comma not followed by three digits is the decimal point, a comma or space between groups of three is a separator, and with both, the last is the decimal point (`1.500,25`). The count is decoration: the page holds the value as written whenever no frame of the count is being painted, a screen reader is given the value as written while it runs, and **reduced motion, `?print`, `pdf`, `pptx`, a capture, the overview, an embedded preview, the slide a deck opens on, a deep link and a step backwards** all show the final value with no count. `decklight check` warns (`figure-long`) at a value of more than eight characters: a sentence is not a figure, its words belong in the label.
|
|
167
|
+
|
|
168
|
+
**Conversations** (`CONVERSATIONS`, #1179): a deck about agents keeps showing an exchange: a user asks, the agent thinks, calls a tool, reads the answer, replies. A **conversation** is a block written as a list of turns, drawn as a transcript.
|
|
169
|
+
|
|
170
|
+
```html
|
|
171
|
+
<div class="conversation" data-build>
|
|
172
|
+
<p data-role="user">Where is my order 4417?</p>
|
|
173
|
+
<p data-role="agent" data-kind="thought">I need the order's latest status.</p>
|
|
174
|
+
<p data-role="agent" data-kind="tool-call">get_order(4417)</p>
|
|
175
|
+
<p data-role="tool" data-name="get_order">{ "status": "delayed", "eta": "Friday" }</p>
|
|
176
|
+
<p data-role="agent">It is delayed and should arrive Friday.</p>
|
|
177
|
+
</div>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
- **A turn** is a child of the block (a `<p>`, or any element but the notes) with `data-role`: `user`, `agent`, `tool`, `system`, or any word of the author's (`planner`), shown small above its words as the speaker's label. **The user's turns sit on the right, everyone else's on the left**, each a bubble: the agent's, a tool's or any other speaker's on `--turn-bg` in `--turn-ink` (the block's ground and the body ink when the theme leaves them unset, THEMING), the user's on `--turn-user-bg` in `--turn-user-ink` (the accent and its contrast), a `system` turn as a muted line across the middle. Those defaults are tokens a design system maps to its roles (DESIGN_SYSTEM_ROLES), and a colour a deck writes on a turn by hand is held to them (`off-role`).
|
|
181
|
+
- **`data-kind`** says what a turn is: `thought` (muted, italic, in a dashed outline, labelled *agent · thinking*), `tool-call` (a call the agent makes, labelled *agent · calls a tool*), and `speech`, the default, which is the attribute left off. A `tool-call` turn and a `tool` turn are set in the code face on the code's ground, and when their words parse as JSON (an object or an array) or read as a call (`get_order(4417)`, `search.query({ … })`) they are **coloured as code**, in the theme's highlight tokens (CODE_AND_MATH), JSON written across lines kept at its own indentation; words that are neither stay words. `data-name` on a tool's turn names the tool after its role in the label (*tool · get_order*). The colouring is the runtime's: the file keeps the words as written, and a turn typed into is typed as its words.
|
|
182
|
+
- **Builds**: `data-build` on the block makes **each turn one step, in order**, as a list's points are (BUILDS); `data-build="highlight"` lights one turn at a time, and `data-build-order` and `data-build-with` on a turn work as on any container's child. `decklight check` counts a conversation's clicks the same way against the notes' `[click]` beats.
|
|
183
|
+
- **A long conversation scrolls in its own box**: the transcript is held to the room its slide leaves it (the slide's column gives it that room, and in a `split` column the runtime holds it there) and scrolls inside, keeping **the newest turn in view** as it builds, its top edge fading once it has scrolled past its start, as a terminal keeps its last line (TERMINAL_PLAYER). A step back shows the turn it is on; a conversation that does not build shows its start. It never overflows the slide, and the guardrail never counts it as clipped. Every position is set as the step is applied, never by a frame. **`?print`, `pdf` and every capture show it whole**: every turn, shrunk to fit as `data-fit` code is (CODE_AND_MATH), never cut at the bottom of its box. For density (SLIDE_DENSITY) a conversation is not counted as prose, as a terminal is not: it arrives a turn at a time in its own box.
|
|
184
|
+
- **Concepts**: `data-concept` on a turn colours its bubble as it colours a diagram shape (SVG_DIAGRAMS, concept colours): the concept's slot, its words in the diagram ink, so "the agent" is one colour in the transcript and in the diagrams. The configuration's **`roleConcepts`** maps a role to a concept for every turn of that role, `{ "roleConcepts": { "agent": "agent", "tool": "tools" } }`; a turn's own `data-concept` wins. A thought or a tool's turn keeps its own ground and wears the concept as its outline.
|
|
185
|
+
- **Write mode**: Add ▾ › **Conversation** places a starter (a user's question, the agent's call, the tool's answer, the agent's reply), its first turn typed first; a turn's words are typed in place with a double-click, as any text's are; **Turn ▸** on the element menu of a turn (PRESENTING_EDITING) changes who speaks and its kind, adds a turn after it and removes it. `decklight check` names a `data-kind` it does not know, with the one meant (`unknown-value`), and VS Code's completion knows the block's attributes and a `dl-conversation` snippet.
|
|
186
|
+
|
|
187
|
+
**Hidden slides** (`HIDDEN_SLIDES`): `<section data-hidden>` is a slide the audience does not see. It **keeps its number**, as in PowerPoint, so everything that numbers slides file-side (comments, review anchors, history) stays in step; presenting steps over it, a deep link onto it lands on the nearest shown neighbour in the direction of travel, the overview shows it dimmed and badged so an author can find it, and `pdf`, `pptx`, `video` and `voiceover` produce nothing for it. `?all` presents hidden slides too, never the default, because hidden is hidden from the audience and the default is the audience. The command palette carries both halves: **Hidden slides show / skip** flips `?all` (the row exists only when the deck has something hidden), and in write mode **Hide this slide / Unhide this slide** writes `data-hidden` onto the current section through the edit server (`POST /deck/edit/slide/hidden`, one undo entry, the same door as a layout pick) and steps off it. The same row is in the editing bar's Slide ▾ and the right-click Slide ▸, for the slide the menu was opened on. `decklight import` keeps a PowerPoint hidden slide as one rather than dropping it.
|
|
117
188
|
|
|
118
189
|
### SLIDE_DENSITY · How much goes on a slide
|
|
119
190
|
|
|
@@ -179,8 +250,13 @@ The most common structured slide, and the one with a trap in it. Use `split`
|
|
|
179
250
|
```
|
|
180
251
|
|
|
181
252
|
The two `<div>`s become the columns and **share a top edge**; the trailing `<p>`
|
|
182
|
-
becomes a full-width centred footer under both.
|
|
183
|
-
|
|
253
|
+
becomes a full-width centred footer under both. A column's blocks are sized to
|
|
254
|
+
their content and centred, the list under its heading; a column written as
|
|
255
|
+
`<div class="column">` lays its blocks across its whole width instead, the way
|
|
256
|
+
a bare block (a lone list, a picture) fills a column by itself. The editor
|
|
257
|
+
writes that class when it wraps a bare column to add a block beside it
|
|
258
|
+
(PRESENTING_EDITING, Adding content), so the column looks as it did. Nothing
|
|
259
|
+
else is needed, in particular:
|
|
184
260
|
|
|
185
261
|
> **Do not combine `data-layout="split"` with your own column flexbox.** A
|
|
186
262
|
> hand-rolled `display:flex` shell inside a section that also carries
|
|
@@ -215,8 +291,12 @@ container, zero classes on the items.
|
|
|
215
291
|
| `data-build` on a leaf element (`p`, `img`, `blockquote`, `pre`, one `g`) | the element itself is one build step |
|
|
216
292
|
| `data-build="fade-up"` | entrance style (see 2.3) |
|
|
217
293
|
| `data-build-order="3"` | explicit step index within the slide (default: document order) |
|
|
294
|
+
| `data-build-with` on a step | it arrives on the click of the step just before it (in document order), wherever that one plays; an explicit `data-build-order` of its own wins |
|
|
218
295
|
| `data-build-stay` on a child of a `data-build` container | child is exempt (stays static) |
|
|
296
|
+
| `data-build-self` on a container that builds | the container is one build step, its children arriving with it (a list, a table or a group all at once) |
|
|
297
|
+
| `data-build` on a diagram's group (`<g data-group>`) inside a container that builds | the group's members are steps of their own, as if they stood where it stands; with `data-build-self` the group is one step (SVG_DIAGRAMS, groups) |
|
|
219
298
|
| `data-draw-stops="347 542 767"` on a stroke in a `draw` build | one stroke drawn in stages: path lengths, or fractions of the total when every value is ≤ 1 (or written `25%`): step k draws to stop k, the arrowhead riding each stage, a reversed build retracting stage by stage (a build provider, so a deep link lands on the right stop); with `data-build-order="N"` on the stroke its stops take the keys N, N+1, …, so an element carrying the same key fades in on the click that draws to that stop (BUILD_PROVIDER_API). A staged stroke is **paced by length**, 300 path units per second by default (a 300 px stage takes a second, never less than the flat draw duration), so a longer stage takes longer, where the flat 660 ms read as a swoosh; `data-draw-speed="400"` (path units per second) sets the pace exactly |
|
|
299
|
+
| `<g data-build="travel" data-along-wire="orders-agent">` in a diagram | one build step that sends a **token along a wire already drawn**, from its start to its end (BUILD_ENTRANCES, `travel`); `data-label="order 4417"` makes the token a chip with those words, `data-concept` colours it, `data-arrive="stay\|fade\|pulse"` says what it does at the end, `data-travel-ms` its pace, `data-travel-repeat` keeps it flowing while its click is the current one |
|
|
220
300
|
|
|
221
301
|
### BUILD_SEMANTICS · Engine semantics
|
|
222
302
|
|
|
@@ -228,7 +308,9 @@ container, zero classes on the items.
|
|
|
228
308
|
|
|
229
309
|
### BUILD_ENTRANCES · Entrance styles
|
|
230
310
|
|
|
231
|
-
`fade` (default) · `fade-up` · `fade-down` · `zoom` · `pop` (overshoot) · `draw` (SVG paths/lines: stroke-dashoffset animation; non-stroke elements fall back to fade; **Line Draw**: a stroke with a `marker-end` (or `marker-start`) draws with its arrowhead riding the tip from the first frame, oriented along the path, on straight lines and curves alike, and un-draws with the head on the retracting tip, the way Keynote's Line Draw carries an arrowhead (#522): the marker's content becomes a head placed by the same frame loop that advances the dash offset, since a CSS transition on each would drift apart; the head is **revealed to the drawn length** while it is still short of the head's own reach (#527): a Line Draw grows out of a point, shaft and head as one silhouette, and retreats into it on the way back, rather than a full-size head standing on the origin on the first frame; `marker-mid`, and a marker on a shape that is not a path, wait at the endpoint until the stroke has drawn; a **dashed stroke draws dashed** (#737): its authored `stroke-dasharray` stays on from the first frame, the stroke revealed through an engine-made `<mask>` rather than drawn by its own dash offset, so there is no solid line snapping to dashes at the end, and it retracts dashed; `?print`, the overview and instant application show the finished stroke with its one head) · `highlight` (element already visible; step emphasizes it: accent outline + others dim) · `none` (instant).
|
|
311
|
+
`fade` (default) · `fade-up` · `fade-down` · `zoom` · `pop` (overshoot) · `draw` (SVG paths/lines: stroke-dashoffset animation; non-stroke elements fall back to fade; **Line Draw**: a stroke with a `marker-end` (or `marker-start`) draws with its arrowhead riding the tip from the first frame, oriented along the path, on straight lines and curves alike, and un-draws with the head on the retracting tip, the way Keynote's Line Draw carries an arrowhead (#522): the marker's content becomes a head placed by the same frame loop that advances the dash offset, since a CSS transition on each would drift apart; the head is **revealed to the drawn length** while it is still short of the head's own reach (#527): a Line Draw grows out of a point, shaft and head as one silhouette, and retreats into it on the way back, rather than a full-size head standing on the origin on the first frame; `marker-mid`, and a marker on a shape that is not a path, wait at the endpoint until the stroke has drawn; a **dashed stroke draws dashed** (#737): its authored `stroke-dasharray` stays on from the first frame, the stroke revealed through an engine-made `<mask>` rather than drawn by its own dash offset, so there is no solid line snapping to dashes at the end, and it retracts dashed; `?print`, the overview and instant application show the finished stroke with its one head) · `highlight` (element already visible; step emphasizes it: accent outline + others dim) · `travel` (a token moves along a wire, below) · `none` (instant).
|
|
312
|
+
|
|
313
|
+
**Travel** (#1180): `<g data-build="travel" data-along-wire="<name>">` in a diagram is one build step that shows something *going along* a wire that is already drawn (a message leaving a producer, landing on a topic, reaching an agent), where drawing the wire again would say a new connection appeared. The wire is the line, path or polyline of the same `<svg>` named `data-wire="<name>"` (SVG_DIAGRAMS, a label on a wire). When the step plays, a token is drawn at the wire's start and moves along its route as it runs now, straight, elbow or curve, so it is right after a node has moved, eased in and out, to its end. Its pace is `data-travel-ms` (100 to 20000), else four times the deck's `--build-duration` (1.2 s at the default), so a theme that slows its builds slows its tokens. The token is a dot in the wire's stroke colour, haloed in the slide's background; `data-label="order 4417"` makes it a small chip with those words, sized from the diagram's labels; `data-concept` colours it as it colours a shape (SVG_DIAGRAMS, concept colours). It rides above the wire, and above the arrowhead the engine draws for it, and below the labels written after it. **Arrival**, `data-arrive`: `fade` (the default) fades the token at the end; `stay` leaves it there; `pulse` fades it and gives the node the wire goes to (`data-to`) one emphasis pulse, a glow in the accent. `data-travel-repeat` sends it again, start to end, for as long as its step is the current one ("events keep flowing"), and stops on the next step. Several tokens arrive on one click as any steps do: `data-build-with` on a later one (it arrives with the step before it) or the same `data-build-order`; one after another on successive clicks. Stepping back past the step takes the token away. The token's end state is applied at once, whatever the frames do: a step not yet played, or played with an arrival that goes, shows nothing; one played with `stay` shows the token at the wire's end. That is what `?print`, the overview, a deep link, arriving backwards and instant application show; only a step that has just become the current one, forwards, on a page that moves plays the trip, and reduced motion never does (the token is at its end, or gone). The token is the engine's (`.travel-token`, after the wire), never in the file; the step's own element stays an empty `<g>`. A `data-along-wire` naming no wire of its svg is a `travel-wire` warning in `decklight check`, and the step still counts against the notes' `[click]` beats.
|
|
232
314
|
|
|
233
315
|
All entrance styles are CSS-driven (`.build-step[data-build-state="done|current|pending"]`), duration via `--build-duration` (theme-overridable, default 300ms).
|
|
234
316
|
|
|
@@ -240,10 +322,13 @@ Complex widgets (code stepping, terminal player) register **build providers** in
|
|
|
240
322
|
Decklight.registerBuildProvider(element, {
|
|
241
323
|
count: 4, // number of steps this widget contributes
|
|
242
324
|
apply(i) { ... }, // called with current step index (0 = nothing, count = all)
|
|
243
|
-
label(i) { return 'git status' } // optional, for the speaker view step list
|
|
325
|
+
label(i) { return 'git status' }, // optional, for the speaker view step list
|
|
326
|
+
past(on) { ... } // optional: true once a later build of the slide has followed its last step
|
|
244
327
|
});
|
|
245
328
|
```
|
|
246
329
|
|
|
330
|
+
`past` is how a widget ends without a step of its own: it is told, once per change, whether its last step is behind the slide (a later build has come), and told `false` again when the slide steps back onto it. A line walk that ends lit (CODE_AND_MATH) lifts its dimming there.
|
|
331
|
+
|
|
247
332
|
The engine interleaves provider steps into the slide's sequence at the element's document position; or, when the element carries `data-build-order="N"`, at the explicit keys N, N+1, …, so a DOM step sharing one of those keys advances together with that provider step (#524; a staged stroke's stops tied to the boxes they reach). Providers must be idempotent (`apply` may be called with any index in any order, e.g. deep links).
|
|
248
333
|
|
|
249
334
|
## SVG_DIAGRAMS · SVG diagrams (first-class)
|
|
@@ -256,20 +341,29 @@ The engine interleaves provider steps into the slide's sequence at the element's
|
|
|
256
341
|
- `data-build="draw"` on groups animates strokes (paths, lines, polylines) via dash-offset.
|
|
257
342
|
- **A diagram is built, by default.** One that lands whole hands the audience the entire picture before the speaker has said its first part, so `decklight check` and Check deck… (PRESENTING) give a **hint** (never a failed run) for an authored `<svg>` diagram, three drawn shapes or more with a `<text>` label among them and outside a chart or a terminal, that has no build on it or inside it. A still picture that is meant says so with `data-static-ok` on the svg or on its section. An illustration with no words in it is drawn, not explained, and asks for nothing.
|
|
258
343
|
- **Lines that draw**, the rules an author (or an agent) writes to (BUILD_ENTRANCES has the engine's side):
|
|
259
|
-
- A shape draws when it has a stroke (`stroke` as an attribute, inline, or inherited from its group) and a length: a `path`, `line`, `polyline`, `polygon`, `circle`, `ellipse` or `rect`. A shape with no stroke, and every `text`, fades in once the strokes of its step have drawn.
|
|
344
|
+
- A shape draws when it has a stroke (`stroke` as an attribute, inline, or inherited from its group) and a length: a `path`, `line`, `polyline`, `polygon`, `circle`, `ellipse` or `rect`. A shape with no stroke, and every `text`, fades in once the strokes of its step have drawn; so does the fill of a shape that draws (its `fill-opacity` back up to the authored value), so nothing of a step shows before its click.
|
|
260
345
|
- An arrowhead is a `<marker>` referenced by `marker-end` (or `marker-start`) on the stroke. It rides the drawing tip; the marker is sized as the bullet above says. Put the head on the stroke, never as a separate shape at the end of the line, or it stands there before the line arrives.
|
|
261
|
-
- A dashed line is `stroke-dasharray` on the stroke, as an attribute or in its `style`. It draws dashed, start to finish, and retracts dashed. A dash pattern set from a stylesheet class is not seen by the draw and would draw solid, then snap.
|
|
346
|
+
- A dashed line is `stroke-dasharray` on the stroke, as an attribute or in its `style`. It draws dashed, start to finish, and retracts dashed. A dash pattern set from a stylesheet class is not seen by the draw and would draw solid, then snap. Write mode's **Line ▸** writes one of two patterns inline, in the `style`: dashed is `stroke-dasharray: 6 4`, dotted is `stroke-dasharray: 0 4` with `stroke-linecap: round` (a dot is a round cap on a dash of nothing); solid takes the dashes off, and the attribute of the same name goes whenever one is written, so the file never says two things.
|
|
347
|
+
- **Several shapes.** Shapes of one diagram selected together (⇧-click, a marquee) are changed together, each change ONE write and one undo: a drag on one moves them all, their wires routed and their labels carried in the same geometry write; the arrows nudge them all a unit (⇧: ten); **Arrange ▸** aligns them on the left, centre or right, the top, middle or bottom of the box round them all, spaces them evenly across or down (three or more: the outermost two stay, the gaps between all of them become equal), or makes them the same width or height as the first selected (its labels following and wrapped again); Colors… paints all of them; **Concept ▸** puts all of them in one concept, or none; Duplicate copies each right after itself (`POST /deck/edit/element/shape` `op: 'duplicate'` with `paths`), the copies selected; Remove takes them out with their connectors (`POST /deck/edit/element/remove` with `paths`), every path read in the file as it was; ⌘C copies all of them (each one's source, as one shape's copy is), and ⌘V in their diagram duplicates all of them in one write, as one shape's paste does. Cut is not offered for shapes. **Group** makes them one (below).
|
|
348
|
+
- **Front and back.** What covers what in a diagram is the order its nodes are written in, and, unless a `data-build-order` says otherwise, so is the order they build in (BUILD_SEMANTICS), with the notes' beats cut per click. Write mode's **Order** (To front, Forward, Backward, To back) moves a node, or the box group a shape is the shape of, among its drawn siblings, its `<defs>`, `<title>` and the like staying where they are, so it changes what covers what and nothing else. When the diagram builds, the slide's clicks as they play are sent with the move and every step of the slide is stamped `data-build-order` first (the Builds tab's order, frozen even when it is the file's own), so the clicks, and the narration's beat on each, do not change. A shape added later to a diagram whose steps carry keys takes the next key, so it arrives last. A shape sent behind a panel takes the panel's nesting tone (`data-nest`), which is correct, and seen. `POST /deck/edit/element/order` `{ slide, index, path, tag, to, groups? }`, one undo.
|
|
349
|
+
- **Groups.** A group is a `<g data-group>` in a diagram holding two drawn things or more: shapes, box groups, lines, labels, other groups. It carries no paint of its own; its members keep their fills, strokes, concepts and `data-node` names, so nesting tones and role fills read the same inside it. Only a marked `<g>` is a group: a box group, a step unit an author wrote and every other plain `<g>` are picked by the shape under the pointer, as before, and an author can mark one by hand. **Picking**: the first click on a member selects the outermost group under the pointer, framed round all its members; a click inside the selected group (or beside a member of it that is selected) goes one level down, to a group inside it or to the shape under the pointer; `⌥`-click goes straight to the shape; `Esc` steps back up one level; the pointer's glow shows what a click would select, and a drag moves it. A selected group moves and nudges by a `translate` on the `<g>`, its members' wires following in the same write; Duplicate, ⌘C ⌘V, Remove and front and back take it as one node (a copy's node and wire names its own; a removed group's wires and their labels go with it); Arrange ▸ counts it as one box; Colors… is greyed and Concept ▸ is not offered on it: select inside it. **Group** (the menu of several shapes, `⌘G` / `Ctrl+G`) wraps them, siblings in the file, in one `<g data-group>` where the frontmost stood, their order kept, in one write: a shape that sat between two of them and was not selected is behind the group after, and the toast says so. Shapes under different parents are refused. **Ungroup** (Shape ▸, `⇧⌘G` / `Ctrl+Shift+G`) puts a group's members back where it stood, in their order, in one write: its translate is given to each member in its own coordinates, or in front of its own `transform` when it has one, so nothing moves on screen; a `<g>` with any other transform, or with an attribute of its own its members would lose (a `class`, a `fill`), is refused with the attribute named. A wire joined to the group itself is joined to the member nearest where it meets the group, that member named when it is not, in the same write, so no wire is left naming a node that is gone. **A `<g>` the author wrote**: with a shape inside a plain `<g>` of two drawn things or more selected, Shape ▸ offers **Select the whole group** (the `<g>` selected, to move, copy or remove as one) and **Make it a group** (`data-group` added in one write); Ungroup takes a plain `<g>` apart by the same rules. **Builds** (BUILD_SEMANTICS): grouping never changes a diagram's clicks or the notes' beats. When the diagram builds, the slide's clicks as they play are sent with Group and Ungroup and every step is stamped `data-build-order` first, as front and back does; a group made inside a container that builds its children one by one takes the container's `data-build` (a group of shapes all there from the start takes `data-build-stay`), and a `<g data-group>` that carries `data-build` inside such a container builds its members as steps of their own, each on its key (`isBuildingGroup`, `src/core/builds.js`; `decklight check` counts the same). The Builds tab's **all at once** (`data-build-self`) on a group makes it one step, on the click its first member played on (its lowest member key written on the group), and **one step per item** gives each member its own again. A group without `data-build`, such as a step unit an author marked, is one step, as any `<g>` is, so Make it a group never changes a click. Ungroup keeps the members' keys; a group that was one step gives each member its key, so they still arrive together, and its own effect, or its `data-build-stay`, goes to each member. `POST /deck/edit/element/group` `{ slide, index, op: 'group', paths: [{ path, tag }], groups? }`, `{ …, op: 'ungroup' | 'mark', path, tag, groups? }`, one undo, answering the group's path and markup, or the members and their wires, and each step's key as stamped.
|
|
350
|
+
- **More shapes than a box.** A shape marked `data-shape` (`diamond`, `hexagon`: a `<polygon>`; `cylinder`, `document`, `note`, `cloud`: a `<path>` in absolute `M`, `L`, `C` and `Z`) is one element whose geometry fills a box: every number of its `points` or `d` lies inside the box and some number reaches each edge, so the box is read back from the numbers (`tools/diagram-shapes.mjs`). Write mode redraws it for a new box when it is resized, and a connector stops at its outline (a polygon, or the first subpath of the path, its curves followed), not at its box. An unmarked polygon or path is drawn as written and joined at its box. A person or an actor is two shapes, which Group can now make one; a shape of its own for it is a follow-up.
|
|
351
|
+
- A box's rounded corners are `rx` and `ry` on its `rect`. **Corners ▸** square takes them off, rounded writes a modest radius (a sixth of the short side, 2 to 12 units), and a pill writes half the short side, which a resize keeps at half.
|
|
262
352
|
- One line in stages is `data-draw-stops` on the stroke (BUILD_AUTHORING), with `data-build-order` to tie the boxes it reaches to the clicks that reach them.
|
|
263
353
|
- A line is one step when it is a direct child of the `data-build="draw"` container, or part of a step when it sits inside a direct-child `<g>` with the box it points at: group a line with its box when they should arrive together, keep it a direct child when the line is its own beat.
|
|
264
354
|
- The engine adds nodes of its own beside a drawing stroke, a `.draw-head` for a riding arrowhead and a `.draw-mask` for a dashed line. They are never in the file: an agent reading the rendered DOM must not copy them into the deck, and write mode, the colour picker and the inspector skip them.
|
|
265
355
|
- **Arrowheads**: a `<marker>` is sized in MULTIPLES OF THE STROKE, not in pixels: SVG's `markerUnits` defaults to `strokeWidth`, so `markerWidth`/`markerHeight` are scaled by the `stroke-width` of the line that references them. The shipped pattern is `markerWidth="6" markerHeight="4" refX="5" refY="2"` over `points="0 0, 6 2, 0 4"`: a head six strokes long and four across, its tip one stroke past the line's end, which stays proportionate across the 1.5–2.5 stroke widths diagrams are drawn at. Multiply those numbers by the stroke to predict the rendered size (9×6 px on a 1.5 line); an 8×6 marker is a 12×9 px head on that same line, which is what reads as oversized. `markerUnits="userSpaceOnUse"` sizes a head in absolute units instead, and it then no longer tracks the line.
|
|
266
356
|
- The runtime namespaces `id` attributes inside each inline `<svg>` at init (prefix `svg{n}-`, rewriting `url(#…)` and `href="#…"` refs): the defs-collision bug class is eliminated at the engine level.
|
|
267
|
-
- **
|
|
268
|
-
- **
|
|
269
|
-
- **
|
|
357
|
+
- **The canvas** (`src/core/canvas.js`, write mode). The room a drawing has is its svg's `viewBox`; the size it is drawn at on the slide is the svg's `width` (capped by `max-width: 100%`), and its `height` when it says one. A selected diagram's edge handles move one side of the `viewBox` out, giving the drawing more room, or in, taking empty room away, without moving or scaling what is drawn: the svg's `width` (and `height`) grows and shrinks with the room so a unit stays the same size on the slide, until the slide's width caps it, from where more room draws smaller. An edge never passes what is drawn, and on a slide that fits the canvas stops before the slide would clip. **Fit the canvas to the drawing** (Shape ▸) trims the room to the drawing's box with an even margin, a twentieth of its longer side and 8 units at least, the width following. The write is `POST /deck/edit/element/canvas` `{ slide, index, path, tag: 'svg', viewBox: { x, y, w, h }, width?, height? }`, one undo, the `viewBox` attribute written in the casing the file had. Its corner handles are the picture's: the whole diagram bigger or smaller on the slide, its `width` alone.
|
|
358
|
+
- **Connectors** (`src/core/connectors.js`): wires that stay attached to what they join. A shape, or a group that is one box (a shape and its labels), names itself `data-node="<name>"`, never by its `id`: ids are namespaced at init (above), and a reference to one would have to be rewritten with it. A wire, a `<line>`, a `<path>` or a `<polyline>`, says which nodes of the same `<svg>` it joins with `data-from="<name>" data-to="<name>"`, and how with `data-route="straight|elbow|curve"` (straight when it says nothing). The wire keeps real coordinates in the file (`x1` to `y2` on a line, `d` on a path, `points` on a polyline), so the deck read without the runtime, a print, an export and an agent reading the file all see a wire drawn where it goes; one end may be named and the other left free, where the file puts it. The runtime routes every connector at load, before a draw build measures its stroke, so `data-build="draw"` still draws a connector, its arrowhead riding the tip to the node's edge. Each node's box is read in the wire's coordinate space, from the shapes' own attributes through every `transform` attribute between the two (a group's box is the union of its shapes, its labels left out; a build's CSS transform is not read, so a box waiting at `scale(0)` is joined where it lands). **straight** runs edge to edge along the line between the two centres (a box's edge, an ellipse's or a circle's boundary); **elbow** is an orthogonal path between the nearest sides, two segments when the boxes are apart on both axes and three when apart on one; **curve** is one cubic between those sides, leaving and arriving square. A `<line>` is always straight and a `<polyline>` never curves (the editor makes a wire that bends a `<path>`). A wire naming a node its svg does not have is left as the file draws it, and `decklight check` warns (`connector-node`). A hand-written deck uses the contract without the editor; in write mode it is what connecting, moving and rerouting write (PRESENTING_EDITING).
|
|
359
|
+
- **A label on a wire.** A wire that carries a label names itself `data-wire="<name>"` (the slug of the nodes it joins, `api-db`, unique in its svg), and the label is a `<text data-on-wire="<name>">` of the same svg, written after the wire so it is drawn over it. Where it sits is `data-along`, a fraction of the wire's length from its start, 0 to 1, the middle (`0.5`) when absent; the label is centred there (`text-anchor="middle"`, `dominant-baseline="central"`). Its `x` and `y` are real coordinates kept in the file, so it renders where it belongs with no runtime; whenever the runtime routes the wire (at load, a node moved, an end dragged, the route changed) it puts the label back at its fraction along the wire as it now runs, its lines' `x` with it, and write mode writes those coordinates in the same write as the wire's. A label sits on one wire, and a wire has one label. Removing a wire, or a node whose wires go with it, takes their labels too; a duplicated wire is renamed, its label with it, so a label never rides on two wires. A text naming a wire the svg does not have is an ordinary label, left where the file put it. Write mode: **Wire ▸ Label…** puts one at the wire's middle, typed into straight away (`POST /deck/edit/element/connector` `op: 'label'`, the server naming the wire and writing the label in theme tokens with a halo of the slide's background, `paint-order: stroke`), **Edit label…** when it has one; the label is edited like any label, and a drag slides it along its wire (it never leaves it), writing `data-along` with its place. A wire's name is also what a token travelling along it names (`data-along-wire`, BUILD_ENTRANCES, `travel`): a label sits at a fraction of the wire's length, a token is that fraction moving from 0 to 1.
|
|
360
|
+
- **Nested fills** (#541): a filled shape drawn inside a filled shape (a box on a panel) is painted a tone step of its container's slot, `var(--d-fill-N-in)`: the same hue, one OKLab lightness step toward the ink (`color-mix(in oklab, var(--d-fill-N) 82%, var(--d-text))` by default, a theme's own value when it declares one; `--d-fill-N-in2` is the step below that, and the deepest, deeper nesting stays there), so the boxes read as the panel's *children* and two panels of different colours hold two visibly different families. The pass (`applyNesting`, src/core/svg.js) runs when a slide is displayed (activation, print, an overview clone) since containment is geometric: a shape whose authored fill is a plain slot token takes the tone of the innermost **earlier-painted** filled shape whose bounding box (in the svg's own space, transforms included) holds its own; containment sees the shape as it is laid out when the slide is displayed, so a shape whose box has collapsed to nothing (one waiting at `scale(0)` for a build to grow it in) is inside nothing and keeps its authored fill (#981), and one waiting translated for its build is judged where it waits; a big shape painted last is an overlay, never a panel, and `fill="none"` is never a container. `data-concept` wins over nesting (a `tools` box inside an `agent` panel stays tools-coloured); any fill that is not a plain slot token is left alone; `data-nest="off"` on a shape or a group opts out; `data-nest="on"` takes a shape the box test misses (rotated) by its centre; `fill: var(--d-fill-in)` on a child means "my container's nested tone" outright, so re-slotting the panel re-slots its children. Idempotent across `sync()`: the authored fill is remembered on the shape. Charts are never nested: their series are slots, not panels.
|
|
361
|
+
- **Labels are edited in place** (write mode): a double-click on a `<text>`, or on any line of a label of several, or `⏎` on one selected, lays a text box over the label in its own font, size, weight and ink, the label hidden under it and the shape beneath still showing; the box grows from the label's `text-anchor`, so a centred label stays centred while it is typed. A label of several lines opens whole, one line per row of the box. `⇧⏎` starts a new row, `⏎` or leaving the box saves, `Esc` gives up, and the deck's keys stand aside meanwhile. SVG text takes no `contenteditable`, which is why it is a box and not the label itself. The save is `POST /deck/edit/element/text` `{ slide, index, path, tag, was, text }`, addressed the way the colour card addresses a shape (the file's element-child path, the engine's own nodes skipped, the tag the page found): only the words between that one node's tags change, the whitespace the file has around them is kept, `<`, `>` and `&` are escaped, and the diagram's markup is never re-serialised, so `viewBox`, self-closing shapes and the file's layout survive byte for byte. The save is in place: the label shows the new words, nothing reloads, other pages do. One undo entry, the undo chord takes it back. Refused: a label the file no longer says (`was` differs: a 409, reload), anything but a `<text>` or `<tspan>`, a line break in `text`, more than 400 characters, and an empty label (it could not be clicked again; the page keeps the old words).
|
|
362
|
+
- **Labels wrap to fit their shape** (write mode). SVG text does not wrap and only a page can measure it, so the page breaks the words: a label wider than the shape it is on (the shape of its box group, else the smallest shape its middle falls in) goes onto as many lines as it needs, each within the part of the shape a label can use (most of a box, less of an ellipse, the middle of a diamond), and the lines typed with `⇧⏎` stay lines. The file keeps the lines it was given, as positioned `<tspan>`s, `<tspan x="…" dy="…em">`, each at the text's `x`, the first `dy` putting the block's middle on the text's `y` and the rest `1.2em` apart, so the diagram renders the same with no runtime. A label that ends up one line is plain words again. The save is `POST /deck/edit/element/text` with `lines` (a list of 1 to 12 non-empty lines, 400 characters in all) instead of `text`, and `was` the lines the page showed, one per line break; the `<text>` must hold only words or positioned `<tspan>` lines. A `<tspan>` with no `x`, `y` or `dy` is a run inside a line (bold, inline code), not a line: a label holding one is edited a run at a time and is never rewritten as lines. **A resize re-wraps**: a box resized moves its label's lines with it (their `x` follows the text's) and breaks the words again for its new width, in the same geometry write (an edit `{ path, tag: 'text', was, lines }` after the moves), so a narrower box takes more lines and a wider one fewer; the words are joined first, so a line typed with `⇧⏎` becomes an ordinary one on a resize. **A label too long for its shape** even wrapped (a word wider than the room, or more lines than its height holds) marks its shape with an amber glow in write mode, never in the file, and is a `label-overflow` warning in Check deck…. A chart's labels are drawn from its data and are not offered.
|
|
363
|
+
- **Concept colors**: `data-concept="agent"` on a shape (or a group, its direct-child shapes recolor; text never does) pins that concept to ONE diagram-fill slot deck-wide, so a recurring concept never changes color between diagrams. A shape recolors its fill; an unfilled outline (`fill="none"`, a line-chart stroke, a wire shape) recolors its stroke instead, since painting its fill would close it. Resolution: `init({ concepts: { agent: 3 } })` pins a slot (1–6) or any raw CSS color (`'var(--d-accent)'`); unconfigured names fall back to a stable hash of the name, identical across sessions and decks. The indirection targets a slot (`var(--d-fill-N)`), not a color, so concept identity survives all themes, generated ones included. Two concepts hashing to the same slot get a console warning telling the author to pin one explicitly. Applied on `sync()` (idempotent, covers dynamic slides). A conversation's turn wears a concept the same way, its bubble painted the slot (DECK_ANATOMY). **Concepts are edited in write mode** (#718): the palette's **Concept colors…** (also found by *colour by meaning*, *legend*, *same colour*) lists every concept the deck's diagrams name (and any the configuration pins that no shape wears yet) with the slot it resolves to, whether pinned or by its name, and how many shapes carry it; a digit `1`–`6` pins the selected concept, `0` takes the pin off, and each pick is written to the deck through `POST /deck/edit/concepts` `{ concepts, quiet, from }` — the `concepts` key of the configuration block, spliced in place (a bundle's plain-data `Decklight.init` literal likewise; an init call that is code is refused), one undo entry — while the page repaints at once and every other open page of the deck is sent a `concepts` event and repaints without a reload, the way a theme pick travels. The element menu's **Concept ▸** on a diagram shape lists the deck's names (the shape's own marked), takes a new name typed in place, and `none (detach)` takes the attribute off. Its last row, **Edit concepts…**, opens the concept list (*Concept colors…*, above) with the cursor on the shape's own concept, for when the question turns from this shape to the concept itself: its colour, its pin, the slides that use it. `POST /deck/edit/element/concept` `{ slide, index, path, tag, concept }` sets or removes `data-concept` on the element the page names (the group, when the shape wears its concept from its group) and nothing else in the tag.
|
|
270
364
|
|
|
271
365
|
**Easy to find, easy to attach** (`src/core/concept-tools.js`). Every way a shape gets its concept goes through one door: `POST /deck/edit/element/concepts` `{ items: [{ slide, index, path, tag }], concept, quiet, from }`, any number of shapes on any slides in ONE write and one undo entry, checked whole before any is written (one the file no longer has is a 409 and nothing changes). It is written **in place**: this page sets the attribute and repaints, every other page is sent `styles` and reloads. The doors:
|
|
272
|
-
- **The Colors tab** (Inspector), where people colour a shape, has a **Concept** row on the Fill side of any diagram shape: the deck's concepts as chips (the shape's own pressed), **+ new** to name one, **none** to take it off. The Info tab names a shape's concept, or says *none*
|
|
366
|
+
- **The Colors tab** (Inspector), where people colour a shape, has a **Concept** row on the Fill side of any diagram shape: the deck's concepts as chips (the shape's own pressed), **+ new** to name one, **none** to take it off, and **edit…** last, into Concept colors… at the shape's concept. On a shape a concept fills, the Fill side says so, with **Concept colors…** (the list, at that concept, to pin its colour) beside **Detach from concept**. The Info tab names a shape's concept as a link into Concept colors… at it, or says *none* as a link to the Colors tab, where the Concept row gives it one.
|
|
273
367
|
- **The look-alikes.** A concept is a recurring idea, and a person sees one recur by the words on the box. After ONE shape joins a concept, every other shape on the deck whose label reads the same (whatever the case) and is not that concept already is offered in one card: *1 other shape on slide 6 says "Agent" too* → **Make it the "agent" concept** (one write) or **Just this one**. A shape's label is the text in its own group when it is the group's one shape, else the labels of its diagram whose anchor falls inside its box (read from its attributes, so a slide not on screen answers too), else the label written right after it.
|
|
274
368
|
- **Where it lives.** Each row of Concept colors… names the slides its shapes are on; the selected concept's shapes on the slide on screen are boxed (dashed, in the accent); **←/→** go to the previous or next slide that has it, the list kept open.
|
|
275
369
|
- **Pick mode.** **⏎** on a row (or its **pick shapes** button) turns the list into a one-line bar over the slide: a click on a shape (or its label) puts it in the concept, a click on one already in takes it out, the hovered shape is boxed, and the arrows walk the slides meanwhile. The first click on a shape whose look-alikes are elsewhere offers them, once per label. **Esc** or **Done** comes back to the list. **New concept…** (the last row, or **N**) takes a name typed in the list and goes straight into picking its shapes, since a concept is nothing until shapes wear it.
|
|
@@ -290,11 +384,21 @@ Declarative charts from inline JSON: a chart IS a theme-aware SVG diagram, gener
|
|
|
290
384
|
```
|
|
291
385
|
|
|
292
386
|
- **Types**: `bar` (grouped), `line`, `area`, `pie` (`donut` is an alias; `"donut": true` also works), and **`scatter`**. Scatter is the one whose x is a *measurement* rather than a category, so it takes `"points": [[x, y], …]` per series instead of `"data"`, no `"labels"` at all, and optional `"x"` / `"y"` axis titles (a scatter with two unnamed numeric axes is a picture of nothing in particular); a pair that is not two finite numbers is dropped rather than drawn at zero, and a series left with none of them is a refusal. The others use a category x-axis; ~5-tick linear y-axis with nice-number bounds, zero always on the grid; pie/donut renders slices with outside name labels and on-slice percentage labels. An inline legend appears automatically on multi-series axis charts (`"legend": false` opts out, `true` forces one). Out of scope in v1: CSV input, stacked bars, dual axes, tooltips/interactivity.
|
|
387
|
+
- **A gap is a gap** (#1125): a value is a number when it is a finite JSON number or a string the Data tab's number cell accepts (`"3"`, `"1.5"`); `null`, `""`, a boolean, a list or a word is a gap, never a zero. A line or an area breaks there (two pieces, no point drawn), a bar's slot stays empty, a pie skips the slice and its name, and the value axis is set by the numbers that are there.
|
|
388
|
+
- **Forecasts, ranges and rules** (line and area charts):
|
|
389
|
+
- `"dashFrom": <label or position>` on a series draws it solid up to that point and **dashed after it**, the two parts meeting there; `data-build="draw"` draws the dashed part dashed, through the mask a dashed wire draws through (BUILD_ENTRANCES).
|
|
390
|
+
- `"band": { "low": […], "high": […] }` on a series (one value a label, `null` a gap in the band) shades the range between the two in the series' fill slot, translucent, **under its line**, its two edges in faint `--d-stroke`; a series `"type": "band"` with a band and no `data` is **only the area** (a learned range), and takes a fill slot and a legend entry like any series.
|
|
391
|
+
- `"markers": [{ "at": <label or position>, "label": "is_anomaly = true" }]` on a series draws that point emphasised (larger, ringed in `--d-stroke`) with its words beside it in `--d-text`; a marker at a gap is not drawn.
|
|
392
|
+
- `"threshold": { "y": 0.8, "label": "alert" }` on the chart draws a dotted horizontal rule across the plot at that value with its words on it, at the left, where a line has usually not reached it yet; `"now": <label or position>` (or `{ "at": …, "label": "today" }`) a dotted vertical rule at that label, worded *now* at its top. Both are `--d-stroke` and `--d-text`, in the chart's chrome, so they stand for the whole build, and the value axis always reaches the threshold and the band. A rule's words and a marker's sit on a thin halo of the slide's `--bg` (none where `--bg` is a gradient), over the series, so a band or a line passing under them never cuts a letter; a marker's words go over a peak, under a dip and beside a point on a slope, on the side its line leaves free.
|
|
393
|
+
- A reference names a label as written, or, when no label is written that way, a position counted from 0, so a chart over the years says `"now": 2025`.
|
|
394
|
+
- In write mode the inspector's Data tab sets every one of these without a line of JSON typed: the band and the markers as columns of their series, where each line turns dashed, the now and the threshold as fields, and a band series by a button (PRESENTING_EDITING).
|
|
395
|
+
- Concepts repaint a band's fill, a dashed core and a marker as they repaint the rest of the series; a series' band, dashes and markers arrive with it in a build, the strokes drawn and the band and the marker faded in on the `draw-fade` channel.
|
|
396
|
+
- **`decklight check`** says every chart the runtime would refuse (`chart`, an error: the slide shows its error box), and warns (`chart`) at what is drawn without being refused: a band's list longer or shorter than the labels, a band whose low is above its high, a `dashFrom`, `now` or marker naming no label, a marker at a gap, and a band, dashes, markers, a threshold or a now on a kind of chart that draws none of them. A band whose `low` or `high` is not a list, a `"type"` other than `"band"`, a band series on a bar or pie chart, and a threshold with no number are refused.
|
|
293
397
|
- **Colors come exclusively from the THEMING diagram tokens**: series *i* → `--d-fill-i` (cycling past 6), axes `--d-stroke`, labels `--d-text`, gridlines `--d-muted`. Value labels sit on the slice fills, which is exactly the `--d-text`-against-every-fill contrast gate `test/contrast.mjs` already enforces: every shipped and generated theme colors charts correctly with zero chart-specific work.
|
|
294
398
|
- **Ink**: the `--d-fill` panels sit deliberately close to the canvas (gated for text ON them, never against `--bg`), so charts use the hand-drawn-diagram box idiom: bars, slices and legend swatches are outlined with `--d-stroke`, and every line/area stroke rides on a `--d-stroke` casing under its fill-colored core. Series identity lives in the fill slot; legibility lives in the ink, in every theme.
|
|
295
399
|
- **Concepts**: `"concept": "agent"` on a series emits `data-concept` on that series' `<g>`, resolved by the ordinary SVG_DIAGRAMS concept pinning: bar/slice/area fills and dot fills repaint, a line's core stroke recolors via the `fill="none"` rule above, and the casing sits one group deeper so the ink is never repainted.
|
|
296
400
|
- **Builds**: the wrapper's authored `data-build` moves onto the generated `<svg>`, which emits one `<g>` per series: the BUILD_AUTHORING SVG-container semantics apply untouched, so series step in per ⟨CLICK⟩ with no build provider. `data-build="draw"` draws each series' ink (bar/slice outlines, line casings and cores) via the BUILD_ENTRANCES dash-offset machinery, while fills, dots and labels materialize on the existing `draw-fade` channel: nothing of a series is visible before its step.
|
|
297
|
-
- **Sizing**: `viewBox` 640×360 by default; `data-aspect="4:3"` (or an `"aspect"` JSON key, `"w:h"`) overrides the height. The chart scales to its container width and behaves as an ordinary content block in split layouts and `?print`.
|
|
401
|
+
- **Sizing**: `viewBox` 640×360 by default; `data-aspect="4:3"` (or an `"aspect"` JSON key, `"w:h"`) overrides the height, and a zero width or height is refused as a malformed one is. In write mode the inspector's Data tab sets the shape and the legend as fields (PRESENTING_EDITING). The chart scales to its container width and behaves as an ordinary content block in split layouts and `?print`.
|
|
298
402
|
- **Errors are visible**: invalid input (bad JSON, unknown type, a pie with two series, …) renders a `.chart-broken` error box naming the problem (the terminal player's broken-box idiom), never a blank slide, never a console explosion.
|
|
299
403
|
|
|
300
404
|
## MOTION · Motion
|
|
@@ -311,6 +415,32 @@ Declarative charts from inline JSON: a chart IS a theme-aware SVG diagram, gener
|
|
|
311
415
|
### ELEMENT_ANIMATIONS · Element animations
|
|
312
416
|
`data-animate="pulse | float | shake | spin | blink | bounce | swing | glow | breathe"`: looping attention animations, start when the slide becomes active (and only then; pause on inactive slides). Respect reduced-motion.
|
|
313
417
|
|
|
418
|
+
A deck may also animate its own elements with CSS keyframes or transitions (an entrance from `opacity: 0`, say). A still (`?print`, and the `?capture` renders behind `pptx`, `shot` and `video`) shows each such animation at its end, finished as builds are completed (PRESENTING_OUTPUT): the slide as it ends up, not as it starts. Only the deck's own are finished: the `data-animate` loops above never end and keep running, and the engine's own animations (builds, the travel token, a terminal's cursor) are left alone. The way to bring an element in on a click is still a build (BUILDS), not hand-written keyframes.
|
|
419
|
+
|
|
420
|
+
### LETTER_BY_LETTER · Text that writes itself
|
|
421
|
+
|
|
422
|
+
`<h2 data-write>The problem</h2>` reveals plain text one character at a time when its slide
|
|
423
|
+
becomes active. The runtime holds each word together and treats a letter with its accents or
|
|
424
|
+
an emoji sequence as one character. A space takes one tick. The whole sentence remains available
|
|
425
|
+
to screen readers and the slide finder. The file keeps the plain text, so checking, translation,
|
|
426
|
+
bundle and publish use the sentence. Write mode edits it as text and plays it again after a save.
|
|
427
|
+
|
|
428
|
+
- Set `--dl-write-step` to a CSS time to change the pace (default `45ms`). Use `data-write="out"`
|
|
429
|
+
to fade after the text has been written. Set `--dl-write-hold` (default `900ms`) and
|
|
430
|
+
`--dl-write-fade` (default `350ms`) to control the hold and fade. Themes, design systems,
|
|
431
|
+
slides and individual elements can set these properties.
|
|
432
|
+
- `data-write-after` reveals an element when the last animated character on the slide appears.
|
|
433
|
+
A template can set `data-write` or `data-write="out"` on a `data-slot` container to give
|
|
434
|
+
its plain-text contents the effect. Set `data-write="off"` on an element or its section to opt out.
|
|
435
|
+
- Exact video samples the animation on the slide's frame clock, including across builds
|
|
436
|
+
(moving capture uses Node 22 or later).
|
|
437
|
+
Live video plays it on the browser's clock. Print, PDF, still captures, thumbnails and
|
|
438
|
+
reduced-motion presentations show the complete text without the fade.
|
|
439
|
+
- `decklight check --fix` converts legacy titles written as a wrapper for each word and letter.
|
|
440
|
+
It takes the words from the outer `aria-label` and migrates the deck's translations at the
|
|
441
|
+
same time. In their version-1 records, the old letter and label pairs become one text pair
|
|
442
|
+
for the whole title. Existing translated labels and their review state carry forward.
|
|
443
|
+
|
|
314
444
|
## THEMING · the token contract
|
|
315
445
|
|
|
316
446
|
`decklight.css` = structure only (layout, builds, navigation chrome, print). A theme = one CSS file defining tokens on `.decklight`:
|
|
@@ -325,17 +455,23 @@ Themes set (all required):
|
|
|
325
455
|
|---|---|
|
|
326
456
|
| Canvas | `--bg` (canvas: color **or** gradient), `--bg-accent` (gradient values paint as an overlay above `--bg`; color values are ignored on the canvas and serve as a secondary-surface token), `--fg`, `--muted` |
|
|
327
457
|
| Type | `--font-body`, `--font-heading`, `--font-mono`, `--heading-color`, `--heading-weight`, `--link` |
|
|
328
|
-
| Accent | `--accent`, `--accent-contrast` (text on accent) |
|
|
329
|
-
| Blocks | `--block-bg`, `--block-border`, `--block-radius`, `--shadow` |
|
|
458
|
+
| Accent | `--accent`, `--accent-contrast` (text on accent); optionally the highlight (`<mark>`): `--mark-tint` (the accent's share in it, 25% when absent), or `--mark-bg` and `--mark-fg` of the theme's own; optionally `--callout-ink`, a code callout's bracket (the accent when absent, CODE_AND_MATH), `--figure-ink`, a figure's value, and `--steps-ink`, a run's current step (each the accent when absent, DECK_ANATOMY); a conversation's user turn, `--turn-user-bg` and `--turn-user-ink` (the accent and its contrast when absent, DECK_ANATOMY) |
|
|
459
|
+
| Blocks | `--block-bg`, `--block-border`, `--block-radius`, `--shadow`; optionally a conversation's other turns, `--turn-bg`, `--turn-ink` and `--turn-border` (the block's ground, the body ink and the block's border when absent, DECK_ANATOMY) |
|
|
330
460
|
| Code | `--code-bg`, `--code-fg`, plus highlight token colors `--hl-keyword`, `--hl-string`, `--hl-number`, `--hl-comment`, `--hl-function`, `--hl-type`, `--hl-punct` |
|
|
331
461
|
| Diagram | `--d-stroke`, `--d-text`, `--d-muted`, `--d-accent`, `--d-fill-1` … `--d-fill-6`; optionally the nested tones `--d-fill-1-in` … `--d-fill-6-in` (derived from the slot and the ink when absent, SVG_DIAGRAMS) |
|
|
332
462
|
| Terminal | `--term-bg`, `--term-fg`, `--term-prompt`, `--term-cursor`, `--term-selection`, ANSI 16: `--ansi-black` … `--ansi-bright-white` |
|
|
333
463
|
| Builds | optionally override `--build-duration`, dim level `--dim-opacity` |
|
|
464
|
+
| Layout | optionally `--code-max-size`, the largest `data-fit="fill"` grows code (CODE_AND_MATH; twice the code's own size when unset), `--code-callout-width`, the gutter a line walk's callouts take (26% of the room when unset), `--figure-size`, the size a figure's value is set at before it is clamped to its column (DECK_ANATOMY; 4.5em when unset), and a run's strip's place and size, `--steps-top`, `--steps-bottom`, `--steps-inset`, `--steps-align` and `--steps-size` (DECK_ANATOMY), each of which a design system may also set (DESIGN_SYSTEMS) |
|
|
334
465
|
|
|
335
466
|
Requirements for the shipped themes:
|
|
336
467
|
- Body text ≥ WCAG AA contrast on `--bg`; code tokens ≥ AA on `--code-bg` (validated by `test/contrast.mjs`).
|
|
337
468
|
- **Diagram ink clears the diagram panels**: `--d-text` ≥ 3.0 and `--d-muted`/`--d-accent` ≥ 2.6 against **every** `--d-fill-1..6`, not just the canvas: labels sit on the fills, and a theme can pass every canvas gate while its boxes are unreadable (the gameboy lesson). Enforced by `test/contrast.mjs` on shipped themes and by the generator's property tests.
|
|
338
469
|
- **A nested box clears its panel** (#541): for every slot, the nested tone (`--d-fill-N-in`, the theme's or the derived default) sits at least 0.06 OKLab lightness off `--d-fill-N` and carries `--d-text` at ≥ 3.0: a theme can pass every ink gate while a box nested in its panel vanishes into it. Same enforcement, in `tools/theme-check.mjs` so a theme outside the repo is judged the same way; a theme whose ink has no headroom toward the tone declares its own `-in` values (reveal-solarized does).
|
|
470
|
+
- **A highlight reads, and shows** (`<mark>`, PRESENTING_EDITING): over every stop of `--bg`, the highlight (`--mark-bg`, else `--accent` at `--mark-tint` over the slide) carries `--fg` (or `--mark-fg`) at ≥ 4.5, `--heading-color` at ≥ 3.0 and `--muted` at ≥ 2.6, and sits at least 0.05 OKLab off the background. Checked in `tools/theme-check.mjs`, as a **warning** for a theme from elsewhere (one written before highlights existed still applies, and `decklight theme gate` names what to set) and as a failure for the shipped ones (`test/contrast.mjs`); a theme with no contrast to spare lowers its tint (reveal-league, reveal-moon) or declares its own pair (reveal-solarized), and a theme made from a template or a brand palette is given the tint that passes.
|
|
471
|
+
- **A code callout's bracket shows** (CODE_AND_MATH): `--callout-ink`, else `--accent`, at ≥ 3.0 on every stop of `--code-bg` (a graphic, not words; the label is `--code-fg`, gated above). A warning for a theme from elsewhere and a failure for the shipped ones, as the highlight's; a theme whose accent is faint on its code declares its own ink (coastal, reveal-blood, reveal-serif, reveal-sky).
|
|
472
|
+
- **A conversation's turns read** (DECK_ANATOMY): `--turn-ink`, else `--fg`, at ≥ 4.5 on `--turn-bg`, else `--block-bg` (a translucent one over every stop of `--bg`), and `--turn-user-ink`, else `--accent-contrast`, at ≥ 4.5 on `--turn-user-bg`, else `--accent`: both are body text. A warning for a theme from elsewhere and a failure for the shipped ones, as the figure's; a theme whose body ink has no contrast to spare on its blocks declares its own (reveal-solarized).
|
|
473
|
+
- **A figure's value reads** (DECK_ANATOMY): `--figure-ink`, else `--accent`, at ≥ 3.0 on every stop of `--bg` (large type, WCAG 1.4.3). A warning for a theme from elsewhere and a failure for the shipped ones, as the callout's; a theme whose accent is faint on its slide declares its own ink (coastal, metropolis, reveal-blood).
|
|
474
|
+
- **A run's current step reads** (DECK_ANATOMY): `--steps-ink`, else `--accent`, at ≥ 3.0 on every stop of `--bg` (bold at 19 design px, large text in WCAG 1.4.3; the other groups are `--fg` and `--muted`, gated above). A warning for a theme from elsewhere and a failure for the shipped ones; coastal, metropolis and reveal-blood declare their own.
|
|
339
475
|
- Variety: ≥10 dark, ≥10 light, ≥4 serif-headed, ≥4 gradient/duotone canvases, ≤2 that are safe-corporate-boring.
|
|
340
476
|
- Fonts: system stacks or bundled-safe Google-font `@import` (deck authors may be offline: every theme must degrade to a system stack gracefully).
|
|
341
477
|
|
|
@@ -360,11 +496,11 @@ A theme travels as what it already is: **one CSS file**. There is no registry, a
|
|
|
360
496
|
**A deck refers to a theme; it does not carry one.** A source deck is data (`DECK_ANATOMY`), and a theme from outside the shipped set is somebody else's kilobytes of CSS, so the deck records only *which* theme it uses, as a reference in its configuration block, and the CSS stays in its marketplace:
|
|
361
497
|
|
|
362
498
|
```json
|
|
363
|
-
{ "decklight": "0.
|
|
499
|
+
{ "decklight": "0.11.0", "theme": "acme",
|
|
364
500
|
"markedThemes": ["acme@acme-themes"], "themeSources": { "acme-themes": "acme/decklight-themes" } }
|
|
365
501
|
```
|
|
366
502
|
|
|
367
|
-
**A reference names its catalog by where it comes from, not only by what it is called.** The `acme-themes` in `acme@acme-themes` is the name the marketplace was registered under on the machine that marked it (`marketplace add --name` renames it) so the same catalog can be `acme` on the next machine, and a different catalog can be `acme-themes` there. `themeSources` records each marketplace's source once, beside the list, in the form `marketplace add` takes (`owner/repo`, or a git URL with any credentials it carried removed), and the **source decides**: a reference resolves to whatever this machine calls the marketplace registered from that source; one that only shares the name is refused by name (`"acme-themes" here is a different catalog`) rather than linked; and a missing one is named with the command that brings it: `decklight marketplace add acme/decklight-themes`. Nothing registers itself: adding a marketplace stays an explicit act. A **local** marketplace records no source (its source is a path on the author's disk, meaningless elsewhere and a disclosure of their home directory) so a theme from one, the personal marketplace included, resolves by name and is reported as local to whoever marked it on a machine that lacks it. A second theme marked from a catalog the deck already records keeps the deck's name for it, whatever this machine calls it. The source is recorded when its marketplace's first theme is marked and dropped with its last. Unlike the catalog's name, a source can locate a **private** repository: it is readable in the deck and in anything bundled from it, and a catalog whose location must not travel should not be marked from.
|
|
503
|
+
**A reference names its catalog by where it comes from, not only by what it is called.** The `acme-themes` in `acme@acme-themes` is the name the marketplace was registered under on the machine that marked it (`marketplace add --name` renames it) so the same catalog can be `acme` on the next machine, and a different catalog can be `acme-themes` there. `themeSources` records each marketplace's source once, beside the list, in the form `marketplace add` takes (`owner/repo`, or a git URL with any credentials it carried removed; a GitHub repository is `owner/repo` however it was added, `https://github.com/…`, `git@github.com:…` or `ssh://git@github.com/…`, and a recorded source is read the same way, so one catalog has one identity), and the **source decides**: a reference resolves to whatever this machine calls the marketplace registered from that source; one that only shares the name is refused by name (`"acme-themes" here is a different catalog`) rather than linked; and a missing one is named with the command that brings it: `decklight marketplace add acme/decklight-themes`. Nothing registers itself: adding a marketplace stays an explicit act. A **local** marketplace records no source (its source is a path on the author's disk, meaningless elsewhere and a disclosure of their home directory) so a theme from one, the personal marketplace included, resolves by name and is reported as local to whoever marked it on a machine that lacks it. A second theme marked from a catalog the deck already records keeps the deck's name for it, whatever this machine calls it. The source is recorded when its marketplace's first theme is marked and dropped with its last. Unlike the catalog's name, a source can locate a **private** repository: it is readable in the deck and in anything bundled from it, and a catalog whose location must not travel should not be marked from.
|
|
368
504
|
|
|
369
505
|
A theme in `markedThemes` is **marked**: it will be part of the deck's bundle, and, for a marketplace theme, linked wherever the deck is served. The picker says it in those words: a marked row reads *marked — part of the bundle*, an unmarked one *Space marks it to include it in the bundle*. **A shipped theme can be marked too**, by its bare name: `"markedThemes": ["ember", "acme@acme-themes"]`. It needs no reference, no source and no link: every install has it, and the servers answer it as they always have. What marking it changes is the hand-over: a bundle holds only the themes put in it, so a marked shipped theme is embedded beside the one the file opens on (`<style data-theme="ember" media="not all">`), whatever `--themes` chose, and the file's own picker can switch to it. A bare name that is not a shipped theme is not a mark and is dropped. Unmarking the shipped theme the deck opens on is allowed: every bundle carries its opening theme anyway. Every server (`open`, `--no-trust`, the render server behind pdf/pptx/video) links each marked theme into the page on its way out (`<link rel="stylesheet" href="decklight-theme/<marketplace>/<name>.css" data-theme="<name>" data-theme-added … media="not all">`) and answers that path from the marketplace's files on **this machine**: its checkout, or the directory a local marketplace was registered from. Nothing on that path fetches (`MARKETPLACE_REGISTRY`, registered, not fetched). The one kind of entry that is not a file in its marketplace, one whose `source` is an https URL, is read when it is marked and kept in `~/.decklight/theme-cache/`, and served from there after. A marked theme this machine cannot resolve (its marketplace not registered, or never fetched) is not linked; the page carries `<meta name="decklight-theme-missing">` naming it and why, and the deck says so once when it opens. `theme` may name a marked theme: the server then links the default under it, and the runtime applies the marked one over it.
|
|
370
506
|
|
|
@@ -380,14 +516,38 @@ A theme in `markedThemes` is **marked**: it will be part of the deck's bundle, a
|
|
|
380
516
|
|
|
381
517
|
**Sharing a deck, as opposed to a theme**: prefer the link. A published deck is served from an origin, over https, by a host the recipient already trusts. The channel is the attestation, and nothing about a URL asks them to decide whether a file is safe to open. When a file has to travel instead (email, an air-gapped room, a conference laptop), send a `.decklight`: it carries the signature with it, and opening it with decklight on the other end checks it. A bare `.html` attachment is the weakest of the three and should be the last resort; it attests to nothing and runs with no policy at all.
|
|
382
518
|
|
|
383
|
-
An added theme (linked for a marked theme, a bundle's inline copy, or a block an older `theme add` pasted into a deck, which keeps working) carries `data-theme-added`, which is what distinguishes it from the deck's own inline theme blocks: without that distinction a link-mode deck that gained one added theme would flip to inline mode and its whole theme list would collapse to that single file (and a data deck carrying only added themes would lose its base theme link). Added themes therefore behave like saved customs, extra entries in the list, applied by media toggle, and work identically in both modes. They cycle with
|
|
519
|
+
An added theme (linked for a marked theme, a bundle's inline copy, or a block an older `theme add` pasted into a deck, which keeps working) carries `data-theme-added`, which is what distinguishes it from the deck's own inline theme blocks: without that distinction a link-mode deck that gained one added theme would flip to inline mode and its whole theme list would collapse to that single file (and a data deck carrying only added themes would lose its base theme link). Added themes therefore behave like saved customs, extra entries in the list, applied by media toggle, and work identically in both modes. They cycle with the palette's *Cycle theme* row and resolve from `?theme=`.
|
|
384
520
|
|
|
385
521
|
## CODE_AND_MATH · Code & math
|
|
386
522
|
|
|
387
523
|
- `<pre><code class="language-sql">…</code></pre>`: highlighting via bundled highlight.js
|
|
388
524
|
(languages: sql, js, ts, python, bash/shell, yaml, json, java, go, rust, html/xml, css, plaintext), themed through the `--hl-*` tokens (no separate hljs theme files).
|
|
389
|
-
- **Line stepping**: `data-lines="1|3-5|all"` on the `<pre>` → registers a build provider with one step per segment; non-highlighted lines get `--dim-opacity`. `data-lines-numbers` shows line numbers.
|
|
525
|
+
- **Line stepping**: `data-lines="1|3-5|all"` on the `<pre>` → registers a build provider with one step per segment; non-highlighted lines get `--dim-opacity`. `data-lines-numbers` shows line numbers. A step is `all`, a line, a range, or several joined by commas (`1,3-4`). In write mode the inspector's Options tab sets the language, line numbers, fit and steps as fields, each step with its callout, and **Keep earlier callouts** and **End with every line lit** (PRESENTING_EDITING).
|
|
526
|
+
- **How a walk ends** (#1186): `data-lines-end="all"` on the `<pre>` ends the walk with every line lit **without a step of its own**, so the notes need no `[click]` beat with nothing to say and `check` counts the same clicks as without it. The last step keeps its dimming while it is the click on screen; the dimming lifts at the slide's next build, in the outgoing transition when the next press leaves the slide, in the overview, in `?print` and in a still (`?capture` at the last step). Without it the walk ends on its last step, as before, and appending `|all` still works, at the cost of one more click.
|
|
527
|
+
- **A stepped block prints whole**: `?print`, `decklight pdf` and `decklight pptx` show every stepped block fully lit, since a printed page with most of a statement dimmed reads as a rendering fault. `data-lines-print="last"` keeps the last step's dimming on the page. A video frame is a moment of the talk, not the printed page: it shows a plain walk's last step as the room saw it.
|
|
528
|
+
- **Callouts** (#1182): a line step can name what it lights, on screen. `data-callouts` on the `<pre data-lines>` holds one label a step, `|` between them, in step order: an empty entry is a step with none, `\|` is a bar inside a label, and a label past the last step is never shown. A label with markup is written as `<aside class="callouts">` on the slide, one element a label (`<p data-step="2">…</p>`; an entry without `data-step` labels the step after the one before it), tied to its block by `data-for` (the block's id) or, without it, to the slide's stepped blocks in order; an aside entry wins over the attribute's label for the same step. The aside itself is never shown.
|
|
529
|
+
|
|
530
|
+
```html
|
|
531
|
+
<pre data-fit data-lines="1-2|3-5|6" data-callouts="The model it reasons with|The tools it may call|Where its answers go">
|
|
532
|
+
<code class="language-sql">…</code></pre>
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
The current step's label is drawn **in a gutter at the block's right**, inside the block, level with the middle of its highlighted lines (the first to the last of the step), with a bracket spanning them; labels nudge apart where two would overlap and stay inside the block. The label is `--code-fg` on the code's ground in the body face, the bracket `--callout-ink` (the accent unless the theme sets it, THEMING), and the gutter `--code-callout-width` of the room (26% when unset), so it never covers code. A block whose room is narrower than 640 px of the slide has no gutter. Live, it shows the current step's label alone, **just under its highlighted lines** (just over them when the block ends there), pushing nothing. When it shows several at once (`data-callouts-keep`, the printed page), it **numbers them**: each step a small numbered marker in a slim column at the block's right, by a bracket spanning its lines, level with their middle and never over the code, and the labels listed by number under the code, inside the block (a **legend**). The legend is in the block's own flow from its first step, its entries arriving with their steps, so the walk pushes nothing; and `data-fit` counts it as the block's height, so the code shrinks to leave it room rather than clip. A label **arrives and leaves with its step**, on the dimming's timing, so a callout is never a click of its own: one `[click]` beat is still one step, and `check` counts the same clicks, and warns (`code-callouts`) at more labels than steps, or an aside with no stepped block to label. **`data-callouts-keep`** leaves earlier steps' labels on screen, muted (`--hl-comment`), as the walk goes on, so the last step shows the whole block annotated. A walk that ends lit (`data-lines-end="all"`) takes its last label away with the dimming, or, kept, shows every label at full ink. `?print`, `decklight pdf` and `decklight pptx` show every label at full ink, as they show the block whole: in the gutter, or, in a block too narrow for one, numbered in its legend; `data-lines-print="last"` prints the last step as the room saw it. `data-fit` leaves the gutter (or the markers' column) to the labels: the code is sized to the width left of it and to the height the legend leaves, so adding callouts never clips the code.
|
|
390
536
|
- Escaping rule for authors: use `<` inside code blocks.
|
|
537
|
+
- **Fit to the room** (`data-fit`): on a `<pre>`, or on an element holding several, the code is sized to the space its slide gives it: as large as fits, never larger than the size the block has with no `font-size` of its own (short code stays at that size; a bare fit only ever shrinks, and `fill`, below, grows it). Every block under one fit host shares one size; a block's own `font-size` is what the fit replaces, and a block with no `data-fit` keeps its hand-set size as before. The host is the room when it holds the blocks, and the block's parent when the attribute is on the `<pre>` itself. The fit is measured, not inferred from the overflow guardrail (PRESENTING_FIT): no line wider than its block, nothing scrolling inside one, and every in-flow box from the host up to the section inside its parent's content box, which catches a slot that centres its content and hides its overflow past its top as well as its bottom. The slide is measured fully built: a pending build keeps its space and its entrance offset is ignored, so later builds never arrive into room the code took. It is redone whenever the guardrail re-checks the slide (a theme, a font, a resize, an edit in write mode), and for every slide in `?print`, so `decklight pdf` and `video` show the browser's size. Nothing fits at 30% of the block's size: the floor stays, and the guardrail flags the slide like any other. `data-fit-scale` on the host says what it came to (`1` at full size). Prefer it to hand-set `font-size` on code slides: `decklight check` warns (`code-font-size`) at a `font-size` set by hand on a `<pre>`, or on a section that holds code, and names `data-fit` instead.
|
|
538
|
+
- **Fill the room** (`data-fit="fill"`, #1185): the same fit, but short code **grows** too, until its block reaches the width or the height the slide gives it, up to `--code-max-size`: the largest the code's text may be, any CSS length (`em` is the block's own text size), and **twice the code's own size** when the theme leaves it unset (THEMING). Long code still shrinks exactly as with bare `data-fit`, and bare `data-fit` is unchanged. It re-fits on the same changes, and every block under one `<div data-fit="fill">` shares one size. A cap below the code's own size never shrinks code that fits: fill is never smaller than a plain fit. A design system raises or lowers the cap per template in its CSS, keyed on the template (`.decklight section[data-template="acme/code"] { --code-max-size: 1.6em }`, DESIGN_SYSTEMS), with no prefix and no exception. A five-line statement on an otherwise empty slide is the case it is for:
|
|
539
|
+
|
|
540
|
+
```html
|
|
541
|
+
<section>
|
|
542
|
+
<h2>The query</h2>
|
|
543
|
+
<pre data-fit><code class="language-sql">SELECT …</code></pre>
|
|
544
|
+
<p>What it returns.</p>
|
|
545
|
+
</section>
|
|
546
|
+
<section>
|
|
547
|
+
<h2>An agent is one SQL statement</h2>
|
|
548
|
+
<pre data-fit="fill"><code class="language-sql">SELECT …</code></pre>
|
|
549
|
+
</section>
|
|
550
|
+
```
|
|
391
551
|
- **Math** (`data-math` on the section): LaTeX math renders at init to MathML Core via
|
|
392
552
|
bundled [Temml](https://temml.org): no per-deck build step, no network fetch, no
|
|
393
553
|
webfonts (evergreen browsers render MathML natively; `?print` output included).
|
|
@@ -398,6 +558,8 @@ An added theme (linked for a marked theme, a bundle's inline copy, or a block an
|
|
|
398
558
|
left alone, as are speaker asides (notes are spoken) and SVG text. Sections without `data-math`
|
|
399
559
|
are never scanned: zero cost, zero behavior change. A TeX parse error renders as
|
|
400
560
|
a visible red error span, never a broken init. Math is core, not a plugin (NON_GOALS).
|
|
561
|
+
In write mode a formula is typed as its TeX source and typeset again on save
|
|
562
|
+
(PRESENTING_EDITING).
|
|
401
563
|
|
|
402
564
|
## TERMINAL_RECORDINGS · Terminal recordings
|
|
403
565
|
|
|
@@ -440,7 +602,7 @@ Behavior: spawn PTY (node-pty), run each `cmd` sequentially in the same shell se
|
|
|
440
602
|
capture raw output chunks with timestamps, apply redaction and idle-clamping, write the
|
|
441
603
|
cast. Commands run inside a brace group with the sentinel on the closing line, so a
|
|
442
604
|
command that reads stdin sees only `interact` sends (never the recorder's own control
|
|
443
|
-
lines). Exit non-zero if any step exceeds its timeout, an `expect` never matches
|
|
605
|
+
lines). **A step can end on Ctrl-C**, the way a server is stopped on camera: an `interact` send of `\u0003`. An interactive shell abandons the rest of the line on an interrupt, which used to take the sentinel with it and time the step out, so under zsh the sentinel sits in the group's `always` block and under bash an INT trap prints it; the step then records exit 130, and 130 counts as a normal end when the script itself sent the interrupt (a command that exits 130 on its own still fails without `--allow-fail`). Exit non-zero if any step exceeds its timeout, an `expect` never matches
|
|
444
606
|
(including command exit before it fires), or the shell dies; `--allow-fail` records
|
|
445
607
|
failures as content (prompts and error output are often the point).
|
|
446
608
|
|
|
@@ -536,22 +698,26 @@ absent: no compatibility break in either direction.
|
|
|
536
698
|
|
|
537
699
|
## PRESENTING · Presenting & output
|
|
538
700
|
|
|
539
|
-
One section with
|
|
701
|
+
One section with nine parts, each its own mnemonic: `PRESENTING_NAVIGATION`, `PRESENTING_CHROME`, `PRESENTING_LOOK`, `PRESENTING_MODES`, `PRESENTING_EDITING`, `PRESENTING_WRITING`, `PRESENTING_VOICE`, `PRESENTING_FIT`, `PRESENTING_OUTPUT`. `PRESENTING` still names the whole.
|
|
540
702
|
|
|
541
703
|
### PRESENTING_NAVIGATION · Moving through a deck
|
|
542
704
|
|
|
543
|
-
- Keyboard: `→/←/Space` steps+slides, `Home/End`, `O` overview grid (in write mode it rearranges the deck: drag a slide to a new place, and each cell carries new, duplicate and delete), `B` blackout, `F` fullscreen (and `⌘⏎` / `Ctrl+Enter`, the present chord, which a card that is open keeps for its save), `⇧F` shows or hides the previous/next arrows and the slide number **in fullscreen** (also a Settings row and a palette row; shown by default, remembered per deck in `decklight-fs-chrome:`; out of
|
|
705
|
+
- Keyboard: `→/←/Space` steps+slides, `⇧→/⇧←` a whole slide whatever builds are left (the same in the speaker view, the History preview and the change review), `Home/End`, `O` overview grid (in write mode it rearranges the deck: drag a slide to a new place, and each cell carries new, duplicate and delete), a click or tap on the slide steps on too, outside write mode (where a click selects) and never on a link, a control, a terminal or a video, `B` or `.` blackout (`.` is what a presenter clicker's black-screen button sends; any key or a click ends it without moving the deck, and a playing voice pauses with it and takes up again after), `F` fullscreen (and `⌘⏎` / `Ctrl+Enter`, the present chord, which a card that is open keeps for its save; in write mode, where `⌘⏎` means save everywhere, one pressed with nothing to save says so and stays put rather than hiding the editing bar behind fullscreen), `⇧F` shows or hides the previous/next arrows and the slide number **in fullscreen and while the speaker view is open** (the talk is driven from the second window, so the deck's window is the room's, fullscreen or not; also a Settings row and a palette row; shown by default, remembered per deck in `decklight-fs-chrome:`; out of both they always show), `T` theme picker (the palette's *Cycle theme* row walks the themes, `[`/`]` cycle the font), `S` the speaker view outside write mode (notes on the projected screen are the one thing never to show the room; in write mode `S` is the notes card), `?` help, a modal card: the deck does not move behind it, in short groups (Navigate · Present · Look · Voice, and **Write only where the deck can be written**), one short line a key, the chords spelled the way the machine spells them (`⌘⏎` on a Mac, `Ctrl+Enter` elsewhere), `/` or `⌘K` / `Ctrl+K` the command palette, editing is on in write mode: a bar along the bottom names every editing door (Text, Picture, Layout, Notes, Slide ▾, Undo, Redo, Lock), a click selects an element, and a right-click opens its menu, `⌘Z`/`⌘⇧Z` on a Mac, `Ctrl+Z`/`Ctrl+⇧Z` elsewhere undo/redo deck edits (write mode), `A` ask an AI agent to edit the deck (write mode), `/` command palette, **`⎵` pauses and resumes the voice while it is speaking** and **`V`** opens the panel that holds everything else about it: track, live voice, engine, tone, character, recording, captions, speed. Recording walks **all the slides or a picked range**: the recorder view's first row, **Slides**, opens the same range picker the video export uses (`src/core/ranges.js`: this slide, this chapter, from here, up to here, or typed), starts from `?slides=a-b` when `decklight narrate --mic --slides` opened the deck, and leaves every slide outside the range exactly as it was. `⎵` takes the key only while the narration is **in play**, never to start it: a deck that merely carries a track keeps `⎵` as the advance key, because presenting a narrated deck by hand is ordinary and a space bar that began narrating over the presenter would be a derailment in front of an audience rather than a stumble. Nothing is lost by the narrowing (a playing track advances the deck itself, so `⎵` is free exactly when the voice wants it) and starting stays deliberate: the palette's **Play the voice** is the unconditional verb from any state, and the panel has the track. `→`/`PageDown`/click always advance. The predicate is answered synchronously, because a keypress cannot wait on a probe. `<`/`>` change the voice speed in 0.25× steps, 0.25–2×, persisted per deck (YouTube's shortcut), `C` captions, `W` pen / `⇧W` laser pointer (draw on the slide, `⌫` clears), `` ` `` messages, `G` slide/module finder (deliberately not `⌘F`: browser find stays untouched), `H` deck history: the commits, which of them are only on this machine, a live preview, and `⏎` to restore one (write mode). In **present** mode `H` is the deck update instead (`NO_TRUST#UPSTREAM`), `?` help overlay.
|
|
544
706
|
- **←/→ move the deck while a panel has the keyboard**: the notes, the inspector, the sources, the comments, the agent and the HTML editor, floating or docked, never keep a bare `←` or `→`; only a text field does, for its caret. What the arrows did used to depend on the panel and on how it was docked.
|
|
545
707
|
- **Esc closes any panel**, with one press, from wherever the focus is: the page, a button in the panel, or one of its text boxes. A panel whose own keys do not answer Esc is closed by the deck's dispatcher, the one place every panel's keys pass through, and every box in a panel answers Esc itself, because the deck's key handler never hears a key typed into a field. Help (`?`) and the debug log (`D`), which take no keys, close on it too. Nothing typed is lost: a draft lives in its panel's state, not in the box (the comments box is the same node across closes). A selection is the one thing let go of first: with an element selected in the inspector, Esc steps back to the slide, and the next one closes it. The `escapeall` render harness opens every panel through its door and presses Esc once on the focused element, and once in each of its boxes.
|
|
546
|
-
- Touch: swipe
|
|
708
|
+
- **Touch** (phones and tablets, `pointer: coarse`): a swipe or a tap on the slide steps; **a swipe over a picker, a panel or a card scrolls that and never turns the slide behind it**. The touch cluster at the top left holds **⋯**, a short menu of big rows for everything past next and back that used to be a key (Overview, Find a slide, Notes, Commands, Help; Esc or a tap outside closes it), fullscreen where the browser has element fullscreen (an iPhone has none, so it gets no button that does nothing), and sound when the deck has a voice. The arrows are finger-sized targets on a quiet scrim, not faint glyphs. A wide deck on a phone held upright says once a visit, at the bottom, *↻ Turn your phone for a bigger slide*, and the pill goes the moment the phone is turned or it is tapped. The first-run welcome on a touch screen speaks in gestures (swipe, ⋯, pinch, 🔊), not keys.
|
|
547
709
|
- **Pinch zoom**: a pinch zooms the **slide**, never the page. On a trackpad a pinch arrives as a `wheel` event with `ctrlKey` (every browser), on a touch screen as two fingers; the engine takes both (`preventDefault`, so the browser does not zoom the whole page) and multiplies the stage's fit transform by a factor, 1 to 4, zooming about the point under the fingers. Only the stage is transformed, so every panel, bar, overlay and caption keeps its size (`--stage-scale`, which sizes the captions, stays the fit scale). While zoomed, a plain two-finger scroll pans, bounded so the stage never leaves the window, and a one-finger swipe pans rather than turns the slide. **The percentage shows**, top right (on the slide number's row, to its left, while editing), for as long as the slide is not at fit: a zoomed slide looks like a slide, and that chip is what says why the edges are missing; a click on it fits, like `0`. A zoom is a look closer, not a setting: it is not persisted, and `0`, `Esc` (before Esc closes anything), a slide change, or pinching back below 1 snap it to fit, and the chip goes with it. The gesture is the slide's where the fingers are over the slide or the letterbox around it: over a panel beside it (the notes card, the inspector) or over a picker or the overview it zooms nothing, and the page still never zooms; a docked panel being open is no reason not to zoom the slide next to it. Nothing happens in print or an embedded preview. `instance.zoom()` reads it and `instance.setZoom(k)` sets it.
|
|
548
710
|
- URL: `#/<slide>[/<step>]`; back/forward supported. `?theme=<name>` loads any theme at startup.
|
|
549
|
-
- **Command palette**: `/` opens the palette: every command with its shortcut, type-to-filter, `Enter` runs, `Esc` clears then closes. **Every command sits at the root, named by its category** (`src/core/palette.js`), the way VS Code's command palette reads: `Go to: Find slide…`, `Slide: Duplicate this slide`, `Voice: Live voice…`, `Share: Export to PDF…`. With no query the list runs category by category (Go to, Slide, Edit, Look, Voice, Present, Review, Git, Share, Help, Preferences) and in written order within each; there are no groups to drill into. Typing matches the category, the name and the aliases, every typed word in any order, so `share` narrows to that category, `voice live` finds `Voice: Live voice…` and `handout` finds both the PDF handout and the print handout. The best match leads: a name or title that starts with what was typed, then one whose title holds every word, then one found only through an alias. **One rule for write mode**: a row that changes the file, or needs the edit server to run, exists only while the deck can be written, and carries a **write** tag; the one exception is the lock row, which stays while the deck is locked because it is how you unlock it. Argument commands (Theme…, Font…,
|
|
711
|
+
- **Command palette**: `/` opens the palette: every command with its shortcut, type-to-filter, `Enter` runs, `Esc` clears then closes. **Every command sits at the root, named by its category** (`src/core/palette.js`), the way VS Code's command palette reads: `Go to: Find slide…`, `Slide: Duplicate this slide`, `Voice: Live voice…`, `Share: Export to PDF…`. With no query the list runs category by category (Go to, Slide, Edit, Look, Voice, Present, Review, Git, Share, Help, Preferences) and in written order within each; there are no groups to drill into. Typing matches the category, the name and the aliases, every typed word in any order, so `share` narrows to that category, `voice live` finds `Voice: Live voice…` and `handout` finds both the PDF handout and the print handout. The best match leads: a name or title that starts with what was typed, then one whose title holds every word, then one found only through an alias. **One rule for write mode**: a row that changes the file, or needs the edit server to run, exists only while the deck can be written, and carries a **write** tag; the one exception is the lock row, which stays while the deck is locked because it is how you unlock it. Argument commands (Theme…, Font…, Voice and narration…, Find slide…) drill into their pickers; contextual commands appear only when applicable (Save generated theme, Marketplace themes, the Configure ⟨engine⟩ wizard rows, Copy style and Paste style with a selection). **With nothing typed the rows run under group headings** (Go to, Slide, Edit, Look, Voice, Present, …), each row named plainly (*Play the voice*, *Show captions*, *Narrator fills the screen*); typed, the results mix groups and each row carries its group as a prefix. **The query is a real text box**, in the palette and in the slide finder: the browser types into it, so a paste, an accented letter typed through ⌥ or AltGr, a dead key and an IME all land, and a phone's keyboard appears; keys sent at the page still type, and the box follows. Inline arguments work: `goto 27`, or just typing `27`, surfaces a “Go to slide 27 / N” row (clamped to the deck), and selecting the bare “Go to slide…” command keeps the palette open with `goto ` prefilled. Text whose words start no command falls back to a “Search slides for …” row that opens the finder with the query prefilled.
|
|
550
712
|
- **Slide finder**: reached from the palette (`/` → Enter, or the search fallback): a find-a-slide overlay with the picker's anatomy, a query bar and result list on the left, a live preview of the selected slide on the right. Typing filters as an AND over the query's words against each slide's text; slides whose **title** contains every word rank first, body-only matches follow, and every match is listed as `<slide number> · <title>` (slides without a heading fall back to their leading text). `↑/↓`/hover browse (the preview swaps live), `Enter`/click jumps to the slide, `Backspace` edits, `Esc` clears the query then closes. The preview reuses the picker's lazy embedded-deck mechanism: the iframe boots once (carrying the active theme, generated/custom included via `?gen=`), then selections postMessage `{__decklightPreview: {goto: [slide, step]}}` into it; no reload per candidate. **A multi-module deck's finder is its outline**: on a deck carrying in-file
|
|
551
713
|
`data-module` markers (`DECK_ANATOMY`) and nothing typed, `G` shows each chapter
|
|
552
714
|
as a `▸ <title> — module · N slides` row folding its own slides, from the
|
|
553
715
|
marked slide up to the next marker, underneath it, with any slides before the
|
|
554
|
-
first chapter left top-level.
|
|
716
|
+
first chapter left top-level. A run of steps (`DECK_ANATOMY`) folds under its
|
|
717
|
+
chapter by its groups: a `<group> · step 2 of 4 · 3 slides` row stands over
|
|
718
|
+
the slides of each group, and goes to the first of them (a deck with runs and
|
|
719
|
+
no chapters is outlined the same way, its runs at the top level). A slide is
|
|
720
|
+
also found by its group's name. It opens folded except for the chapter you are
|
|
555
721
|
standing in, cursor on your slide. `→` unfolds a chapter (and steps into an open
|
|
556
722
|
one), `←` folds it (and climbs from a slide back to its chapter), and the
|
|
557
723
|
`▸`/`▾` glyph folds in place on a click; `⏎` or a click on the row itself still
|
|
@@ -567,33 +733,35 @@ slide. The chapters were visible, but they organised nothing.
|
|
|
567
733
|
|
|
568
734
|
### PRESENTING_CHROME · What sits over the slides while you talk
|
|
569
735
|
|
|
570
|
-
- **Captions** (`C`): a YouTube-style bar at the bottom showing the current notes segment, the same ⟨CLICK⟩-segmented text the live voice speaks, synced to slide/step, with narration on or off. **On means shown, voice or no voice:** while the live voice speaks it owns the bar (blanked on arrival, then filled sentence by sentence, so the caption follows what is being said rather than the whole segment), and the moment the voice goes, for any reason (switched off in the panel, a bridge that fails before its first clip, audio the browser blocked), the bar is handed back to the step's own text; it never keeps the last sentence spoken, and never sits empty over a slide that has notes. Slides/steps without notes show no bar. Persists per deck in localStorage. The bar sits on the deck root, outside the scaled stage, so it is sized by the stage's scale (`--stage-scale`, published by the engine's rescale). **Down only**: in a slide-finder or theme-picker preview it shrinks with the thumbnail instead of covering it, and a deck at or above its design size captions exactly as before. A slide-finder or theme-picker **preview shows no caption bar** even when the deck behind it has captions on (#490): captions are chrome for the person presenting the current slide, and a preview is a thumbnail of wherever the cursor is; it neither reads the per-deck setting as on nor writes it (`C` inside a preview changes nothing), the same line the voice-over hint holds. The **history's** preview is the one exception, and only on the parent's say: it is a version being read rather than a thumbnail, so it shows that version's notes when the deck's captions are on (History, below).
|
|
736
|
+
- **Captions** (`C`): a YouTube-style bar at the bottom showing the current notes segment, the same ⟨CLICK⟩-segmented text the live voice speaks, synced to slide/step, with narration on or off. **On means shown, voice or no voice:** while the live voice speaks it owns the bar (blanked on arrival, then filled sentence by sentence, so the caption follows what is being said rather than the whole segment), and the moment the voice goes, for any reason (switched off in the panel, a bridge that fails before its first clip, audio the browser blocked), the bar is handed back to the step's own text; it never keeps the last sentence spoken, and never sits empty over a slide that has notes. Slides/steps without notes show no bar. Persists per deck in localStorage. The bar sits on the deck root, outside the scaled stage, so it is sized by the stage's scale (`--stage-scale`, published by the engine's rescale). **The rest of the chrome follows a small box down too**: the arrows, the slide number, toasts, the voice-over hint and the welcome and help cards take `zoom` from `--chrome-k`, which is `clamp(0.5, --stage-scale × 1.4, 1)`. It is full size whenever the slide is drawn at 0.72× or more (a window about 920 px wide), shrinks with the box below that, and stops at half size so an arrow is still something a finger can hit; it never grows, so a full-screen deck is as it was. A deck embedded in a 520×292 box (decklight.io's hero, slide at 0.4×) showed a full-size welcome card that overflowed the frame; the cards now also cap at 92% of the box, padding included, and scroll inside it. `test/engine.html?mode=chromescale` resizes the root to that box, to one below the floor and to a large one, and asserts each. **Down only**: in a slide-finder or theme-picker preview it shrinks with the thumbnail instead of covering it, and a deck at or above its design size captions exactly as before. A slide-finder or theme-picker **preview shows no caption bar** even when the deck behind it has captions on (#490): captions are chrome for the person presenting the current slide, and a preview is a thumbnail of wherever the cursor is; it neither reads the per-deck setting as on nor writes it (`C` inside a preview changes nothing), the same line the voice-over hint holds. The **history's** preview is the one exception, and only on the parent's say: it is a version being read rather than a thumbnail, so it shows that version's notes when the deck's captions are on (History, below).
|
|
571
737
|
- **Presenter clock** (`K`): the wall-clock time (HH:MM) and the elapsed talk time, directly below the slide number: positioned so it never covers the slide number, the message window, or the default logo/controls corners. The elapsed count starts at the deck's **first advance after load**, not at page load: a deck idling on its title slide while the room fills is not a talk yet. Off by default, persists per deck in localStorage, never rendered in `?print`. `instance.toggleClock()` programmatically.
|
|
572
|
-
- **Progress bar** (palette: *Present:
|
|
738
|
+
- **Progress bar** (palette: *Present: Show the progress bar*): a hairline along the bottom edge of the deck whose width tracks the position through the deck (slide plus build step, slide 1 empty → last slide full), updated on every navigation: keys, `G`, `Home`/`End`, deep links. A passive readout of the deck state: it never drives navigation or auto-advance. Sits at the very bottom edge, below the captions bar, the character overlay and the corner chrome, so it covers none of them. Off by default, persists per deck in localStorage, never rendered in `?print`. `instance.toggleProgress()` programmatically.
|
|
573
739
|
- **Ink annotations** (`W` / `⇧W`): Keynote-style presenter ink on a canvas overlay above the slides. `W` toggles the **pen**: the cursor becomes a crosshair and pointer drags (mouse, touch, stylus) draw strokes in the theme's `--accent`; `⇧W` toggles the **laser pointer**: a glowing accent dot with a ~300 ms fading trail follows the pointer. `Backspace` clears the canvas while a tool is active. Annotations are EPHEMERAL: cleared on every slide change, never persisted, never rendered in `?print` (the annotator is not instantiated there: the clock pattern, exclusion by construction). Strokes are stored in **design coordinates** and redrawn at the engine's scale, so a window resize or rescale never drifts them off their slide positions; the ink color is read live from the applied theme, so switching themes recolors the next stroke. With no tool active the canvas is `pointer-events: none`. Slide clicks and touch swipes work exactly as before. `instance.annotate = { toggle, laser, clear, stroke }` programmatically (`stroke(points)` draws one from design-coordinate points: the headless-harness and demo-driver hook).
|
|
574
740
|
- **Transcript** (palette → *Present: Transcript… (speaker view)*): the deck's full spoken script, every slide's notes segments in order, read in the **speaker view's script view** (its `script` button): the slide on screen lit and kept in view, a slide's title moves the deck there. It was a card over the slides, the one way to read notes a presenter could not use while presenting. Export is two palette rows, *Share: Download the transcript (.md)* and *(.txt)* (`<deck>-transcript.txt|.md`), no second window needed. Also programmatic: `instance.transcript.text()` / `.markdown()` / `.download('md'|'txt')` / `.open()` (opens the speaker view on the script).
|
|
575
|
-
- **Messages** (`` ` ``, the key
|
|
576
|
-
- **
|
|
741
|
+
- **Messages** (`` ` ``, the tilde key, matched on `code` so it is the same physical key on every layout; or the palette's "Messages"): the deck talks back in the **top-left corner**: 20px, high-contrast, stacked newest-last (at most 4 at a time), each fading after a few seconds. Every message is also KEPT: that key opens the log (the full history with arrival times) because a message that explains why the voice stopped is worthless if it faded while you were looking at the slide. The shortcut is handled BEFORE the typing guard, so `` ⌃` ``/`` ⌥` `` reach you even while the notes editor has focus and owns every bare keystroke; the bare key works whenever you are not typing. `instance.messages()` returns `[{ at, text }]`, `instance.toggleMessages()` opens the log.
|
|
742
|
+
- **One look for Decklight's own controls**: the palette, the finder, the editing bar and the voice cards were a fixed dark grey in the system's type, help and the welcome card followed the deck's theme, and messages were the theme's big monospace. Everything that is Decklight rather than the deck wears the first now (`--dl-chrome-*`): one surface, one ink, one type, with the deck's accent the one thing it borrows. **A message has a kind**: an ordinary one; an **aside**, for the presenter alone (clock, progress bar, pen, captions on or off, a font's or a theme's name, the voice's speed), drawn small rather than large over a talk; and an **error**, which used to look exactly like a success: a red edge and a ⚠, announced as an alert, up at least seven seconds. An error is known by its words (*could not*, *failed*, *not saved*, *cannot*) or said by its caller. **One counter in the corner**: in write mode the accent slide number stands in for the deck's own, which used to sit under it. On a touch screen the messages start below the touch cluster and clear of a notch.
|
|
743
|
+
- **Accessibility**. **A slide change is announced**: a polite, out-of-sight live region says *Slide 4 of 12: Title* on every slide change (not on every build step, which would talk over the speaker), never in a render. **The pickers and cards say what they are**: the palette, the finder and the overview are lists of options, the overview's cells named *Slide 4: Title* and the selection said; the welcome card, the editing tour and help are dialogs named by their heading, and a card takes the focus so its keys are heard. **One focus ring** in the accent on every control Decklight draws, where many text boxes and buttons had none. **Reduced motion is respected everywhere**: matching-element animation (`data-id`, MOTION) set its moves as inline transitions the stylesheet's reduced-motion rule could not reach, so for somebody who asked for less motion it is not started at all, and the slide lands as it is.
|
|
744
|
+
- **Debug log** (palette: *Help: Debug log*; the **events** tab of the one log panel, beside **messages**: `` ` `` opens the panel on messages, the palette row on events, a tab switches in place, and `Esc` closes it on either): a passive monospace panel over the deck (keys keep driving the presentation) showing a timestamped event stream: ready/slide/build with direction, theme and font applies, narration on/off and config changes, every TTS call with its duration and estimated cost (`slide 3 seg 1 · Alnilam · 214 chars → 2.4s · ~$0.0041`, previews included) and failures, and window `error` events; plus a live state line (slide/step/theme/narration incl. the active voice · tone or track, the voice rate, and the running TTS spend). Cost is an ESTIMATE: the Gemini API returns token counts (`usageMetadata`), never dollars; the bridge prices them at published Vertex list rates, sends `x-tts-cost` on each fresh synthesis (0 on cache replays), and prints a per-call line plus session total on its console. Events ring-buffer (last 200) from init, so the panel shows history from before it was opened. **The log survives a reload.** Write mode reloads the page on every write of the file, which used to wipe the one record that could say why: the page leaving now stashes its buffer and the reason it was told (sessionStorage, this tab's and this deck's; older than a minute it is another session's), and the page arriving starts from it, the rows before dimmed with their own times, then a *reload* row first on its own clock: `↻ reloaded — notes saved · this tab`, `↻ reloaded — layout picked · another tab`, `↻ reloaded — claude's edit`, `↻ reloaded — slide 4 added` (an outside edit, said slide by slide: PRESENTING_EDITING, outside edits), or `↻ reloaded — by the browser (⌘R, or a navigation)` when no server said. **The reason is the server's** (`cli/edit.mjs`, `describeReload`): the reload message it sends is `data: {"reload":"<what>","from":<page id or null>}` rather than a bare `reload`; *what* is the route that wrote the file within the last two seconds, in words (`whatWrote`: notes saved, layout picked, undo (Z), theme picked, restored from git, git pull …), else the running agent's edit, else a change on disk this server never made, said by what it changed (`changed on disk — an editor, git, or a tool outside this server` only when the server cannot tell); *from* is the page the write named, so the row says whether it was this tab's doing. An older page reloads on any message as before, and an older server's bare `reload` reads as *the file changed*.
|
|
577
745
|
- **Brand logo**: `init({ logo: { onLight, onDark, src?, height?, position? } })` renders a mark as chrome on every slide (default `bottom-left`; also `top-left|top-right|bottom-right`; default height 30px). `onLight`/`onDark` are the variants for light/dark canvases: the engine reads the applied theme's real background luminance (first gradient stop for gradient canvases), sets `data-canvas="dark|light"` on the root, and the matching variant shows, following theme cycling, the picker, and generated themes ( `src` alone shows always). Refs resolve as `'#id'` (clones an inline element: bundle- and `file://`-safe, the `data-cast-inline` idiom), `'<svg…'` raw markup, or an `<img>` URL. In `?print`, every slide gets its own copy. **Hero variant**: `data-logo` on a section prepends a larger in-flow copy of the mark above the slide's content (default 96 design px; `data-logo="128"` overrides): module openers and cover slides. Hero slides hide the corner chrome (and skip the print copy), the mark doesn't count as pinnable content, and the same on-light/on-dark variant switching applies.
|
|
578
|
-
- **Speaker view**: `⌥⏎` / `Alt+Enter` (PowerPoint's presenter-view chord, the same on every OS and no F-key) (or the palette's *Speaker view — second window*) opens a popup (synced via BroadcastChannel): current + next slide thumbnails (**current is what the audience sees**, the slide at the step the deck is on, stepping through its builds in place; it used to show the slide fully built), notes (with `⟨CLICK⟩` markers highlighted as the matching build lands), elapsed timer, build step list (provider labels). **
|
|
746
|
+
- **Speaker view**: `⌥⏎` / `Alt+Enter` (PowerPoint's presenter-view chord, the same on every OS and no F-key) (or the palette's *Speaker view — second window*) opens a popup (synced via BroadcastChannel): current + next slide thumbnails (**current is what the audience sees**, the slide at the step the deck is on, stepping through its builds in place; it used to show the slide fully built), notes (with `⟨CLICK⟩` markers highlighted as the matching build lands), elapsed timer, build step list (provider labels). **Text size**: `A−` / `A+` in the header (or `−` / `+` in the popup, which the deck never sees) step the notes' type size from 11 to 48 px (16 by default); the rest of the view stays put, and the size is remembered in this browser, so the next speaker view opens at it. **Rehearse mode**: `S` or `⌥⏎` in the popup (the header badge also toggles) swaps the prose notes for the slide's `aside.rehearse` cue cards (DECK_ANATOMY): rendered large and bold, one cue per segment, same said/now/next highlighting. Slides without rehearse notes fall back to the full prose. **Pressed again in the deck**, the shortcut brings the open popup to the front (behind the deck, or under another window on the other screen, is when it is pressed again) instead of opening a second. **The popup takes the deck's keys**: a clicker types into whichever window has focus, so `→ ← ⎵ PageDown PageUp Home End` and `B` / `.` (blackout) are sent on to the deck and do exactly what they do there. **It survives a reload**: the deck installs the popup's bridge on every load, so a speaker view open while write mode reloads the deck finds the new page and carries on; when it cannot reach the deck (closed, or a `file://` deck that reloaded) its header says so rather than showing a stale slide. **Phone remote**: when the deck is being played by `decklight <deck> --no-trust --remote` (below), the speaker view also shows a QR of the controller URL: click it to enlarge for scanning across a lectern. It appears only when a remote is actually on, since without it there is no LAN URL to encode.
|
|
579
747
|
- **Rehearsal timings** (`REHEARSAL_TIMINGS`): the speaker view's `⏱ rehearse timings` records how long each slide takes as you present, and `⏹ stop & save timings` writes the result onto the sections as `data-timing="<seconds>"` through the edit server (`POST /deck/edit/timings`, one edit for every slide, one undo entry), or, with no edit server, keeps it in this browser. From then on the speaker view shows a pace line: this slide's elapsed against its planned time (red past five seconds over) and the talk's total against the plan. The deck's own `data-timing` always wins over a browser's memory, because the file is the source of truth. The palette's **Rehearse timings…** opens the speaker view if it is not already open and starts the clock in one step: a recorder that could only be found by opening a popup first was a recorder most presenters never found.
|
|
580
|
-
- **Phone remote** (`decklight <deck.html> --remote`, in either mode): the server also listens on the LAN and serves `GET /deck/remote`: a self-contained controller page with prev/next and a live "slide x/N" readout, no external asset of any kind (a phone is off-loopback, so anything it fetched from elsewhere would be a hole). A tap is relayed as a named `remote` event on the SSE stream the deck already holds, and the deck POSTs its position back, so the readout tracks the deck however it moved (phone, keyboard, or click). `POST /deck/remote/pos` is the deck→phones direction and **accepts only loopback callers**: the deck is the one thing that knows the position, it reports from this machine, and a phone, or anyone who obtained the QR token, posting a fabricated `{i,n}` would desync the readout every other phone shows. `--remote` widens the **listener** and nothing else: off this machine **only** `/deck/remote/*` answers, and only with the per-run random token the printed URL and its QR embed. The deck itself and every file beside it stay unreachable from the LAN either way. One exported classifier decides it, `allowRemote(req, token)`, and `NO_TRUST#REMOTE` is why the flag widens nothing else: a clicker must never mean running `/deck/edit/*` on the LAN during a talk you are not watching. The QR is generated server-side with no dependencies, and a deck that never uses a remote grows by zero bytes.
|
|
748
|
+
- **Phone remote** (`decklight <deck.html> --remote`, in either mode): the server also listens on the LAN and serves `GET /deck/remote`: a self-contained controller page with prev/next and a live "slide x/N" readout, no external asset of any kind (a phone is off-loopback, so anything it fetched from elsewhere would be a hole). A tap is relayed as a named `remote` event on the SSE stream the deck already holds, and the deck POSTs its position back, so the readout tracks the deck however it moved (phone, keyboard, or click). `POST /deck/remote/pos` is the deck→phones direction and **accepts only loopback callers**: the deck is the one thing that knows the position, it reports from this machine, and a phone, or anyone who obtained the QR token, posting a fabricated `{i,n}` would desync the readout every other phone shows. `--remote` widens the **listener** and nothing else: off this machine **only** `/deck/remote/*` answers, and only with the per-run random token the printed URL and its QR embed. The deck itself and every file beside it stay unreachable from the LAN either way. One exported classifier decides it, `allowRemote(req, token)`, and `NO_TRUST#REMOTE` is why the flag widens nothing else: a clicker must never mean running `/deck/edit/*` on the LAN during a talk you are not watching. The QR is generated server-side with no dependencies, and a deck that never uses a remote grows by zero bytes. **While the voice recorder is capturing a beat** (`decklight narrate --mic --remote`), the phone is the recorder's keyboard: `next` ends the beat as `→` does, and the deck is not also stepped (the recorder reveals the next build itself, so stepping too would reveal two); a `retake` key, accepted only by the relay and meaningful only then, is `⌫`; `prev` is ignored, because moving the deck under a take would record the beat at the wrong build. The deck's position report then carries `rec: { slide, beat, of }` (null otherwise, and refused unless all three are integers), and the controller says it is recording, which beat, and swaps prev for retake, so recording needs no glance at the laptop and no keystroke gets into the audio. Anywhere else (the plan card, between slides, no recorder open) the phone is the clicker it always was. The recorder's plan card shows the QR, since the speaker view that usually carries it is not open while you record.
|
|
581
749
|
- **Onboarding, the first-run welcome and the editing tour**: the two moments a deck can afford to teach the tool, and nothing after them. A rotation of one-line tips used to follow the welcome, one per load, with palette rows to turn it off and reset it; the palette answers "how do I…" for anyone who types the word and `?` lists every key, so the tips taught what both already say, and they are gone.
|
|
582
|
-
- **First-run welcome**: the first time a browser opens *any* deck, a card
|
|
583
|
-
- **Editing tour**: the first load that *is* write mode (the edit server has answered, so the card is about what this deck can do) gets a card of its own, **Editing this deck**: double-click to edit text in place, drop a file to add a picture, the editing bar and click-to-select, `S` for the notes drawer and `O` for the overview that rearranges slides, `A` to describe a change for an agent, `K` to commit what the chip keeps count of, `/` for the rest. Same look and same rules as the welcome: any key dismisses it and does nothing else, a click dismisses without advancing, any real advance retires it, never past slide 1 / step 0, never in `?print`, `?embedded` or `?capture`.
|
|
750
|
+
- **First-run welcome**: the first time a browser opens *any* deck, a short card for whoever is **watching** the deck: `→` or a click for next (a swipe or a tap on a phone), `←` back, `/` for every command, `?` for every key, `V` for the voice, `T` for themes (and `⌃T` to generate one, on a Mac, where the page can have it). Write mode, agents and undo are the author's, and the author gets the editing tour instead (below). **`?` and `/` on the card do what it says**: the card goes and help or the palette opens (every other key only dismisses it, so `?` used to close the card and never open the help it named). Themed through the token contract (`--bg`, `--fg`, `--accent`, `--accent-contrast`, `--muted`), so it reads on every theme. **Any key dismisses it and does nothing else** (a newcomer pressing `→` clears the card, then advances on the next press) and any real advance (touch swipe, the on-screen chevrons, a programmatic `next()`) retires it for good, so it can never sit over a talk in progress. A click dismisses without advancing, even though a bare click on the deck is "next" everywhere else. Reopen from the palette ("Welcome to Decklight") or `instance.showWelcome()`.
|
|
751
|
+
- **Editing tour**: the first load that *is* write mode (the edit server has answered, so the card is about what this deck can do) gets a card of its own, **Editing this deck**: double-click to edit text in place, drop a file to add a picture, the editing bar and click-to-select, `S` for the notes drawer and `O` for the overview that rearranges slides, `A` to describe a change for an agent, `K` to commit what the chip keeps count of, `/` for the rest. Same look and same rules as the welcome: any key dismisses it and does nothing else, a click dismisses without advancing, any real advance retires it, never past slide 1 / step 0, never in `?print`, `?embedded` or `?capture`. **The author's card comes first**: on a write-mode load the tour takes the welcome's place, even when the welcome went up while the edit server was still answering (it told an author to run the command they had just run, and the tour waited for their second visit). Dismissing the tour marks the welcome seen too, since it names `/` and `?` itself. `?` and `/` on it open help and the palette, as on the welcome. Once per browser (`localStorage['decklight-onboarded-tour']`); reopen from the palette ("Editing tour") or `instance.showEditingTour()`.
|
|
584
752
|
- Neither ever appears in `?print` or `?embedded` (a printout and a preview teach nobody), nor when the URL deep-links past slide 1 / step 0, which is somebody presenting from a link rather than a first run. Both seen-flags are **global** (`localStorage['decklight-onboarded']`, `decklight-onboarded-tour`), not path-scoped like the theme/font/clock keys: they remember what a *person* has been told, not what a *deck* should look like, the same reasoning as `decklight-custom-themes`. Every write is best-effort, so `file://` and private mode play normally and simply forget.
|
|
585
|
-
- **Settings** (`SETTINGS`): the palette's **Settings…** row (also found by typing `config`, `preferences` or `version`) opens a small panel of facts about what this deck is running, and **the home for the presenter's knobs**: each row reads what the deck remembers and ⏎ changes it, the panel staying open around it. Besides the rows below, it holds **Arrows and slide number in fullscreen** (shown/hidden, `⇧F`), **Clock**, **Progress bar** and **Captions** (on/off), **Voice speed** (⏎ walks 0.75×, 1×, 1.25×, 1.5×, 2×; `<`/`>` still step by 0.25) and, in write mode, the **Editing bar** (shown/hidden). The palette keeps its rows for the same toggles: the palette is where you do a thing, Settings is where you see how the deck is set up. A row with no action is a **fact**, shown at full strength with no pointer cursor, never greyed out the way an unavailable command is: dimming it would say "not available to you" about something that is merely information. Its fixed rows: the first is the **runtime version**, which is the first thing a bug report asks for and which nothing in the player could previously answer: the version rides the bundle's banner, a comment you would have to open the file to read. It shows the **build**, not just the version (`0.9.0+107.g6dad7a3`, the same stamp `decklight --version` prints, plain on a release build), because "which 0.9.0?" is the question a bug report is asking. It is baked in at build time (`__DECKLIGHT_VERSION__`), formatted by the CLI's own `versionLine` from the `git describe` the build already records, so the panel and the terminal can never spell one build two ways; a render assertion checks the panel against the runtime's own `Decklight.version`. **⏎ or a click copies it** ("copied 0.9.0+108.gcca64bd"), because a version retyped into a bug report arrives with a typo in it: the async clipboard first, the old select-and-copy where that is refused (a deck on `file://` is not a secure context everywhere), and if both are refused the toast carries the text itself. `instance.settings.open()` / `.close()` / `.rows()` is the programmatic door, and `rows()` answers `[{ label, value?, run? }]` without opening an overlay, so a headless probe can read the version without driving the UI. The second is **Display**, the one knob: the deck's own ratio (`16:9` for the default 1280×720, letterboxed on any other screen) or **fill screen**, and ⏎ switches between them with a toast naming the new one. **A knob switches in place**: the panel stays open with the same row selected and the row reads the new value, so a second ⏎ switches back and Escape closes; it was closing on every press, which made a two-way switch cost three keys a turn. The copy is the whole of its act, so that row still closes. Filling grows the stage to the screen's shape instead of stretching it: a wider screen keeps the deck's height and gains width, a taller one keeps its width and gains height, so the slides lay out into the extra room and nothing that fits at the deck's ratio is squeezed. Pinned titles and the overflow guardrail measure again once a resize stops. Past 1:1 and 2.4:1 it letterboxes again, because a phone held upright or an ultrawide would turn a slide into a ribbon. **In fullscreen the bands are black**, like a projector's, and the slide itself carries the theme's canvas and accent; in a window they keep the theme's colour, and a slide whose art bleeds (Bleed, DECK_ANATOMY) still fills the screen. The choice belongs to this browser and this deck (`decklight-display:<path>`), like a dock placement: it says how this screen shows the deck, never what the file says, so print, PDF and every export keep the deck's ratio, and the row is absent under `?print`. The third, in write mode only, is **Push tags**: `with the branch` (the default) or `off`, and ⏎ switches it, in place like Display. It decides whether the commit window's **Push** sends the annotated tags with the branch (`git push --follow-tags`) or the branch alone, so a tag can stay a local mark until you push it yourself. It is kept per browser and per deck (`decklight-push-tags:<path>`), because a tag is a release name in one repository and a scratch mark in another; the page sends it with each push (`POST /deck/edit/commit/push {tags}`), and a push with no body sends tags as before. The fourth, in write mode only, is **Notes autosave**, the notes card's quiet time (PRESENTING, speaker notes): ⏎ cycles it, in place.
|
|
753
|
+
- **Settings** (`SETTINGS`): the palette's **Settings…** row (also found by typing `config`, `preferences` or `version`) opens a small panel, headed *this browser* (what the deck's file says is **Deck settings…**, `PRESENTING_EDITING`), of facts about what this deck is running, and **the home for the presenter's knobs**: each row reads what the deck remembers and ⏎ changes it, the panel staying open around it. Besides the rows below, it holds **Arrows and slide number in fullscreen and speaker view** (shown/hidden, `⇧F`), **Clock**, **Progress bar** and **Captions** (on/off), **Voice speed** (⏎ walks 0.75×, 1×, 1.25×, 1.5×, 2×; `<`/`>` still step by 0.25) and, in write mode, the **Editing bar** (shown/hidden). The palette keeps its rows for the same toggles: the palette is where you do a thing, Settings is where you see how the deck is set up. A row with no action is a **fact**, shown at full strength with no pointer cursor, never greyed out the way an unavailable command is: dimming it would say "not available to you" about something that is merely information. Its fixed rows: the first is the **runtime version**, which is the first thing a bug report asks for and which nothing in the player could previously answer: the version rides the bundle's banner, a comment you would have to open the file to read. It shows the **build**, not just the version (`0.9.0+107.g6dad7a3`, the same stamp `decklight --version` prints, plain on a release build), because "which 0.9.0?" is the question a bug report is asking. It is baked in at build time (`__DECKLIGHT_VERSION__`), formatted by the CLI's own `versionLine` from the `git describe` the build already records, so the panel and the terminal can never spell one build two ways; a render assertion checks the panel against the runtime's own `Decklight.version`. **⏎ or a click copies it** ("copied 0.9.0+108.gcca64bd"), because a version retyped into a bug report arrives with a typo in it: the async clipboard first, the old select-and-copy where that is refused (a deck on `file://` is not a secure context everywhere), and if both are refused the toast carries the text itself. `instance.settings.open()` / `.close()` / `.rows()` is the programmatic door, and `rows()` answers `[{ label, value?, run? }]` without opening an overlay, so a headless probe can read the version without driving the UI. The second is **Display**, the one knob: the deck's own ratio (`16:9` for the default 1280×720, letterboxed on any other screen) or **fill screen**, and ⏎ switches between them with a toast naming the new one. **A knob switches in place**: the panel stays open with the same row selected and the row reads the new value, so a second ⏎ switches back and Escape closes; it was closing on every press, which made a two-way switch cost three keys a turn. The copy is the whole of its act, so that row still closes. Filling grows the stage to the screen's shape instead of stretching it: a wider screen keeps the deck's height and gains width, a taller one keeps its width and gains height, so the slides lay out into the extra room and nothing that fits at the deck's ratio is squeezed. Pinned titles and the overflow guardrail measure again once a resize stops. Past 1:1 and 2.4:1 it letterboxes again, because a phone held upright or an ultrawide would turn a slide into a ribbon. **In fullscreen the bands are black**, like a projector's, and the slide itself carries the theme's canvas and accent; in a window they keep the theme's colour, and a slide whose art bleeds (Bleed, DECK_ANATOMY) still fills the screen. The choice belongs to this browser and this deck (`decklight-display:<path>`), like a dock placement: it says how this screen shows the deck, never what the file says, so print, PDF and every export keep the deck's ratio, and the row is absent under `?print`. The third, in write mode only, is **Push tags**: `with the branch` (the default) or `off`, and ⏎ switches it, in place like Display. It decides whether the commit window's **Push** sends the annotated tags with the branch (`git push --follow-tags`) or the branch alone, so a tag can stay a local mark until you push it yourself. It is kept per browser and per deck (`decklight-push-tags:<path>`), because a tag is a release name in one repository and a scratch mark in another; the page sends it with each push (`POST /deck/edit/commit/push {tags}`), and a push with no body sends tags as before. The fourth, in write mode only, is **Notes autosave**, the notes card's quiet time (PRESENTING, speaker notes): ⏎ cycles it, in place. The fifth, in write mode only, is **Review quick fixes**: `before they land` (the default) or `off — they land at once`, ⏎ switches it in place. **Review agent asks**: the same switch for `A`; a script rewrite has no switch, the review is how it arrives. On, a Check deck… quick fix opens the side-by-side review before anything is written (PRESENTING_EDITING); off, it lands at once as one undo entry and one commit. Per browser (`decklight-fix-review`), because it is how the author likes to work, not a fact about a deck. In write mode, **Code editor** names the editor that Open in your editor starts (PRESENTING_EDITING), or `asked the first time`; ⏎ opens its chooser. It is the machine's, not the browser's: the server keeps it for every deck.
|
|
586
754
|
|
|
587
755
|
### PRESENTING_LOOK · Themes and type
|
|
588
756
|
|
|
589
|
-
- **Theme switching**: the theme is the stylesheet link into `themes/`; the engine swaps its href in place, so every token cascades and the deck restyles live. `T` opens the **theme picker**: the theme list (config `themes: [...]`, defaulting to the shipped set baked in at build time) beside a live preview of the *current slide at the current step*: a real embedded deck (`?embedded&theme=<name>#/<slide>/<step>`). `↑/↓`/hover browse (debounced), `Enter`/click applies, `Esc` closes. **Packs** (themes/packs.json, baked in at build; the build fails if a shipped theme is missing from the manifest): the picker opens on the pack list (name + count; the active theme's pack is marked), `Enter` drills in, the `← packs` row or `Esc` goes back, `✳ all themes` flattens; saved-custom and generated themes form dynamic packs at the end. An active filter always searches globally and tags each hit with its pack. **Marketplace themes** (`THEME_BROWSE#UI`) are listed **only in write mode**, not greyed out, absent: a presented deck lists the themes it marks and nothing else, and never reaches for a catalog. **The mark itself shows in every mode**: a theme the deck marks (THEME_DISTRIBUTION) is tagged `●` whoever opens the file, without trust or from disk as much as while authoring, and the marked themes come first, as a `● Marked` pack ahead of the recommended one and at the head of the flattened list, because the mark is a fact of the file and a reader with the shipped set in front of them has no other way to tell the deck's four from the forty beside them; the caption says *marked, part of the bundle* and, outside write mode, nothing about changing it. While authoring, every registered marketplace is a pack under its title, its themes tagged `●` when the deck marks them and `○` when it does not; any of them previews and applies, and **Space** marks or unmarks the selected one, a shipped theme as well, which a bundle then carries; a shipped row is tagged `●` only when marked, since `○` on every shipped theme would be noise, and its caption says Space marks it. The mark is written quietly: the row changes in place and the picker stays open, because the page is not reloaded for a write the picker has already shown. Space is free because the filter types `[a-z0-9-]` only. A theme whose bytes live at a URL has **no preview** until it is marked. Marking is the explicit act that reads it. A refusal keeps the picker up with the contract problems in the caption rather than closing on a failure; a mark lands on disk and the watcher's reload brings the deck back with the list as the file now says it is. **Pack-aware cycling**:
|
|
757
|
+
- **Theme switching**: the theme is the stylesheet link into `themes/`; the engine swaps its href in place, so every token cascades and the deck restyles live. `T` opens the **theme picker**: the theme list (config `themes: [...]`, defaulting to the shipped set baked in at build time) beside a live preview of the *current slide at the current step*: a real embedded deck (`?embedded&theme=<name>#/<slide>/<step>`). `↑/↓`/hover browse (debounced), `Enter`/click applies, `Esc` closes. **Packs** (themes/packs.json, baked in at build; the build fails if a shipped theme is missing from the manifest): the picker opens on the pack list (name + count; the active theme's pack is marked), `Enter` drills in, the `← packs` row or `Esc` goes back, `✳ all themes` flattens; saved-custom and generated themes form dynamic packs at the end. An active filter always searches globally and tags each hit with its pack. **Marketplace themes** (`THEME_BROWSE#UI`) are listed **only in write mode**, not greyed out, absent: a presented deck lists the themes it marks and nothing else, and never reaches for a catalog. **The mark itself shows in every mode**: a theme the deck marks (THEME_DISTRIBUTION) is tagged `●` whoever opens the file, without trust or from disk as much as while authoring, and the marked themes come first, as a `● Marked` pack ahead of the recommended one and at the head of the flattened list, because the mark is a fact of the file and a reader with the shipped set in front of them has no other way to tell the deck's four from the forty beside them; the caption says *marked, part of the bundle* and, outside write mode, nothing about changing it. While authoring, every registered marketplace is a pack under its title, its themes tagged `●` when the deck marks them and `○` when it does not; any of them previews and applies, and **Space** marks or unmarks the selected one, a shipped theme as well, which a bundle then carries; a shipped row is tagged `●` only when marked, since `○` on every shipped theme would be noise, and its caption says Space marks it. The mark is written quietly: the row changes in place and the picker stays open, because the page is not reloaded for a write the picker has already shown. Space is free because the filter types `[a-z0-9-]` only. A theme whose bytes live at a URL has **no preview** until it is marked. Marking is the explicit act that reads it. A refusal keeps the picker up with the contract problems in the caption rather than closing on a failure; a mark lands on disk and the watcher's reload brings the deck back with the list as the file now says it is. **Pack-aware cycling**: the palette's *Cycle theme* row walks the pack-grouped order (`,`/`.` did, until `.` became the clicker's blackout); a step that would cross into another pack pends instead of applying: a toast names the pack and target theme, running the row again confirms, `Esc` cancels, and the pending step times out after 4s. **Quick filter**: printable keys type into a filter bar that narrows the list (substring match; the generate row hides while a filter is active); `Backspace` edits, `Esc` clears the filter first and closes on the second press. Because keystrokes feed the filter, the picker has no letter shortcuts (`⌃T` re-rolls the generate-row candidate; the former `R`/`T` bindings are gone). The applied choice persists per deck path in `localStorage`; **embedded instances never persist** (previews can't pollute the saved choice).
|
|
590
758
|
- **Inline-theme mode** (bundled single-file decks): when `<style data-theme="name">` blocks exist, they replace the link: `applyTheme` toggles which block applies (via `media="not all"`; the HTML `disabled` attribute on `<style>` is non-functional per spec, and the engine normalizes either form at init). The picker lists the embedded names (config `themes` narrows), `?theme=` works, and everything else is unchanged.
|
|
591
759
|
- **Theme generator**: `⌃T` generates a brand-new contract-complete theme (THEMING note) and applies it instantly: press again to re-roll. The roll lives as a `<style data-theme data-generated>` block appended last in `<head>` (wins the cascade over the link/inline base); cycling `<`/`>` or picking another theme deactivates it but keeps it in the theme list under its autoname (`gen-<word>-<hex4>`) until the next roll replaces it. The picker's first row is **“✨ Generate new…”**: selecting it rolls a candidate and previews it live like any other theme (`⌃T` re-rolls while selected; `Enter` applies). Previews for generated and saved-custom themes carry their tokens in the URL (`?gen=<base64url {name, tokens}>`) which the engine applies statelessly at init (works on `file://` and inside bundles). The preview deck loads **once per picker session**; subsequent selections are postMessage'd into the embedded instance (`{__decklightPreview: {theme|gen}}`, parent-origin-guarded) and applied in place: no document reload per candidate, which matters in bundles where each reload would re-parse the whole payload. `⌃⇧T` **saves** the applied generated theme: prompts for a name (sanitized `[a-z0-9-]{1,40}`, `custom-` prefixed on collision with a shipped name), persists `{name → tokens}` into `localStorage['decklight-custom-themes']`, and downloads `<name>.css` (a normal theme file). Saved customs appear in the theme list and picker (tagged “custom”), survive reload, and apply via the same inline-style mechanism, but localStorage is per-origin/per-browser: **the downloaded .css is the portable artifact** (drop it into `themes/` and commit). Unsaved generated autonames are never persisted as the deck's theme choice.
|
|
592
760
|
- **Font cycling**: `[`/`]` walk a curated list of offline-safe system stacks (sans, rounded, humanist, geometric, two serifs, slab, mono; entry 0 = the theme's own type), then the deck's **font packages** (`FONTS`), applied to `--font-body` + `--font-heading` as inline root properties: they win over any theme and survive theme switches. The choice persists per deck path in localStorage, **by name** (a 0.9.0 pick was an index into the stacks and still restores), and is restored before the first layout pass, falling back to the deck's own default, its config's `font`; every change re-measures pinned titles and re-runs the overflow guardrail (type metrics differ). **Font…** (`/`) lists the same, each row in its own face, and **previews on the slide** as the selection moves: `⏎` keeps it, `Esc` or a click outside puts back the font you came with; a design system's `recommendedFonts` come first under **★ recommended by …**; while authoring, every font the registered marketplaces offer is listed too (○ / ● in the deck), previewable before it is referenced, and **Space** references it (`FONTS`). `instance.cycleFont(±1)` programmatically.
|
|
593
761
|
|
|
594
762
|
### PRESENTING_MODES · Write mode, no-trust mode, and what a deck may run
|
|
595
763
|
|
|
596
|
-
- **Write mode**: `decklight <deck.html>` (the deck is the command) serves the deck over localhost with live reload and accepts persisted edits from the player. **`--no-trust` is the same server's other mode** (the one described below): the routes that write are registered in both modes, and the mode gate refuses the whole write family (`/deck/edit/*`, the bridges, the review owner's half) with a 403 that names the mode, ahead of any route; the deck is served from its own directory under the CSP header, and the ingredients label runs before the first slide. `--strict`, `--check` and `--root` apply there; `--remote` applies in either mode. **A deck that embeds a runtime older than this install is named at startup** (`runtime:` row, write mode): it is served as it is, and its runtime probes routes the server may no longer have, gets a 404, and hides every write-mode affordance without a word, so the row says it may not wire up and names `decklight upgrade <deck>`; the comparison is `NO_TRUST#AUDIT`'s own (this install's bytes, or a version it cannot vouch for). **So is a project skill older than this install** (`skill:` row): every skill `decklight skills` or `init` writes carries the version that wrote it (`<!-- decklight skill 0.9.0 -->`, after the frontmatter and after the AGENTS.md marker), and a `.claude/skills/decklight/SKILL.md` or a marked AGENTS.md section whose stamp is older, or missing, is named with `decklight skills` as the fix, because the agent reading it reads an old contract and has no way to know. **On a terminal the fix is offered** before the server starts (`decklight <deck>`, write mode): the stale files are listed, the project's and every agent's global home alike (`~/.claude/skills/decklight/SKILL.md`, a marked `AGENTS.md` under `~/.codex` and the rest, whether or not that agent is on PATH today, since a file that was installed is a file something reads), and `update it now? [Y/n]` refreshes them with the command's own writers, so a refresh from the prompt and one from the command cannot differ; `n` is remembered for this version (`skill-prompt-declined` in the config home), so the question comes back with the next decklight and never at the next start, and off a terminal nothing is asked. `decklight skills` refreshes a skill older than the build without `--force`; one that is already this version is refused without it. **The mode is the run's**: `--no-trust` is decided when the deck is opened and never from the page, because a page that could grant itself write access would make the flag worth nothing for the deck it exists for, the one you did not write. **A deck that runs code of its own asks before it opens in write mode** (`cli/open.mjs`, `cli/trust.mjs`): with no flag, the ingredients label (`NO_TRUST#AUDIT`) runs first, every time. Zero findings, which is every deck that is data and every bundle whose runtime is this install's, opens in write mode. Findings are named in yellow, block by block, and on a terminal the question is asked: *do you trust where this deck came from?* Yes opens write mode and is **remembered against the bytes of that code** (`~/.decklight/trust.json`, `decklight trust list` / `forget`), so a changed script asks again and an unchanged one never does; no opens without trust, strict. Off a terminal nobody can answer and no trust is the answer that costs nothing; `--trust` says yes on the command line and is remembered too. The label decides nothing, because it cannot tell your script from a stranger's; only the person who knows the source can, and the question is theirs. **In write mode a theme pick is the deck's**: `T`, the picker's ⏎ and `,`/`.` write the theme into the file the way the deck carries it (`POST /deck/edit/theme { theme, quiet, from }`, `setDeckTheme`: the configuration block's `theme` for a deck that is data, the active `<style data-theme>` for a bundle, the `themes/<name>.css` link for a source deck), quiet and in place like a layout pick, with a `theme` event every other page follows; one undo entry. The cycle keys browse: the theme on screen changes on every press and the file is written once, 600ms after the presses stop, and only if the theme stopped on is not the deck's already; the picker's ⏎ is one deliberate pick and writes at once. A shipped theme or a marked one, which the server can serve as the deck's base; an unmarked marketplace theme stays a look until Space marks it, and a generated theme lives in the browser until it is saved. Without a server, or without trust, a pick is the viewer's preference, remembered in that browser and never written: freezing a watcher's pick into someone else's file would be wrong. **For your own deck, the lock is the one switch**: editing is on from the moment write mode answers, and the lock turns changes off, to avoid making one by mistake, and back on. It is the server's state (`POST /deck/edit/lock { locked }`, said by `/deck/ping` and by a `lock` event on the channel), so every tab and the agent see the same thing: locked, every `POST /deck/edit/*` but the lock answers 423, the bar goes, and the page shows a **🔒 locked** chip at the bottom left that unlocks on a click; the palette carries **Lock deck** / **Unlock deck**, and the bar's **Lock** button is the same switch. While locked `available()` is false, so the bar, the drawer's writes and every other author affordance say so. In no-trust mode `available()` is false too, and the probe says `locked`. **The server owns `/deck/`, and every other path is a file beside the deck.** That is the whole rule, for both modes: nothing decklight answers sits at the root, so no folder beside a deck (`voices/`, `review/`, `edit/`) is ever shadowed by a route, and a test pins it by the path literals in the server's modules. Under it, the families: `/deck/ping` is the one probe every served deck makes (one implementation, `cli/deck-routes.mjs`: in write mode it answers with what write mode offers, in no-trust mode with `noTrust: true`, `phone`, `container` and nothing that edits, and the page wires up accordingly), `/deck/events` is the stream every tab listens on (reload, lock and export events in write mode; the remote's taps in either mode; the upstream's news in no-trust mode), and `/deck/upstream*` is the upstream readout (`NO_TRUST#UPSTREAM`). `/deck/edit/*` is write mode's alone; `/deck/review/*` is the review's, the shared routes both modes' and the owner's write mode's (REVIEW); `/deck/remote/*` is the phone's, the one family `allowRemote` lets off loopback (`NO_TRUST#REMOTE`); `/deck/tts` and `/deck/tts/*` are the voice bridge and `/deck/lipsync/*` the lip-sync bridge on the deck's own origin (write mode; the prefix comes off on the way to the bridge, which serves its routes at its own root). Under `/deck/edit/`, a slide's own properties are `/deck/edit/slide/*` (`layout`, `hidden`, `notes`, `sources`, `slide-template`, and `POST /deck/edit/slide {op}` for the slide itself), one element's are `/deck/edit/element/*` (`source`, `content`, `effect`, `style`, `remove`, `image`), and the recorder's are `/deck/edit/narration/*` (`record`, `tracks`, and `POST /deck/edit/narration` to point the deck at a track). The marketplace routes use five verbs and no others: `browse` reads a catalog, `add` installs into the library, `mark` references from the deck, `apply` changes the deck's look, `insert` makes a slide. **A git URL opens the deck straight from its repository** (`cli/clone-deck.mjs`): the repository is cloned *in full* (its history is what `H` shows and what a restore needs, so a snapshot would open a deck with no past) into `./<repo>` (`--into <dir>` elsewhere, `--branch <ref>` a branch or tag), the deck inside is found (the one `.html` file that is a deck: a `class="decklight"` element, `isDeck`, so a deck that is data is found as surely as one that boots itself; two candidates are refused and listed, and `<url>#<path>` or a GitHub `…/blob/<branch>/<path>` link names one) and it proceeds as `decklight <that path>` with `--git` on, because a clone is a repository and not a question. A directory that already exists is opened only when it is a clone of that same remote, with no pull: the upstream check is what says if it is behind; anything else there is refused rather than written into. **`--no-trust` and `comments submit` take the same URL the same way** (`deckFromUrl`, one function): **one clone per repository, whichever command asked**: they clone to the same `./<repo>` and reuse it after, and a command run from *inside* that clone means this clone rather than `<repo>/<repo>`. A reused clone on another branch than the link names is reported, with the `git switch` to run, never switched. In no-trust mode the clone is the command's doing before any server exists (the server still writes nothing); it is what gives `H` an upstream to check, and what `comments submit` pushes the review branch to. `decklight <repository url>` with no command routes to `open`, as a `.html` file does. Only an explicit URL counts (`https://`, `git@`, `ssh://`, `git://`, `file://`): `owner/repo` shorthand is not accepted, because a mistyped `slides/q3.html` reads exactly like one and the honest answer to a missing path is "no such deck". Nothing here ever pushes. Endpoints: `GET /deck/ping` (capabilities: deck name, undo/redo depths, git state, detected agents, `agentBusy`), SSE `GET /deck/events` (`reload` on any file change; named `agent` events for job status; a named `notes` event `{ slide, aside, from }` instead of a reload when the change was a notes save, which every page puts in place), `POST /deck/edit/slide/notes {slide, text}` (answers `changed`: an edit that normalises to the notes already in the file writes nothing and says so, and the page reports "nothing to save" instead of waiting for a reload; the notes are written literally, so `$1`, `$&` and the like stay the author's text and are never read as replacement patterns), `POST /deck/edit/slide/layout {slide, layout, quiet?, from?}` (writes `data-layout` into the slide's `<section>` tag; `auto` removes it; a no-change write is skipped; with `quiet` the write is one the pages do themselves, as a notes save is: the watcher skips its reload and a `layout` event `{ slide, layout, from }` sends the pick to every other page, which puts it on the slide in place, because the page that picked the layout already showed it and a reload per keypress was the one thing picking a layout did not need), `GET /deck/edit/element/source?slide=&index=` (an element's outerHTML, read fresh from the FILE: never the live DOM), `POST /deck/edit/element/remove {slide, index}`, `POST /deck/edit/element/content {slide, index, html}`, `POST /deck/edit/element/effect {slide, index, effect}` (writes `data-build`; `effect: null` strips it), `POST /deck/edit/undo` / `POST /deck/edit/redo`, and `POST /deck/edit/agent {prompt, agent?}`. **The server binds `127.0.0.1` unless `--remote` asks for the LAN**, in either mode: off this machine only `/deck/remote/*` answers, with the per-run token (`NO_TRUST#REMOTE`), so a clicker widens the listener and never the edit surface. Without the flag the controller still answers on loopback and the QR refuses. **The voice and the face are saved settings, not flags**: `decklight setup voice --engine … --voice … --model … --stability …` and `decklight setup face --portrait … --veo …` write them once (`tts.json`, `lipsync.json`) and the bridges read them; `decklight <deck>` keeps only `--tts-engine` for one session and `--no-tts` / `--no-lipsync`, and refuses the 22 flags it used to pass through, naming where each went.
|
|
764
|
+
- **Write mode**: `decklight <deck.html>` (the deck is the command) serves the deck over localhost with live reload and accepts persisted edits from the player. **`--no-trust` is the same server's other mode** (the one described below): the routes that write are registered in both modes, and the mode gate refuses the whole write family (`/deck/edit/*`, the bridges, the review owner's half) with a 403 that names the mode, ahead of any route; the deck is served from its own directory under the CSP header, and the ingredients label runs before the first slide. `--strict`, `--check` and `--root` apply there; `--remote` applies in either mode. **A deck that embeds a runtime older than this install is named at startup** (`runtime:` row, write mode): it is served as it is, and its runtime probes routes the server may no longer have, gets a 404, and hides every write-mode affordance without a word, so the row says it may not wire up and names `decklight upgrade <deck>`; the comparison is `NO_TRUST#AUDIT`'s own (this install's bytes, or a version it cannot vouch for). **So is a project skill older than this install** (`skill:` row): every skill `decklight skills` or `init` writes carries the version that wrote it (`<!-- decklight skill 0.9.0 -->`, after the frontmatter and after the AGENTS.md marker), and a `.claude/skills/decklight/SKILL.md` or a marked AGENTS.md section whose stamp is older, or missing, is named with `decklight skills` as the fix, because the agent reading it reads an old contract and has no way to know. **On a terminal the fix is offered** before the server starts (`decklight <deck>`, write mode): the stale files are listed, the project's and every agent's global home alike (`~/.claude/skills/decklight/SKILL.md`, a marked `AGENTS.md` under `~/.codex` and the rest, whether or not that agent is on PATH today, since a file that was installed is a file something reads), and `update it now? [Y/n]` refreshes them with the command's own writers, so a refresh from the prompt and one from the command cannot differ; `n` is remembered for this version (`skill-prompt-declined` in the config home), so the question comes back with the next decklight and never at the next start, and off a terminal nothing is asked. `decklight skills` refreshes a skill older than the build without `--force`; one that is already this version is refused without it. **The mode is the run's**: `--no-trust` is decided when the deck is opened and never from the page, because a page that could grant itself write access would make the flag worth nothing for the deck it exists for, the one you did not write. **A deck that runs code of its own asks before it opens in write mode** (`cli/open.mjs`, `cli/trust.mjs`): with no flag, the ingredients label (`NO_TRUST#AUDIT`) runs first, every time. Zero findings, which is every deck that is data and every bundle whose runtime is this install's, opens in write mode. Findings are named in yellow, block by block, and on a terminal the question is asked: *do you trust where this deck came from?* Yes opens write mode and is **remembered against the bytes of that code** (`~/.decklight/trust.json`, `decklight trust list` / `forget`), so a changed script asks again and an unchanged one never does; no opens without trust, strict. Off a terminal nobody can answer and no trust is the answer that costs nothing; `--trust` says yes on the command line and is remembered too. The label decides nothing, because it cannot tell your script from a stranger's; only the person who knows the source can, and the question is theirs. **In write mode a theme pick is the deck's**: `T`, the picker's ⏎ and `,`/`.` write the theme into the file the way the deck carries it (`POST /deck/edit/theme { theme, quiet, from }`, `setDeckTheme`: the configuration block's `theme` for a deck that is data, the active `<style data-theme>` for a bundle, the `themes/<name>.css` link for a source deck), quiet and in place like a layout pick, with a `theme` event every other page follows; one undo entry. The cycle keys browse: the theme on screen changes on every press and the file is written once, 600ms after the presses stop, and only if the theme stopped on is not the deck's already; the picker's ⏎ is one deliberate pick and writes at once. A shipped theme or a marked one, which the server can serve as the deck's base; an unmarked marketplace theme stays a look until Space marks it, and a generated theme lives in the browser until it is saved. Without a server, or without trust, a pick is the viewer's preference, remembered in that browser and never written: freezing a watcher's pick into someone else's file would be wrong. **For your own deck, the lock is the one switch**: editing is on from the moment write mode answers, and the lock turns changes off, to avoid making one by mistake, and back on. It is the server's state (`POST /deck/edit/lock { locked }`, said by `/deck/ping` and by a `lock` event on the channel), so every tab and the agent see the same thing: locked, every `POST /deck/edit/*` but the lock answers 423, the bar goes, and the page shows a **🔒 locked** chip at the bottom left that unlocks on a click; the palette carries **Lock deck** / **Unlock deck**, and the bar's **Lock** button is the same switch. While locked `available()` is false, so the bar, the drawer's writes and every other author affordance say so. In no-trust mode `available()` is false too, and the probe says `locked`. **The server owns `/deck/`, and every other path is a file beside the deck.** That is the whole rule, for both modes: nothing decklight answers sits at the root, so no folder beside a deck (`voices/`, `review/`, `edit/`) is ever shadowed by a route, and a test pins it by the path literals in the server's modules. Under it, the families: `/deck/ping` is the one probe every served deck makes (one implementation, `cli/deck-routes.mjs`: in write mode it answers with what write mode offers, in no-trust mode with `noTrust: true`, `phone`, `container` and nothing that edits, and the page wires up accordingly), `/deck/events` is the stream every tab listens on (reload, lock and export events in write mode; the remote's taps in either mode; the upstream's news in no-trust mode), and `/deck/upstream*` is the upstream readout (`NO_TRUST#UPSTREAM`). `/deck/edit/*` is write mode's alone; `/deck/review/*` is the review's, the shared routes both modes' and the owner's write mode's (REVIEW); `/deck/remote/*` is the phone's, the one family `allowRemote` lets off loopback (`NO_TRUST#REMOTE`); `/deck/tts` and `/deck/tts/*` are the voice bridge and `/deck/lipsync/*` the lip-sync bridge on the deck's own origin (write mode; the prefix comes off on the way to the bridge, which serves its routes at its own root). Under `/deck/edit/`, a slide's own properties are `/deck/edit/slide/*` (`layout`, `hidden`, `notes`, `sources`, `slide-template`, and `POST /deck/edit/slide {op}` for the slide itself), one element's are `/deck/edit/element/*` (`source`, `content`, `effect`, `style`, `remove`, `image`), and the recorder's are `/deck/edit/narration/*` (`record`, `tracks`, and `POST /deck/edit/narration` to point the deck at a track). The marketplace routes use five verbs and no others: `browse` reads a catalog, `add` installs into the library, `mark` references from the deck, `apply` changes the deck's look, `insert` makes a slide. **A git URL opens the deck straight from its repository** (`cli/clone-deck.mjs`): the repository is cloned *in full* (its history is what `H` shows and what a restore needs, so a snapshot would open a deck with no past) into `./<repo>` (`--into <dir>` elsewhere, `--branch <ref>` a branch or tag), the deck inside is found (the one `.html` file that is a deck: a `class="decklight"` element, `isDeck`, so a deck that is data is found as surely as one that boots itself; two candidates are refused and listed, and `<url>#<path>` or a GitHub `…/blob/<branch>/<path>` link names one) and it proceeds as `decklight <that path>` with `--git` on, because a clone is a repository and not a question. A directory that already exists is opened only when it is a clone of that same remote, with no pull: the upstream check is what says if it is behind; anything else there is refused rather than written into. **`--no-trust` and `comments submit` take the same URL the same way** (`deckFromUrl`, one function): **one clone per repository, whichever command asked**: they clone to the same `./<repo>` and reuse it after, and a command run from *inside* that clone means this clone rather than `<repo>/<repo>`. A reused clone on another branch than the link names is reported, with the `git switch` to run, never switched. In no-trust mode the clone is the command's doing before any server exists (the server still writes nothing); it is what gives `H` an upstream to check, and what `comments submit` pushes the review branch to. `decklight <repository url>` with no command routes to `open`, as a `.html` file does. Only an explicit URL counts (`https://`, `git@`, `ssh://`, `git://`, `file://`): `owner/repo` shorthand is not accepted, because a mistyped `slides/q3.html` reads exactly like one and the honest answer to a missing path is "no such deck". Nothing here ever pushes. Endpoints: `GET /deck/ping` (capabilities: deck name, undo/redo depths, git state, detected agents, `agentBusy`), SSE `GET /deck/events` (`reload` on any file change; named `agent` events for job status; a named `notes` event `{ slide, aside, from }` instead of a reload when the change was a notes save, which every page puts in place), `POST /deck/edit/slide/notes {slide, text}` (answers `changed`: an edit that normalises to the notes already in the file writes nothing and says so, and the page reports "nothing to save" instead of waiting for a reload; the notes are written literally, so `$1`, `$&` and the like stay the author's text and are never read as replacement patterns), `POST /deck/edit/slide/layout {slide, layout, quiet?, from?}` (writes `data-layout` into the slide's `<section>` tag; `auto` removes it; a no-change write is skipped; with `quiet` the write is one the pages do themselves, as a notes save is: the watcher skips its reload and a `layout` event `{ slide, layout, from }` sends the pick to every other page, which puts it on the slide in place, because the page that picked the layout already showed it and a reload per keypress was the one thing picking a layout did not need), `GET /deck/edit/element/source?slide=&index=` (an element's outerHTML, read fresh from the FILE: never the live DOM), `POST /deck/edit/element/remove {slide, index}`, `POST /deck/edit/element/content {slide, index, html}`, `POST /deck/edit/element/effect {slide, index, effect}` (writes `data-build`; `effect: null` strips it), `POST /deck/edit/undo` / `POST /deck/edit/redo`, and `POST /deck/edit/agent {prompt, agent?, offer?, place?}`. **Before an agent edit runs, Decklight's skill is offered to an agent that does not have it** (an ask from the agent panel, an agent fix from Check deck… or the review, a Migrate, which adds its own skill to the offer): the agent's copy is looked for where it reads one, its config home's (`~/.claude/skills/decklight/`, a marked `AGENTS.md` under `~/.codex` and the rest) and then the project's, and when there is neither the route answers `{ choose: 'skill', agent, skills, places }` instead of running. The page asks where it goes, **every project** (the config home, recommended and selected), **this project only**, or **not now**, and posts the job again with `place: 'global' | 'project' | 'none'`; an install is `decklight skills [--global]` for that one agent, and Esc sends nothing. Not now is remembered for that project and agent (`skill-offer-declined.json` in the config home), so the next ask goes ahead without asking. Only a page that says it can ask (`offer: true`) is asked, so a script posting a job is never held up, and an agent decklight has no install for is never offered one. **The server binds `127.0.0.1` unless `--remote` asks for the LAN**, in either mode: off this machine only `/deck/remote/*` answers, with the per-run token (`NO_TRUST#REMOTE`), so a clicker widens the listener and never the edit surface. Without the flag the controller still answers on loopback and the QR refuses. **The voice and the face are saved settings, not flags**: `decklight setup voice --engine … --voice … --model … --stability …` and `decklight setup face --portrait … --veo …` write them once (`tts.json`, `lipsync.json`) and the bridges read them; `decklight <deck>` keeps only `--tts-engine` for one session and `--no-tts` / `--no-lipsync`, and refuses the 22 flags it used to pass through, naming where each went.
|
|
597
765
|
- **No-trust mode**: `decklight <deck.html> --no-trust [--port 8788]` plays a deck you did **not** write, and is the only way a `.decklight` container opens. It serves **the deck's own directory** (never the cwd) over `127.0.0.1`, with the same port-conflict handling as write mode (`listenTakingOverIfNeeded`). Everything under the served root is fetchable by the deck's own script same-origin, and with `connect-src https:` open (below), fetchable means exfiltratable. So the root is the exposure you accepted by opening the file, not whatever directory the command happened to run from (`$HOME` via file association, a project checkout with its sources). Two refusals are unconditional on top of that: **no path segment may start with a dot** (`.env`, `.git/config`: decoded or percent-encoded), and **no file type outside the server's MIME table is served** (a deck plays HTML, CSS, JS, JSON, images, fonts, audio and video; `id_rsa` or a `.pem` beside a travelled deck is only ever fetched to be exfiltrated). **The runtime a deck links is served from the installed package** (#517): a request for `decklight.js`, `decklight.css` or `themes/<name>.css` that has no file beside the deck, or that reaches outside the served root, as a source deck's `../dist/decklight.js` does, is answered from decklight's own `dist/` and `themes/`, so a deck that carries only its slides plays under `open`, `--no-trust` and every render (`pdf`, `pptx`, `video`, `shot`) with no copy of the runtime beside it. **A deck that carries no reference at all**, the data shape (`DECK_ANATOMY`, #520), has those three references written into the page on its way out, by every server alike (`staticFiles`; no-trust mode applies the same function to the deck it serves from memory, after the audit has described the file): the stylesheet and the block's theme at the end of `<head>`, the engine before the first script that executes or else before `</body>`, never a second reference on a deck that has one. In write mode the deck also reaches the bridges on its own origin: `/tts` and the routes the runtime derives from it are proxied to the voice bridge, `/lipsync/*` to the lip-sync bridge (`--tts-port`, `--lipsync-port`), a missing bridge answering 503, which the deck takes as no bridge at all. Because the deck reaches them through `open`, `open` is the one place a bridge may **move**: when its port is held by a program that is not a decklight bridge (another project's dev server on 8787 is the usual case), it takes the next free port no other service of the run uses, the server is told where to forward, and the banner says who holds the port and where the bridge went. A decklight bridge already on the port is reused, never moved, and the banner says so on the bridge's own row, green (`✓ voice the say voice bridge is already on :8787 — using it`): the bridge that stood aside exited on purpose, and nothing calls that a degradation. A service that exits for any other reason is a red row in the same place (`✗ voice exited (1) — carrying on without it; the deck degrades on its own`), and a second session whose edit port is taken gets a yellow `port` row first (`! port 8788 has another decklight editing "deck.html" — this one is on 8790`) once the question has been answered, in place of two loose lines above the banner (`describePortOutcome`; `resolvePortConflict` takes an `outcome` for the caller that says it this way, and prints its own lines otherwise, which is what a bridge or an edit server run alone still does). A bridge run alone (`decklight tts`, which `decklight <deck>` starts and the help no longer lists) still refuses rather than move, since a deck opened from disk assumes its literal port. The live-voice engine picker tells the two failures apart: a `/tts/engines` 404 from something that answers `/tts/ping` as a decklight bridge is an old bridge (*predates the engine picker*), and from anything else it is *another program answering on the voice bridge's port*. A copy that IS beside the deck wins; nothing else escapes the root or answers for a missing path, so a probe still learns nothing from a 404. A **source** deck whose *other* assets are not siblings, images or casts kept a directory up, still needs **`--root <dir>`**: the deck must live under it, the same dotfile and file-type rules still apply, and the wider exposure is a flag someone typed and a directory startup prints, never a default. GET only, except the phone remote's own `POST /deck/remote/{key,pos}` (`PRESENTING_CHROME`). It exists because a deck travels: code inlined into one runs in front of an audience that installed nothing, and a deck opened over `file://` gets no policy at all. Serving it instead buys a **`Content-Security-Policy` HTTP header**, which the document cannot override the way it could a `<meta>` tag an attacker edited in the same pass as the payload. The header rides on **every** response the server writes (the deck and its assets, but also the error pages, the control-channel JSON and SSE, and the remote controller), set at one seam ahead of the routes, so the coverage holds by construction rather than by each route's `writeHead` remembering. The policy is `default-src 'none'` plus exactly what a SPEC'd deck needs: `media-src`/`connect-src` reach `https:` (a recorded track's `dir` may be an absolute URL, background video stays external, and a manifest track's presigned URL has no knowable origin to pin), `frame-src`/`frame-ancestors` are `'self'` (the theme picker, slide finder and speaker view boot the deck into same-origin iframes), `style-src` allows inline (themes are inline `<style data-theme>` blocks and the engine writes inline custom properties), and `object-src`/`base-uri`/`form-action` are `'none'`. `script-src` must allow inline (a bundled deck **is** inline script), so the header does not stop a deck from executing; it constrains where that execution can reach. Naming what runs is `NO_TRUST#AUDIT`, removing it is `NO_TRUST#STRICT`. **The write family refuses**: `/deck/edit/*`, `/deck/tts*`, `/deck/lipsync/*` and the review owner's routes are registered in both modes, and in no-trust mode the gate ahead of the table answers every one of them 403 `{ noTrust: true }` before a body is read or a route runs. Nothing in this mode writes a file but the review sidecar. **The deck itself is served from the audited in-memory bytes** (a container's verified payload slice and a plain `.html` alike), so a file edited on disk after startup can never ride out under the verdict already printed and read; every *other* file under the root is read per request, because the ingredients label is an inventory of the deck, not of the directory. The watcher never reloads in this mode; entering it re-runs the audit and re-prints the verdict, never silently serving new bytes under the old one. The bridges are refused with the write family: live synthesis is a write-mode engine, and recorded narration needs no bridge. **The phone remote** (`NO_TRUST#REMOTE`) is the server's in either mode. `--remote` widens the **listener** only: off this machine **only `/deck/remote/*` answers**, and only carrying the per-run token the printed URL and its QR embed; the deck itself and every file beside it stay unreachable from the LAN whether or not the flag is passed. `allowRemote` is one classifier for both modes. The deck discovers the mode via **`GET /deck/ping`**, whose read-only answer carries no agent roster and no edit capability because nothing that edits answers, and subscribes to **`/deck/events`**, which in this mode carries the remote's taps and the upstream's news and never an unnamed `reload`: the watcher does not reload a deck served from audited bytes. The runtime wires this in its own path rather than through the edit path with a flag; `editAvailable` stays **false**, so `A`, the undo chord and layout picks all still say they need write mode. Without `--remote` the QR **404s rather than encoding `127.0.0.1`** (a code that scans cleanly and goes nowhere is worse than no code) while `/deck/ping` and the position readout still answer, because those are loopback business.
|
|
598
766
|
- **Upstream updates** (`NO_TRUST#UPSTREAM`; a deck in a clone only). When the presented deck is a **tracked file in a git work tree whose branch has an upstream**, no-trust mode checks that upstream: every 10 minutes by default (`--upstream-every N`; **`0` stops the timer and keeps the manual check**, `--no-upstream` turns it all off; `CI` and `DECKLIGHT_NO_UPSTREAM_CHECK` suppress it, and the reason is a string a test can read). The check is `git fetch` with no refspec plus `rev-list --left-right --count @{upstream}...HEAD`: **no name, path or refspec derived from anything is ever a git argument**, prompts are off (`GIT_TERMINAL_PROMPT=0` plus `ssh -oBatchMode=yes`), and hooks, `fsmonitor`, submodule recursion and `gc` are disabled: decklight is not the presenter typing `git pull`, and it must not run local scripts in the middle of a talk. Every outcome is a **named state**, and a fetch that failed is **never** reported as up to date: like a signature that could not be checked, "unchecked" is its own answer and never a pass. **The gate that carries the safety is `untracked`**: anyone whose `$HOME` is a repository has every deck in `~/Downloads` "inside a clone", so the deck must be a file that repository actually versions. With **`--upstream-pull`** the server also registers `POST /deck/upstream/pull`, which **takes no parameter of any kind** (the body is not read), only ever runs `merge --ff-only @{upstream}` against the repository resolved at startup, and refuses unless the branch is strictly behind with a clean tree. It is **not registered at all** without the flag, without an upstream, or with `--remote` on: a phone must never move somebody's repository. It is gated on the request's **exact own origin**, which is stricter than `/deck/edit/*`'s: that one admits `null`, and `null` is a **sandboxed plugin frame**'s origin. **A pull re-runs the audit and re-prints the verdict**: the payload, the label and `strict` are recomputed and printed, bracketed by the sentence saying the new label replaces the old one, which is this section's own stated condition on live reload. `strict` **ratchets**: a pull may turn it on and never off, or a deck could disarm the one mitigation `--no-trust` applies unasked. When the new bytes carry findings the old ones did not, the deck is swapped but **not reloaded**: swapping executes nothing, so the reload waits for a second confirmation naming what was found. **The page reloads itself; the server never tells it to**: `/deck/events` still carries no `reload` in this mode, because the prohibition was never about the word: a server that can move a deck that did not ask is an editing server with the writes left out, and that capability is not created here. **Why this is still not an editing server, and where the argument stops**: nothing here originates content: the server cannot write a byte that did not already exist in a commit on a remote the presenter chose to clone, cannot rewrite history, cannot create a commit, and accepts nothing from the request; and a deck you were emailed is a single file with no repository, so none of it is ever registered. What is honestly given up: while the route exists, **any script in the deck can call it**, because a page's own script is indistinguishable from its user server-side. So a deck served from a clone can update itself to any commit its upstream offers. That is why the route is a flag someone typed, why every pull is printed, and why the re-printed label is not optional.
|
|
599
767
|
- **Ingredients label** (printed by every no-trust start, before the first slide renders; `decklight <deck> --no-trust --audit` prints it and exits instead of serving). A decklight deck's shape is predictable (content is HTML, themes are CSS, charts and casts are JSON read by the runtime), so the executable surface is short and everything else that executes is worth naming. The label states: the embedded runtime's banner version and the first bytes of its SHA-256, compared against the build this install ships (**three-valued**: `identical to this install` / `DIFFERS from this install's build of X` / `not comparable here` when the deck carries another version: a package can only vouch for the build it has, and calling an older release a mismatch would read as an accusation); the inert counts (JSON data blocks (casts, viseme sidecars, voice manifests, narration audio) plus `<style data-theme>` blocks, templates, and the `Decklight.init` call); and then **every unaccounted script block, named with its line number, byte size and opening line**. Script blocks are not the whole executable surface (the `'unsafe-inline'` a bundled deck forces into `script-src` also lets an inline handler and a `javascript:` navigation run), so the label names **executable attributes** on their own lines, with the same coordinates: any `on*=` handler attribute carrying a value; any URL attribute (`href`, `src`, `action`, `formaction`, `xlink:href`, `data`) whose value resolves to `javascript:` or `data:text/html`: resolved the way a browser would read it, character references decoded and scheme whitespace stripped, so `javascript:` does not pass on spelling; and any non-empty `srcdoc`, an inline document that inherits the deck's CSP. A handler *mentioned* in prose, an HTML comment, an escaped code sample or the runtime's own strings is not a handler on a tag and is not named: comments and script/style text are masked before the tag scan, offsets preserved. When there are none, the label says `0 inline handlers or executable URLs in attributes` out loud, because the zero line is what states this class of content was examined at all. Accounted for = the runtime (by `data-decklight-runtime`, or the unmarked block defining `Decklight` before the init call: the same locator `upgrade` uses, so the two commands never disagree about which block is the engine), a `src=` naming `decklight.js`, `type="application/json"` or `text/template` data, and a `<script>` whose entire body is one `Decklight.init(…)` call. That last one is matched by **shape, not by mention**: `Decklight.init(); fetch('//evil')` mentions it too, so the call's parentheses are walked (skipping string literals) and anything after the closing paren but a semicolon disqualifies it. A source deck's runtime lives in a separate file the audit never sees, and the label says so rather than reporting a hash it did not compute. A deck that is data (`DECK_ANATOMY`) carries no runtime and, with no author script beside its slides, no script at all: the label's strongest line, `no script in this file — the runtime is the one this install serves (X); written for Y`: presenting someone else's deck means running *your* runtime against *their* content, and the version the block records is compared the way a linked deck's is. **It is an inventory, never a verdict**: no "safe", no check mark, no score. The scan is a heuristic over a file someone may have edited, and a green mark would promise more than the mechanism can keep; a list of what will run promises nothing and is still what you needed. `--check` exits non-zero on any unaccounted block or executable attribute, which means "this deck executes something I could not account for", not "this deck is malicious". The crypto path, a signature over the whole file, is `INTEGRITY#SIGNING` and is deliberately separate: this audit needs no signature, no network, and no cooperation from whoever produced the file.
|
|
@@ -605,15 +773,618 @@ slide. The chapters were visible, but they organised nothing.
|
|
|
605
773
|
|
|
606
774
|
### PRESENTING_EDITING · Editing a deck in the browser
|
|
607
775
|
|
|
608
|
-
- **Editing** (write mode, on by default; `src/core/editbar.js`). Write mode has always had several ways to change a deck, each learnt on its own: a double-click, a drop, `L`, `S`, a right-click menu, five palette rows, `Z`. (Bare `L` and `Z` have since gone: a stray press while presenting changed the file, so layout is the bar's button and undo is the platform's chord.) Editing is on from the moment write mode answers, and the bar gives it one face; the lock (above) is what turns it off, and there is no key for either. **The bar**, along the bottom of the deck, names every door with the key it stands for: **Text** (⏎), **Picture** (a file chooser, placed as a drop would be, after the selected element or last on the slide), **Layout · auto** (the button names the layout the slide has; ⇧-click cycles backwards), **Notes** (`S`), **Slide ▾** (new, duplicate, move up, move down, delete), **Undo** (`⌘Z` / `Ctrl+Z`), **Redo** (`⌘⇧Z` / `Ctrl+⇧Z`), **Lock** (locks the deck: the bar goes, the 🔒 chip unlocks). **The bar hides**: the palette's **Hide the bar** / **Show the bar** row takes it off the screen and brings it back, remembered per deck, and fullscreen hides it on its own, the commit chip with it (in write mode fullscreen is a rehearsal, not an edit, and a rehearsal screen says nothing about git); hidden, editing stays on and every door the bar names still works, because the bar is a surface over them. **The bar moves**: a grip (⠿) at its left edge drags it anywhere on the stage, which is where it goes when the bottom of a slide is where the content is; the place is remembered per deck as fractions of the stage, so it survives a resize, and a double-click on the grip puts it back at the bottom centre. **Selection**: while editing, a click on an element selects it, outlined, with a ⋯ handle at its corner that opens the element's menu by left-click, and the pointer outlines, more faintly, what a click would select. **Inside a diagram the selection is a node** (`src/core/pick.js`): a click selects the deepest drawn node under the pointer (a shape, a wire, a label; a label's line selects its whole `<text>`), the diagram's empty canvas selects the `<svg>`, and a chart stays one block. SVG takes no CSS outline, so the node is framed by a box drawn over it, which follows it when the stage reflows (a panel docking) or a build moves it. A shape under the pointer is **boxed by a dashed line in the theme's accent** (the yellow of Eclipse, the mint of Aurora) and **glows** (a drop-shadow that follows its outline), and the stage around it dims a little, by one box that lets every pointer event through. Nodes the engine or a template added are never picked. With something selected, `⏎` edits it in place when it is text (as a double-click would) and opens its menu when it is not, `⌫`/`Delete` removes it (one undo entry, the undo chord takes it back; a node selected inside a diagram goes alone, by `POST /deck/edit/element/remove` `{ slide, index, path, tag }`, its line with it when it stood alone on one, a path that lands on another tag a 409), `Esc` lets it go; the arrows still move between slides, and moving on lets the selection go. The bar writes nothing itself: every button and key goes through the route the gesture or the menu already used, so each lands on the same undo stack. The right-click menu, the double-click and the drop are unchanged; the bar is a surface over them, not a second path. **The slide number** sits at the top right while editing is on, `3 / 12` in the theme's accent on the theme's background, above the commit chip, which steps down under it with the clock; it goes with the lock, and fullscreen hides it as it hides the chip. **A text, code or label save is written in place**: the page that saved keeps what it typed (a code block is rendered again from its new source, highlighted and lined), the slide is rescanned and laid out again, and nothing reloads; the write is quiet (`quiet: true, from`, as the colour card's and the notes drawer's are) and every other page of the deck is sent a `content` event and reloads for the new words. The undo chord takes it back with the ordinary reload. Off a print, an embedded view and a capture, the bar does not appear. The palette carries **Lock deck** and, locked, **Unlock deck**. **The element menu**: with editing on, right-clicking the current slide, or the ⋯ handle on a selection, opens it. Right-clicking a specific element (found by walking up from the click to the section's direct child that contains it, so a click anywhere inside a bullet list or a chart still resolves to that top-level element, and inside a diagram to the node under the pointer as a click would select it) opens a menu about that element: Inspect, Remove element (inside a diagram *Remove this rect* and *Remove the whole svg*), Edit content (HTML), Colors…, Type…, Copy style and Paste style (below), Concept ▸ (on a diagram shape, `SVG_DIAGRAMS`), Add text effect ▸, Slide ▸. No notes row on an element, HTML or SVG: the notes are the slide's, and the background right-click, `S`, the bar's Notes and the palette open them. Right-clicking the bare slide background (nothing under the cursor but the `<section>` itself) shows Edit speaker notes and Slide ▸. Elements are addressed by **raw position among the slide's direct children** (`[...section.children].indexOf(el)`, title included, never filtered as chrome the way the engine's own `splitContent()` filters a *live* DOM): no per-element ID scheme, so a hand-authored deck needs no new markup to become editable. `tools/deck-html.mjs`'s `sectionChildRanges()` is the walker the server-side transforms share with `locateSlide`: it treats `<script>`/`<style>` bodies as opaque (a chart's embedded JSON is not markup) and nests by genuine recursion rather than a same-tag-name counter, so self-closing SVG children and same-name nested tags still resolve correctly. "Edit content (HTML)" reads the element's outerHTML fresh from the **file** via `GET /deck/edit/element/source`, never the live DOM, which the engine mutates in place (pinned-title classes, namespaced SVG ids, chart/code/math subtree replacement), in the same textarea-and-⌘⏎-saves shape as the notes editor, syntax-highlighted by a painted layer behind the textarea that shares its every metric (font, wrapping, padding, so a 400-character line wraps where the caret wraps and the paint scrolls as far as the text does, #529), opened at the top of the source with the caret first. **The editor docks** (#530) (float, left, right or bottom, the review and sources panels' placement (`dock.js`), remembered per deck under its own key): docked, nothing is dimmed, the stage reflows away from the gutter and the text area fills it, the element under edit keeps the outline a double-click edit gets, and the deck's keys work whenever the caret is not in the textarea; `Esc` and the × close, `⌘⏎` saves and the reload re-opens nothing, so the placement is met again on the next open. **Every editor read and write is bounded** (`boundedFetch`, 8s): Chrome gives a plain-HTTP origin six sockets shared across all its tabs, and each tab of the deck pins one to `/deck/events` for live reload, so with enough tabs open a further fetch queues in the browser and never reaches the server: it neither answers nor rejects. Unbounded, the content editor sat on `loading…`, disabled, with Esc the only way out; bounded, the stalled request fails through the same toast as any other error (`no answer in 8s — close other tabs of this deck and retry`). Reads and writes that can honestly take long (an agent run, an export, a publish) are not bounded. **"Colors…" recolors the shape under the click and the text on it**, in the inspector: the menu's *Inspect*, *Colors…* and *Type…* select what the menu was opened on and open the inspector on its Info, Colors or Type tab, so restyling is one panel, beside the facts about the same node (`src/core/colorpicker.js`): the one row that looks *below* the top-level element, because in a diagram the thing you point at is a box, not the `<svg>`. In a diagram the background is the shape's `fill` and the text is the `<text>` sharing its `<g>` (the one-group-per-box convention; a shape loose on the canvas takes the labels whose centre falls inside it, and right-clicking the label finds the same pair from the other side); anywhere else the element is a box in the CSS sense (the click climbs out of inline runs and out of a highlighted `<pre>`) and the two colors are its `background-color` and `color`. A **Fill | Stroke | Text** switch says which a pick lands on: the fill, the text, or the shape's border (#717), its `stroke` (a box's `border-color`), with a **Width** row beside the Stroke side, a slider and a number in px that preview as they move and land in the same save as the colour (`stroke-width`, unitless as SVG reads it; `border-width` in px on a box), and the card has **two tabs, deliberately**: **Theme** is the applied theme's own palette read live off the token contract (`THEMING`) and *named*: **Primary** (`--accent`), **Secondary** (`--link`, offered only where the theme's links are not simply its accent: one color gets one name), On primary, Heading, Text, Muted, Background, Background alt, Block, the six numbered diagram fills and the diagram inks; a token the theme does not define is left out rather than shown as a dead swatch, the swatch the target already carries is marked, and a pick writes the token **by reference** (`fill: var(--d-fill-3)`, never the hex it resolves to today), so a recolored box still follows `T` to the next theme, still takes its panel's nested tone (`SVG_DIAGRAMS`) and still answers to the theme gates. A deck that uses a **design system** (`DESIGN_SYSTEMS`) gets one more group per design system after the theme's (a palette of scales, one row per colour, its weights in order, and a deck held to its brand no Custom tab: `BRAND_PALETTE`), in the order the deck references them, from its meta block's `palette`, headed `<title> · <group>` (just `<title>` for a one-group palette), each swatch under the design system's own label, painted from the page's live token and dropped when the page leaves the token undefined, and a pick there writes the token **with one hex fallback**, `var(--acme-blue, #0056f9)`, the hex being what the token computed to at pick time: the token is the design system's, not the theme's, so the box keeps its brand colour through `T`, and still has it if the design system goes missing. The marked swatch is matched on the token, never on a fallback that may have gone stale. A deck with no design system shows exactly the theme's groups. **Custom** is a literal color (**RGB** or **HSB** sliders with typed values, and a hex field that reads what people paste (`ffb319`, `#fa0`)) opening on the color the target has now; it is a separate tab because a literal is exactly what stops following the theme, and reaching for it should be a decision rather than the default. Every pick **shows on the slide and is saved at once**, the way DevTools applies a style: one POST and one undo entry a pick (a slider previews while it is dragged and saves when it is let go, a typed value when it is entered), the saves made one after another in the order picked, and a save the server refuses puts the slide back to what was last saved, with a toast; there is no Apply and no Cancel, and the undo chord is the way back. **Reset** takes the colour set here back off, and saves that. It docks wherever the inspector does, and a key pressed inside it stays in it; docked along the bottom it lays the switches in a column beside the palette. Each save is one `POST /deck/edit/element/style` `{ slide, index, edits: [{ path, tag, prop, value }], quiet: true, from }`, **written in place**: the page that picked already shows it, so the server's write is quiet (no reload, the inspector stays open on the node) and every other page of the deck is sent a `styles` event and reloads; without `quiet` the route still answers with the ordinary reload. The edits of one save are **one undo entry**: `path` is the element-child path below the top-level element counted the way the *file* counts (nodes the engine added, a draw build's `.draw-head`, are skipped), `tag` is what the page found there, and a path that lands on a different tag in the file (generated content such as a chart, or a deck that moved on) is refused with a 409 rather than recolored. Only the open tag's `style` is touched, textually: `viewBox` and every other attribute survive byte for byte, and because the value lands inside an attribute the server writes **only** `fill`, `color` or `background-color`, set to a `var(--token)`, a `var(--token, #hex)` (one hex fallback, nothing nested), or a hex, or removed (`null`; an emptied `style` goes with it). **The Type tab** is the editor's other half, and the element menu's **Type…** row opens the inspector on it: the text the card would colour (a diagram's label, a block's own text) gets a **Size** (a slider and a number, 8–160 px, in deck units, since the stage is scaled and the text is not), a **Weight** (Regular 400 to Heavy 800), a **Font** that is one of the theme's three roles by reference (`var(--font-heading)`, `var(--font-body)`, `var(--font-mono)`; a role the theme leaves undefined is offered disabled), never a family name, so the text still follows `T` and a deck's marked fonts (`FONTS`), **Italic**, and **Align**, which is `text-anchor` (start, middle, end) on a diagram label and `text-align` (left, center, right) on a block. The rows open on what the text has now, the role read from its authored `font-family` or matched against the theme's; every change shows at once and is saved as it is made, like a colour; **Reset** on the Type tab takes all five back off, to what the theme or the markup gives (a presentation attribute such as `font-size="14"` is never touched: the style declaration overrides it, and removing the declaration hands it back). The server writes each of these in one closed shape only: `font-size` as `N px` (1–999, one decimal), `font-weight` in hundreds, `font-family` as exactly one of the three role tokens, `font-style` `normal` or `italic`, `text-anchor` `start`/`middle`/`end`, `text-align` `left`/`center`/`right`; anything else is a 400. **Copy style and Paste style** (`src/core/style-clip.js`) put one shape's look on another, the format painter every slide tool has: the element menu's two rows, `⌥⌘C` and `⌥⌘V` on a selection (`Ctrl+Alt+C` and `Ctrl+Alt+V` elsewhere, Keynote's and PowerPoint's chords, read by key position because `⌥` turns the C into a ç), and the palette's *Copy style* and *Paste style* while something is selected. A style is exactly what the Colors and Type tabs write and nothing more: the fill, the border and its width, the text's colour, and the type the source sets (size, weight, font role, italic, alignment). It is copied **by role**, so a diagram box pastes onto an HTML box (fill to `background-color`, stroke to `border-color`, a label's ink to `color`, `middle` to `center`); a size crosses only between two of the same kind, since a diagram's px are its viewBox's. A colour the source's markup writes is copied as written, a token **by reference**, so the paste still follows `T`; a colour it only inherits is copied as what it looks like, the paste first taking the target's own value off and keeping that when the target then looks the same, else writing the hex. A diagram shape's authored fill is read from its `data-nest-fill`, not the nested tone the engine painted over it. **A shape in a concept pastes its concept** onto a diagram shape, not the concept's colour, and a plain style pasted onto a concept shape takes it out of its concept, since the concept would paint over the fill: the route carries the change as `concept: { path, tag, value }` beside the edits, written in the **same** `POST /deck/edit/element/style` and so **one undo entry**. The paste shows at once and is written in place (`quiet`), a refusal puts the slide back, a paste that would change nothing writes nothing (*already that style*), and `⌥⌘V` with nothing selected says to select a shape first. The clip is remembered per browser (`decklight-style-clip`), so it outlives a reload and reaches another deck in another tab. "Add text effect ▸" drills into a submenu offering the spec's 7 entrance styles (`MOTION`) plus `none` (an explicit, instant build step, one more advance still reveals the element, it just carries no animation, which is why it is distinct from "remove effect", the separate action that strips `data-build` entirely). Remove / edit-content / add-effect all land on the SAME undo/redo stack as layout and notes edits, through the same `applyEdit`. **Two gestures need no menu** (`src/core/authoring.js`): with editing on (locked, a double-click on text changes nothing), a **double-click** on a text element (headings, paragraphs, list items, quotes, cells; never generated content such as charts, math, terminals, or an aside) edits it in place, `⏎` saves and `esc` gives up. A diagram's label is text too (`SVG_DIAGRAMS`). **Emphasis while editing**: `⌘B`, `⌘I` and `⌘E` (`Ctrl` on Windows and Linux) wrap the selection in `<strong>`, `<em>` or `<code>` and take it off again, and a pill above any selection offers the same three to the mouse; the file gets the semantic tag, never the `<b>` or `<i>` a browser's own bold command writes, so a theme's rule for `strong` (the heading colour) is what the emphasis looks like. The save fetches the element's SOURCE through `GET /deck/edit/element/source`, changes the one node the click landed on by the same element-child path in both trees, and posts the whole top-level element back through `POST /deck/edit/element/content`, so the file's own markup survives around the words that changed. **A code block is edited as its source text, never its rendered DOM:** double-clicking a `pre > code` reads the element's source from the file and shows the code plain (`contenteditable="plaintext-only"`): code.js has highlighted it into spans and wrapped every line, and writing that back would put the spans in the deck. Enter is a newline, `⌘⏎`/`⌃⏎` or clicking away saves, Tab indents, Escape gives it up. The save changes only the `<code>`'s text (attributes such as `data-lines` and the `language-` class untouched, the file's own newline after `<code>` and before `</code>` kept, `<`/`>`/`&` escaped) through the same `POST /deck/edit/element/content`, so the undo chord takes it back. Escape puts back the very `.code-line` nodes that were shown rather than re-parsing them, because a `data-lines` build steps through references to those nodes. **Dropping an image** onto a slide uploads it through `POST /deck/edit/asset` into `assets/` beside the deck (a safe lowercased name, the extension from the content type; an SVG carrying a script is refused) and places `<img>` after the element under the cursor, or last on the slide, through `POST /deck/edit/element/image`. **The slide as a whole** (new, duplicate, delete, move up, move down) is the palette's five `Slide:` rows and the menu's `Slide ▸` submenu, each one `POST /deck/edit/slide` `{op, slide}` and one undo entry; **the overview (`O`) is where a deck is rearranged**: in write mode every cell drags to a new place (`{ op: 'move', slide, to }`, the slide ending up at `to`, one undo entry however far it went; dropped on the left half of a cell it lands before it, on the right half after it, and a drop that changes nothing asks for nothing), each cell carries **+** new after, **⧉** duplicate and **🗑** delete on hover, and the selected cell answers `N`, `D` and `Delete`. Without an edit server the overview is the picture it always was: no tools, nothing drags. The write reloads the page, and the overview reopens on the slide the server named, so a second drag follows the first without pressing `O` again; a deck keeps at least one slide, and the answer names the slide to land on after the reload. A slide with no per-element source mapping declines the whole menu rather than opening one that cannot honestly save anything: markdown-authored slides (`data-markdown`, removed in 0.3.0, above) are the one case of this today, marked `data-markdown-removed` at parse time. The menu is the first **cursor-anchored** overlay in the engine: every other one dims the screen and centers a card; this one keeps a transparent backdrop (dimming would hide the very slide the menu is about) and positions the card at the click, clamped to stay on-screen. It still reuses the shared `closeOnBackdrop`/`selectInList` machinery: arrow keys navigate, `Escape` and a backdrop click both close it, exactly like every other overlay.
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
- **Git autocommit**: with `--git` (or automatically when the deck already sits inside a repository; `--no-git` opts out) the server keeps the deck safe and lets you say when it enters history. **The cadence no longer commits.** It used to, every `--commit-every` seconds, and what that produced was a column of `decklight: autosave deck.html` in which no commit marked anything: a backup wearing a history's clothes. The two jobs are now separate. The **backup** is a silent snapshot: every 30s the deck's current bytes are written to `refs/decklight/wip`, a real commit object parented on HEAD and reachable by that name and nothing else: not on your branch, never in `git log`, never pushed, and deck-only (it is built with plumbing rather than `git stash create`, which would sweep in a co-worker's unrelated working-tree changes). A crash costs `git show decklight/wip:<deck>`, not an afternoon. The **history** is yours: decklight asks, **once per stretch of uncommitted work**, and commits when you answer. The ask is a small chip in the deck (`K`, or click it). **The chip is also where the state of the work is read**: it is on screen, quietly, the whole time the deck differs from its last commit (*12 lines since the last commit — K commits*), led by the slides it changed, added and removed in the window's colours with a zero left out (*●1 changed ●1 added · 12 lines since the last commit — K commits*; a change that is only review records touches no slide and reads as before), so what has changed and how to keep it are answered without opening History, Commit or Restore; it is absent when nothing has changed or there is no git to write to. It turns into the ask (*12 lines uncommitted · 5m — K commits*, at full strength) when the work has sat for 10 minutes **or** grown past 40 changed lines, whichever comes first, and then stays quiet however long it sits or however large it grows until a commit resets the episode; an unanswered nag is an answer, the same rule the unpushed-work toast keeps and for the same reason: a nudge that reappears on a timer is one people turn off. `K` opens the commit window, or **⌘K / ⌃K**, which is the shortcut JetBrains has meant by "commit" for twenty years and the one place the deck's no-modifiers rule is bent: it is handled above the typing guard, so it reaches you mid-sentence in the notes editor, and the message box lets it back out again so the key that opened the window also closes it. What the window holds: what changed, in lines and **in slides** (*3 slides: 1 changed, 1 added, 1 removed*, each count in its colour, amber, green and red, a zero dimmed; slides are matched against HEAD the way a diff matches lines, identical ones kept in order and, between two kept ones, an old and a new paired as one slide edited only when they share their heading or half their lines, so a slide swapped for a different one is one removed and one added, never an edit), a message box, and one button, with **⌘⏎ / ⌃⏎** to commit, the convention VS Code and every GUI client share; **write them for me** asks the agent for the commits the uncommitted work makes (on a click, or the moment the window opens with `--commit-messages`) and it never overwrites what you have already typed, because a proposal that eats your sentence is not one. **The proposal is one commit or several** (`cli/commit-split.mjs`): the deck's diff against HEAD is cut into **units** at zero context, one per hunk, each named by the slides it touches (`slide 3`, `slides 3-4`; past 40 hunks, the hunks of one slide travel together), and the agent is asked to group them, one commit per separate idea, replying `<numbers> | <subject>` a line. Every unit lands in exactly one commit (one named twice stays with the first, one forgotten joins the commit of the unit before it), and an answer with nothing usable leaves the deck as one commit for the author to name. One commit fills the message box as before; several replace it with **a row per commit**, its subject editable and where it lands beside it, a **one commit** button that sets the proposal aside (its first subject offered in the box), and **Commit all N**. **Each row has a tick**, on to start with: an unticked commit is left out (*Commit 2 of 3*, and nothing at all with none ticked), its units staying uncommitted in the working file while the ticked ones are built on HEAD without them, so a change not ready yet need not ride along with one that is. The plan is still normalised whole, so a unit the agent forgot joins its neighbour's commit and stays out with it when that one is unticked. What was left out comes back: the server re-cuts it against the new HEAD (a `-U0` hunk carries its own lines, so it is found again by its text) and the window stays open with those rows, their subjects kept, ready to commit then or later; when they cannot be matched the window offers *write them again*. The review sidecar is never sent to the agent: its units are a commit of their own, the last, with the subject its records give (below). The commits are built in a **private index** (`read-tree`, `update-index`, `write-tree`, `commit-tree`), so what the author staged by hand stays staged and out of them; commit *k*'s deck is HEAD's deck with the units of the ticked commits 1..*k* applied, so with every row ticked the last one is the working file byte for byte; and the branch moves **once**, with `update-ref`'s old-value check, so all of them land or none does. A plan carries `base`, a fingerprint of HEAD and the work it was cut from: an edit that lands while the agent is thinking makes it a plan for other work, refused (`STALE`) with *write them again*. `commit-tree` runs no hooks; the one-commit path still does. A first commit, with no HEAD to cut against, is one commit. Below the commit, two more rows, **so the window opens with nothing to commit too**: **Tag** puts an annotated tag (`git tag -a <name> -m <name>`) on HEAD, the name checked by `git check-ref-format` and refused when it starts with `-` or exists, and the tags already on HEAD named beside it; **Push** sends the branch and the annotated tags on what it sends (`git push --follow-tags`, or `git push --follow-tags -u <remote> <branch>` the first time), or the branch alone when **Settings… → Push tags** is off (then the tags on HEAD read `· not pushed` and the toast says they were kept here), on the click and only then, under `noPromptEnv` and a one-minute bound, turning `pushing |` while it goes. The row reads where the branch stands, from the same local read the four places below use (*↑3 commits not on origin/main*, *main is not on origin yet*, *up to date with origin/main*), and a push that cannot go says why instead of asking (*no remote to push to: git remote add origin <url>*, a detached HEAD, several remotes and none called origin); one the remote refuses says it in words (*origin has commits this branch does not: pull them first*, credentials refused, offline). After a commit the window **stays open when there is somewhere to push**, so commit then push is one visit, and closes when there is not. A change that is only review records (the sidecar beside the deck, REVIEW) gets its subject **from the records themselves, with no agent asked**: *review: resolve 1 comment*, *review: a comment on slide 2*, because that is a fact read off the diff and not a thing to make up; and the window **names the files that changed**, so a resolve reads as a line in `talk.review.jsonl`, never as a line in a deck that did not change. **While a subject is being drafted the window says so**, in the empty message box and on the button that asked: `thinking |`, the bar turning through `| / - \` with the seconds joining after two (slow dots under `prefers-reduced-motion`): ASCII, so it renders in every font a deck can be themed with, and moving, because a draft takes one second or twenty and a still window reads as a stuck one. The **session bookends** follow the same rule (a run that ends with uncommitted work refreshes the snapshot and *names* it on the way out rather than committing it) while the save taken **before an agent edits** stays, because it exists to keep authorship honest rather than to save anything. **`--git-mode timer`** restores the old cadence, bookends included, for anyone who wants it. `--git` creates the repository when none exists; write mode ASKS first on a TTY ("no git repository here — create one so every version of the deck is kept?"). A repository decklight creates starts with a starter `.gitignore`: `.shots/` (screenshot evidence), `.DS_Store`, and, behind a delete-this-line comment naming the tradeoff (bulky vs. cloud narration costing money to regenerate), `voiceover/`, written between `git init` and any initial commit; an existing `.gitignore` is never touched, and a repository decklight didn't create never gets one. Only the deck and what rides its commits (the review sidecar, and the `.gitattributes` decklight wrote for it, REVIEW) are staged (`git add -- <deck> <sidecar>`), and a machine with no git identity gets a per-commit `-c user.name/user.email` fallback rather than a silent failure. **When to commit** is chosen by `--git-mode`: `agent` (the **default**), `timer`, or `off`. In `agent` mode a completed agent edit produces one commit carrying the agent's own summary as the subject (a failed run or one that changed nothing commits nothing), while the snapshot runs underneath as the backstop, held back while a job is in flight so nothing captures a half-finished agent run. A timer is the wrong boundary for agent-authored work: the commits land on a clock that lines up with nothing the agent did and every message reads `autosave`, which is why the cadence became a snapshot and a question rather than a commit. **`--commit-messages`** answers the other half of that: an agent reads each commit's diff and writes the subject decklight would otherwise template, so the cadence's wall of `decklight: autosave deck.html` becomes `add a grind slide framing time as a consequence, not a setting`. It covers every subject decklight authors itself (the save that clears the way before an agent edit, the `timer`-mode cadence and bookends) and never an agent's own message, which already says what happened. It is also what pre-fills the commit window, where the sentence is a proposal you can edit rather than one that lands behind you. **The commit lands first and the subject arrives after, as an amend**: autocommit exists so a crash cannot cost an afternoon, and a safety net that waits on a language model is not one, so a slow, wedged, missing or rambling agent costs a generically-worded commit rather than a lost one. That ordering is also what makes the amend safe: it rewords one commit, on the tip, seconds old, and refuses the moment `HEAD` has moved (a restore, the agent flow's own commit, a second tick) or the commit has reached a remote, so it is never a rewrite of anything shared or of anything below the tip. The agent is asked through a **read-only** argv (`claude` without `acceptEdits`, `codex` under `--sandbox read-only`, `aider` handed no deck at all) because a call to describe a change has no business being able to make one. The diff is capped at 24 KB and truncation is stated in the prompt rather than hidden, since a deck is one enormous file and a theme swap rewrites 70 KB of CSS around the two sentences that matter. **The prompt also says WHERE the change is** (the deck's `<title>`, and the heading of every slide the hunks fall inside) because a diff cannot carry that and git's own hunk header is worse than nothing here: its function-context heuristic picks the last line resembling a definition, which in a single-file deck is a CSS selector from the inlined stylesheet thousands of lines above. Without it an agent with a gap fills it, and did: a row added to a brewing deck's troubleshooting table came back as *the espresso troubleshooting table*, a word the deck never uses. A change inside no `<section>` reports exactly that, so a theme or runtime swap is not described as slide content; and the prompt asks for a slide's own words rather than its number, which stops being true the moment one is inserted above it. **Consented by the click, not by a setting.** A diff of your deck goes to the agent CLI installed on this machine, and most of them pass what they are given on to their provider, so nothing is sent without a person asking. By default the commit window's **write them for me** is always there and asks only when pressed, and **its tooltip says, before it is pressed, where the changes go**: "Sends the deck's uncommitted changes to claude (Claude Code), the agent installed on this machine, which may pass them to its provider". The agent named is the one `describeWorking` would ask (`agentAsk`), carried in the commit state as `describer`. With no agent installed the button reads **write them for me — no agent** and says `decklight doctor` lists the ones it can use; a session started with **`--no-commit-messages`** reads **— off** and says so; neither asks the server anything. **`--commit-messages`** is the automatic level: the window drafts as it opens, and every subject decklight authors itself is written by the agent. Nothing is stored and nothing is asked at `init`: the setting is the command line's, and the button is the consent. (An earlier release asked at repository creation and stored the answer as `decklight.commit-messages` in git config; that key is no longer read.)
|
|
776
|
+
- **Editing** (write mode, on by default; `src/core/editbar.js`).
|
|
777
|
+
Write mode has always had several ways to change a deck, each learnt on its own: a double-click, a drop, `L`, `S`, a right-click menu, five palette rows, `Z`.
|
|
778
|
+
(Bare `L` and `Z` have since gone: a stray press while presenting changed the file, so layout is the bar's button and undo is the platform's chord.)
|
|
779
|
+
Editing is on from the moment write mode answers, and the bar gives it one face; the lock (above) is what turns it off, and there is no key for either.
|
|
780
|
+
**The bar**, along the bottom of the deck, names every door with the key it stands for: **Text** (⏎), **Picture** (a file chooser, placed as a drop would be, after the selected element or last on the slide), **Layout · auto** (the button names the layout the slide has; ⇧-click cycles backwards), **Build ▾** (the selected element's entrance effects, the one it has ticked; with nothing selected it says to select one: the effects used to be behind a right-click and a submenu.
|
|
781
|
+
They are about what is selected: a node selected inside a block, such as a point of a list, gets its own `data-build`.
|
|
782
|
+
The attribute is changed where it stands, so a bare `data-build` is replaced rather than joined by a second one, and *remove* takes it off.
|
|
783
|
+
It is written in place, as the Builds tab's settings are (below), and the slide steps to show the element), **Notes** (`S`), **Slide ▾** (new, duplicate, move up, move down, delete, hide or unhide (`HIDDEN_SLIDES`), and **Deck settings…**: **in place**, the page making the same change the file gets and re-reading its slides, so the selection, the scroll and the panel stay where they were; still a reload in a deck of chapters, for a duplicate of a slide with something live on it, a terminal, a video or a frame, and when recordings moved with the slides; a delete says so with an **Undo** button, as a removed element does on the page its reload brings), **Undo** (`⌘Z` / `Ctrl+Z`), **Redo** (`⌘⇧Z` / `Ctrl+⇧Z`), **Lock** (locks the deck: the bar goes, the 🔒 chip unlocks).
|
|
784
|
+
**The bar hides**: the palette's **Hide the bar** / **Show the bar** row takes it off the screen and brings it back, remembered per deck, and fullscreen hides it on its own, the commit chip with it (in write mode fullscreen is a rehearsal, not an edit, and a rehearsal screen says nothing about git); hidden, editing stays on and every door the bar names still works, because the bar is a surface over them.
|
|
785
|
+
**The bar moves**: a grip (⠿) at its left edge drags it anywhere on the stage, which is where it goes when the bottom of a slide is where the content is; the place is remembered per deck as fractions of the stage, so it survives a resize, and a double-click on the grip puts it back at the bottom centre.
|
|
786
|
+
**Editing has its own look**: text being edited in place is tinted and glows in the accent, where a selected element is only outlined, and a hint under it names its two ways out (*⏎ keep · Esc cancel*, *⌘⏎ keep* for code), so it is plain when keys go into the words.
|
|
787
|
+
**The panel the keyboard goes to is marked**: a ring in the accent round the panel whose box has the caret, and round the comments panel, with *keys here* in its foot, in front of the keys it lists, while it is taking R, S, A, D and ⌫ (it opens with the keyboard, and a click on the deck hands it back).
|
|
788
|
+
**Selection**: while editing, a click on an element selects it, outlined, with a ⋯ handle at its corner that opens the element's menu by left-click, and the pointer outlines, more faintly, what a click would select.
|
|
789
|
+
**A group in a diagram is selected the same way** (`SVG_DIAGRAMS`, groups): the first click selects the outermost group, a second click inside it the next level down, `⌥`-click the shape, and `Esc` steps back up.
|
|
790
|
+
**A block inside a column is selected at depth** (`nodeForClick`, `src/core/pick.js`): the first click on a block in a column selects the column (its drag and its layout are the column's), a second click on the same column selects the block under the pointer, and a click on a block beside a selected one selects that block in turn; `⌥`-click goes straight to the deepest block. Only plain wrappers are stepped into: a list's points, a table's cells and a figure's caption are their own sessions, and a chart or a terminal is one block. The pointer outlines what a click would select, and the inspector's breadcrumb shows the path down to it. A right-click inside a selected column opens the element menu on the block at depth, the one the ⋯ handle carries: the selected block itself, or one beside it as a click would select it.
|
|
791
|
+
**Several are selected with ⇧-click** (`src/core/editbar.js`, the actions `src/core/several.js`): ⇧-click adds a top-level element of the same slide to the selection, or takes it out, each outlined the same way; the first stays the primary, the one the ⋯ handle and every one-element door are about. A plain click, Esc and another slide go back to one.
|
|
792
|
+
With several selected, the element menu opened on one of them (right-click or ⋯) says how many and offers only what applies to all: Colors…, Type…, Paste style, Move up, Move down, Duplicate and Remove; ⌫, ⌘D / Ctrl+D and ⌃⇧↑ / ↓ do the same, and the inspector's title says *3 selected*, its tabs Info, Colors and Type, a pick on the element itself going on every one of them.
|
|
793
|
+
**Several shapes of one diagram** are selected the same way, ⇧-click on each, or by a drag on the diagram's empty canvas, which draws a marquee and selects every shape it covers whole (a box group by its shape, never a wire); their menu offers **Group** (`⌘G` / `Ctrl+G`), Colors…, **Arrange ▸**, **Concept ▸**, Duplicate and Remove, ⌘C and ⌘V copy and paste them all into their diagram, the arrows nudge them all (⇧: ten units), and a drag on one moves them all (`SVG_DIAGRAMS`, several shapes).
|
|
794
|
+
Each is ONE write and one undo, through the element routes' `items` form (`{ slide, items: [{ index, tag? }] }`, with `dir` to move and each item's `edits` to restyle; cli/edit.mjs `removeSlideElements`, `duplicateSlideElements`, `moveSlideElements`), shown in place: removed together, copied each right after itself (the copies then selected), moved one place together (each past the element beside it that is not selected, so a gap between two closes as they reach it).
|
|
795
|
+
A slide a template laid out, or one with something live on it, takes the write and reloads, as a one-element move does there; copying several to the clipboard and a marquee on the background are not offered yet.
|
|
796
|
+
**Inside a diagram the selection is a node** (`src/core/pick.js`): a click selects the deepest drawn node under the pointer (a shape, a wire, a label; a label's line selects its whole `<text>`), the diagram's empty canvas selects the `<svg>`, and a chart stays one block.
|
|
797
|
+
SVG takes no CSS outline, so the node is framed by a box drawn over it, which follows it when the stage reflows (a panel docking) or a build moves it.
|
|
798
|
+
**A wire is never boxed**: a connector, a `<line>`, or an unfilled `<path>` or `<polyline>` spans a rectangle that is mostly empty, so selected it glows along its own stroke in the theme's accent (a runtime class, `dl-wire-selected`, a tight drop-shadow on the wire itself, so it follows a re-route, a resize and a move of the nodes it joins with nothing to place, and is never written to the file), and its `⋯` handle sits beside the middle of the line (the point halfway along its stroke), following it when a route change moves that point.
|
|
799
|
+
A shape under the pointer is **boxed by a dashed line in the theme's accent** (the yellow of Eclipse, the mint of Aurora) and **glows** (a drop-shadow that follows its outline), and the stage around it dims a little, by one box that lets every pointer event through.
|
|
800
|
+
A wire under the pointer only glows: no dashed box, nothing dimmed.
|
|
801
|
+
Nodes the engine or a template added are never picked.
|
|
802
|
+
**What waits behind a build is there to click**: with the bar on, a step still to come is shown dimmed where it will land instead of hidden (its strokes drawn, its fades in), so it can be selected, typed in, restyled and removed, and selecting it steps the slide forward to the click that shows it (a list selected whole, to its last point).
|
|
803
|
+
The bar off (fullscreen, hidden, the lock), print and export show the builds as they play; code line steps and staged strokes are not dimmed, since their block is on screen already.
|
|
804
|
+
**The steps still to come can be hidden**: `D` (with the bar on and no text being edited), the palette's *Hide steps still to come* / *Show steps still to come* (also found by *waiting*, *dimmed*, *ghost*, *upcoming*, *audience*, *preview*) and the **Show steps still to come** checkbox at the top of the Builds tab switch the dimming off, so the slide plays click by click as the audience sees it, each step with its own entrance and `←` taking it away again, while the bar, the selection and editing of what is on screen stay.
|
|
805
|
+
While they are hidden a **Steps ahead hidden** chip sits at the end of the bar, and a click on it shows them again; a Builds tab row still steps the slide to its click, so its step is on screen.
|
|
806
|
+
The choice is remembered per deck in this browser (`localStorage`, by the deck's path), shown by default and when storage is unavailable, and never reaches the file, a print, an export, the overview or a presentation.
|
|
807
|
+
With something selected, `⏎` edits it in place when it is text (as a double-click would) and opens its menu when it is not, `⌫`/`Delete` removes it (one undo entry, the undo chord takes it back; a node selected inside a diagram goes alone, by `POST /deck/edit/element/remove` `{ slide, index, path, tag }`, its line with it when it stood alone on one, a path that lands on another tag a 409), `Esc` goes up a level (a block at depth to the column holding it) and lets go from the top; the arrows still move between slides, and moving on lets the selection go.
|
|
808
|
+
**A block at depth is worked on where it is**: Move up and Move down (and `⌃⇧↑` / `⌃⇧↓`) move it among its own siblings, Duplicate copies it right after itself, Build ▸ gives it its own build, and Remove takes it off in place (`POST /deck/edit/element/remove` `{ slide, index, path, tag, quiet, from }`: no reload on this page, every other page sent `content`, an Undo button in the toast), each by its file path below the column.
|
|
809
|
+
The bar writes nothing itself: every button and key goes through the route the gesture or the menu already used, so each lands on the same undo stack.
|
|
810
|
+
The right-click menu, the double-click and the drop are unchanged; the bar is a surface over them, not a second path.
|
|
811
|
+
**The slide number** sits at the top right while editing is on, `3 / 12` in the theme's accent on the theme's background, above the commit chip, which steps down under it with the clock; it goes with the lock, and fullscreen hides it as it hides the chip.
|
|
812
|
+
**A text, code or label save is written in place**: the page that saved keeps what it typed (a code block is rendered again from its new source, highlighted and lined), the slide is rescanned and laid out again, and nothing reloads; the write is quiet (`quiet: true, from`, as the colour card's and the notes drawer's are) and every other page of the deck is sent a `content` event and reloads for the new words.
|
|
813
|
+
The undo chord takes it back with the ordinary reload.
|
|
814
|
+
Off a print, an embedded view and a capture, the bar does not appear.
|
|
815
|
+
The palette carries **Lock deck** and, locked, **Unlock deck**.
|
|
816
|
+
**The element menu**: with editing on, right-clicking the current slide, or the ⋯ handle on a selection, opens it.
|
|
817
|
+
Right-clicking a specific element (found by walking up from the click to the section's direct child that contains it, so a click anywhere inside a bullet list or a chart still resolves to that top-level element, and inside a diagram to the node under the pointer as a click would select it) opens a menu about that element, **the same short list for every element, in the same order**, so a row is where it was last time: Inspect, Colors…, Type…, Copy style, Paste style (below), Build ▸, Animate ▸, Move up, Move down, Duplicate (`⌘D` / `Ctrl+D`), Remove (`⌫`), Edit content (HTML), Slide ▸ (and Writing tools… after Edit content when an agent is on the machine, `PRESENTING_WRITING`).
|
|
818
|
+
A row that cannot act on this element is greyed, not gone: Paste style with nothing copied, Move up at the top of the slide, or on a diagram's shape already at the front.
|
|
819
|
+
What only some elements have is **one submenu row each, just above Slide ▸, only where it applies**: **Turn into ▸** on a text block (below), **Table ▸** on a table's cell (its rows and columns, below), **Picture ▸** on a picture (Replace…, Add caption, Use as slide background, Reset size), **Wire ▸** on a connector or a line (its route, its arrowheads and its line as three small headed groups in one submenu, each ticking what the wire has, then Width… and Reverse), **Shape ▸** on a diagram's node or its canvas (the shapes Add puts there, a box's Corners, a stroke's Line and, from a node inside it, Remove the whole diagram), **Concept ▸** on a diagram shape (`SVG_DIAGRAMS`), and **Turn ▸** on a conversation's turn (below).
|
|
820
|
+
**Turn ▸** (`src/core/conversation-menu.js`) on a turn of a conversation (DECK_ANATOMY) lists **who speaks** (user, agent, tool, system, and the turn's own word when it is another), its **kind** (Speech, Thought, Tool call), each ticked as the turn has it, then **Add a turn after** (whoever speaks next: the agent after the user, the tool after a call, named after what was called, the agent after the tool, the user after the agent; written *New turn* at the turn's indentation) and **Remove this turn** (greyed on the last one: remove the conversation instead). Each is `POST /deck/edit/element/turn` `{ slide, index, path, tag, op, value? }` (`op` role, kind, add or remove; a kind of speech takes `data-kind` off), one write and one undo, and the page follows the file. A turn is not a text block for **Turn into ▸**.
|
|
821
|
+
**Turn into ▸** (`src/core/turn-into.js`, `src/core/block-kind.js`) makes a text block, a heading, a quote or a list (a point selected means its list) **Text**, **Heading**, **Small heading**, **Quote**, **Bullets** or **Numbered**, the kind it is ticked.
|
|
822
|
+
The block's source is read from the file and only the tags around its words change, the words, their emphasis and a nested list kept as written, in one write through `POST /deck/edit/element/content` and one undo.
|
|
823
|
+
Bullets to numbered and back is the two tag names (a numbered list's `start`, `type` and `reversed` dropped on the way), a list made text or a heading is one block a point, each with the list's attributes, so a build that was a step a point still is, and a list made a quote is one quote whose build is now one step, which the toast says.
|
|
824
|
+
The slide's title is offered only Heading, the other kinds greyed with the reason, so the slide never loses its title.
|
|
825
|
+
With several selected (⇧-click), **Turn into ▸** in their menu joins them into one: **Bullets** or **Numbered** (a point for each paragraph or heading, and each point of a list among them) or **Quote** (a paragraph each), what is inside each carried as written, written where the first of them stands by `POST /deck/edit/element/join` `{ slide, items, html }` in one edit and one undo; a list made of blocks that all built builds a step a point, one that only some built takes no build and says so, and the slide's title among them greys the rows, with why.
|
|
826
|
+
**Remove removes what is selected**: a shape picked inside a diagram goes alone (its diagram whole from Shape ▸, or with the canvas selected), a picture in a figure alone (the figure whole from Picture ▸).
|
|
827
|
+
No notes row on an element, HTML or SVG: the notes are the slide's, and the background right-click, `S`, the bar's Notes and the palette open them.
|
|
828
|
+
Right-clicking the bare slide background (nothing under the cursor but the `<section>` itself) shows Edit speaker notes and Slide ▸.
|
|
829
|
+
Elements are addressed by **raw position among the slide's direct children** (`[...section.children].indexOf(el)`, title included, never filtered as chrome the way the engine's own `splitContent()` filters a *live* DOM; what the engine itself puts in front of them, a background layer or a hero logo, is not in the file and never counts, and a click on it addresses the slide): no per-element ID scheme, so a hand-authored deck needs no new markup to become editable.
|
|
830
|
+
`tools/deck-html.mjs`'s `sectionChildRanges()` is the walker the server-side transforms share with `locateSlide`: it treats `<script>`/`<style>` bodies as opaque (a chart's embedded JSON is not markup) and nests by genuine recursion rather than a same-tag-name counter, so self-closing SVG children and same-name nested tags still resolve correctly. "Edit content (HTML)" reads the element's outerHTML fresh from the **file** via `GET /deck/edit/element/source`, never the live DOM, which the engine mutates in place (pinned-title classes, namespaced SVG ids, chart/code/math subtree replacement), in the same textarea-and-⌘⏎-saves shape as the notes editor, syntax-highlighted by a painted layer behind the textarea that shares its every metric (font, wrapping, padding, so a 400-character line wraps where the caret wraps and the paint scrolls as far as the text does, #529), opened at the top of the source with the caret first.
|
|
831
|
+
**The editor docks** (#530) (float, left, right or bottom, the review and sources panels' placement (`dock.js`), remembered per deck under its own key): docked, nothing is dimmed, the stage reflows away from the gutter and the text area fills it, the element under edit keeps the outline a double-click edit gets, and the deck's keys work whenever the caret is not in the textarea; `Esc` and the × close, `⌘⏎` saves and the reload re-opens nothing, so the placement is met again on the next open.
|
|
832
|
+
**One stream for every tab** (#1240, `src/core/shared-events.js`): Chrome gives a plain-HTTP origin six sockets shared across all its tabs, and a `/deck/events` response never ends, so a stream per tab used to pin one socket each, and at six tabs every further fetch from any of them queued in the browser forever.
|
|
833
|
+
Now a browser profile holds **at most one long-lived connection per stream URL**, however many tabs, windows or speaker views of the deck are open: one tab leads (a Web Lock picks it) and opens the real `EventSource`, and relays every event, and the stream's opening and failing, to the others over a `BroadcastChannel`; when it closes, the next tab in line takes the lock and opens the stream.
|
|
834
|
+
Every tab still hears the reload, the lock, the phone's taps and the rest as before, through an object shaped like an `EventSource`; a page without Web Locks or `BroadcastChannel`, or with an opaque origin (a deck opened from disk), opens its own stream.
|
|
835
|
+
**Every editor read and write is bounded** (`boundedFetch`, 8s): a fetch can still queue in the browser behind other connections (several decks served from one port, other pages of the same origin), and then it neither answers nor rejects.
|
|
836
|
+
Unbounded, the content editor sat on `loading…`, disabled, with Esc the only way out; bounded, the stalled request fails through the same toast as any other error (`no answer in 8s — close other tabs of this deck and retry`).
|
|
837
|
+
Reads and writes that can honestly take long (an agent run, an export, a publish) are not bounded.
|
|
838
|
+
**"Colors…" recolors the shape under the click and the text on it**, in the inspector: the menu's *Inspect*, *Colors…* and *Type…* select what the menu was opened on and open the inspector on its Info, Colors or Type tab, so restyling is one panel, beside the facts about the same node (`src/core/colorpicker.js`): the one row that looks *below* the top-level element, because in a diagram the thing you point at is a box, not the `<svg>`.
|
|
839
|
+
In a diagram the background is the shape's `fill` and the text is the `<text>` sharing its `<g>` (the one-group-per-box convention; a shape loose on the canvas takes the labels whose centre falls inside it, and right-clicking the label finds the same pair from the other side); anywhere else the element is a box in the CSS sense (the click climbs out of inline runs and out of a highlighted `<pre>`) and the two colors are its `background-color` and `color`.
|
|
840
|
+
A **Fill | Stroke | Text** switch says which a pick lands on: the fill, the text, or the shape's border (#717), its `stroke` (a box's `border-color`), with a **Width** row beside the Stroke side, a slider and a number in px that preview as they move and land in the same save as the colour (`stroke-width`, unitless as SVG reads it; `border-width` in px on a box), and the card has **two tabs, deliberately**: **Theme** is the applied theme's own palette read live off the token contract (`THEMING`) and *named*: **Primary** (`--accent`), **Secondary** (`--link`, offered only where the theme's links are not simply its accent: one color gets one name), On primary, Heading, Text, Muted, Background, Background alt, Block, the six numbered diagram fills and the diagram inks; a token the theme does not define is left out rather than shown as a dead swatch, the swatch the target already carries is marked, and a pick writes the token **by reference** (`fill: var(--d-fill-3)`, never the hex it resolves to today), so a recolored box still follows `T` to the next theme, still takes its panel's nested tone (`SVG_DIAGRAMS`) and still answers to the theme gates.
|
|
841
|
+
A deck that uses a **design system** (`DESIGN_SYSTEMS`) gets one more group per design system after the theme's (a palette of scales, one row per colour, its weights in order, and a deck held to its brand no Custom tab: `BRAND_PALETTE`), in the order the deck references them, from its meta block's `palette`, headed `<title> · <group>` (just `<title>` for a one-group palette), each swatch under the design system's own label, painted from the page's live token and dropped when the page leaves the token undefined, and a pick there writes the token **with one hex fallback**, `var(--acme-blue, #0056f9)`, the hex being what the token computed to at pick time: the token is the design system's, not the theme's, so the box keeps its brand colour through `T`, and still has it if the design system goes missing.
|
|
842
|
+
The marked swatch is matched on the token, never on a fallback that may have gone stale.
|
|
843
|
+
A deck with no design system shows exactly the theme's groups.
|
|
844
|
+
**Custom** is a literal color (**RGB** or **HSB** sliders with typed values, and a hex field that reads what people paste (`ffb319`, `#fa0`)) opening on the color the target has now; it is a separate tab because a literal is exactly what stops following the theme, and reaching for it should be a decision rather than the default.
|
|
845
|
+
Every pick **shows on the slide and is saved at once**, the way DevTools applies a style: one POST and one undo entry a pick (a slider previews while it is dragged and saves when it is let go, a typed value when it is entered), the saves made one after another in the order picked, and a save the server refuses puts the slide back to what was last saved, with a toast; there is no Apply and no Cancel, and the undo chord is the way back.
|
|
846
|
+
**Reset** takes the colour set here back off, and saves that.
|
|
847
|
+
It docks wherever the inspector does, and a key pressed inside it stays in it; docked along the bottom it lays the switches in a column beside the palette.
|
|
848
|
+
Each save is one `POST /deck/edit/element/style` `{ slide, index, edits: [{ path, tag, prop, value }], quiet: true, from }`, **written in place**: the page that picked already shows it, so the server's write is quiet (no reload, the inspector stays open on the node) and every other page of the deck is sent a `styles` event and reloads; without `quiet` the route still answers with the ordinary reload.
|
|
849
|
+
The edits of one save are **one undo entry**: `path` is the element-child path below the top-level element counted the way the *file* counts (nodes the engine added, a draw build's `.draw-head`, are skipped), `tag` is what the page found there, and a path that lands on a different tag in the file (generated content such as a chart, or a deck that moved on) is refused with a 409 rather than recolored.
|
|
850
|
+
Only the open tag's `style` is touched, textually: `viewBox` and every other attribute survive byte for byte, and because the value lands inside an attribute the server writes **only** `fill`, `color` or `background-color`, set to a `var(--token)`, a `var(--token, #hex)` (one hex fallback, nothing nested), or a hex, or removed (`null`; an emptied `style` goes with it).
|
|
851
|
+
**The Type tab** is the editor's other half, and the element menu's **Type…** row opens the inspector on it: the text the card would colour (a diagram's label, a block's own text) gets a **Size** (a slider and a number, 8–160 px, in deck units, since the stage is scaled and the text is not), a **Weight** (Regular 400 to Heavy 800), a **Font** that is one of the theme's three roles by reference (`var(--font-heading)`, `var(--font-body)`, `var(--font-mono)`; a role the theme leaves undefined is offered disabled), never a family name, so the text still follows `T` and a deck's marked fonts (`FONTS`), **Italic**, and **Align**, which is `text-anchor` (start, middle, end) on a diagram label and `text-align` (left, center, right) on a block.
|
|
852
|
+
The rows open on what the text has now, the role read from its authored `font-family` or matched against the theme's; every change shows at once and is saved as it is made, like a colour; **Reset** on the Type tab takes all five back off, to what the theme or the markup gives (a presentation attribute such as `font-size="14"` is never touched: the style declaration overrides it, and removing the declaration hands it back).
|
|
853
|
+
The server writes each of these in one closed shape only: `font-size` as `N px` (1–999, one decimal), `font-weight` in hundreds, `font-family` as exactly one of the three role tokens, `font-style` `normal` or `italic`, `text-anchor` `start`/`middle`/`end`, `text-align` `left`/`center`/`right`; anything else is a 400.
|
|
854
|
+
**Copy style and Paste style** (`src/core/style-clip.js`) put one shape's look on another, the format painter every slide tool has: the element menu's two rows, `⌥⌘C` and `⌥⌘V` on a selection (`Ctrl+Alt+C` and `Ctrl+Alt+V` elsewhere, Keynote's and PowerPoint's chords, read by key position because `⌥` turns the C into a ç), and the palette's *Copy style* and *Paste style* while something is selected.
|
|
855
|
+
A style is exactly what the Colors and Type tabs write and nothing more: the fill, the border and its width, the text's colour, and the type the source sets (size, weight, font role, italic, alignment).
|
|
856
|
+
It is copied **by role**, so a diagram box pastes onto an HTML box (fill to `background-color`, stroke to `border-color`, a label's ink to `color`, `middle` to `center`); a size crosses only between two of the same kind, since a diagram's px are its viewBox's.
|
|
857
|
+
A colour the source's markup writes is copied as written, a token **by reference**, so the paste still follows `T`; a colour it only inherits is copied as what it looks like, the paste first taking the target's own value off and keeping that when the target then looks the same, else writing the hex.
|
|
858
|
+
A diagram shape's authored fill is read from its `data-nest-fill`, not the nested tone the engine painted over it.
|
|
859
|
+
**A shape in a concept pastes its concept** onto a diagram shape, not the concept's colour, and a plain style pasted onto a concept shape takes it out of its concept, since the concept would paint over the fill: the route carries the change as `concept: { path, tag, value }` beside the edits, written in the **same** `POST /deck/edit/element/style` and so **one undo entry**.
|
|
860
|
+
The paste shows at once and is written in place (`quiet`), a refusal puts the slide back, a paste that would change nothing writes nothing (*already that style*), and `⌥⌘V` with nothing selected says to select a shape first.
|
|
861
|
+
The clip is remembered per browser (`decklight-style-clip`), so it outlives a reload and reaches another deck in another tab. "Build ▸" (named *Build: zoom ▸* once the element has one; the bar's Build ▾ opens the same list) drills into a submenu offering the spec's 7 entrance styles (`MOTION`) plus `none`, the effect the element has ticked and *remove effect* offered only when there is one to remove, (an explicit, instant build step, one more advance still reveals the element, it just carries no animation, which is why it is distinct from "remove effect", the separate action that strips `data-build` entirely).
|
|
862
|
+
Remove / edit-content / add-effect all land on the SAME undo/redo stack as layout and notes edits, through the same `applyEdit`.
|
|
863
|
+
**Two gestures need no menu** (`src/core/authoring.js`): with editing on (locked, a double-click on text changes nothing), a **double-click** on a text element (headings, paragraphs, list items, quotes, cells; never generated content such as charts, terminals, or an aside) edits it in place, `⏎` saves and `esc` gives up.
|
|
864
|
+
A slide marked for math (`data-math`, CODE_AND_MATH) is edited like any other, and **a formula is typed as its source**: text that holds a typeset formula (or a formula's error) opens showing what the file has (`Energy is $$E = mc^2$$`), never the MathML on the page, which the TeX is not in; `⏎` saves it and the formula is typeset again in place, `Esc` gives it up and the typeset formula comes back.
|
|
865
|
+
A formula that does not parse is saved as typed, shows Temml's error where it stands, and the toast says what is wrong.
|
|
866
|
+
A formula typed into any text is typeset when the text is saved, with no reload.
|
|
867
|
+
Inside a list being typed in, a press on another point that holds a formula leaves the typing where it is and says to double-click that point instead.
|
|
868
|
+
A diagram's label is text too (`SVG_DIAGRAMS`).
|
|
869
|
+
**Emphasis while editing**: `⌘B`, `⌘I` and `⌘E` (`Ctrl` on Windows and Linux) wrap the selection in `<strong>`, `<em>` or `<code>` and take it off again, and a pill above any selection offers the same three to the mouse; the file gets the semantic tag, never the `<b>` or `<i>` a browser's own bold command writes, so a theme's rule for `strong` (the heading colour) is what the emphasis looks like.
|
|
870
|
+
`⌘⇧H` wraps the selection in a highlight (`<mark>`) and `⌘⇧X` in a strikethrough (`<s>`), toggles like bold; the pill offers those two and superscript and subscript (`<sup>`, `<sub>`, the pill's only: `⌘,` and `⌘.` are the browser's), each lit when the selection is in it.
|
|
871
|
+
A highlight is the theme's accent tinted over the slide (THEMING), never the browser's yellow, and a list's or a table's save, and a paste, keep all seven.
|
|
872
|
+
**A paste while typing arrives clean** (`cleanPasted`, `src/core/list-edit.js`): in a heading, a paragraph, a quote, a caption, a point or a cell, what another app put on the clipboard brings its words and, of their look, only the editor's own emphasis (`<strong>`, `<em>`, `<code>`, `<mark>`, `<s>`, `<sup>`, `<sub>`, and the bold, italic and strikethrough of the `<b>`, `<i>`, `<del>`, `<strike>` or styled spans other apps write) and links, a link keeping its `href` only when it is the web, mail, a slide or a path beside the deck.
|
|
873
|
+
No `style`, `class`, `<span>`, `<font>`, `<div>` or picture from the source reaches the file: its paragraphs and lines become spaces, and a picture, a frame or a script goes with its content.
|
|
874
|
+
A picture alone on the clipboard brings nothing into the words, and plain text comes in as text.
|
|
875
|
+
The save cleans again (`cleanTyped`, the cleaning a list's points get) whatever reached the words some other way, keeping a `style` the element had in the file; words that hold blocks of their own, a quote of paragraphs, are saved as typed.
|
|
876
|
+
The save fetches the element's SOURCE through `GET /deck/edit/element/source`, changes the one node the click landed on by the same element-child path in both trees, and posts the whole top-level element back through `POST /deck/edit/element/content`, so the file's own markup survives around the words that changed.
|
|
877
|
+
**A code block is edited as its source text, never its rendered DOM:** double-clicking a `pre > code` reads the element's source from the file and shows the code plain (`contenteditable="plaintext-only"`): code.js has highlighted it into spans and wrapped every line, and writing that back would put the spans in the deck.
|
|
878
|
+
Enter is a newline, `⌘⏎`/`⌃⏎` or clicking away saves, Tab indents, Escape gives it up.
|
|
879
|
+
The save changes only the `<code>`'s text (attributes such as `data-lines` and the `language-` class untouched, the file's own newline after `<code>` and before `</code>` kept, `<`/`>`/`&` escaped) through the same `POST /deck/edit/element/content`, so the undo chord takes it back.
|
|
880
|
+
Escape puts back the very `.code-line` nodes that were shown rather than re-parsing them, because a `data-lines` build steps through references to those nodes.
|
|
881
|
+
**Dropping an image** onto a slide uploads it through `POST /deck/edit/asset` into `assets/` beside the deck (a safe lowercased name, the extension from the content type; an SVG carrying a script is refused) and places `<img>` after the element under the cursor, or last on the slide, through `POST /deck/edit/element/image`.
|
|
882
|
+
**A picture from the clipboard** (`src/core/clipboard.js`): `⌘V` / `Ctrl+V` in write mode with editing on, nothing being typed and no field focused, with a picture on the system clipboard (a screenshot, a browser's *Copy image*, which wins over the html that comes with it), adds it exactly as a dropped file does: uploaded into `assets/`, placed after the selected element (inside its column) or last on the slide. A picture pasted while typing goes nowhere (the words' own paste above), and the clipboard is the system's, so a picture copied anywhere pastes here.
|
|
883
|
+
**Words from another app, outside typing** (`pastedWords`, `src/core/list-edit.js`): `⌘V` / `Ctrl+V` with words on the clipboard and nothing being typed adds them where Add would add one (after the selection, inside a column, or last on the slide): one line is a paragraph, several lines a list, numbered when every line was (`1.`, `2)`), its markers taken off, thirty points at most. Each line is cleaned as a paste while typing is (the words and the editor's own emphasis and links), and the server builds the paragraph or the list round them, through `POST /deck/edit/element/insert` with `words` (one line of inline words each), taking them only as words and those tags (`inlineWords`, `tools/starters.mjs`, anything else a 400), so a forged request cannot make it a door for other markup. The new block is selected, not opened for typing: they are the author's words already. One write, one undo.
|
|
884
|
+
**A picture's alt text from its file name** is left empty when the name says nothing about the picture (`image.png`, as a pasted screenshot is called; a screenshot tool's or a camera's timestamp or counter; *unnamed*, *download*): alt that reads "image" is worse than none, and the picture's Alt text row is where it is written.
|
|
885
|
+
**Copy, cut and paste an element** (`src/core/clipboard.js`): `⌘C` / `⌘X` / `⌘V` (`Ctrl` elsewhere) on a selected element, the element menu's **Copy**, **Cut** and **Paste** beside Duplicate, and the palette's three rows, all through the system clipboard, so a copy crosses to another slide, another tab and another deck and outlives a reload.
|
|
886
|
+
What is copied is the element as the FILE has it (its builds, colours and classes, never the page the engine decorated), read through `GET /deck/edit/element/source` (which takes a `path` and a `tag` for a block selected inside another) when it is selected, since a `copy` event is answered at once: as `text/html` behind a `<!--decklight:element-->` comment, so a paste knows it is the editor's own without a new attribute, and as `text/plain` its words, for any other app.
|
|
887
|
+
Words selected on the page and anything being typed keep the browser's own copy and paste. **Cut** is the copy and the remove `⌫` makes.
|
|
888
|
+
With several selected (⇧-click), Copy takes every one of them, back to back in the slide's order, and Paste puts them all after the selection in one write; Cut is that copy and the one remove of all of them.
|
|
889
|
+
**A paste** goes to `POST /deck/edit/element/paste` `{ slide, index | null, path?, html }`, which **cleans it on the server first**, since any web page can put markup and a forged marker on the clipboard: `<script>`, `<style>`, frames, embedded objects, `<base>`, `<link>`, `<meta>` and forms go, and so does every attribute that runs (`on*=` handlers, `javascript:` and `data:text/html` URLs, `srcdoc`, a style that reaches out), each named once in the answer (`dropped`).
|
|
890
|
+
The element then loses the ids the page would have twice, its diagrams' node names are made its own on the slide, and it lands where a new block does (`whereNewBlockLands`: after the selection, inside its column, or last on the slide), one write and one undo; the page shows it in place and selects it, and the toast says what was left out and names any picture the deck's folder does not have (its file is still beside the deck it came from).
|
|
891
|
+
A slide built on a design-system template refuses a paste with a sentence (409), as Add does.
|
|
892
|
+
A diagram's shape copies as a shape: pasted with something in the same diagram selected it is Duplicate, and anywhere else the toast says it cannot yet.
|
|
893
|
+
**Copy and paste a slide**: Slide ▸ (the bar's Slide ▾ and the right-click menu's) has **Copy slide** and **Paste slide**, and in the overview `⌘C` / `⌘V` copy the chosen cell's slide and paste one after it; elsewhere `⌘V` with a slide on the clipboard pastes it after the slide on screen.
|
|
894
|
+
The slide is copied as the file has it, its notes with it, read through `GET /deck/edit/slide/source` when the menu opens or the cell is chosen, behind a `<!--decklight:slide-->` comment, its words as plain text; a paste is `POST /deck/edit/slide` `{ op: 'paste', slide, section }`, cleaned as an element is, one `<section>` or refused, its page ids left behind, put after slide N with later recordings moved as for a new slide, in one write and one undo, and placed on the page as a new slide is.
|
|
895
|
+
Its recorded narration stays with the deck it came from, and the toast says so, with what was left out and any picture the deck's folder does not have.
|
|
896
|
+
**The slide as a whole** (new, duplicate, delete, move up, move down) is the palette's five `Slide:` rows and the menu's `Slide ▸` submenu, each one `POST /deck/edit/slide` `{op, slide}` and one undo entry; **the overview (`O`) is where a deck is rearranged**: in write mode every cell drags to a new place (`{ op: 'move', slide, to }`, the slide ending up at `to`, one undo entry however far it went; dropped on the left half of a cell it lands before it, on the right half after it, and a drop that changes nothing asks for nothing), each cell carries **+** new after (the kinds New slide offers everywhere, opened at that cell), **⧉** duplicate and **🗑** delete on hover, and the selected cell answers `N` (the same kinds), `D` and `Delete`.
|
|
897
|
+
Without an edit server the overview is the picture it always was: no tools, nothing drags.
|
|
898
|
+
The write reloads the page, and the overview reopens on the slide the server named, so a second drag follows the first without pressing `O` again; a deck keeps at least one slide, and the answer names the slide to land on after the reload.
|
|
899
|
+
A slide with no per-element source mapping declines the whole menu rather than opening one that cannot honestly save anything: markdown-authored slides (`data-markdown`, removed in 0.3.0, above) are the one case of this today, marked `data-markdown-removed` at parse time.
|
|
900
|
+
The menu is the first **cursor-anchored** overlay in the engine: every other one dims the screen and centers a card; this one keeps a transparent backdrop (dimming would hide the very slide the menu is about) and positions the card at the click, clamped to stay on-screen.
|
|
901
|
+
It still reuses the shared `closeOnBackdrop`/`selectInList` machinery: arrow keys navigate, `Escape` and a backdrop click both close it, exactly like every other overlay.
|
|
902
|
+
- **The same action works the same way everywhere** (write mode).
|
|
903
|
+
An action reachable from several doors does the same thing from each.
|
|
904
|
+
**Duplicate any element**: the element menu's Duplicate, or `⌘D` / `Ctrl+D` on a selection (not while typing; the browser's bookmark chord, taken only in write mode with something selected, as Keynote and Slides take it), copies what is selected right after itself: a diagram's node through the shape route (moved off the original, `SVG_DIAGRAMS`), anything else through `POST /deck/edit/element/duplicate` `{ slide, index, tag?, path?, quiet?, from? }` (`duplicateSlideElement`, `cli/edit.mjs`): the element's source, or with `path` a node inside it outside a diagram, copied from the FILE onto its own line(s) right after it, its ids dropped (an svg's inner ids stay, scoped per diagram) and its `data-node` names made its own, so a copied diagram is a second diagram.
|
|
905
|
+
The slide's notes and sources are not something it shows and are refused (409), as a stale tag or path is, and so is a column of a two-column slide, whose copy would be a third column dropped underneath as a footer: what is inside a column still duplicates.
|
|
906
|
+
One write, one undo entry; the answer is the copy's markup and where it is, which the page puts in place, refreshes the slide around (`refreshSlide`) and selects.
|
|
907
|
+
**New slide offers the same kinds from every door**: the bar's Slide ▾ and the right-click Slide ▸ (New slide ▸), the palette's **New slide…** and the overview's **+** and `N` all open one short list, Title and bullets first and ready for `⏎`; from the overview it opens at that cell and the new slide stays a cell there, its title not typed under the overview.
|
|
908
|
+
**A caption is one undo** and **`⌘K` is the palette, and the link only while typing with words selected** (Pictures after the drop and the links passage above).
|
|
909
|
+
- **Moving things within a slide** (write mode, editing on; `src/core/element-move.js`).
|
|
910
|
+
A slide could be moved and nothing on one could: putting the picture above the bullets meant opening the HTML.
|
|
911
|
+
Three ways now, through one route. **The element menu** has **Move up** and **Move down** (with their chords), greyed at the ends of the slide.
|
|
912
|
+
**The keys**: with an element selected (not while typing), **Control-Shift-↑ / ↓** (`⌃⇧↑` / `⌃⇧↓` on a Mac, the same chord on every platform, as a document's outline moves a paragraph) move it one place; the bare arrows still move between slides.
|
|
913
|
+
A bullet being typed in moves by the same chord, inside its list session (`PRESENTING_EDITING`, lists).
|
|
914
|
+
**The drag**: the selection's ⋯ handle drags (a press that does not travel is still the click that opens the menu); while it travels the element fades and a line in the accent shows where it would land, between two of the slide's elements (upright between two columns side by side), and letting go moves it there; `Esc` gives the drag up.
|
|
915
|
+
A shape picked inside a diagram is not moved this way: the diagram's empty canvas selects the whole of it.
|
|
916
|
+
On a diagram's shape, Move up and Move down and their chords are front and back's Forward and Backward (`SVG_DIAGRAMS`): up brings it in front of the next shape, down sends it behind the one before.
|
|
917
|
+
A block selected inside a column moves among its own siblings, by the menu's rows and the chord (`path`, below), greyed at the ends of its column; its handle does not drag.
|
|
918
|
+
**The notes, sources and rehearsed time stay last**: an element moves among what the slide shows, and nothing moves onto them or past them.
|
|
919
|
+
Each move is one `POST /deck/edit/element/move` `{ slide, index, to, tag }` (`to` the element's place among what the slide shows), or `{ slide, index, path, tag, to }` for a node among its own siblings, and **one undo entry**; the transform (`moveSlideElement`, `cli/edit.mjs`) moves the element's text and nothing else: when every element sits on its own lines, whole lines move with their indentation, and a slide written on one line stays on one line.
|
|
920
|
+
A path or a tag the file does not have is a 409, never a guess, and so is a move past an end, said as a sentence.
|
|
921
|
+
The answer names where the element is now (`index`, `path`).
|
|
922
|
+
**It shows at once**: the page makes the same move in its own DOM, the write is quiet (`quiet: true, from`) and every other page is sent a `content` event and reloads, the selection follows the element, and the slide is laid out again (its pinned title and subtitle, a split's sides) and scanned for builds again, so a build that moved is a step that moved (builds follow document order).
|
|
923
|
+
Where the page cannot follow, on a design-system slide (the template built its DOM) or one with something live on it (a terminal, a video, a frame), it is the ordinary reload, landing on the slide with the element selected.
|
|
924
|
+
**On a design-system slide an element stays in its slot** (`DESIGN_SYSTEMS`): its `data-slot`, not its place in the file, says where it goes, so it moves only among its own slot's elements, and a move past another slot's is refused with a sentence that says so and points at Edit content (HTML) for changing the slot.
|
|
925
|
+
Locked, or opened without trust, nothing moves, and the toast says why, as for every other edit.
|
|
926
|
+
- **Open in your editor** (write mode; `src/core/open-in-editor.js`, the server's half in `cli/edit-open.mjs` and `cli/code-editor.mjs`).
|
|
927
|
+
The browser edits what it offers, and the rest is the HTML: this is the way from what is on screen to its place in the file.
|
|
928
|
+
The element menu's **Open in your editor**, the slide menu's and the palette's **Open this slide in your editor** send `POST /deck/edit/open` `{ slide, index?, path?, tag? }`, the address every element route takes (no `index`: the slide's `<section>`); the server reads the line and column where that tag opens from the file's own offsets, a path or a tag the file does not have being a 409 like any stale address, and starts the author's editor there: **VS Code** and **Cursor** (`-g file:line:column`), **Zed** (`file:line:column`), what `$VISUAL` or `$EDITOR` names when it is an editor with a window of its own that decklight knows how to send to a line, or **a command of your own** with `{file}`, `{line}` and `{column}` in it.
|
|
929
|
+
A terminal editor (vim, nano) is listed but not offered, with the reason: the server has no terminal to open it in.
|
|
930
|
+
**Asked once**: the first open answers 428 with the editors this machine has (on PATH, and on macOS in the app bundles too), the page shows them on a small card, and the pick is kept beside the voice settings (`~/.config/decklight/editor.json`, `$XDG_CONFIG_HOME` honoured, `GET`/`POST /deck/edit/editor`); Settings' **Code editor** row and the palette's **Choose your code editor…** change it.
|
|
931
|
+
An editor that is gone or does not start is a 422 the page says in a sentence, with **Choose another editor** beside it.
|
|
932
|
+
**The command is never the request's**: the program is the saved choice, the file is always the deck being served, the line and column are the server's own numbers, and it is started as an argument array, detached, with no shell.
|
|
933
|
+
Both POSTs answer this server's own page only (not a plugin's frame, not another loopback page), every `/deck/edit/*` route refuses without trust, and a locked deck still opens, since nothing is written.
|
|
934
|
+
- **Links while editing** (write mode; `src/core/authoring.js`, the rule in `src/core/links.js`).
|
|
935
|
+
In text being edited in place, `⌘K` (`Ctrl+K` on Windows and Linux) over selected words opens a small URL box under them, focused; the pill above a selection carries a link button that opens the same box.
|
|
936
|
+
`⏎` puts `<a href="…">` around the words and leaves the caret just after the link, as a document editor does, so typing carries on outside it and an Enter in a list starts the next point rather than replacing the linked words; `Esc` closes the box and leaves the words as they were, the selection kept.
|
|
937
|
+
Everywhere else `⌘K` is the palette's, as in Docs, Slack and Notion, and the help card's row and the palette's own hint say both meanings; inside the words the element's own key handler takes it first, so the palette never opens over an edit, and with **no words selected** (and the caret in no link) it opens neither the box nor the palette but says *select words to link*; in a code block or a diagram's label, which take no link, it says so.
|
|
938
|
+
On a link already there (the caret or a selection inside an `<a>`) the box opens with its href, a new address updates that link, **Remove link** takes the tag off and keeps the words, and **Open** opens it in a new tab; the pill's link button is lit while the selection is inside one.
|
|
939
|
+
While `#` or a number is typed the box offers the deck's slides by title (a few rows, `↑`/`↓` and `⏎`, or a click).
|
|
940
|
+
**What a link may point at** is one pure rule, unit-tested on its own: `https:`, `http:` and `mailto:` as typed (the scheme lowercased), a bare domain (`example.com`, `//host/…`) written `https://…`, a file beside the deck as a relative path (spaces written `%20`; a path from the site root is refused, because it breaks when the deck moves), and a slide of this deck written `#/N` (`#N` or a bare number mean the same; a slide the deck does not have is refused).
|
|
941
|
+
Anything else is refused in the box with a short reason: `javascript:`, `vbscript:` and `data:` because following them runs or loads a page of their own, any other scheme because a deck cannot carry it.
|
|
942
|
+
The scheme is read the way `NO_TRUST#AUDIT` reads an href (character references decoded, the whitespace a browser drops inside a scheme dropped), so the editor never writes a link the ingredients label would name, and a test holds the two scanners together.
|
|
943
|
+
A new link carries no `target` unless the deck's own web links already use one, in which case it copies that `target` and `rel`.
|
|
944
|
+
The `<a>` goes into the element the way an emphasis tag does and is written by the same save (the element's source rebuilt, the content route, quiet and in place), so it shows at once and `⌘Z` takes the whole edit back.
|
|
945
|
+
No `<a>` ever nests in another: the links the selected words carried step out of the new one, and a link the selection cut through keeps its other half with its own href.
|
|
946
|
+
Links use the theme's `--link` (`THEMING`), in a heading or a list item too.
|
|
947
|
+
**A click on a slide's link does not leave the deck while editing is on**: a plain click (the first click of a double-click included) stays on the deck and selects, as any click there does, and `⌘`-click (`Ctrl`+click) still opens the link in a new tab, as the browser does.
|
|
948
|
+
Locked, or presenting without an edit server, a link works as it always has.
|
|
949
|
+
- **Adding content** (write mode; `src/core/add-content.js`, `tools/starters.mjs`).
|
|
950
|
+
The bar's **Add ▾**, beside Picture, opens a menu of what a slide is made of: Heading, Text, Bullets, Numbered list, Quote, Figure, Conversation, Table, Code, Formula, Two columns, Diagram, Chart, Picture (the file chooser the Picture button opens), Video, Terminal recording and Web page.
|
|
951
|
+
The palette has one row for it, *Slide: Add to slide…*, which opens the same menu.
|
|
952
|
+
What is added lands **after the selected element**, or, with nothing selected, after the slide's last content and before its asides, where a dropped picture goes.
|
|
953
|
+
**Where it lands is one rule, on the server** (`whereNewBlockLands`, `tools/starters.mjs`), the same for Add, the Picture button, a picture dropped on a block and a paste, so that none of them can break the slide's shape: with the **title** selected on a slide that has a subtitle, the new block goes after the subtitle, not between the two (where it would become the subtitle); on a **two-column slide** (`split`, COMPARISON_SLIDES), with a column selected, or anything inside one, it goes **inside that column**, after the column's own child the selection is in, or at the column's end (beside the column it would become a column itself, and the real second column would drop underneath as a footer); with the header of a two-column slide selected, it goes first in the left column.
|
|
954
|
+
A column that is one bare block (a lone list, a picture, no wrapper) is wrapped in a `<div class="column">` in the same write, so the new block has somewhere to go, and keeps the look it had: a `.column`'s blocks take the column's whole width, as the bare block did (a plain `<div>`'s are sized to their content and centred, COMPARISON_SLIDES); the page reloads onto it then.
|
|
955
|
+
Two columns asked for with a column selected are refused (409) with what to do instead, and a column is not duplicated (Duplicate, below).
|
|
956
|
+
**The server owns the markup**: `POST /deck/edit/element/insert` `{ slide, index, path?, kind, quiet, from }` takes a kind from a closed set (anything else is a 400), writes that kind's starter at the slide's own indentation, or a column's (the lines of a code block stay at the margin, since inside `<pre>` every space shows), as one undo entry, and answers the new element's `index`, its `path` below it when it went inside a column, and the markup the file got.
|
|
957
|
+
`POST /deck/edit/element/image` takes the same `path` and lands by the same rule.
|
|
958
|
+
The starters are idiomatic and plainly placeholders: a heading is the slide's `h2` when it has no title and an `h3` when it has one; bullets read *New point*, a numbered list *First step*; a table has a header row; code is `<pre><code class="language-js">` (CODE_AND_MATH); two columns are two sibling `<div>`s, each a heading over its points, and the slide takes `data-layout="split"` in the same write (COMPARISON_SLIDES), so they go first under the title and its subtitle, and after other content they are refused (409) with what to do instead; a diagram is two labelled boxes and a wire in theme tokens only, with the shipped arrowhead under an id no other element of the deck has, and built (`data-build="draw"`, SVG_DIAGRAMS); a chart is a `data-chart="bar"` of three labels and one series (CHARTS); a figure is `<div class="figure">` with its value `42%`, a label and a line of context (DECK_ANATOMY); a conversation is `<div class="conversation" data-build>` of four turns, a user's question, the agent's call, the tool's JSON answer and the agent's reply (DECK_ANATOMY).
|
|
959
|
+
A formula is a display formula in a paragraph, `<p>$$e^{i\pi} + 1 = 0$$</p>`, and a slide not yet marked for math takes `data-math` in the same write (CODE_AND_MATH), so one undo takes back both.
|
|
960
|
+
**A video** is a file: Video opens a chooser for an mp4 or a webm (a video dropped on a slide goes the same way), whose bytes are streamed into `assets/` beside the deck by `POST /deck/edit/asset` (`video/mp4` or `video/webm`, at most 200 MB, refused before it is sent and again by the server with the cap in the sentence; named as a picture is, never over another file), then placed by the insert route as `{ kind: 'video', with: { src } }`, its `src` only a relative path beside the deck: `<video src="…" controls playsinline preload="metadata">`, which the engine plays only on its slide (DECK_ANATOMY).
|
|
961
|
+
The deck's automatic commits carry the deck file alone, so the toast says the video is to be committed by hand.
|
|
962
|
+
**Terminal recording** lists the recordings found beside the deck (`GET /deck/edit/casts`: every `*.cast.json` and asciicast `*.cast` under the deck's folder, a few folders deep, never in a hidden folder or `node_modules`, nearest first), one row each; the one picked is placed by the insert route as `{ kind: 'terminal', with: { cast } }`, its path only one beside the deck, as `<div class="terminal" data-cast="…" data-mode="step">` (TERMINAL_PLAYER), and since a terminal is set up when the deck loads, the page reloads onto it, selected.
|
|
963
|
+
With no recording it adds nothing and says how one is made: recording stays the CLI's (RECORDER_CLI).
|
|
964
|
+
**Web page** asks for its address in a field above the bar (an https address only, said in the field otherwise) and places it as `{ kind: 'webpage', with: { url } }`: `<iframe src="…" title="Web page: host" loading="lazy">`, the content's width at 16:9 unless it says its own size, and while editing a frame takes no clicks of its own, so a click selects it as a block.
|
|
965
|
+
Someone else's page is fetched as the slide shows, so it is **blank in no-trust mode** (whose policy allows only the deck's own frames), **in a video export** (rendered under the same policy) **and offline**; the toast, its Options and Check deck (`web-page`, a warning) each say so.
|
|
966
|
+
**It shows at once**, with no reload: the page puts the file's markup where the file has it, the engine does to it what it does at load (a chart drawn, a diagram's ids namespaced, code highlighted, the split laid out), a diagram that builds is shown whole, the new element is selected, and words (a heading, text, a list's first point, a quote, the first table cell, a column's heading, the code's source, the formula's TeX, a figure's value, a conversation's first turn) go straight into editing with the placeholder selected, so typing replaces it.
|
|
967
|
+
The write is quiet and every other page reloads for it; where the page cannot follow the file in place, it reloads onto the slide and selects the element there.
|
|
968
|
+
**A slide that follows a slide template** (`data-template`, DESIGN_SYSTEMS) takes nothing beside its slots: Add is greyed out there and a press says why, and the route refuses it (409), for the same reason an edit may never drop a slot.
|
|
969
|
+
Locked, or without trust, there is no bar and no row.
|
|
970
|
+
**New slide** in the bar's Slide ▾ and the right-click Slide ▸ is a short choice, **New slide ▸**: Title and bullets, Title and text, Two columns, Section title (an `h1` over one line, a title card), Big number (a figure alone, DECK_ANATOMY: the number is the slide), Blank.
|
|
971
|
+
`POST /deck/edit/slide` `{ op: 'new', slide, kind }` takes the kind from a closed set (no kind is the blank slide it always was), in place as before, and the new slide's title goes straight into editing, selected; a Big number has no title, and its figure's value is what goes into editing. A figure's value and label are typed in place like any words: a first click selects the figure, a second the value or the label under the pointer.
|
|
972
|
+
- **Lists and tables type like a document** (`src/core/list-session.js`, the markup changes in `src/core/list-edit.js`).
|
|
973
|
+
A double-click on a point of a list (`ul` or `ol`, at any depth) starts a **session on the whole list**: **Enter** cuts the point at the caret, the words after it starting a new point below, the caret at its start; emphasis the caret stood inside is cut into two of the same tag, attributes and all, and a sublist goes with the words after the caret, as the lines under a point read in a document.
|
|
974
|
+
**Enter on an empty last point** ends the list: in a sublist it comes out one level, at the top it is removed and the session saved (the only point of a list stays).
|
|
975
|
+
**Backspace at the start** of a point joins its words to the end of the point above as it reads (an empty point simply goes), the caret where the two met and the halves of a cut tag one again; its own sublist stays where it read.
|
|
976
|
+
**Tab** nests the point under the one before it, last in that point's sublist or in a new one of its own list's type (the first point of a list has nothing to go under, and says so); **Shift-Tab** takes it out to sit after the point that held it, the points that followed it there becoming its own sublist so the list reads in the same order.
|
|
977
|
+
**Control-Shift-↑ / ↓** (the same chord on every platform, `⌃⇧↑` on a Mac, as a document's outline moves a paragraph) swaps the point with the one before or after it in its own list, its sublist going with it, and the typing stays in it; at either end of its list it stays and says so, and it never changes level (Tab does that).
|
|
978
|
+
The move is part of the session, so its one write and one undo carry it.
|
|
979
|
+
A point carries its sublist wherever it goes.
|
|
980
|
+
Tab never leaves the page. **⌘⏎** (**Ctrl+⏎**) keeps and **Esc** gives the whole session up, every point the session made or moved put back as it was (the very elements, so a point that is a build step stays one); a click on another point of the same list moves the typing there without ending anything.
|
|
981
|
+
The hint under the list says so: *⏎ new point · ⇥ indent · ⇧⇥ outdent · ⌘⏎ keep · Esc cancel*, under the whole list rather than the point, so it covers none of the next one.
|
|
982
|
+
**One session, one write**: every cut, join and move is made on the list's SOURCE, read once from `GET /deck/edit/element/source` when the session begins, and the session ends in one `POST /deck/edit/element/content` of the top-level element (quiet, from this page, written in place), so one undo chord takes the session back; a list that changed in the file meanwhile is refused rather than overwritten.
|
|
983
|
+
The list is found in the element by its path and only the list is rewritten, so every byte around it stays as written (a bare `data-build` stays bare); a new point copies the tag of the point it came from less its `id` and `data-build-order`, a list the session restructures is laid out again the file's way (one point a line, indented a step a level, or on one line if it was), and what was typed goes in cleaned of what `contenteditable` makes on its own: no `<div>`, no `<br>` holding an empty line open, no ` ` for a space, no `<span style>`, `<font>`, `<b>` or `<i>` (a `style=` stays only when the list had one in the file; an author's own no-break space between two words stays).
|
|
984
|
+
After the write the slide's builds are scanned again, so in a list with `data-build` a new point is a build step of its own, and the point being typed in stays on screen; when the notes' [click] markers no longer match the build clicks (BUILD_SEMANTICS, `tools/click-match.mjs`) the save says so, once.
|
|
985
|
+
A list this editor cannot cut honestly (a point holding a paragraph, a table, two sublists) keeps the old edit, one point at a time, Enter keeping its words.
|
|
986
|
+
**A table** (`td`, `th`) is a session too: **Tab** and **Shift-Tab** move to the next and previous cell with its words selected, as a spreadsheet does, so typing replaces them; **Tab in the last cell adds a row** shaped like the last one, and Enter keeps; the session's words and rows are one write.
|
|
987
|
+
The element menu of a table, right-clicked on a cell, has **Table ▸**: **Add row above**, **Add row below**, **Add column left**, **Add column right**, **Delete row** and **Delete column**, each one write through the content route, shown in place: a new row copies the cell tags of the row beside it (below the header it is a body row), a new column copies in every row the cell beside it (a header keeps its `<th>`, a `<colgroup>` naming every column gains or loses its `<col>`), a table keeps at least one row and one column, and a table that merges cells (`colspan`, `rowspan`) is refused, since which column a merged cell is in has no one answer.
|
|
988
|
+
Under them, **Align column left**, **center** and **right** put a `text-align` on every cell of the column the click is in (the header's too), ticking the one the column has; **Header row** turns the first row's cells into `<th>` in a `<thead>` of its own (ticked when the table has one), and unticked makes them `<td>` again, the first row of the body.
|
|
989
|
+
Alignment and the header row need no column arithmetic, so a table that merges cells takes them; its rows and columns are still refused.
|
|
990
|
+
While editing, the pointer at a cell's right edge (not the last of its row) is a column cursor: a drag there sets that column's width live, and on release one write puts it in a `<colgroup>` naming every column as a share of the table (`<col style="width: 30%">`, 5 to 95%), the `<colgroup>` made when the table has none; **Even widths** under Table ▸, offered once a width is set, takes every width off, and a `<colgroup>` it made goes with them.
|
|
991
|
+
Headings and paragraphs are unchanged: Enter keeps.
|
|
992
|
+
A sublist sits under its point (the inline-block that centres a list was putting a nested one beside the words), and while editing is on an empty cell keeps a line's height, so a new row can be clicked into.
|
|
993
|
+
- **Pictures after the drop** (write mode; `src/core/pictures.js`).
|
|
994
|
+
A dropped or chosen picture is an `<img>`, and from then on it is changed without the HTML.
|
|
995
|
+
**Resize**: a selected picture (on the slide, or picked inside a figure or a column, which selects the picture itself rather than its box) wears four corner handles on its outline, and the ⋯ handle steps aside for them.
|
|
996
|
+
Dragging one resizes it live with its aspect kept, the size it would write shown under it, and one write lands on release: the `width` attribute, a whole number of **deck units** (the stage is a fixed design size scaled to the window, so screen pixels would mean another size on another screen).
|
|
997
|
+
An attribute rather than a style because every theme's `max-width: 100%` still caps it, so it survives a theme change; a `height` attribute and an inline width or height would fight it, so the write takes them off.
|
|
998
|
+
A drag never makes the picture wider than the slide's content box or taller than it, and on a slide that fits it stops where the rest of the slide would start to clip; the overflow guardrail (`PRESENTING_FIT`) judges the slide after as always.
|
|
999
|
+
A double-click on a handle is the picture's own size again (the attribute removed).
|
|
1000
|
+
**How a picture sits in its frame**: Picture ▸ has **Fit** (**Whole picture**, or **Fill a 16:9, 4:3, 3:2 or square frame**, the picture filling a frame of that shape and cropped to it: `aspect-ratio` and `object-fit: cover`), and, once it fills one, **Position ▸**, the nine places the frame shows it from (`object-position`), and **Corners** (**Square**, **Rounded**, **More rounded**, **Circle**: `border-radius` 8px, 16px or 50%), the one it has ticked in each.
|
|
1001
|
+
Each shows at once and is written as the picture's own style through `POST /deck/edit/element/style`, one write and one undo, in one closed shape each (four frame shapes, nine places, three roundings), and a refusal puts the picture back; **Whole picture** takes the frame and its position off together.
|
|
1002
|
+
Cropping by dragging a picture's edges inward is not there yet.
|
|
1003
|
+
**A diagram and a framed web page resize the same way** (`src/core/resize-handles.js`, the handles every resize shares): a diagram selected whole (its canvas, not a shape in it) and an `<iframe>` wear the same four corners, and the write is the same `width` through the same route (`POST /deck/edit/element/picture`, which takes a width, and only a width, on an `<svg>` or an `<iframe>`).
|
|
1004
|
+
A diagram selected whole also wears a handle on the middle of each **edge** (`src/core/canvas.js`): its corners make the whole diagram bigger or smaller on the slide, its edges give the drawing more room or take empty room away (its canvas, `SVG_DIAGRAMS`), and Shape ▸ **Fit the canvas to the drawing** trims the room round it to an even margin.
|
|
1005
|
+
**A block's width** (`src/core/block-resize.js`): a selected chart, text, quote, list (a point selected means its list), table or code block has a handle on each side, and dragging one sets how wide it may be, live, with one write on release: `max-width` in whole deck px (40 to 4096, the one shape `POST /deck/edit/element/style` takes for it).
|
|
1006
|
+
It is never wider than what holds it: the slide's content box, the column it is in, or, a direct half of a split slide, its half (the layout's 48%); on a slide that fits it stops before the slide would clip, which for text that wraps is a narrowest width as much as a widest; a fitted code block is fitted again to its new width; and a double-click on a side takes `max-width` off, back to automatic.
|
|
1007
|
+
**Alt text and Replace…**: with a picture selected, the inspector's Info tab, which otherwise only reports, makes `alt` a field (⏎ saves, Esc puts it back, a missing one still marked !) and puts **Replace…** beside the image row: a file chooser, an upload through `POST /deck/edit/asset`, and the same `<img>` pointed at the new file, its size and alt kept.
|
|
1008
|
+
**The slide's background**: Slide ▸ (the right-click menu's and the bar's Slide ▾) has **Background picture…** (choose, upload, then the slide's `data-background-image`, `DECK_ANATOMY`) and, when the slide has one, **Change background picture…** and **Remove background** (which takes the size, position and dim that tuned it along, unless a background video is still there).
|
|
1009
|
+
A picture's element menu has **Picture ▸**, the same four rows for every picture, one that cannot act greyed: **Replace…** (the Info tab's), **Add caption**, **Use as slide background** and **Reset size** (the handles' double-click, greyed at its own size).
|
|
1010
|
+
**Use as slide background**: it leaves the slide's content (a `<figure>` it leaves empty goes too) and its file becomes the background, in one edit; only a file beside the deck can, never an inline `data:` picture or a link.
|
|
1011
|
+
**Add caption** (on a picture not already in a figure) wraps it in a `<figure>` on the page at once, whose `<figcaption>` opens straight into inline editing with its placeholder selected; **the file gets the figure and the words in ONE write when the typing ends** (`⏎`, or leaving), so one undo takes the caption back, and `Esc` (or no words) writes nothing and puts the picture back as it was; a figure stands where the picture stood, centred, its caption small in the theme's `--muted`, all at zero specificity so a deck's own figure rules win.
|
|
1012
|
+
**The routes**: `POST /deck/edit/element/picture` `{ slide, index, path?, tag?, width?, alt?, src?, caption? }` (the picture addressed like any nested node; `width` a number from 16 to 4096 or null, `alt` any string escaped, `src` only a relative path beside the deck, `caption` one line; a path landing elsewhere is a 409) and `POST /deck/edit/slide/background` `{ slide, src | null, take? }` (`take: { index, path?, tag? }` is the picture made the background).
|
|
1013
|
+
Pure textual transforms in `cli/edit.mjs` (`setElementPicture`, `setSlideBackground`, `pictureToBackground`), one undo entry each.
|
|
1014
|
+
**Shown at once**: every write is quiet (`quiet: true, from`), the page making the change itself (the slide rescanned and laid out again; a background's layer drawn again for that one slide, and the bleed behind the stage repainted when it is the slide on screen), and every other page of the deck is sent `content` and reloads.
|
|
1015
|
+
The lock and no-trust mode refuse them as they refuse every write.
|
|
1016
|
+
- **A chart's numbers, as a grid** (write mode; `src/core/chartgrid.js`, its pure half `src/core/chartdata.js`).
|
|
1017
|
+
The inspector's **Data** tab, beside Info, Colors and Type, is enabled when the selection is a chart (`CHARTS`) or inside one, and shows its data as a grid: a row per label, a column per series, the series' names in the header row, every cell typed into in place.
|
|
1018
|
+
**+ row** adds one below the cell the caret is in (its label `label N`, a 0 in every series), **− row** removes it, **↑** and **↓** move it, **+ series** adds one (`series N`, a 0 per label), **− series** removes the one the caret is in, a header cell renames its series; a **Type** switch offers the kinds a grid can draw (bar, line, area, pie, donut; pie and donut only with one series) and a **Title** field writes `data-title`.
|
|
1019
|
+
**Shape** is wide, standard, square or tall (16:9, 4:3, 1:1, 3:4: `data-aspect`, wide taking it off, or the JSON's `"aspect"` where the chart says it there; a shape of the chart's own, `5:2`, is shown as written, none of the four ticked), and **Legend** is auto, on or off (the JSON's `"legend"`, auto taking the key off).
|
|
1020
|
+
`Tab` and `⇧Tab` walk the cells across and on to the next row, `⏎` and `⇧⏎` down and up, and `Esc` in a cell puts back what it held when the caret came in (a second `Esc` leaves the cell).
|
|
1021
|
+
A number cell takes a number or nothing (a gap, `null`, which the chart skips); anything else (`12a`, `1,5`) is marked and neither drawn nor written.
|
|
1022
|
+
**On a line or area chart a series' band and markers are columns too** (CHARTS): a series with a band has a **low** and a **high** column after its values (a band series has only those two), typed into as a value is; **+ band** gives the series the caret is in a band whose low and high start as its values, and **− band** takes it off; a **◆** column a series ticks the rows it has a marker at (a tick is its own write, a new marker naming its row by its label) and, once ticked, has the marker's words beside the tick, written as a cell is.
|
|
1023
|
+
**Where a line turns dashed** is a row under the grid, **dashed from**: a choice per line series of *solid* or one of the chart's labels (`dashFrom`, naming the row by its label; *solid* takes the key off); a band series has none. **+ band series** adds a band series at the end (`"type": "band"`, named *range*), its low and high starting as the values of the series the caret is in, to be widened, the caret on its first low.
|
|
1024
|
+
**On a bar, line or area chart** (one with a value axis) two fields sit above the grid: **Now** picks *none* or one of the chart's labels (`"now"`, naming the row by its label, after `"labels"`), with its words beside it (empty is drawn *now*; words turn it into `{ "at": …, "label": … }`, and taking them off turns it back), and **Threshold** takes the value the rule is drawn at, a number as a cell takes one (empty takes the threshold off; anything else is marked and neither drawn nor written), with its words beside it (`"threshold": { "y": …, "label": … }`). A pick is its own write; the fields are written as a cell is, each field its own burst. A reference that names no label is shown as written until another is picked.
|
|
1025
|
+
A row added gives a band a gap there, never a 0; a row removed takes the markers at it with it, and a `dashFrom` or `now` there comes off; a row moved, added or removed renumbers every reference that names a row by its position, and a label renamed carries every reference that names it by that label.
|
|
1026
|
+
**Every change is drawn at once**: the page's own copy of the chart's JSON changes and that one chart is drawn again (`renderChart`), its series' concepts painted and its slide's builds rescanned, a `data-build` moving onto the new `<svg>` as at init.
|
|
1027
|
+
**The write waits for the typing**: it goes once the cell has been quiet for 700 ms, or is left, and a button is its own write, so one burst of typing is one `POST /deck/edit/element/content` `{ slide, index, html, quiet: true, from }` and one undo entry, written in place like a colour pick.
|
|
1028
|
+
**The file keeps its shape**: the chart is read from the file (`GET /deck/edit/element/source`, never the live DOM, where the engine has put an `<svg>` in its place), found in its element's source by its place among the element's charts, and its JSON is edited as text: only the values that changed are spliced, so the key order, the line breaks, a `1.50` typed on purpose and every key the grid does not know stay as they were, and an inserted item copies the spacing its neighbours use.
|
|
1029
|
+
Only the JSON, `data-chart` and `data-title` change; the element's other attributes and its `data-build` are the file's bytes.
|
|
1030
|
+
A chart that says its type or title in its JSON (`"type"`, `"title"`) has them written there instead, and `"donut": true` comes off when it stops being a donut.
|
|
1031
|
+
**A scatter opens as x / y pairs** (CHARTS): a column pair per series under its name, a row per point, an **X axis** and a **Y axis** field for its `"x"` and `"y"` titles (empty takes one off), **+ point** (a copy of the point the caret is in, after it), **− point** (a series keeps one), **+ series** (one point at the origin) and **− series**; both numbers of a point are needed, and anything else in one is marked and neither drawn nor written, as a cell is; its type stays scatter, since its pairs are not one value per label.
|
|
1032
|
+
**A chart the grid cannot show says so**: a scatter point that is not two numbers, JSON that does not parse, a series without a `data` list, a value that is not a number, more values than labels, a band that is not two lists, a marker at no label or two at one; the tab shows the reason and a button to edit the chart in the HTML editor, never a broken grid.
|
|
1033
|
+
Locked, without trust, or with no edit server, the grid only reads (from the chart on the slide) and says why, as `cannot()` words it.
|
|
1034
|
+
- **A block's settings: the Options tab** (write mode; `src/core/options-tab.js`, the shared reading in `tools/code-options.mjs`).
|
|
1035
|
+
The inspector's **Options** tab, after Data, shows when the selection is a code block (a `<pre>` holding a `<code>`, CODE_AND_MATH) or holds just one, with its settings as plain fields.
|
|
1036
|
+
**Language** lists the languages the runtime highlights, and *plain text*, which takes the `language-` class off; a name the file already has for the same language, `js`, is kept, and one the runtime does not highlight is shown as it is and never rewritten.
|
|
1037
|
+
**Line numbers** (`data-lines-numbers`) is a checkbox, written bare. **Fit** is *off* (no `data-fit`), *shrink to fit* (bare `data-fit`) or *fill* (`data-fit="fill"`, CODE_AND_MATH).
|
|
1038
|
+
The **line steps** (`data-lines`) are one row a step with its number and a ✕, **+ a step** adding one, and a click on a line of the block putting that line into the step typed in last (a second click takes it out again, the step kept as ranges: `1-2` and 3 is `1-3`).
|
|
1039
|
+
Under each step's lines is its **callout**, a label field written to `data-callouts` in place (a bar in a label escaped, the attribute taken off when no step has one); removing a step removes its label, and while a step is refused its labels wait with it. **Keep earlier callouts** (`data-callouts-keep`) is a checkbox, written bare.
|
|
1040
|
+
A step is `all`, a line, a range or several (`1,3-4`); one the block cannot take (a line past its end, a range that runs backwards) is refused in its row, in a sentence, and none of the steps is written until every row is one the block can take.
|
|
1041
|
+
**Every change shows at once**: the block is set up again from the file's source, highlighted, lined, fitted and its steps counted again, so presenting it lights the lines a click at a time.
|
|
1042
|
+
**The write waits**, as the Data tab's does: 700 ms after the last change, or when a step's field is left, one burst of changes is one `POST /deck/edit/element/options` `{ slide, index, path?, tag, set: { name: value | null }, quiet: true, from }` and one undo entry.
|
|
1043
|
+
The route takes a closed set of names per tag (`ELEMENT_OPTIONS`, `setElementOptions` in `cli/edit.mjs`), each in its one shape (the toggles written bare, `true`, or taken off, null), checks the steps against the lines the file's code has, and refuses anything else with a sentence and nothing written; a refusal puts the block and the fields back to what the file has.
|
|
1044
|
+
A selected **video** on a slide (DECK_ANATOMY) has its own fields there: its **File** with **Replace…** (another mp4 or webm, copied beside the deck as Add's is), **Controls**, **Loop**, **Muted**, **Play when the slide arrives** (`autoplay`, which the engine keeps as the ask to play on arrival; ticking it ticks Muted too and says why, since a browser will not start a video with sound, and unticking Muted unticks it the same way; the route refuses one without the other) and its **Poster** (**Choose…** or **Replace…**, a picture copied beside the deck, and **Remove**), written as the code block's are, `tag: 'video'`, a file only a relative path beside the deck.
|
|
1045
|
+
A selected **terminal** (TERMINAL_PLAYER) has its fields there too: **Recording** (one of the recordings `GET /deck/edit/casts` finds beside the deck), **Plays** (a command a click, `step`, or by itself, `play`), **Title**, **Rows** (4 to 60), **Typing speed** (1 to 10), **Typing sound** (thocky, creamy, clacky, off) and **Poster** (how many steps show before it plays), each empty for the player's own default.
|
|
1046
|
+
A terminal is set up when the deck loads, so these are gathered and written together by **Save and reload**, `tag: 'div'` (only a `.terminal` takes them), and the deck reloads to show them.
|
|
1047
|
+
A selected **figure** (DECK_ANATOMY), or its value, has **Count up** (`data-count`, written bare) and **Start from** (`data-count-from`, a plain number, empty for 0), each written as it is changed, `tag: 'p'` (only a value, `data-figure`, takes them); a change plays the count on the slide.
|
|
1048
|
+
A selected **web page** has its **Address** (https only) and its **Title** (a screen reader says it, so it cannot be emptied), each written as it is entered, and the sentence saying where it is blank.
|
|
1049
|
+
Locked or without trust the tab is not there.
|
|
1050
|
+
- **A diagram's shapes move, resize, and are added and duplicated in place** (write mode, `src/core/shapes.js`; SVG_DIAGRAMS).
|
|
1051
|
+
A selected node inside an authored `<svg>` drags: a plain click still selects, and a drag only starts a few pixels out.
|
|
1052
|
+
The node moves live and the release is ONE write and one undo entry, `POST /deck/edit/element/geometry` `{ slide, index, edits: [{ path, tag, attr, value }], quiet, from }`, in the geometry the node already uses: `x`/`y` on a rect, a label, an image or a `<use>`, `cx`/`cy` on a circle or an ellipse, both ends of a line, and a translate in the `transform` of a group, a path or a polygon.
|
|
1053
|
+
The attributes are a closed set (`x`, `y`, `width`, `height`, `cx`, `cy`, `r`, `rx`, `ry`, `x1`, `y1`, `x2`, `y2`, `transform`), each a number written to one decimal at most (a size never negative), and a `transform` value is `translate(x y)`: the translate the node is to have, which replaces a leading translate the file has and goes in front of whatever else the transform says, so a `rotate()` survives; `translate(0 0)` takes it off.
|
|
1054
|
+
A box moves with its labels: a group that is one shape and its labels moves whole, and a shape whose labels sit loose beside it (their middle inside it) takes them along, each by its own `x`/`y`.
|
|
1055
|
+
A build step owns its transform (the build's CSS sets it), so a group that is a step moves what it holds, and a path or a polygon that is a step is not moved.
|
|
1056
|
+
The pointer goes through the inverse screen matrix of the node (its parent's, for a translate), so a scaled stage and a viewBox both come out right; `⇧` holds the move to one axis, `Esc` gives it up, and a coordinate keeps its grain (an integer stays an integer).
|
|
1057
|
+
**Nothing leaves the canvas**: an `<svg>` draws nothing past its `viewBox`, so a move stops with the node's box (its labels with it) against the edge it is dragged at, a resize handle stops on that edge, and a wire's or a line's end dragged past it lands on the nearest point of it, so the file never gets a point the slide cannot show and a handle never sits where its shape is not.
|
|
1058
|
+
Growing the canvas is a deliberate act on one of its edge handles (`SVG_DIAGRAMS`, the canvas), never what a drag past the edge does.
|
|
1059
|
+
A shape an older file already has poking out of an edge is not pulled in: it goes no further out on that side.
|
|
1060
|
+
The page does the holding, since the server checks each value and does not know the `viewBox`; an svg with no `viewBox` is not held.
|
|
1061
|
+
**Resize**: a selected rect, ellipse, circle or image, a shape marked `data-shape`, or a box group, wears eight handles in the accent (`⇧` on a corner keeps the proportions, a circle keeps its centre), and a line wears one at each end; a marked shape's `points` or `d` is written again for its new box, so it keeps its form; a label centred on the box stays centred on it, and one written from an edge keeps its distance to that edge.
|
|
1062
|
+
**Shape ▸**, on the element menu of a diagram (the svg or any node in it), under its Add heading: **Box** (a group of a rect and a centred label), **Ellipse**, **Label**, **Line / arrow**, and **Diamond**, **Hexagon**, **Cylinder**, **Document**, **Note** and **Cloud** (each a group of one shape marked `data-shape` and a centred label, typed into as a box is, the size and look of the nearest of its kind, else the look of the nearest box), each written by the server, `POST /deck/edit/element/shape` `{ slide, index, path, tag: 'svg', op: 'add', kind, at }`, the way the nearest of its kind in that diagram is written (its look, never its place, its id, its concept or its build), else in theme tokens only (`var(--d-fill-1)`, `var(--d-stroke)`, `var(--d-text)`); a line ends in the arrowhead the svg already defines, else the shipped marker (Arrowheads, above) is added to its `<defs>`, made when it has none.
|
|
1063
|
+
It lands where the menu was opened, in the svg's own coordinates (the viewBox centre when the menu was opened off the diagram), last in the svg, on its own line at its siblings' indentation, and a new box or label goes straight into its words, in the label box above.
|
|
1064
|
+
**Duplicate** (the element menu's, or `⌘D` / `Ctrl+D`), on a node (`op: 'duplicate'`, `path` the node, or the box group a shape is the box of): the file's markup, its ids taken off, moved a fiftieth of the viewBox down and right in the geometry it uses (a build step's children, points or path coordinates), right after it, and selected.
|
|
1065
|
+
The server answers with the markup it wrote (`added: { path, html }`, and `defs` when it defined an arrowhead), and the page puts that very node on the slide, its `url(#…)` references pointed at the svg's namespaced ids.
|
|
1066
|
+
Everything shows at once and is written quiet, every other page sent `content`.
|
|
1067
|
+
What the engine drew from a moved shape follows it: a riding arrowhead and a dashed line's mask are fitted to the new geometry, and nested tones and concept colours are painted again for that svg.
|
|
1068
|
+
A shape added to a built diagram shows at once on this page and is its last step from the next load.
|
|
1069
|
+
A path the file no longer has is a 409; the lock and no-trust mode write nothing, and the engine's and a template's nodes are never moved.
|
|
1070
|
+
A connector follows the boxes it joins (the connectors bullet below); a plain line does not, until its ends are dropped on them.
|
|
1071
|
+
- **Connectors and alignment guides in a diagram** (write mode, `src/core/shapes.js`; SVG_DIAGRAMS has the file contract and the routing).
|
|
1072
|
+
A selected box or shape shows a small dot off each of its four sides; a drag from one draws a dashed wire after the pointer, the node under it lit and boxed in the accent, and a drop on it makes a connector, `POST /deck/edit/element/connector` `{ slide, index, op: 'add', path, tag: 'svg', nodes: { from, to }, geometry, quiet, from }` (each node `{ path, tag, label }`), one undo entry: the server gives each node a `data-node` if it has none (named from its words, a group's label or the label the page read beside it, slugged and unique in the svg), writes a line last in the svg the way the diagram's other wires are written (else in theme tokens), ending in the arrowhead the svg already defines (else the shipped one, added to its `<defs>`), and answers with the markup, which the page puts on the slide, selected.
|
|
1073
|
+
A drop on the canvas makes nothing, and `Esc` gives the wire up.
|
|
1074
|
+
A panel (a node whose box holds another shape) joins only when the pointer is near its edge, so an end moved about inside one is not caught by it.
|
|
1075
|
+
**Connectors stay attached**: a move, a resize or a Duplicate routes the node's connectors again, live, and their new geometry goes in the same `POST /deck/edit/element/geometry` as the move, one undo entry for the whole gesture (the route's closed set takes `d`, path data in absolute `M`, `L`, `H`, `V`, `C`, `Q` and `Z` with numbers only, and `points`, pairs of numbers, each written back in one spelling); a node removed takes the connectors that name it in the same write; a duplicate's nodes get names of their own, its connectors joining the copies (an end on a node outside the copy is let go).
|
|
1076
|
+
**A connector's ends**: selected, it wears a handle at each end, and its body does not drag.
|
|
1077
|
+
An end dropped on another node reconnects it (`op: 'reconnect'`, its `data-from` or `data-to` rewritten), one dropped on the canvas lets go where it lands (`op: 'detach'`), held on the canvas when the pointer leaves it (below), and a hand-drawn `<line>` whose end is dropped on a node becomes attached: that is how an old deck's wires get connected.
|
|
1078
|
+
`⌘`/`Ctrl` held keeps an end from attaching.
|
|
1079
|
+
**The element menu on a wire** (a connector, or a plain line) has **Wire ▸**, one submenu of two small headed groups: **Route** Straight, Elbow, Curved (`op: 'route'`; a line that bends becomes an unfilled `<path>`), **Arrows** None, End, Both ends (`op: 'arrows'`; a start head is a marker oriented `auto-start-reverse`, the shipped one added when the svg has none), **Line** Solid, Dashed, Dotted (a style write, `SVG_DIAGRAMS`; it survives a re-route, and a drawn stroke is put on the page again as the file has it, so a dashed one draws dashed), each ticking what the wire has, then **Width…** (the inspector's Colors tab on its Stroke, where its width is), **Label…** (a label that rides on the wire, `SVG_DIAGRAMS`; **Edit label…** when it has one), **Send a token along it** (a build step, `<g data-build="travel" data-along-wire>` appended to its svg, `op: 'token'`, the wire named first when it is not; it plays on a click of its own after the diagram's others, and the slide steps to it so the token is seen travelling; BUILD_ENTRANCES) and **Reverse** (`op: 'reverse'`: from and to swapped, the geometry run the other way).
|
|
1080
|
+
A box's **Shape ▸** has **Corners** Square, Rounded, Pill (one geometry write of its `rx` and `ry`), and a stroke that is no wire, a polyline or an unfilled path, has **Line** there.
|
|
1081
|
+
A shape's **Shape ▸** has **Order**: To front, Forward, Backward, To back, each greyed where the shape already is (`POST /deck/edit/element/order`, `SVG_DIAGRAMS`).
|
|
1082
|
+
Under **Group** it has **Ungroup** on a group (`⇧⌘G` / `Ctrl+Shift+G`), and, on a shape inside a plain `<g>` of two drawn things or more, **Select the whole group** and **Make it a group** (`POST /deck/edit/element/group`, `SVG_DIAGRAMS`, groups); each row only where it applies.
|
|
1083
|
+
**Colors…** on a line or a polyline is its stroke alone: its colour and its width, no fill.
|
|
1084
|
+
The page routes and sends the geometry, since only it can measure a label; the server checks every value and owns the markup, and a path the file no longer has is a 409.
|
|
1085
|
+
A drawn connector whose arrowheads or element change is put on the page again and its slide's builds scanned again.
|
|
1086
|
+
**Alignment guides**: while a shape is dragged or resized, a thin accent line shows where its edges or its middle line up with another shape's in the same svg, and it snaps to them within a few pixels; a resize snaps only the edges its handle moves, a corner dragged with `⇧` (keeping the proportions) is not bent to them, and `⌘`/`Ctrl` held turns snapping off for that drag.
|
|
1087
|
+
- **The layout picker** (write mode only, `src/core/layout-picker.js`): the bar's **Layout** button, and the palette's *Slide: Slide layout…*, open one short row of small pictures of the CURRENT slide, one per way it can be arranged, each this slide's own content laid out by the engine as choosing it would lay it out (cloned from the live slide, so a chart is drawn and code is lit; never a screenshot). The row sits just above the bar and is no taller than about a fifth of the stage, so the slide it previews stays in view; a long row scrolls sideways.
|
|
1088
|
+
**In a deck on a design system its templates come first** (DESIGN_SYSTEMS): one group per design system, headed by its title, one cell per template in the design system's order, each the slide put into that template by the same rule the server writes with (`GET /deck/edit/slide/template/preview?slide=&template=` runs that write on the file without saving it and answers each child's slot, so a cell is what choosing it writes). **More layouts** at the end of the row shows the built-in layouts after them; they start shown when the slide already takes one (other than `auto`), so the current choice is always in sight. A design system the deck names that this machine cannot load is a group with one line saying so. Without a design system the row is the built-in layouts, no toggle.
|
|
1089
|
+
**The dry runs are queued, two at a time** (#1240): a deck of ten templates never needs ten free connections at once. A dry run that fails (`boundedFetch`'s stall, the server's error) leaves its cell showing a dash, and the panel says so **once**, in a status line under the row (*no preview for 3 templates: no answer in 8s — …*), with **Retry** (or `R`), which asks again for the missing ones without closing the picker.
|
|
1090
|
+
The current choice is marked (`●`, `aria-selected`). A cell says what is wrong before it is chosen: **clips** (the overflow guardrail's mark on that variant), **fights its columns** (`data-split-conflict`), **N parts have no slot** (a template switch's `lacking`).
|
|
1091
|
+
**Moving over a cell, or onto it with ←/→ (Home/End), shows it on the slide**: the variant sits over the live slide, which stays as it is underneath, and **nothing is written**. Escape, a press outside the picker, a slide change, another page's layout pick or another overlay opening puts the slide back. ⏎ or a click **writes once**, one undo entry: a built-in layout on a plain slide through `POST /deck/edit/slide/layout` (quiet and in place, at once rather than debounced, a pending cycle sent first); a template through `POST /deck/edit/slide/template` (into it from a plain slide, or to it from another), which reloads the pages because a template is laid out at load. Choosing the current one closes and writes nothing.
|
|
1092
|
+
**Space on a cell opens a large preview of it** (#1241, Quick Look's gesture): the same variant the tile shows, at the largest size that fits the window with a margin, at the deck's aspect ratio, headed by the choice's name (*Acme Brand · Quote*, *Built-in · split*) and the tile's note in full, the parts without a slot named (*2 parts have no slot: "quote", "author"*). ←/→ move to the previous and next cell (past the More layouts toggle) and the row's focus moves with them; ⏎ chooses that cell exactly as ⏎ on the tile does (one write, one undo); Space or Esc goes back to the row on the same cell, and Esc a second time closes the picker. A cell whose dry run failed opens it with the reason and **Retry**. Opening it writes nothing, and while the picker is up Space is never the narration's play and pause: the picker takes every key first. Space on the More layouts toggle shows or hides the built-in cells, as ⏎ does. The row's key line says `space: larger preview`.
|
|
1093
|
+
**A slide on a template can leave it for a built-in layout, and is asked first**: its built-in cells carry `↗` (leaves the template) and preview the slide out of it; choosing one replaces the row with *Slide N leaves the T template and takes L. Its words and pictures stay. The design system's background, artwork and placeholder text for this slide go. Choosing T again puts everything back.* ⏎ **Leave template and use L** writes `POST /deck/edit/slide/template { slide, template: null, layout }`: out of the template and into the layout in ONE edit, one undo entry, never a moment with neither; the `data-slot` attributes stay, so choosing the template again restores each part to its slot. Escape goes back to the row. Cycling never does this: it still refuses a template's slide.
|
|
1094
|
+
The bar's button names the choice: `Layout · split`, or `Layout · acme/statement` on a template's slide. The picker is a `dialog` holding a horizontal `listbox`; focus starts on the current cell (on a plain `auto` slide of a design-system deck, the first template) and goes back to the button on close.
|
|
1095
|
+
- **Slide layout cycling** (write mode only): the palette's *Slide: Cycle slide layout* walks the CURRENT slide through the layout ring: `auto` (deck default: the `pinTitles` config, **on by default**, + the pinnable heuristic, so out of the box a pinnable slide pins) → `centered` (title in flow, content vertically centered) → `pinned` (title pinned at the pin Y) → `top` (everything flows from the top of the slide) → `split` → `split-flip`.
|
|
1096
|
+
Ring entries that cannot change the slide's look are SKIPPED so every press shows something new: `pinned` when `auto` already pins, `split-flip` when there aren't two content blocks to swap sides.
|
|
1097
|
+
**Split layouts**: the first two content blocks, everything after the title + subtitle header (which spans the full width, pinned or in flow), become ~half-width sides in a wrapping flex row, first block left and second right; `split-flip` mirrors (bullets left · diagram right ⇄ diagram left · bullets right).
|
|
1098
|
+
The two sides **share a top edge** (`align-items: stretch`): columns of unequal height used to centre independently, so the shorter one's heading floated down the slide and the pair stopped reading as a pair: authors were hand-rolling `display:flex; flex-direction:column; height:100%` on each column to get this back.
|
|
1099
|
+
Images opt out of the stretch (`align-self: center`) so a picture is never letterboxed inside a box taller than itself.
|
|
1100
|
+
A **third block is a footer, not a third column**: it spans both sides, centred, below them (`.split-footer`, applied by the engine to every block past the second).
|
|
1101
|
+
The shape that asks for this is the comparison slide (two columns and a note that applies to both) and treating it as "everything else right" hung that note under one side of a comparison it was about equally.
|
|
1102
|
+
Three side-by-side columns are deliberately **not** a shape: grouping three items onto one slide multiplies content-per-slide, which is what the density guidance exists to discourage; use two and a footer, or another slide.
|
|
1103
|
+
A slide whose ONLY content block is a list can't take sides: the engine marks it `.split-columns` and the list itself splits across two CSS columns (`break-inside: avoid` per item).
|
|
1104
|
+
The pick lands on the section as a `data-layout` attribute (the same attribute an author can write in the file, and headless probes can assert on) and it wins over `data-pin` (`pinned` forces the pin, a numeric `data-pin` still sets the Y; `centered`/`top` lay out in flow; the split pair keeps the deck's auto pin resolution for its header).
|
|
1105
|
+
`auto` removes the attribute. A layout pick is a PERSISTED deck edit, so cycling requires write mode: the pick applies to the DOM instantly and is written back into the file through the edit server (debounced ~600ms, so a cycling burst costs one write/reload, and a pick pending when the slide changes is flushed, not dropped): the file is the ONLY persistence (no localStorage).
|
|
1106
|
+
Without the server, cycling toasts what it needs and changes nothing: a presenter can't silently fork the deck from what's on disk.
|
|
1107
|
+
Every change re-measures pinned titles and re-runs the overflow guardrail.
|
|
1108
|
+
`instance.cycleLayout(±1)` programmatically (same gate); `instance.layoutRing(n)` exposes a slide's ring, skips included, so headless probes can assert the skip logic without a server; also in the `/` palette ("Cycle slide layout").
|
|
1109
|
+
- **Undo/redo** (the platform's own chord: `⌘Z`/`⌘⇧Z` on a Mac, `Ctrl+Z`/`Ctrl+⇧Z` on Windows and Linux; only that platform's, so the other modifier keeps whatever the system makes it).
|
|
1110
|
+
The chord is checked **below the typing guard**, so in a text box, the notes editor or a slide element being edited the browser's own undo is the one you get, and an open dialog still owns it.
|
|
1111
|
+
The server keeps ONE in-memory edit history (whole-file snapshots, capped at 200) fed by every mutation it performs (layout picks, notes saves, agent runs).
|
|
1112
|
+
Undo/redo rewrites the deck file; the watcher's reload shows the result (the hash keeps the position).
|
|
1113
|
+
The history is deliberately **independent of git**: commits never consume or reset it, and undoing never touches the repository.
|
|
1114
|
+
A file edited externally between an edit and its undo isn't lost: the current content rides the opposite stack.
|
|
1115
|
+
Empty stacks answer 409, and the player toasts the remaining depths.
|
|
1116
|
+
**Undo waits for an edit still in flight.**
|
|
1117
|
+
The mouse gestures answer asynchronously (a double-click save reads the element's source before it writes, a slide operation and a dropped picture wait on the server), so an undo pressed the instant one is sent used to reach the server first, find nothing to undo, and let the edit land behind it.
|
|
1118
|
+
The browser now holds the undo and redo until every pending write has landed, and then undoes the edit you just made.
|
|
1119
|
+
Agent runs are not waited on: they can take minutes.
|
|
1120
|
+
**An undo says what it took back and goes there**: every entry carries what wrote it and the slide it named, so the page says "Undid: notes on slide 7" (or "Redid: …"), moves to that slide, and says it again after the reload the undo causes.
|
|
1121
|
+
**A stretch of note typing is one step**: the notes card saves itself at every pause, and the saves of one slide from one page, each made within a minute of the last and straight on from it, join one entry that goes back to before the stretch began; anything written in between starts a new one.
|
|
1122
|
+
**Undoing an agent keeps the author's own edits**: the agent writes the file itself, so its undo point is the deck when the run began, moved on past every write this server makes while it runs (the author typing notes, fixing a word); Z takes back the agent's edit and leaves those.
|
|
1123
|
+
**The bar's Undo and Redo are greyed out** while there is nothing to take back or put back: the server says the counts with the ping, every write and every undo, and the bar follows them.
|
|
1124
|
+
**A failure is said in full**: messages were cut at sixty or eighty characters, usually just before the part that says what to do; they now keep their words (collapsed, capped only against a page of server output) and stay up six seconds.
|
|
1125
|
+
**A drop of several pictures places them all**: each but the last is a quiet write, so the reload the first one caused can no longer cut the drop short.
|
|
1126
|
+
- **Nothing typed is lost** (`src/core/drafts.js`).
|
|
1127
|
+
Write mode reloads the page when the file changes on disk, and a reload throws away whatever the page holds that the file does not.
|
|
1128
|
+
So every place that holds a draft says so: the notes card with unsaved edits, the HTML editor with a changed source, the sources editor, the agent prompt, a comment being written, and a text, code or label edit in progress.
|
|
1129
|
+
While any of them holds something, the reload **waits**: a bar at the top says the deck changed and names what it waits on, and the page reloads by itself the moment that is saved or closed.
|
|
1130
|
+
**Reload now** on the bar reloads at once, for the author who would rather have the new deck.
|
|
1131
|
+
A text, code or label edit whose save fails **keeps its words**: they stay on the slide, marked unsaved, the message says why, and a double-click picks the edit up again (⏎ tries the save again, Esc puts the file's words back); the reload waits for them meanwhile.
|
|
1132
|
+
The live-reload stream is the page's line to the server, so when it drops and does not come back within a moment the page says **disconnected** at the top, and says reconnected when it does: the author hears that nothing can be saved before typing into a box that cannot save.
|
|
1133
|
+
**Esc never throws a draft away**: it closes, and ⌘⏎ (⏎ in the sources editor) saves.
|
|
1134
|
+
The HTML editor, the sources editor, the agent prompt and a comment card closed with something typed (by Esc, ×, a click outside, or another panel taking the slot) KEEP it and say so; opening that place again (the same element's HTML, the sources of that slide, the agent card, ⇧M on that slide) opens it on the draft, and the reload waits for a kept draft as for an open one.
|
|
1135
|
+
The notes card saves as it closes, and an inline text edit's Esc is a cancel by name (the file's words come back).
|
|
1136
|
+
**A dropped file is always caught**: one the page let through was opened by the browser in the deck's place.
|
|
1137
|
+
A file that is not a picture is named and left out ("notes.txt is not a picture"), and a deck with no edit server behind it says pictures are added in write mode.
|
|
1138
|
+
- **An outside edit lands where it should** (write mode; `cli/outside-edit.mjs`, `src/core/outside-edit.js`).
|
|
1139
|
+
The deck file changed by a hand the server never saw, the author's text editor, git, a tool, used to reload every page onto the same slide NUMBER: a change to slide 14 left the author on slide 3, a section put in above moved everyone onto other content, and the reload flashed and remounted the docked panels.
|
|
1140
|
+
The server keeps the bytes the pages show and compares the file with them, slide by slide (the top-level `<section>`s; a script's text and a nested section are not slides).
|
|
1141
|
+
**Only slides' own markup changed** (the same slides in the same order, and nothing around them: head, settings, styles, scripts, the deck root's attributes), no changed slide carries a script or `data-markdown`, and the new markup is under a megabyte: the pages are sent those slides and **swap them in place**, each brought up to date as load does it (`instance.refreshSlide`: charts, formulas, diagram ids, code, builds, layout), with no reload; the speaker window's previews load again, and a slide the speaker view or the overview shows is shown new.
|
|
1142
|
+
**Anything else reloads**, as it always did.
|
|
1143
|
+
Bytes that differ only in the spacing between slides send nothing.
|
|
1144
|
+
**Where a page lands**, one rule: a page that is editing (write mode, unlocked, not full screen) goes to the slide the change touched first, at its first step: the first slide changed, added or moved (both places for a swap), numbered in the new deck, and after a removal only the slide that now stands in its place.
|
|
1145
|
+
Any other page, a locked or full-screen one presenting, stays on its **content**: its slide's new number, the step kept, a slide that went giving way to the one now in its place; so does every page when the change touched no slide.
|
|
1146
|
+
A presenter whose own slide was swapped in place sees it new at the same step, clamped to its builds.
|
|
1147
|
+
**It is said**: the reason is what changed, in a few words (`slide 9 changed: the bullet list`, `slide 2 changed: the title and a picture added`, `slides 3 and 9 changed`, `slide 4 added`, `slide 6 removed`, `slides 7 and 8 swapped`, `slide 3 moved to 7`, `the deck's head changed`), on the server's console line (`changed → slide 9 changed: the bullet list · in place × 2`, or `changed → reload × 2 — slide 4 added`), in the debug log, and as a toast on a page that is editing.
|
|
1148
|
+
**The message** is the reload message with fields added: `data: {"reload":"<what>","from":null,"patch":{"total":N,"slides":[{"slide":n,"html":"<section…>"}]},"land":{"go":n,"moves":[[was,now|null]],"was":N,"total":N}}`, `patch` only when the slides can be swapped; an older page reloads on any message and so still does.
|
|
1149
|
+
The guards hold as for a reload: a draft open in the page (Nothing typed is lost, above) **holds a patch as it holds a reload**, and when it is saved or closed the page reloads, landing by the rule; a page that cannot follow (a deck of chapters, a slide count the file does not have, something live on a swapped slide: a terminal, a video, a frame) reloads.
|
|
1150
|
+
A quiet write, a held fix and an agent's run are unchanged, and no-trust mode never reloads.
|
|
1151
|
+
- **Notes editor** (`S`, right-click a slide's background, or the `/` palette).
|
|
1152
|
+
`A−` / `A+` in its header step the notes' type size from 11 to 48 px (13 by default), read-only or not, remembered in this browser apart from the speaker view's.
|
|
1153
|
+
**With no edit server behind the deck** (`--no-trust`, a file), `S` opens the same card **read-only**: the heading says so (*read-only (write mode edits them)*), the box is dashed and cannot be typed into, there is no save or ✨ button, it follows the slide, and it is never modal: `→` and the deck's other keys still work with the caret in it (the typing guard skips a read-only box); `Esc` closes it.
|
|
1154
|
+
In write mode: opens a notes editor (`[click]`-separated plain text, every marker shown in square brackets) whose Save rewrites the slide's `<aside class="notes">` in the file (one `<p>` per paragraph, the editor shows each paragraph a blank line apart and saving never merges them, with a `<p>[click]</p>` between beats, HTML-escaped; the aside is inserted if the slide had none).
|
|
1155
|
+
`E` used to open this directly; it now arms element edit mode instead (below), and the background right-click is where notes editing moved to, the same `toggleEditor()` reached a different way.
|
|
1156
|
+
**The notes are a drawer that saves itself.**
|
|
1157
|
+
The card opens where every panel does until one is moved, docked right (`dock.js`), the deck navigable beside it; the dock buttons move it anywhere (float, left, right or bottom), remembered per deck under its own key, modal only while floating; docked, nothing is dimmed, the stage reflows away from the gutter and the text area fills it, and the deck's keys work whenever the caret is not in the textarea.
|
|
1158
|
+
**It is written without being asked**: once the typing has stopped for the **quiet time** (500 ms unless changed; the mark beside the heading says *autosaving…* while it goes and *saved* for a moment after, with no toast, since one every pause would be a toast every sentence), when the author leaves the card (a press on the slide, or the window going behind another; not a focus event, because the card's own machinery drops focus all the time, a button disabled while drafting, the box hidden behind the before/after view), when the deck moves to another slide (the edits go to the slide they were written for, and the card follows once they are written), and when the card is closed (Esc, ×, `S`: the save first, the close once it is written).
|
|
1159
|
+
A save that fails leaves the card open and marked unsaved, because closing would be the one way to lose what was typed; a box that matches the file writes nothing.
|
|
1160
|
+
**An agent's rewrite is held for review**: the toolbar's two quick actions, **Rewrite** and **Match slide** (each with the AI mark), run at once on this slide, and **Writing tools…** (the Writing picker, PRESENTING_VOICE) offers every tool for this slide, its module or the deck.
|
|
1161
|
+
**Rewrite follows the box**: with words selected the button reads *Rewrite selection* and rewrites only them, the notes around them as they are; per build, with nothing selected, only the build's part; otherwise the slide's notes.
|
|
1162
|
+
While a rewrite of a selection or a part runs, the selection is lit again in the box and a mark after the buttons says which words (*rewriting the selection: “…”*, *rewriting build 2 of 3…*) until the run ends.
|
|
1163
|
+
*Match slide* always reads the whole slide's notes against the slide, and its tooltip says so when words are selected.
|
|
1164
|
+
Each saves the box first (the agent is asked about the notes as the file holds them) and hands what comes back to the review view (Check deck… below, #907), which opens over the card; nothing is written until it is applied, and the card is still there when the review closes.
|
|
1165
|
+
It was asked for, and a draft that waited for a keystroke before it saved read as a save that did not happen.
|
|
1166
|
+
`⌘⏎` still saves at once; there is no save button, since a card that writes itself when you stop typing has nothing for one to do that `⌘⏎` does not; and the **● unsaved** mark beside the heading says when the box and the file differ.
|
|
1167
|
+
**The quiet time is a setting** (SETTINGS, *Notes autosave*, write mode): `250 ms`, `500 ms`, `1000 ms`, `2000 ms after typing stops`, or `on leaving only`, which is the card as it was before, and ⏎ walks them; it belongs to the browser, not the deck (`decklight-notes-quiet`), because how long a pause means "done" is the typist's, not the file's.
|
|
1168
|
+
**Docked, it follows the slide**: the notes of whatever slide is on screen, and its heading says which.
|
|
1169
|
+
**Whole slide or per build**: a switch beside *edit / changes*, the lit half what the box holds.
|
|
1170
|
+
*Whole slide* is every word of the slide's notes, its `[click]` lines included.
|
|
1171
|
+
*Per build* is only the part the `[click]` lines give the build on screen: the words before the first `[click]` while nothing is built, then one part per build; `→` / `←` step the build and the card follows to its part (edits saved first, as on a slide change), and the heading names it (*before the first build*, *build 2 of 3*).
|
|
1172
|
+
A part saves back in its place, every `[click]` around it kept; a `[click]` typed into a part moves the split, so once it is saved the card shows the whole slide, to see where the builds now fall.
|
|
1173
|
+
A slide with builds and no `[click]` shows the whole slide and says why (*2 builds, no [click] to split the notes*), as does a build the notes have no part for; a slide with no builds just shows its notes.
|
|
1174
|
+
Switching with edits in the box saves them first, into the view they were typed in.
|
|
1175
|
+
The choice is the typist's, per browser (`decklight-notes-view`), like the quiet time; *edit / changes* and ↺ reset work on whatever the box holds.
|
|
1176
|
+
The server watches the deck file and broadcasts a reload to every connected browser on ANY change, the player's edits and external editors alike, and the `#/slide/step` hash restores the position.
|
|
1177
|
+
`file://`-opened decks probe the server at its default localhost port so the printed URL and a double-clicked file both work; `config.edit.url` overrides, and a basename guard refuses a server that's editing a different deck.
|
|
1178
|
+
**The `/deck/edit/*` surface is not CORS-open.**
|
|
1179
|
+
Binding loopback is the wrong boundary for the threat: the dangerous caller is the user's *own* browser, where any open tab can `fetch()` the port, and a wildcard `access-control-allow-origin` waves that through: a `text/plain` POST is a "simple" request the browser sends with no preflight, so a coding agent has already run against the deck's directory by the time CORS is consulted on the way back.
|
|
1180
|
+
So every request is gated on its `Origin` **before** any handler runs (`allowEditRequest`, `cli/serve.mjs`): a loopback web origin (the deck this server serves), `null` (the `file://` double-click above), and a missing header (the CLI, the port-conflict probe, `curl`, not a browser cross-origin call) are admitted; a foreign site is refused with no CORS grant, so it cannot even read the refusal.
|
|
1181
|
+
The one residual is that `null` is also a sandboxed iframe's origin: closing it would cost the `file://` path a token it has no way to receive, so the double-click affordance is kept and the residual named here.
|
|
1182
|
+
- **Inspector** (`I`, or the palette's *Inspector*; `src/core/inspector.js`).
|
|
1183
|
+
With a top-level element selected in write mode its tabs are **Info**, **Colors**, **Type** and **HTML**: HTML opens the element's source in the content editor, which takes the inspector's place in the panel slot and has a **← Inspector** button that comes back on the same element (the right-click menu's *Edit content (HTML)* opens the same editor).
|
|
1184
|
+
One panel that says everything about the slide on screen, or about the element selected on it, so "what is going on with this slide" has one place to be asked instead of a debug line, the speaker window and a terminal.
|
|
1185
|
+
Its **Info** tab reports and never edits.
|
|
1186
|
+
Each row is a short fact with no commentary, marked the way the terminal banner marks its rows: a green ✓ when it is fine, a yellow ! when it wants a look (the banner adds a red ✗ for a service that failed and is not running).
|
|
1187
|
+
**With nothing selected** it shows the slide: title (the heading the finder and the overview name it by, with its level; ! with no heading, when every list shows the slide by its opening words or its number), layout (and design-system template), notes (words and ⟨CLICK⟩s, ! when the clicks do not match the builds), time (planned and rehearsed), fit (✓ fits, ! clips by how many px, ! a split layout fighting a flex block), voice, comments (open and resolved, this deck's own), and its sources (`SLIDE_SOURCES`: named facts and real links).
|
|
1188
|
+
In write mode it adds the slide's lines in the file and what `decklight check`'s static half says about that slide, through the read-only `GET /deck/edit/inspect?slide=N` (the whole deck's, with the fixes, is **Check deck…**'s, below); the render half needs a browser and seconds, and the panel asks on every slide.
|
|
1189
|
+
**With an element selected** (write mode, `Editing` above) it shows that element: what it is (`ul · 5 items`, `svg · 14 nodes`), its box in deck units and share of the slide, its type (`family size/line-height · weight`) and colour, named by the theme token that holds it when one does (`var(--heading-color) · #fafafa`), its **contrast** against what is really behind it (composited up the tree; a gradient stands in by its first stop and is marked `≈`) with ! under the WCAG AA floor for its size, and the figure cut rather than rounded so a fail never reads as the floor, which build step shows it, an image's natural size and whether it has alt text, whether it clips or runs off the slide, and its lines in the file.
|
|
1190
|
+
A **breadcrumb** runs from the selected block down to the node selected (`svg › g.node › "API"`): hovering a crumb lights that node on the slide, clicking one makes it the node selected and inspected.
|
|
1191
|
+
**Colors and Type tabs**: with an element selected in write mode, beside Info, the colour card's two halves (below), on the node inspected, each pick saved as it is made.
|
|
1192
|
+
**Slide tab**: with nothing selected in write mode, beside Info, the slide's own settings as fields, each a `<section>` attribute (`DECK_ANATOMY`): **Chapter starts here** (`data-module`; emptied, the slide starts none), **Step** (shown only on a slide in a run of steps, DECK_ANATOMY: the run's groups, first what saying none means, *the first: Foundation* on the slide the run starts on or *continues: Tools* after it; written as `data-step` and drawn again in place, the whole run renumbered), **Transition** (*the deck's*, which takes `data-transition` off, or none, fade, slide, scale, flip), **Hidden when presenting** (the Slide menu's own write, `HIDDEN_SLIDES`) and **Planned time** (m:ss, stored as whole seconds in `data-timing`; empty takes it off).
|
|
1193
|
+
Under **Background**: the picture by its file name, with **Picture…** (or **Replace…**) and **Remove**, which are the Slide menu's background rows; **Video**, a muted looping video typed as a path beside the deck (`data-background-video`), and once there its **Poster** (`data-background-poster`); then, once there is a picture or a video, **Fit** (fill the slide or show it whole, `data-background-size`), **Position** (nine places, `data-background-position`) and **Dim** (0 to 100%, stored 0 to 1 in `data-background-dim`).
|
|
1194
|
+
The slide's background is drawn again at each change; a dragged dim follows the slider and is written once, when it rests.
|
|
1195
|
+
Remove takes a video off with its poster, and takes the fit, position and dim along unless a picture is still there.
|
|
1196
|
+
Whatever sets the background from elsewhere (the Slide menu, a picture's **Use as slide background**, another page) shows in the tab.
|
|
1197
|
+
**Morph from previous** writes `data-auto-animate` on this slide and the one before, in one edit and one undo (greyed on the first slide, which says why).
|
|
1198
|
+
Unticked, the pair parts and only what nothing else pairs with is taken off: this slide's, and the one before's when the slide before that does not morph into it; but when the next slide morphs from this one and the one before pairs with nothing else, the one before's goes instead, so the next slide keeps its morph.
|
|
1199
|
+
When both neighbours pair, this slide's goes, and the toast says the next slide's morph went with it.
|
|
1200
|
+
Under **Title**: **Pin title** (the deck's, off, or pinned, at the default height or a height typed in design px: `data-pin` off, `none`, bare or a number) and **Subtitle** (auto or none, `data-subtitle`), the slide laid out again at once.
|
|
1201
|
+
Under **Narration**: the pause after the slide, between beats and between sentences (`data-narration-pause`, `-beat-pause`, `-sentence-pause`, in seconds, `NARRATION`) and how long it holds in a video (`data-video-hold`); empty is the deck's.
|
|
1202
|
+
A change shows on the slide at once and is one undo, written through `POST /deck/edit/slide/attr` `{ slide, set: { name: value } }` (a string its value, `true` the attribute bare, null off; `edits: [{ slide, set }]` writes several slides in one edit), which takes only the slide attributes the vocabulary lists that have no route of their own, each in its one shape, and refuses anything else with nothing written.
|
|
1203
|
+
It is quiet: every other open page gets the same edits and puts them on its slide.
|
|
1204
|
+
A chapter is read when the deck loads, so its name is written for the reload every page then makes.
|
|
1205
|
+
The tabs are a list a feature adds its own tab to, and with nothing selected the bar shows only when such a tab is there.
|
|
1206
|
+
**Builds tab** (`src/core/builds-panel.js`, its rows `src/core/buildlist.js`): the current slide's builds, with or without a selection, last in the bar.
|
|
1207
|
+
What is there from the start is one row at the top; under it, one row a click in the order they play, naming what arrives (its first words, or *picture*, *chart*, *diagram · 3 strokes*, a code block's *lines 3-5*, a stroke's stage) and its effect; things that arrive on one click share a row.
|
|
1208
|
+
A table that builds one step per item has a row for each body row, and a list that builds has one for each point, named by its first words, a row's cells read apart (*Tools fail Retry budget*), so each can be moved, tied and untied like any other step.
|
|
1209
|
+
A step from a code block's lines or a stroke drawn in stages is a row of its own, owned by its block.
|
|
1210
|
+
A token along a wire is named by the nodes its wire joins, *travel · orders → agent* (the wire's name where an end is free); in write mode its row has, in place of an effect, its **pace** (default, slow, fast: `data-travel-ms` 2400 or 600), its **arrival** (fades, stays, pulses the node: `data-arrive`) and **repeat** (`data-travel-repeat`), and its ✕ takes the step's element off the slide (`POST /deck/edit/element/remove`), since it is nothing else.
|
|
1211
|
+
Each row shows the notes' beat that goes with its click (the beat after its `[click]`, in first words), or *no beat*; beats past the last click are listed after it, and the foot counts both (*notes: 3 beats · 3 clicks*).
|
|
1212
|
+
A click on a row steps the slide to that click and selects what it brings (a code step selects its block), and the row on screen is marked as the keys move the slide.
|
|
1213
|
+
In write mode each row picks its element's effect (Build ▸'s list, the one it has chosen) and a ✕ takes its click away (a point of a built list is then there from the start, any other element loses its build); with something selected the tab adds its settings: a list, table or group that builds is **one step per item** or **all at once** (`data-build-self`), a point of one is **there from the start** (`data-build-stay`), an element of its own has **Remove this step**, and one with no build **Add a step** (a bare `data-build`).
|
|
1214
|
+
**Animate ▸** in the element menu gives the selection one of the looping animations (`data-animate`: none, pulse, float, shake, spin, blink, bounce, swing, glow, breathe), the one it has ticked.
|
|
1215
|
+
Every one of these, and Build ▸, is written by `POST /deck/edit/element/build` `{ slide, index, path?, tag?, effect?, stay?, self?, animate?, drawStops?, drawSpeed?, travelMs?, arrive?, repeat?, quiet?, from? }`, each attribute where it stands and a bare one written bare, one undo each, and shown in place: the page makes the same change and counts the slide's steps again, and steps the slide to show the element when it now waits.
|
|
1216
|
+
A change that gives or takes a `draw` build is the one exception: a drawn stroke carries more than its marks, so that write reloads the page, which selects the element again.
|
|
1217
|
+
**The order** is arranged by dragging a row by its grip: dropped above or below another row it plays there, dropped onto one it arrives with it.
|
|
1218
|
+
**⤒** (with previous) does the same without a drag, and **split** puts the things sharing a click each on a click of its own.
|
|
1219
|
+
Build ▸ in the element menu offers the same for the step that was right-clicked (a row of a table that builds, a point of a list, an element of its own): **Arrive with the one before** ties its click to the click before it, and **On its own click** takes it off the click it shares, before the others when it comes first on the slide and after them otherwise. Either is greyed where it cannot act, and neither is offered on a code block's lines or a stroke's stages.
|
|
1220
|
+
Nothing on the slide moves: the order is written by `POST /deck/edit/slide/builds` `{ slide, groups }`, each click the nodes it brings (`{ index, path?, tag?, count? }`, `count` the steps a code block's lines or a stroke's stages bring).
|
|
1221
|
+
It stamps every step of the slide with `data-build-order` (its click's key, the things on one click sharing it, BUILD_SEMANTICS) in one undo, and takes every key off when the order asked for is the file's own.
|
|
1222
|
+
Two rows of a table tied this way carry the same key, the rows after them counting on from it, so the play order is otherwise as it was; the beats beside the rows follow the clicks, and `decklight check` counts the tied rows as one click against the notes' `[click]` markers (`clicks-vs-builds`). When untying them leaves the file's own order, every key comes off and the file is as it was.
|
|
1223
|
+
A code block's lines and a stroke's stages keep together with their block: their rows are not dragged, and nothing is dropped onto them.
|
|
1224
|
+
A step added after an order was written (a new point of a list) has no key, so it plays by its place on the slide; its row says *no place in the order* until it is dragged where it goes, and every other step keeps the place it was given.
|
|
1225
|
+
A point typed into such a list (⏎ in a list session) is given its key when the list is saved: right after the point before it (the first of the list, right before the point after it), the order written again (`POST /deck/edit/slide/builds`, one more undo) with every other step keeping its click; a step that arrives any other way is the flagged case above.
|
|
1226
|
+
`decklight check` counts the clicks from the same keys.
|
|
1227
|
+
**A stroke drawn in stages**: a stroke selected in a `draw` build has **Draw in [n] stages** (1 to 12, even parts of its length, written as `data-draw-stops` fractions such as `0.333 0.667 1`; 1 takes it off) and a **Speed** (default, slow or fast: `data-draw-speed` 150 or 600 path units a second, BUILD_AUTHORING).
|
|
1228
|
+
Both go through the same `POST /deck/edit/element/build` (`drawStops`, `drawSpeed`); a draw build is the reload case above, so the page that comes selects the stroke again, and its stages are then rows of the tab, owned by the stroke.
|
|
1229
|
+
**Place a stop…** on such a stroke makes the next press on the slide say where a stage ends: the nearest point along the stroke to the press, as a fraction of its length, joins its stops in order (the last always 1, a stop within 2% of one already there taken as that one), written the same way; Esc gives it up.
|
|
1230
|
+
**The picker** (the header's dashed box with an arrow, DevTools' *select an element*): while it is on, whatever is under the pointer on the slide is lit, a diagram's drawn nodes one by one and anything else as the element itself, and a click makes it the element inspected (the selection moves to it) and turns the picker off; the pointer's presses are the picker's alone, captured before the deck, the selection or a build hears them, and `Esc` turns it off.
|
|
1231
|
+
Without write mode the picker still inspects, on the Info tab.
|
|
1232
|
+
`Esc` lets go of the selection first and closes the panel second.
|
|
1233
|
+
A **copy** button puts the facts on the clipboard as plain text, for an agent or a comment.
|
|
1234
|
+
It **docks** right by default (float, left, right or bottom, remembered per deck), follows the slide and the build step, re-reads the overflow guardrail's verdict when it lands, and leaves the arrow keys to the deck.
|
|
1235
|
+
`e` in it opens the sources editor. Docked panels each claim their own side (`dock.js`), so the inspector beside the agent or the notes keeps both gutters.
|
|
1236
|
+
- **Deck settings…** (write mode: the palette's row, and the bar's Slide ▾ and the right-click Slide ▸; `src/core/deck-settings.js`): a card whose heading says it is **saved in the deck**, for what belongs to the whole deck: its **Title** (the page's `<title>`, which the hud, a commit message and an export read), the default **Transition**, **Slide numbers** (off, *n* or *n / N*: `slideNumber` false, `"n"`, `"n/N"`), **Arrows** (`controls`), **Pin titles** (at the same height, off, or at a height: `pinTitles` true, false or a Y), the **Logo** (a picture for light themes and one for dark, chosen and uploaded through `POST /deck/edit/asset` or typed as a path beside the deck, its height and its corner: `logo`) and the narration pauses (`narration.slidePause`, `beatPause`, `sentencePause`, `NARRATION`).
|
|
1237
|
+
It reads the file through `GET /deck/edit/config`; **Save** writes what changed and nothing else through `POST /deck/edit/config` `{ set: { key: value | null }, title? }`, in one edit and one undo, each key spliced in place into the configuration block, or into a bundle's `Decklight.init({…})` of plain data, and a value set back to its default takes its key off the file.
|
|
1238
|
+
The runtime reads these when the deck loads, so every page reloads.
|
|
1239
|
+
The width, height, hash and bleed are left to the HTML.
|
|
1240
|
+
A deck whose configuration cannot be rewritten safely (an init call that is code, a deck booted from a separate script, a block that is not JSON) shows the card read-only with one sentence saying why, and the route answers 409 and writes nothing.
|
|
1241
|
+
**Settings…** (`SETTINGS`) is a different card, headed *this browser*: presenting preferences kept in this browser.
|
|
1242
|
+
- **Find and replace…** (write mode, the palette's row; `src/core/find-replace.js`, `cli/find-replace.mjs`): a panel docked beside the slide (`⌘F` stays the browser's) with a phrase to find and one to put in its place, and **Match case**, **Whole word**, **Notes** and **Code**.
|
|
1243
|
+
It looks in the deck's **file**, never the page the engine rewrote, through `GET /deck/edit/find`: only the text between tags (no tag, attribute, comment, script or style), the speaker notes and code (`<pre>`, `<code>`) only when ticked, a slide's sources never, entities read as the characters they stand for.
|
|
1244
|
+
Each match is a row with its slide and the words around it; a click goes to that slide, its **Replace** replaces that one and **Replace all N** every one, through `POST /deck/edit/replace` `{ find, replace, opts, only?, expect }` in one edit and one undo, the replacement written as text.
|
|
1245
|
+
`expect` is how many the search found: a deck that changed since (another count, or a match no longer there) is a 409 that says so, nothing written.
|
|
1246
|
+
A match that runs across formatting (`<b>quar</b>ter`) is not found in the file, so the panel says how many more the slides show across bold, a link or other formatting.
|
|
1247
|
+
- **Ask an agent** (`A`): write mode drives whichever AI coding agent CLIs the authoring machine has installed: the roster (`cli/agents.mjs`) covers **Claude Code** (`claude -p … --permission-mode acceptEdits --allowedTools "Bash(npx decklight:*)" "Bash(decklight:*)"`: the deck file is its to edit and decklight's own CLI its to run, for the render check the skill asks for, and nothing else, since a headless run has no TTY to ask on), **Codex CLI** (`codex exec --full-auto …`), and **IBM Bob** (`bob -p … --accept-license`), plus Gemini CLI, GitHub Copilot CLI, OpenCode, Goose, Aider, Cursor CLI, and Qwen Code, each as a headless one-shot invocation, detected by probing `$PATH`.
|
|
1248
|
+
**The prompt names the slide on screen**, so "this slide" in an ask means that one rather than a question back, and says that decklight commits the edit itself when the agent finishes, so an agent started by A never calls the commit route the skill shows an agent that opened the deck on its own.
|
|
1249
|
+
A opens a prompt card (agent picker when several are detected; `--agent` sets the default; beside it, the model that agent runs on for decklight, `--agent-model` for one run, AGENT_UNITS; the chip names both, *Claude Code · sonnet*) that **docks** like the content editor above (float, left, right or bottom (`dock.js`), remembered per deck under its own key, modal only while floating) so the slide you are asking about stays on screen and the deck's keys work whenever the caret is not in the prompt.
|
|
1250
|
+
**Docked, the card is a conversation**: ⌘⏎ sends and the card stays open (floating, it closes as before), and above the prompt it lists this session's asks, oldest first: each with the slide on screen when it was sent (a click goes back there), the prompt, and what came of it: *working…* with the latest clue, then *edited the deck* / *no changes* / *failed* and the agent's own report, from its start (a report leads with what it did; past 4000 characters its start and its end, with the cut marked), and the files the run created beside the deck and left there, which no commit takes (*left beside the deck, not committed: before.html*).
|
|
1251
|
+
**Before the first ask** the list's place holds a line on what the card is for and three asks to start from (*Tighten the text on this slide*, *Write speaker notes for this slide*, *Split this slide in two*): a click types one into the prompt, about the slide on screen, and sends nothing.
|
|
1252
|
+
The prompt keeps a fixed height at the foot of the card from the start, where it used to fill the whole panel until something had been asked.
|
|
1253
|
+
The edit server keeps that log (`agentAsks` on `/deck/ping`, the last 20, each `{ id, agent, prompt, slide, state, ok, changed, tail }`), because an agent's edit reloads the page; a card docked open before that reload is open after it (per tab), and closing it forgets that.
|
|
1254
|
+
That holds for every panel in the slot: the one open when the deck reloads (an agent's edit, a dropped picture, the HTML editor's own `⌘⏎`) is open after it, the inspector included, and the HTML editor comes back on the element whose save reloaded the deck; a panel closed on purpose stays closed.
|
|
1255
|
+
Send is disabled while a run is in flight.
|
|
1256
|
+
The server snapshots the deck, spawns the agent in the serving directory with the instruction wrapped in deck context, and streams start/done status over SSE (toasts in the player; 10-minute timeout; strictly one job at a time, `agentBusy` survives reloads via ping).
|
|
1257
|
+
**The run narrates itself**: Claude Code is invoked with `--output-format stream-json`, each tool call becomes an `activity` event on the same channel ("editing talk.html", "running: npm test"), and the chip shows the latest clue beside the timer: a run that used to read as "stuck" after twenty silent seconds now says what it is doing; the final `result` is what the done-toast carries, never the raw JSON wall.
|
|
1258
|
+
Agents without a stream dialect get their last non-empty stdout line, throttled: the glance a person watching the terminal would take.
|
|
1259
|
+
The activity is the agent's text and is rendered as text, never markup, and it survives a reload the same way the timer does (it rides `agentBusy`).
|
|
1260
|
+
**An edit that would strand a recording is warned about**: after an agent run the server diffs the deck's `narration.files` config and its per-slide notes against the snapshot, and if a configured track lost its config (orphaned), a recorded slide's notes were rewritten (stale), or the slide count changed under a track (reshaped, files map to slides by position), the done event carries a `recordingWarning` the deck holds as a longer toast and the terminal prints.
|
|
1261
|
+
It is a warning, never a block (the file is already written and the undo chord takes it back, the audio never leaving the disk) and it is silent when the recordings are untouched or a track has nothing on disk.
|
|
1262
|
+
This is the one thing an agent asked to "rewrite the voiceover" can quietly destroy: minutes of somebody's own voice, orphaned by a rewritten `Decklight.init` with nothing on screen to say so.
|
|
1263
|
+
**Held for review by default** (#907): the ask runs as a quick fix does, with the file put back when the agent is done and the edit kept as the candidate the review view shows side by side; nothing is committed and no page reloads until the author applies it.
|
|
1264
|
+
**Settings → Review agent asks** (per browser; on by default) turns that off, and then, if the agent changed the file, the watcher reloads every browser and the undo chord takes the edit back like any other.
|
|
1265
|
+
- **Check deck…** (palette; also found by `lint`, `issues`, `crowded`, `overflow`; `src/core/deckcheck.js`).
|
|
1266
|
+
Every problem with this deck in **one docked panel**, each with the fix that would clear it, without leaving the deck: `decklight check` answers "what is wrong" in a terminal, and an author with the deck open has none in front of them.
|
|
1267
|
+
**Three sources, one list.** The open deck answers what the render half of the CLI asks a headless one, plus what only a live page can: content **clipped** (every slide measured now, an inactive one under the same momentary `.pin-measure` the pinned titles use), a slide **crowded** past SLIDE_DENSITY (the same count as `data-dense`), a split layout **fighting** its own flexbox, **[click] markers** that do not match the build clicks (counted from the engine's own build groups, so a slide with a terminal or another provider is compared too, and the file's reading of that rule is always dropped for the page's), an image or a video that **did not load**, a `data-markdown` slide, content that would **print invisible** (`invisible-in-print`, PRESENTING_FIT: read from the deck's own print view, below), and **a word Decklight does not know**, read against the one table of the authoring vocabulary (`tools/vocabulary.mjs`, which `decklight check` reads the file against too, and the editor support files are generated from): a `data-*` attribute one slip from one Decklight reads (`unknown-attribute`, *data-buld is not an attribute Decklight reads: did you mean data-build?*; a name close to none is the author's own and is left alone), a value an enumerated attribute does not take (`unknown-value`: a build effect, a layout, a route, a transition, …, with the one meant), and in the configuration block JSON that does not parse (`config-json`, an **error** naming the line, since the deck booted on its defaults), a key Decklight does not read (`config-key`) and a value it does not take (`config-value`); every one but `config-json` is a warning, and each says what was meant.
|
|
1268
|
+
**Invisible in print is judged in print, never on stage.** On the live deck an entrance the deck animates with its own CSS is rightly at opacity 0 until it runs, and finishing it there would spoil it for the audience. So the panel loads the deck's own `?print` view (in the theme on screen) in a hidden, same-origin frame, where every build is complete and the deck's own animations are finished as `decklight check` sees them, and names on each slide what still does not show there: the element, the same exemptions, the same warning and the same words as `check`, a jump to the slide and the element outlined on stage. It reads it when the panel opens and after each write, and drops the frame once read; the animations on stage keep playing. A page that cannot read its own frame (a `file://` deck in a browser that keeps local files apart) lists no such row.
|
|
1269
|
+
In write mode the edit server adds **the file's half for the whole deck** (`GET /deck/edit/check`, read-only: `staticFindings` with the same rule ids `check --json` prints, `{ level, rule, slide, title, message, fix? }`), so nothing needs a terminal: the **head-level, deck-wide findings come first** (`ds-behind`, `theme-off-brand`, `ds-unresolved`, a `missing-asset` or an `unaccounted-script` outside any slide), marked `—` for *the deck*, then each slide's (`off-role`, `off-palette-literal`, `ds-unknown-system`, a slot left empty, …); a finding the page measured itself wins over the file's reading of the same rule on the same slide.
|
|
1270
|
+
A row per finding, errors (`✗`) before warnings (`!`) within a slide: the slide number, its title, what is wrong, and under it **the fix**.
|
|
1271
|
+
The head counts them (*check · 10 issues on 6 slides and the deck · 2 errors · 3 with a fix*), a clean deck says *no issues: 9 slides checked, file included*, and without a server the foot says the file's own findings need write mode.
|
|
1272
|
+
After the issues come **suggestions** (`+`), counted apart (*· 1 suggestion*): a label that recurs across slides in different colours, worth a concept (SVG_DIAGRAMS), whose fix makes it one in a single write; and a diagram with no build (SVG_DIAGRAMS), `decklight check`'s hint asked of the open deck, with the same threshold and opt-out, except that the page asks the engine's build records whether a diagram builds rather than reading its attributes.
|
|
1273
|
+
After both, when one has run, come the **agent review**'s findings (below), under their own head (*agent review · 2 · f asks the agent to fix one*), marked `✦` with their rule named, and counted apart in the head (*· 2 from the agent*).
|
|
1274
|
+
**Every row with a fix shows it**, as what pressing it will do (*Migrate to acme 6.0.0 · 62 renames*, *Switch to acme-dark, the brand's first theme*, *Rename text-main → text-body on slide 4*, *Fix it*, with the AI sparkle); `⌘⏎` / `Ctrl+Enter`, or the button, applies the selected row's (a fix writes the file, so it is a deliberate chord: a bare `f` used to do it, in a panel the deck's keys pass through, and `F` could fix a row and go fullscreen in one press; `f` now only says where the fix went); a row with none says *no quick fix*.
|
|
1275
|
+
**Explain further** (`e`) sits beside **Fix it** on every row the agent could fix, and on a *no quick fix* row when an agent is available: the same agent, asked read-only (its `ask` invocation, `POST /deck/edit/agent { explain: true }`), is given the finding and the slide's source and says what is wrong, why it matters and the ways to fix it, in the agent panel.
|
|
1276
|
+
Nothing is written: no undo entry, no commit.
|
|
1277
|
+
The answer ends with a **Fix it** that runs the row's own fix.
|
|
1278
|
+
**Two kinds of quick fix, both shown in the agent panel.**
|
|
1279
|
+
A **deterministic** fix is one the server applies itself (`POST /deck/edit/check/fix { rule, slide?, all?, ref? }`, `cli/check-fixes.mjs`) and records in the agent panel's log as an entry by *decklight*, beside the agents' edits: `ds-behind` → Migrate (`DESIGN_SYSTEM_MIGRATIONS`, its own words and commit); `theme-off-brand` → the theme the design system's migration renames the configured one to, else the brand's first; `off-role` on a renamed role → its successor, on that slide; `ds-unresolved` → `marketplace update` of the marketplace that holds it (nothing in the deck changes, so the page reloads to link what resolves now); `ds-unknown-system` → `design-system add` when a registered marketplace offers one of that name; `concept-suggestion` → the concept, as before.
|
|
1280
|
+
A **judgement** fix (clipped and crowded slides, `clicks-vs-builds`, `off-palette-literal`, an agent-review finding, anything a migration's `skill` handles) goes to the A agent as an ordinary ask, its prompt carrying the finding and its rule (and the skill, when the fix names one), watched in the docked agent panel with its progress and result — the `f` path the agent review had, open to every finding without a deterministic fix; it is offered only when this machine has an agent.
|
|
1281
|
+
**Either way it is one undo entry and one commit** (`fix: <rule> on "Slide Title"`, or `fix: <rule>` for the deck), and the row goes away when the finding does: the panel refreshes after every write.
|
|
1282
|
+
**A fix is reviewed before it lands** (`src/core/fixreview.js`, `cli/fix-review.mjs`): a judgement fix (`POST /deck/edit/agent { …, review: true, rule }`) and a deterministic one that rewrites the deck (`theme-off-brand`, `off-role`, `POST /deck/edit/check/fix { …, review: true }`) are held by the server as a **candidate**.
|
|
1283
|
+
The agent edits the deck file as before, with every reload held, and the file is put back byte for byte when it exits (a hand edit posted meanwhile is refused, since the put-back would undo it); a deterministic fix is computed and not written.
|
|
1284
|
+
So `deck.html` is unchanged, nothing is committed, before or after, and no page reloads.
|
|
1285
|
+
The **review view** opens on it: the deck as it is on the left, the candidate on the right (`GET /deck/edit/candidate/at?id&side=before|after`, served like a version in the history), both at the same `#/slide/step`, moving together.
|
|
1286
|
+
It visits only the places they differ, one stop a slide: a changed slide (its build steps compared by what each one reveals: build 0 the slide with every build taken out, build k only what that build brings on, plus that step's caption, read from both decks' own build records, so a change to a title every build shows is a change at build 0 alone), an added and a removed slide (the side without it says so), and the deck's **head** (styles, the config, anything outside the slides) as its own stop.
|
|
1287
|
+
`←`/`→` step from one changed build of the slide to the next and run on to the next slide past the last one (back from the first, the previous slide's last changed build) (#956); **`W`** switches them to the talk's way (#944), a build at a time and back into the previous slide fully built, with a toast saying which, remembered per browser (`decklight-review-all-builds`).
|
|
1288
|
+
A slide with no build to compare (added, removed, a change no build shows) is walked a build at a time either way; `⇧←`/`⇧→` (or `[`/`]`, `↑`/`↓`) go a whole slide, and the counter says where (*change 3 of 7 · slide 24*).
|
|
1289
|
+
`C` turns captions on in both panes, each showing its own version's; when the slide's notes changed, their word diff (the notes editor's) shows under the panes.
|
|
1290
|
+
**A slide is decided, a step is shown**: `A` approves, `X` rejects with an optional comment, and the decision covers every changed step of that slide, the head having its own.
|
|
1291
|
+
`E` **adjusts**: the comment and that slide go to the agent (`POST /deck/edit/candidate/adjust { id, key, comment }`), which works on the candidate the same held way and is told to change only that slide; the right pane reloads with the new candidate (a `candidate` event), the other slides' decisions stay, and the adjusted one is undecided again.
|
|
1292
|
+
**The slide list** down the left side is every slide the candidate changes with its state (undecided, ✓ approved, ✗ rejected, ⟲ adjusting), then the slides the job looked at and **left as they were** (`left` on the candidate: an answer that failed its check, a slide edited while the agent thought) with why on hover and, clicked, in the status line; `↑`/`↓` or a click jumps to a slide, `←`/`→` walk its builds and on through the changes in order.
|
|
1293
|
+
**Two modes, one panel**: a change the slides can show opens on the two live renders; a change that is only the notes (every unit `notesOnly`, which the server marks when the slide's source without its aside is unchanged: a script rewrite) opens in **text mode**, the slide's whole script with the words that changed marked inline, the proposed render kept small beside it for context (a click brings both slides up), and `P` (or *▶ hear the proposed script*) says the proposed notes in the deck's live voice, the one check two identical renders cannot give.
|
|
1294
|
+
`D` cycles the view in either mode: the words, the two scripts side by side (the current on the left, the proposed on the right), the two slides; the text-mode choice is remembered per browser.
|
|
1295
|
+
**The words on the slide are marked where they sit** (#940): in each pane's own copy of the slide (never the deck), what the change takes out is tinted red in the current pane and what it puts in is tinted in the deck's accent in the proposed one, with nothing added to the layout.
|
|
1296
|
+
A word that changed only a little is marked letter by letter, so a comma swapped for a semicolon marks the two characters, not the whole word; a word swapped for an unlike one stays whole.
|
|
1297
|
+
Under the slides each change is said in words, where it is when the slide names it (`bullet 3 · “nice-to-have,” → “nice-to-have;”`), and the words views read the slide's text, a line a block, the way they read a script.
|
|
1298
|
+
A slide whose source changed only in punctuation and spacing says **punctuation only** beside its position, since it is the change two renders hide best.
|
|
1299
|
+
**A changed slide opens on the first build where the two versions look different** (#942): a step is compared by what it shows and its caption, never by the source's spacing or the section's own attributes, so a build that looks the same in both is not a stop.
|
|
1300
|
+
The section's attributes are said in words instead, a line each, on every stop of the slide (`slide style: font-size 0.75em removed`, `data-layout split → none`; the engine's own `--` layout variables are left out).
|
|
1301
|
+
A slide where no build looks different opens fully built and says so, and so does an added or a removed slide, which has no other version to compare build by build.
|
|
1302
|
+
**The builds step in place**, on screen as well as on the keys: beside the counter, a slide with builds has **‹ build 2 of 4 ›** (*· changed* on a build the proposal changes) and a **fully built** toggle (`B`), the arrows disabled at the slide's ends and the control absent on a slide without builds.
|
|
1303
|
+
They move both panes a build together, a version with fewer builds holding on its last, and so does a click on either pane (⇧-click goes back).
|
|
1304
|
+
A line of the slide's text whose words a later build brings in says **from build k**, and a click goes there.
|
|
1305
|
+
**Apply validated only** (`⇧⏎`) writes the approved slides; **Apply all** (`⌘⏎`) writes every change but the rejected ones.
|
|
1306
|
+
Either is `POST /deck/edit/candidate/apply { id, take, rejected }`: the taken slides from the candidate, everything else as it is, merged slide by slide and written as **one undo entry**, after the work that was already outstanding is committed on its own; refused when the deck changed while the fix waited.
|
|
1307
|
+
A summary line says what landed (*applied 5 of 7 · 2 rejected*), and the page the write reloads opens the **commit window** (`K`) with a drafted message, editable: the subject names the slides that landed, by name (*fix: off-role on "Pricing" and "Roadmap"*), and the rejected changes, with their comments, are the body after a blank line (the commit window keeps a body there: a message with no blank line is one subject, as before).
|
|
1308
|
+
Nothing is committed until Commit is pressed.
|
|
1309
|
+
**Esc discards** the candidate and says the deck is unchanged; a new fix replaces one never applied, and a page that loads while one waits reopens it.
|
|
1310
|
+
**Settings → Review quick fixes** (per browser; on by default) turns the view off, and a fix then lands at once as above.
|
|
1311
|
+
A fix that writes no deck (`ds-unresolved`, `ds-unknown-system`), Migrate (its own job, over the stylesheets too) and a concept suggestion land as before.
|
|
1312
|
+
**Fix all**: a rule whose fix is deterministic and safe to batch (renamed roles) offers *every <rule>* on its row, and `⌘⇧⏎` / `Ctrl+⇧Enter`, applied to every slide as one undo entry and logged as one entry.
|
|
1313
|
+
**It docks** like the other panels (`dock.js`: float, left, right or bottom, right by default, one slot per deck with the tabs to the Inspector, the notes and the agent), stays open across the reload an edit causes, and `⏎` or a click goes to the row's slide without closing it; `←`/`→` keep driving the deck.
|
|
1314
|
+
**The toasts became pointers to it**: the behind, off-brand and missing-design-system toasts say there is a problem with a fix and open the panel on that row, instead of carrying the whole message and expiring.
|
|
1315
|
+
Otherwise read-only, in every mode. `instance.check()` returns the same findings, shaped like the CLI's `--json`, for a headless probe.
|
|
1316
|
+
- **A clipped slide says so on its number** (write mode, editing on; `src/core/editmode.js`, the measure in `src/core/overflow.js`).
|
|
1317
|
+
The guardrail's `data-overflow` used to reach an author editing by hand only as a console line or a row in Check deck…, so a slide could clip for an hour unseen.
|
|
1318
|
+
While the slide on stage is clipped, the slide number at the top right carries a **clipped** badge in the guardrail's red, drawn toward the theme's text so it reads on a dark canvas and a light one; its tooltip and its label say what clips and by how much (*clipped: a code block runs 84px past the bottom of its box*), from the same measure as the guardrail and the inspector's fit row, and a click opens Check deck… on that slide's `overflow` row.
|
|
1319
|
+
It follows the attribute, wherever it changes: a reload, an edit made in place, the overflow watch's own re-check; it is gone the moment the slide fits.
|
|
1320
|
+
It goes with the number: the lock, fullscreen, print and a reader's page never show it.
|
|
1321
|
+
- **Agent review** (palette *Review: Review deck with agent…*, write mode; `cli/agent-review.mjs`).
|
|
1322
|
+
What a count cannot judge and a reader can: the local agent (the one on `A`, `PRESENTING`) reads the deck and says where it could be better, under four rules, each asked in the words `REVIEW_RULES` holds: **`unsourced-figure`** (a figure, date, percentage, ranking or quotation that no source listed for the slide backs, `SLIDE_SOURCES`), **`thin-voiceover`** (no speaker notes, or notes that read the slide back instead of carrying what it does not say), **`topic-title`** (a title naming a topic, "Results", where it could state the point, "Latency halved after the cache"), and **`better-as-visual`** (a process or a comparison written as bullets that a diagram, built step by step, or a table would show better).
|
|
1323
|
+
The agent runs **read-only**, the way `enhance` does: a few slides at a time (`POST /deck/edit/review`, progress as `review` events), shown each slide's text, notes and sources and the deck's outline, and asked for a JSON list.
|
|
1324
|
+
**Every answer is checked before anything is shown**: a finding on a slide it was not asked about, under a rule nobody named, or with nothing to say is dropped, never repaired, and a part that answers nothing usable is reported as unanswered.
|
|
1325
|
+
The findings join **Check deck…**, where ⏎ goes to the slide and **`f` hands that one finding's instruction to the A agent**: an ordinary A edit, one undo entry and one commit (`review: <rule> on slide N`).
|
|
1326
|
+
A figure is never given an invented source: the instruction says to add one only if the agent can open and read it.
|
|
1327
|
+
Findings are kept by the server for the session and re-read on every page load (`GET /deck/edit/review`), each matched to its slide by a fingerprint of the slide's text and notes, so a slide that moved keeps its finding and a slide that was edited, fixed or rewritten, drops it.
|
|
1328
|
+
- **Git autocommit**: with `--git` (or automatically when the deck already sits inside a repository; `--no-git` opts out) the server keeps the deck safe and lets you say when it enters history.
|
|
1329
|
+
**The cadence no longer commits.** It used to, every `--commit-every` seconds, and what that produced was a column of `decklight: autosave deck.html` in which no commit marked anything: a backup wearing a history's clothes.
|
|
1330
|
+
The two jobs are now separate. The **backup** is a silent snapshot: every 30s the deck's current bytes are written to `refs/decklight/wip`, a real commit object parented on HEAD and reachable by that name and nothing else: not on your branch, never in `git log`, never pushed, and deck-only (it is built with plumbing rather than `git stash create`, which would sweep in a co-worker's unrelated working-tree changes).
|
|
1331
|
+
A crash costs `git show decklight/wip:<deck>`, not an afternoon.
|
|
1332
|
+
The **history** is yours: decklight asks, **once per stretch of uncommitted work**, and commits when you answer.
|
|
1333
|
+
The ask is a small chip in the deck (`K`, or click it).
|
|
1334
|
+
**The chip is also where the state of the work is read**: it is on screen, quietly, the whole time the deck differs from its last commit (*12 lines since the last commit — K commits*), led by the slides it changed, added and removed in the window's colours with a zero left out (*●1 changed ●1 added · 12 lines since the last commit — K commits*; a change that is only review records touches no slide and reads as before), so what has changed and how to keep it are answered without opening History, Commit or Restore; it is absent when nothing has changed or there is no git to write to.
|
|
1335
|
+
It turns into the ask (*12 lines uncommitted · 5m — K commits*, at full strength) when the work has sat for 10 minutes **or** grown past 40 changed lines, whichever comes first, and then stays quiet however long it sits or however large it grows until a commit resets the episode; an unanswered nag is an answer, the same rule the unpushed-work toast keeps and for the same reason: a nudge that reappears on a timer is one people turn off.
|
|
1336
|
+
`K` opens the commit window, or **⌥⌘K / Ctrl+Alt+K** (it was ⌘K, which nearly every other app opens its command palette with, and which is the palette's now), the one place the deck's no-modifiers rule is bent: it is handled above the typing guard, so it reaches you mid-sentence in the notes editor, and the message box lets it back out again so the key that opened the window also closes it.
|
|
1337
|
+
What the window holds: what changed, in lines and **in slides** (*3 slides: 1 changed, 1 added, 1 removed*, each count in its colour, amber, green and red, a zero dimmed; slides are matched against HEAD the way a diff matches lines, identical ones kept in order and, between two kept ones, an old and a new paired as one slide edited only when they share their heading or half their lines, so a slide swapped for a different one is one removed and one added, never an edit), a message box, and one button, with **⌘⏎ / ⌃⏎** to commit, the convention VS Code and every GUI client share; **✨ write it for me** asks the agent for the commits the uncommitted work makes (on a click, or the moment the window opens with `--commit-messages`) and it never overwrites what you have already typed, because a proposal that eats your sentence is not one.
|
|
1338
|
+
**The proposal is one commit or several** (`cli/commit-split.mjs`): the deck's diff against HEAD is cut into **units** at zero context, one per hunk, each named by the slides it touches, by number and by name (`slide 3 — "Pricing"`, `slides 3-4 — "Pricing" and "Roadmap"`), because the agent is asked to name slides by their words and a unit labelled with a number alone gets a number back (past 40 hunks, the hunks of one slide travel together), and the agent is asked to group them, one commit per separate idea, replying `<numbers> | <subject>` a line.
|
|
1339
|
+
Every unit lands in exactly one commit (one named twice stays with the first, one forgotten joins the commit of the unit before it), and an answer with nothing usable leaves the deck as one commit for the author to name.
|
|
1340
|
+
One commit fills the message box as before; several replace it with **a row per commit**, its subject editable and where it lands beside it, an **as one commit** button that sets the proposal aside (its first subject offered in the box), and **Commit all N**.
|
|
1341
|
+
**Each row has a tick**, on to start with: an unticked commit is left out (*Commit 2 of 3*, and nothing at all with none ticked), its units staying uncommitted in the working file while the ticked ones are built on HEAD without them, so a change not ready yet need not ride along with one that is.
|
|
1342
|
+
The plan is still normalised whole, so a unit the agent forgot joins its neighbour's commit and stays out with it when that one is unticked.
|
|
1343
|
+
What was left out comes back: the server re-cuts it against the new HEAD (a `-U0` hunk carries its own lines, so it is found again by its text) and the window stays open with those rows, their subjects kept, ready to commit then or later; when they cannot be matched the window offers *✨ write it again*.
|
|
1344
|
+
The review sidecar is never sent to the agent: its units are a commit of their own, the last, with the subject its records give (below).
|
|
1345
|
+
The commits are built in a **private index** (`read-tree`, `update-index`, `write-tree`, `commit-tree`), so what the author staged by hand stays staged and out of them; commit *k*'s deck is HEAD's deck with the units of the ticked commits 1..*k* applied, so with every row ticked the last one is the working file byte for byte; and the branch moves **once**, with `update-ref`'s old-value check, so all of them land or none does.
|
|
1346
|
+
A plan carries `base`, a fingerprint of HEAD and the work it was cut from: an edit that lands while the agent is thinking makes it a plan for other work, refused (`STALE`) with *✨ write it again*.
|
|
1347
|
+
`commit-tree` runs no hooks; the one-commit path still does.
|
|
1348
|
+
A first commit, with no HEAD to cut against, is one commit.
|
|
1349
|
+
**The window reads top to bottom in the order the work goes**: named for the branch (`git · main`), then three labelled sections, **commit**, **tag** and **push**, each ending in one button at the same right edge.
|
|
1350
|
+
Commit is the only filled button; *✨ write it for me* and *as one commit* sit on the message's own label line, where they act; every button is a real `<button>`, so `Enter` on Tag tags and on Push pushes, and only `Enter` elsewhere (or `⌘⏎`) commits.
|
|
1351
|
+
Push is off when there is nothing to send: no commit ahead, the branch already on the remote, and no tag it would carry.
|
|
1352
|
+
Below the commit, the two other sections, **so the window opens with nothing to commit too**: **Tag** puts an annotated tag (`git tag -a <name> -m <name>`) on HEAD, the name checked by `git check-ref-format` and refused when it starts with `-` or exists, and the tags already on HEAD named beside it; **Push** sends the branch and the annotated tags on what it sends (`git push --follow-tags`, or `git push --follow-tags -u <remote> <branch>` the first time), or the branch alone when **Settings… → Push tags** is off (then the tags on HEAD read `· not pushed` and the toast says they were kept here), on the click and only then, under `noPromptEnv` and a one-minute bound, turning `pushing |` while it goes.
|
|
1353
|
+
The row reads where the branch stands, from the same local read the four places below use (*↑3 commits not on origin/main*, *main is not on origin yet*, *up to date with origin/main*), and a push that cannot go says why instead of asking (*no remote to push to: git remote add origin <url>*, a detached HEAD, several remotes and none called origin); one the remote refuses says it in words (*origin has commits this branch does not: pull them first*, credentials refused, offline).
|
|
1354
|
+
After a commit the window **stays open when there is somewhere to push**, so commit then push is one visit, and closes when there is not.
|
|
1355
|
+
A change that is only review records (the sidecar beside the deck, REVIEW) gets its subject **from the records themselves, with no agent asked**: *review: resolve 1 comment*, *review: a comment on "Pricing"*, because that is a fact read off the diff and not a thing to make up; and the window **names the files that changed**, so a resolve reads as a line in `talk.review.jsonl`, never as a line in a deck that did not change.
|
|
1356
|
+
**While a subject is being drafted the window says so**, in the empty message box and on the button that asked: `thinking |`, the bar turning through `| / - \` with the seconds joining after two (slow dots under `prefers-reduced-motion`): ASCII, so it renders in every font a deck can be themed with, and moving, because a draft takes one second or twenty and a still window reads as a stuck one.
|
|
1357
|
+
The **session bookends** follow the same rule (a run that ends with uncommitted work refreshes the snapshot and *names* it on the way out rather than committing it) while the save taken **before an agent edits** stays, because it exists to keep authorship honest rather than to save anything.
|
|
1358
|
+
**`--git-mode timer`** restores the old cadence, bookends included, for anyone who wants it.
|
|
1359
|
+
`--git` creates the repository when none exists; write mode ASKS first on a TTY ("no git repository here — create one so every version of the deck is kept?").
|
|
1360
|
+
**A deck git has never seen stays out of history until K.**
|
|
1361
|
+
In a repository with commits, opening an untracked deck commits nothing: whether a deck is versioned is the author's call, so it stays untracked, the snapshot keeps it safe meanwhile (it needs a HEAD, not the deck in it), the chip counts it as uncommitted work, and the startup line says it is not in git and that `K` adds it.
|
|
1362
|
+
It used to be committed at startup on whichever branch was checked out, so a scratch deck opened in a repository landed on `main` before anyone pressed anything.
|
|
1363
|
+
Only a repository with no commits at all still gets the deck as its first commit, since there is no HEAD for a snapshot to parent on.
|
|
1364
|
+
A repository decklight creates starts with a starter `.gitignore`: `.shots/` (screenshot evidence), `.DS_Store`, and, behind a delete-this-line comment naming the tradeoff (bulky vs. cloud narration costing money to regenerate), `voiceover/`, written between `git init` and any initial commit; an existing `.gitignore` is never touched, and a repository decklight didn't create never gets one.
|
|
1365
|
+
Only the deck and what rides its commits (the review sidecar, and the `.gitattributes` decklight wrote for it, REVIEW) are staged (`git add -- <deck> <sidecar>`), and a machine with no git identity gets a per-commit `-c user.name/user.email` fallback rather than a silent failure.
|
|
1366
|
+
**When to commit** is chosen by `--git-mode`: `agent` (the **default**), `timer`, or `off`.
|
|
1367
|
+
In `agent` mode a completed agent edit produces one commit carrying the agent's own summary as the subject (a failed run or one that changed nothing commits nothing), while the snapshot runs underneath as the backstop, held back while a job is in flight so nothing captures a half-finished agent run.
|
|
1368
|
+
A timer is the wrong boundary for agent-authored work: the commits land on a clock that lines up with nothing the agent did and every message reads `autosave`, which is why the cadence became a snapshot and a question rather than a commit.
|
|
1369
|
+
**`--commit-messages`** answers the other half of that: an agent reads each commit's diff and writes the subject decklight would otherwise template, so the cadence's wall of `decklight: autosave deck.html` becomes `add a grind slide framing time as a consequence, not a setting`.
|
|
1370
|
+
It covers every subject decklight authors itself (the save that clears the way before an agent edit, the `timer`-mode cadence and bookends) and never an agent's own message, which already says what happened.
|
|
1371
|
+
It is also what pre-fills the commit window, where the sentence is a proposal you can edit rather than one that lands behind you.
|
|
1372
|
+
**The commit lands first and the subject arrives after, as an amend**: autocommit exists so a crash cannot cost an afternoon, and a safety net that waits on a language model is not one, so a slow, wedged, missing or rambling agent costs a generically-worded commit rather than a lost one.
|
|
1373
|
+
That ordering is also what makes the amend safe: it rewords one commit, on the tip, seconds old, and refuses the moment `HEAD` has moved (a restore, the agent flow's own commit, a second tick) or the commit has reached a remote, so it is never a rewrite of anything shared or of anything below the tip.
|
|
1374
|
+
The agent is asked through a **read-only** argv (`claude` without `acceptEdits`, `codex` under `--sandbox read-only`, `aider` handed no deck at all) because a call to describe a change has no business being able to make one.
|
|
1375
|
+
The diff is capped at 24 KB and truncation is stated in the prompt rather than hidden, since a deck is one enormous file and a theme swap rewrites 70 KB of CSS around the two sentences that matter.
|
|
1376
|
+
**The prompt also says WHERE the change is** (the deck's `<title>`, and the heading of every slide the hunks fall inside) because a diff cannot carry that and git's own hunk header is worse than nothing here: its function-context heuristic picks the last line resembling a definition, which in a single-file deck is a CSS selector from the inlined stylesheet thousands of lines above.
|
|
1377
|
+
Without it an agent with a gap fills it, and did: a row added to a brewing deck's troubleshooting table came back as *the espresso troubleshooting table*, a word the deck never uses.
|
|
1378
|
+
A change inside no `<section>` reports exactly that, so a theme or runtime swap is not described as slide content; and the prompt asks for a slide's own words rather than its number, which stops being true the moment one is inserted above it.
|
|
1379
|
+
**No subject names a slide by its number alone**, whoever writes it: the ones decklight writes itself (a review comment, a quick fix, a reviewed fix's draft) name it by its heading in quotes, or with none by a few words (a diagram's `aria-label`, its opening words, its layout: *the "Kafka to agents" diagram*, *the slide "Thank you"*), and an agent started from **A** and the skill's commit route are told the same rule (`slideName`, tools/deck-html.mjs).
|
|
1380
|
+
**Consented by the click, not by a setting.**
|
|
1381
|
+
A diff of your deck goes to the agent CLI installed on this machine, and most of them pass what they are given on to their provider, so nothing is sent without a person asking.
|
|
1382
|
+
By default the commit window's **✨ write it for me** is always there and asks only when pressed, and **its tooltip says, before it is pressed, where the changes go**: "Sends the deck's uncommitted changes to claude (Claude Code), the agent installed on this machine, which may pass them to its provider".
|
|
1383
|
+
The agent named is the one `describeWorking` would ask (`agentAsk`), carried in the commit state as `describer`.
|
|
1384
|
+
With no agent installed the button reads **✨ write it for me — no agent** and says `decklight doctor` lists the ones it can use; a session started with **`--no-commit-messages`** reads **— off** and says so; neither asks the server anything.
|
|
1385
|
+
**`--commit-messages`** is the automatic level: the window drafts as it opens, and every subject decklight authors itself is written by the agent.
|
|
1386
|
+
Nothing is stored and nothing is asked at `init`: the setting is the command line's, and the button is the consent.
|
|
1387
|
+
(An earlier release asked at repository creation and stored the answer as `decklight.commit-messages` in git config; that key is no longer read.)
|
|
617
1388
|
|
|
618
1389
|
**Unpushed work is named in four places, and none of them nags.** `decklight
|
|
619
1390
|
history` and the `H` overlay show it when you go looking; write mode prints one
|
|
@@ -638,29 +1409,106 @@ directory already held other work, the question's **default flips to no** and
|
|
|
638
1409
|
the files that would be pushed are named first: `initRepo` runs `git add -A`, so
|
|
639
1410
|
that init has just committed all of them.
|
|
640
1411
|
|
|
641
|
-
Authorship is **structural, not detected**: the server spawns the agent itself and diffs the deck around that process.
|
|
642
|
-
|
|
1412
|
+
Authorship is **structural, not detected**: the server spawns the agent itself and diffs the deck around that process.
|
|
1413
|
+
An agent driven from OUTSIDE that flow, a `claude` session in another terminal, is indistinguishable from a hand edit, and nothing in the filesystem could tell them apart.
|
|
1414
|
+
Such an agent declares itself instead, by `POST /deck/edit/commit { message }` when it finishes a logical change; the installed authoring skill instructs agents to do exactly that.
|
|
1415
|
+
The same endpoint is how a multi-step agent marks intermediate boundaries.
|
|
1416
|
+
Uncommitted work is committed before an agent job starts, so the agent's commit holds only the agent's work.
|
|
1417
|
+
Agent-supplied messages are untrusted text: collapsed to a single line, length-capped, and never allowed to begin with `-`.
|
|
1418
|
+
`decklight init` states the policy when it creates a repository rather than asking about it.
|
|
1419
|
+
- **History** (`H`, write mode). Every commit that touched this deck, newest first, with a live preview of each and a `⇑` on the ones that exist nowhere but this machine.
|
|
1420
|
+
Each row carries what that version **was** and what it **changed**: a slide count, and `+added` / `−removed` lines in the two colours every diff has used for forty years: because a hash and a subject cannot tell "tightened the wording" apart from "cut four slides", and that is exactly the distinction you are scanning for.
|
|
1421
|
+
The preview has its own transport, so a version is judged by walking it rather than by its first slide; the deck behind the overlay does not move.
|
|
1422
|
+
It walks **every build**, the way the talk does: `◀ ▶` (`← →`) step one build and cross into the neighbouring slide at either end, arriving backwards on that slide's last build; `◀◀ ▶▶` (`⇧← ⇧→`) skip a whole slide; `|◀ ▶|` (`Home End`) go to the first and last.
|
|
1423
|
+
Only the version knows how many builds a slide has, so the embedded deck reports its position to the panel around it after every move (`__decklightPreviewState`: slide, step, its build count, the slide count), and the readout says *slide 3 / 12 · build 2 / 4* once it has heard.
|
|
1424
|
+
A version whose runtime predates the report still steps slide by slide.
|
|
1425
|
+
Under the transport, a second row holds three **switches**, each a box and a label that never changes, because a label that flipped between *all slides* and *changes* read as a state to some and as an action to others: **changed slides only** (`D`), **captions** (`C`) and **more info** (`I`).
|
|
1426
|
+
More info is a line that spells out the selected row in a sentence (hash, age, subject, slide and line counts), and it is **off by default**: it repeats a row you can already read, right under the slide you are trying to judge.
|
|
1427
|
+
`I` or its switch shows and hides it, and the choice is remembered per browser (`decklight-history-details`), because it is how you like this overlay rather than a fact about any one deck.
|
|
1428
|
+
It is not captions and is not called so.
|
|
1429
|
+
The **captions** are the deck's own: `C` or its switch flips the same switch `C` flips on the deck, and with it on the preview carries a caption bar with **that version's notes** for the slide and step on screen, because a version's notes are part of what it changed and the history is where you read them side by side.
|
|
1430
|
+
The preview is told by its URL (`&captions`) when it loads and by a message when the switch flips, so turning them on does not reload the version.
|
|
1431
|
+
Any other embedded preview (the slide finder, the theme and template pickers) is a thumbnail of wherever the cursor is and still shows none.
|
|
1432
|
+
**Changed slides only** (`D`, or its switch) decides what the transport walks: every slide of the version, or only the slides that version **changed, added or removed** against the one before it, which are the slides a version is about, each still build by build.
|
|
1433
|
+
Each stop is named under the position in the commit window's three colours (*slide 2 changed*, *slide 4 added*, *slide 3 removed*), a version that touched no slide says *no slide changed*, and a **removed slide is shown from the version before it**, at its old number, since that is the only version that still has it.
|
|
1434
|
+
The slides are matched the way the commit window counts them (`slideDiff` in cli/commit-split.mjs: the longest run of identical slides kept, an edit paired by heading or shared lines), answered per version by `GET /deck/edit/history/changes?ref=<hash>` (a hash only, since the ref is handed to `git show`; a commit never changes, so the answer is kept), and the choice is remembered per browser (`decklight-history-changes`) like the captions.
|
|
1435
|
+
The preview's URL carries the slide and build (`#/N/S`), so a version opens where it is asked to rather than on slide 1.
|
|
1436
|
+
**The preview is what this overlay is for**, so the layout is built never to fight it: a wide panel, the preview on a 16:9 `aspect-ratio` because a deck is 1280×720 and a letterboxed sliver judges nothing, and a rail that is structurally incapable of squeezing it.
|
|
1437
|
+
That last part is the lesson from shipping it squeezed: a flex item's default `min-width: auto` forbids shrinking below its own min-content width, so a rail whose row put four things on one line, under a `nowrap` title bar, made `flex: 0 0 300px` a suggestion its content could veto, and the pane rendered 57px.
|
|
1438
|
+
The row is two lines now: subject, then a dimmer line of hash, badges and a compact age.
|
|
1439
|
+
The title bar wraps, and `min-width: 0` is on the column, so nothing in the rail wants to be wide and the preview's size stops being an accident of how somebody worded a commit message.
|
|
1440
|
+
A preview that cannot be produced **says so in the frame**: `/deck/edit/history/at` answers with a small page carrying the reason, because this frame is dark chrome and a bare line of error text rendered in it reads as a black rectangle, which is exactly how a deck that was merely too big to read looked for a release (#508: `git show` through `execFileSync` capped stdout at Node's 1 MB default and THREW `ENOBUFS` rather than truncating, and a blanket catch reported that as a missing revision).
|
|
1441
|
+
`GIT_MAX_BUFFER` (cli/git.mjs, 128 MB) is that cap named once and shared by every git read of a deck, a single-file deck is over 1 MB as a matter of course, and only a ref git itself does not know is a 404.
|
|
1442
|
+
`⏎` **asks** (it names the version, says the restore is written as a NEW commit and that nothing is rewritten), and `⏎` again does it.
|
|
1443
|
+
Restoring is recoverable, but recoverable is not the same as intended, and the whole premise of a history is that you opened it to look rather than to decide.
|
|
1444
|
+
Restoring used to be its own overlay with its own list and its own name for a commit; folding it in means there is one place a version is looked at and one place it is chosen, rather than two that had already begun to differ.
|
|
1445
|
+
It is the git-level sibling of the undo chord: that takes back an edit, this takes back a session.
|
|
1446
|
+
**In no-trust mode `H` opens the deck update instead** (`NO_TRUST#UPSTREAM`): a presented deck has no edit server and so no history to preview, and the live question there is whether the author has pushed anything since you cloned it.
|
|
1447
|
+
|
|
1448
|
+
### PRESENTING_WRITING · The slide-text writing tools
|
|
1449
|
+
|
|
1450
|
+
- **Four tools for the words on the slide** (`cli/rewrite.mjs`; the Writing picker's *slide text* group, PRESENTING_VOICE; the `/` palette rows *Tighten the slide text…*, *Fix typos and grammar on the slide…*, *Match the slide text to the script…*, *Rewrite the slide text with an instruction…* under Slide, each opening the picker on its slides step; and *Writing…* on an element's right-click menu, which opens the picker on that group): **✂ tighten** (shorter, same meaning, same terms, never longer), **✓ fix typos and grammar** (spelling, grammar, punctuation and capitalisation, nothing reworded), **⇄ match the script** (the runs reworded to agree with the slide's speaker notes, which are sent along) and **… custom instruction** (one line of the author's, asked for in the card before the slides step, applied to every run it applies to). The scopes are the picker's: this slide, its module, the whole deck.
|
|
1451
|
+
- **The agent sees text runs, not markup.** A slide's visible text is cut into **runs**, the text between tags outside the notes, code, `pre`, scripts, styles and SVG, numbered in reading order, and the agent (read-only, the same argv the script rewrites use, one ask per slide, three at a time) is asked for the same numbered runs back, `N: text`, one per line. Decklight puts them into the slide where they came from, HTML-encoded, so a tool can only change words: the slide's structure, builds, attributes, classes and styles cannot move, which is what makes a tool safe on a whole deck. A hidden slide is skipped. **Decklight writes only what passes a check** (`rewriteProblem`): every run answered, none emptied, no markup in an answer, and the tool's own rule: a typo fix that changed more than a few characters per word reworded; a tighten that made a run longer; a match or a custom rewrite that doubled or halved the slide's words. A slide whose answer fails is left exactly as it was, with why.
|
|
1452
|
+
- **Held for review, like a script rewrite** (#907): `POST /deck/edit/rewrite { slides: [n…] | 'all', tool, instruction? }` (409 while another rewrite, a review or an agent edit runs; 400 for an unknown tool or a custom one with no instruction; 422 with no slide text) runs like an enhance, progress rides the same SSE `enhance` events (`kind` is the tool), and against the deck as it is when the run ends (a slide edited meanwhile keeps the edit, and is listed as left as it was) the passing slides make the candidate the review view shows side by side, `what` *text: tightened* / *text: typos and grammar* / *text: matched to the script* / *text: <the instruction>*, `kind: 'text'`. The slide's text changed, so the review opens in slide mode, the two renders at every build step that differs; what the author approves is one write and one undo entry, and the drafted commit names the slides (*text: tightened on slides 4 and 7*).
|
|
643
1453
|
|
|
644
1454
|
### PRESENTING_VOICE · The voice
|
|
645
1455
|
|
|
646
|
-
- **Narration**: `⎵` plays and pauses the voice; `V` opens the panel: **off**, track, live voice, engine, tone, character, recording, captions, speed (persisted per deck). **The voice ends with the talk**: narration that runs past the last slide turns itself off and says so (`🔚 end of the talk — narration off`), instead of staying "on" in silence; and `⎵` where the live voice has nothing left to say (the last build of the last slide, its notes all spoken on earlier builds) says that (`nothing left to say — this is the end of the talk · ← goes back, Home starts over`) rather than switching the voice on into silence. **Narration is OFF until somebody picks**, however much audio the deck ships: a deck is opened to be read far more often than to be played, and defaulting to the first track made "chosen" indistinguishable from "shipped", the distinction every other decision here needs. `⎵` belongs to the voice only once a track is CHOSEN (in the panel, or restored from a previous visit, both deliberate) or the voice is already running or parked; a deck that merely carries a track keeps `⎵` for advancing, so a presenter talking over their own slides cannot start the narration by pressing it. The panel's first row is `🔇 Off`, current when nothing is chosen, and picking it stops the voice and hands `⎵` back. The choice is written as `off` rather than left implied, so a later change to what "no choice" means cannot start a deck talking that somebody switched off. Two entry points are themselves the choosing and select a track rather than refusing: `?voiceover`, where the url is the request, and the touch sound button, where a speaker icon has one meaning and the phone tapping it has no `V` key to be redirected to; neither persists, being a request for this visit rather than every future one. Two sources. **Recorded**: pre-rendered per-slide audio (`<dir>/slide-NN.m4a`, 1-based like `state.slide`), synced to slide changes; the deck configures **one track** as `narration: { files: '<dir>', ext, segments }` (`ext` defaults to `m4a`; this is the line `voiceover`, `record` and the deck's recorder all print) or **several** as `files: [{ label, dir, ext, segments }, …]`, the same fields once per track; the runtime and the edit server normalise the first to a one-item list of the second. **A recorded track can pace the builds, not just the slides.** `tools/voiceover.mjs` already writes one file per `⟨CLICK⟩` segment (`<dir>/slide-NN-KK.m4a`, KK 1-based over the segments that produced audio: empty segments produce none, so the file number is not the step number) and lists them as `slides[i].segments`; a track carrying them reveals build step k when segment k ends, which is the build-synced pacing the live voice has, from a recording. On a **directory** track it is opt-in: `narration: { files: '<dir>', segments: true }`, off again with `segments: false`, because the runtime cannot see the folder and must not guess. A **manifest** track needs no flag, the manifest being the list of what exists; except on a *signed* one, where a segment counts only if it carries a `url` of its own. `publish-voices.mjs` writes those urls (every beat is uploaded and signed alongside its slide) and the rule stands anyway, because a manifest published before it did lists beats whose bytes never left the author's disk, and a signature is the only thing that tells the two apart. Whether a track paces itself is settled **once**, when narration starts, from what the track declares, never by probing for a file, which neither `file://` nor a CORS-less bucket can answer. A slide recorded whole inside such a track still plays as one file and then advances; a surplus `⟨CLICK⟩` beyond the slide's builds is chained onto the last step exactly as the live voice chains it. A missing FIRST segment falls back to the whole-slide file; one missing mid-slide has nothing to fall back to, so the deck stops and names it. The voice is the clock. The character keeps up: `tools/lipsync.mjs` cuts a sidecar per beat too (`slide-NN-KK.visemes.json`, from that beat's own `slide-NN-KK.txt` as the dialog hint), the synthesized recorder writes them beside its beat WAVs, and `decklight bundle` inlines them under the same stem. A beat with no sidecar animates from amplitude rather than replaying the slide's timeline, which would start at zero against every beat and be confidently wrong. The talking-head *video* stays per slide: a clip is minutes of GPU time and the element mirrors the audio's transport rather than seeking a timeline, so cutting it per beat would cost a great deal to fix a smaller error. **Both recorders write those beats.** the panel's `Record this deck…` stitches them from the live voice's own sentence cache alongside the whole-slide file it always wrote (so a synthesized track gains build-pacing for free, with no second pass) and writes the folder's `manifest.json` after every slide (engine, model, voice, style, one entry per slide with the hash of the notes it was voiced from and its beat files, the shape `decklight narrate` writes, hashed by the same `tools/narration-manifest.mjs` from the deck file's notes, so an aborted take is a valid partial, `decklight video` and the export dialog take the folder as a track, and re-recording the same engine and voice refreshes that folder instead of minting `voices/<voice>-2`, #535). **Its done card says what the take cost** (#565): `N clips · R reused · S sent to <engine> · ~$X`, counted for THAT run and not the session: a clip already in the window (played, or warmed by the lookahead) and one the bridge replayed from its own disk cache (`x-tts-cached: 1`) are both *reused*, so `reused + sent` is every clip the take voiced, and the spend is what the bridge priced the sent ones at, `$0` on a free or offline engine rather than blank. Re-recording an edited slide into an existing track is the case it answers: nearly everything reused, and a bill only for what changed. The your-voice recorder voices nothing, so it shows no such line, and **the panel's `Record this deck…` records them in your own voice**, for which `decklight narrate --mic <deck.html>` is the door: a browser will not open a microphone for a `file://` page (getUserMedia needs a secure context, and `http://127.0.0.1` is one), so the command serves the deck and opens it at `?record`. Your-voice recorder on a `file://` deck says exactly that instead of failing silently. The deck is the teleprompter: it shows one ⟨CLICK⟩ beat at a time at the build that beat plays over, and `→` ends the take *and* reveals the next build, one gesture, so the timing you record is the timing you will present. `⌫` retakes the beat just read, `Esc` stops (every slide already finished is already written). Capture is WebAudio → 16-bit PCM → `stitchWav`, at 24 kHz mono like every engine's output: not MediaRecorder, whose webm/opus nothing else here reads, and not an AudioWorklet, whose module would have to come from a `blob:` URL that the no-trust mode's `script-src 'self' 'unsafe-inline'` forbids. Each slide is written twice by EITHER recorder: one `slide-NN-KK.wav` per beat, and the whole-slide `slide-NN.wav`, so `lipsync.mjs`, `video.mjs` and a deck that never opts in all keep working: the layout on disk says nothing about which recorder made it. A beat file carries neither the segment-sized silence that separates beats (it belongs between them, not at the head of one) nor the slide's trailing `data-narration-pause`, and neither does the **whole-slide file**, nor the viseme timeline beside it: `advanceFrom` honours every pause at play time for recorded and live tracks alike, so baking one into a file as well would hold twice (which the whole-slide file quietly did until the pause gained a non-zero default and the double showed). A slide the tool would not have segmented (fewer than two beats with words in them) is one take and no segment files, the same threshold `tools/voiceover.mjs` gives up at; a slide with builds but no ⟨CLICK⟩ is recorded whole and says so on the card, because that is an authoring gap and the moment you are reading its notes aloud is the moment to learn about it. Files are written through the edit server (`POST /deck/edit/narration/record`, which is told a folder and a beat number and builds the name itself), and fall back to the browser's download folder when there is none, **saying which of the three reasons** applies, because where the files went is not something a presenter can act on and why they went there is. Whether a server exists is **awaited, never sampled**: the probe answers asynchronously and a recorder that read it early sent whole takes to the download folder because the answer had not arrived yet, not because there was no server. A deck opened with `?record` that finds no server is the loud case: that parameter means one was started, so something else is holding the port for another deck, and it says so on the intro card, before the first beat rather than after the last. **A TRACK IS A FOLDER**, and the recorders name it after the voice: a deck carries as many tracks as you have voices (several cloned ones, the system voice, two takes of your own) and `N` is the switcher, so a single `voiceover` default meant recording a second voice erased the first with nothing said. The folder is chosen by four rules in order: `--dir`/`?dir=` (asked for out loud); a folder whose `manifest.json` names this same engine and voice (a re-record **refreshes** its take rather than accumulating `-2`, `-3`); the deck's own single configured folder (a deck that names one place has decided); else `voices/<voice>`, suffixed past anything already there. `GET /deck/edit/narration/tracks` is how the deck finds out what exists (it cannot see the filesystem, which is why `segments: true` is opt-in at all) and the proposal is shown on the card as an **editable field** before recording starts, because a proposal that cannot be corrected is a decision made somewhere else. The done card then **offers to point the deck at what it just wrote**: `POST /deck/edit/narration` **adds** the track to `narration.files` (updating in place when that folder is already listed, never duplicating a row) through the same `applyEdit` door every other edit uses; the one-string form becomes a one-element list carrying the same `ext`/`segments`, which is the shape `narrationTracks()` normalises it to anyway, so the undo chord takes it back and live-reload shows it. A button rather than automatic: editing someone's deck the moment a recording ends is the wrong default even with undo behind it, and the offer is absent exactly where it could not work (no edit server → the card prints the line, as before). The call site is located by the same classifier `audit` and `upgrade` use, and its argument walked with strings skipped, because `{ title: 'Acme (Inc)' }` is a deck that did nothing wrong. A deck that builds its config elsewhere (`const cfg = {…}; Decklight.init(cfg)`) has no literal to edit: that is **refused with the reason**, never guessed at. `decklight narrate --mic --slides a-b` re-records a range and leaves every other slide's files alone: recording starts at slide 1 and cannot skip, so without it a fluffed beat on slide 30 costs 29 slides of reading. A `dir` may be an absolute URL, so a **public** bucket has always served a track with no extra machinery (`dir: 'https://storage.googleapis.com/…/algenib'`: media elements load cross-origin without asking). **Manifest tracks** exist for the case a `dir` cannot express: `[{ label, manifest: 'voices/algenib/manifest.signed.json' }, …]` fetches a small JSON list once when narration starts and plays each slide's URL **verbatim**, because a presigned URL carries its signature in the query string and a query string can never be a directory prefix. The manifest is the file `tools/voiceover.mjs` already writes (`{engine, voice, style, slides: [{file, hash}]}`), extended with an optional per-slide `url` and a top-level `expires` (ISO 8601); a slide with no `url` resolves its `file` next to the manifest, so an unsigned `manifest.json` in a public bucket is a track for free, and a `null` slide (no notes, no file) is silence rather than a failure. `tools/publish-voices.mjs <dir> --bucket gs://… [--sign 7d]` uploads the files whose hash moved (the last `manifest.signed.json` is the record of what is already up there; `--all` overrides), signs every one through `gcloud storage sign-url`, never our own key handling, and writes `manifest.signed.json` to deploy beside the deck while the megabytes stay in the bucket. It refuses a `--sign` longer than **7 days**, the V4 signing scheme's own ceiling, and names the public-bucket alternative for audio that must outlive a week. Signatures expiring is one more way for the voice to be unplayable, so it behaves like all the others: the expiry is checked before the first clip, narration turns off, auto-advance stops, and the message names the track, the date, and the literal re-sign command (the manifest records the `source`, `bucket` and `signDuration` it was made with, so it is a line to re-run and not a shape to fill in). A signed file that fails to load is treated the same way: a media element cannot report an HTTP status, so a 403 for a lapsed signature is indistinguishable from any other failure, and naming the only cause worth naming beats staying silent. `N` shows a manifest track with a ☁ and the time left. `decklight bundle` **inlines the manifest** under its own path (`data-decklight-voices`), like the viseme sidecars, because `fetch` is dead on `file://`; the audio stays in the bucket, which is the whole point. One honest caveat: the character overlay's `amplitude` fallback reads the audio through WebAudio, and cross-origin media taints that unless the bucket sends CORS headers. Viseme sidecars are same-origin JSON and are unaffected. **Live voice**: the player synthesizes each slide's notes on the fly through the local bridge (`decklight tts`; the deck asks its own origin for `/tts`, which `open` proxies to the bridge it started, a deck never spells a port, and falls back to `http://127.0.0.1:8787/tts` when opened from disk; override via `narration.liveUrl`). The bridge speaks with one engine at a time, six built in (`--engine`, tools/tts-engines.mjs), plus any installed one, and the deck can change which: **gemini** (gemini-2.5-{pro,flash}-tts on Vertex AI: a delivery style always reaches it; no free tier, and a fresh project's per-minute quota 429s under the lookahead's bursts), **chirp** (Chirp 3: HD on the Cloud Text-to-Speech API; the same 30 star-named voices, ~1s a sentence, 1M characters a month free, no style channel), **piper** (a local neural model: offline, unlimited, free, no credentials; one voice per installed model, and the process is held RESIDENT because piper reloads its ~120 MB model on every start), or **elevenlabs** (your own ElevenLabs account's voices, the ones you *cloned* included, which is the reason it exists). The first three know their roster up front; ElevenLabs cannot, because the interesting voices are yours, so it fetches the account's list once and `/tts/ping` and `/tts/voices` await it: **your** voices first (cloned, then professional, then premade), each tagged with where it came from, and the picker's default is the first of them. The player sends a voice NAME; a `voice_id` pasted from the dashboard resolves too. Its key is read from `$ELEVENLABS_API_KEY` and is **never written to `tts.json`**; decklight remembers the choice and leaves the secret to your environment. The model is `eleven_v4` by default (`--tts-model eleven_v4_turbo`, `eleven_v3` or `eleven_multilingual_v2` otherwise; a track keeps the model it was voiced with, so the default moving re-voices nothing). Style reaches it only on a tag model, v3 or v4 (`stylable` and `audioTags` follow the model chosen, not just the engine): it reads a short bracketed **audio tag** ahead of the sentence as performance direction, never the Gemini-shaped prose instruction, and never sent to any other ElevenLabs model, where the brackets would just be read aloud as words instead of shaping them. In the notes themselves, `[click]` is decklight's marker on every engine, never sent; `[pause]` and `[long pause]` are sent to a tag model as those tags, where the voice holds them itself, and held by decklight for every other voice (DECK_ANATOMY); any other bracketed tag reaches a tag model as written and is taken out for every other voice. An optional `--tts-stability creative|natural|robust` (v3 only; refused up front on any other model rather than silently doing nothing) trades how hard v3 follows the tag against how much it drifts, and is left alone entirely (no `voice_settings` sent at all) when unasked. Both the tag and the sentence it directs are billed as the characters actually sent, and it is metered in characters against a plan rate decklight cannot see, so the bridge reports characters rather than inventing a dollar figure. Audio is `pcm_24000` wrapped as WAV like every other engine; `--tts-format mp3` is the escape hatch for plans without PCM output and costs you the panel's `Record this deck…` offline recording and the lip-sync bridge, both of which read WAV, so it is opt-in, never a silent downgrade. `GET /ping` reports `{engine, model, voices, stylable}` and the picker offers exactly those voices, skipping the tone step when the engine cannot be told how to speak: a roster the bridge cannot pronounce would be a silent lie. **Which engine is itself a choice the deck can make**: `GET /tts/engines` lists every engine with its price note and, for the ones this machine cannot use, what is missing. **Voices by language** (ElevenLabs): the bridge reports the languages each account voice speaks, what ElevenLabs verified it for and what its labels name (`voiceLangs`), as the roster's fourth element, `[name, flavor, group, langs]`, shown after the flavor (`cloned · en fr`) and matched by the filter's `lang:` term. The voices view carries a **🌐 Language** row (the same `lang:` term, chosen from a list: the deck's language first, then what your voices speak with a count each, then the languages ElevenLabs speaks), and **opens on the deck's own language** (`<html lang>`, once per open, never English) because a deck translated to Spanish wants a Spanish voice. The account's voices are mostly English, so the view ends with **🔎 Find <language> voices in the ElevenLabs library…**: `GET /tts/voices/library?language=&search=` (the bridge asks `/v1/shared-voices`; free, changes nothing), each voice with ElevenLabs' own sample on ▶ (played as hosted, no synthesis). The first ⏎ on one ARMS it ("⏎ again adds “Mateo” to your ElevenLabs voices — it uses one of your plan's voice slots"); the second is `POST /tts/voices/library/add { engine, owner, id, name }` (`/v1/voices/add/{owner}/{id}`), the one call that changes the account; the roster is fetched afresh and the voice picked like any other. A plan with no free slot says so; any other engine answers 404 "has no voice library — ElevenLabs does". **The choice belongs to the tab, not the bridge**: one bridge serves every open tab (a deck, its speaker view, a second deck) so the bridge holds every engine it is asked for side by side, built once, and each tab names its engine on every request (`GET /tts/ping?engine=`, `/tts/voices?engine=`, `/tts/engines?engine=` marks that tab's engine current, `POST /tts { …, engine }`). A deck restores the engine its saved live voice was picked on by asking for it by name, and picking another in the picker does the same; neither switches anything for another tab. (They used to switch the bridge itself, and a second tab restoring its own engine on load silently took the voice from the first.) An engine this machine cannot run is refused with its blocker (409), and the deck speaks with the bridge's default and says so. A request naming no engine gets the default, the one the bridge started with; `POST /engine {engine}` still moves that default, for decks built before `?engine=`. The picker hangs off the voices view (`N` → live voice → *engine*), because the engine decides the whole roster and that is the screen where you notice the names are not the ones you wanted. It is drawn as a **bar at the top of the voices card**, above the filter: `ENGINE elevenlabs eleven_v4 … change engine ›`, the model named only where it is a real choice (ElevenLabs, Gemini, Chirp; for say, SAPI and piper it is merely the default voice), so the one control that decides every voice below it is not one more line among them; it is still the first row, so ↑/↓ and ⏎ reach it. The engines view lists the **ready** engines first, then the ones that **need setup**, each group under its own heading with its one-line fix, and the V panel's *Live voice* row names the engine and voice in use. **The readiness check is shared with write mode** (`engineStatus`, tools/tts-engines.mjs) and only its phrasing differs (a picker offering an engine `open` would have refused to start is a picker that lies) and it is asked BEFORE the engine is built, because gemini and chirp construct perfectly well against an unchecked project and fail on the first sentence, which mid-talk is a keypress into silence. A swap re-runs the same stale-voice rule a first probe does, and the response cache is keyed by engine name, so switching back replays instantly rather than re-billing. **Synthesis is cached on disk, for every engine including the paid ones** (`$XDG_CACHE_HOME/decklight/tts`, oldest dropped past 400 MB, `--no-cache` to opt out). The key is `(engine, model, format, voice, style, text)` and it is one function shared by the bridge and `decklight narrate` (`clipKey`, tools/tts-cache.mjs), because those are separate processes and a deck previewed sentence by sentence in the browser and then batch-recorded was billed twice for identical words. The **model** is in the key, which is what makes caching a cloud engine safe rather than reckless: a server that changes its model underneath us produces a MISS, not a stale clip filed under today's name. **Style is in the key only when the engine can act on it**: every engine but gemini and ElevenLabs v3 ignores a delivery instruction, the deck usually sends none and the CLI defaults to a paragraph, so keying on a style nobody read would make identical audio hash two ways and miss every clip. `voiceover`'s manifest hash is that same key, shortened, so the folder-level skip and the content-level cache cannot disagree about whether a slide changed. **An engine that cannot be used is shown, dimmed, with the terminal command that fixes it** (hiding it would answer "where did ElevenLabs go?" with silence) and every fix is something you do in a terminal: the deck lists what is missing and never collects it, because a key or a project id typed into a web page (even one on loopback) is a different thing from one exported in a shell, and a deck under `--remote` is reachable from a phone. **The deck remembers the engine with its live voice**, and nothing else does: a voice name only means something on the engine it came from, so the deck's saved live voice carries its engine, and the next session's probe asks the bridge for that engine before it reads the roster: a bridge restarted on its default engine would otherwise find the saved voice missing and replace it. A saved engine the bridge refuses (the key is gone, the model deleted) is said out loud and the deck speaks with what the bridge has. `tts.json` is still never written from the deck: it is what the CLI and the wizard write and what the next write-mode start uses for *every* deck, and an experiment two minutes before a talk must not quietly become every deck's default. The bridge is probed when live narration **starts**, not only when the picker opens, and a saved voice the live bridge does not have is treated as **stale rather than chosen**: it came from a different engine (the star roster is the default, and an ElevenLabs key knows none of those names), so the bridge's first voice takes over, is persisted, and the swap is announced: a voice changing on its own must never be silent. **The voice already on the machine**: with no engine chosen, none saved, and no cloud project, write mode asks the operating system what it can speak with before defaulting to an engine that would only be skipped. **macOS** is read through `say -v '?'`: the roster mixes twenty years of engines, so voices are ranked and shown by **quality category**: *best* (a **Personal Voice** the user recorded, and **Siri** voices, recognisable on current macOS only by their sample sentence, the name markers having disappeared from the listing), *good* (Premium/Neural, then Enhanced), *average* (plain built-ins, and the **robots**: Albert, Zarvox, Bad News and the rest of the novelty/formant roster, pinned there by name and listed last, because they sort alphabetically first and once narrated decks by default). The categories render as labelled shelves in the picker, and only the deck's language gets them: the **novelty tail** (robots and the 2022 persona family: Eddy, Flo, Grandma, Grandpa, Reed, Rocko, Sandy, Shelley) and **every other-language voice** each fold to a single expandable row (`‣ novelty voices (26)` · `‣ other languages (140)`), expanded per picker-open and never persisted: a real Mac answers ~184 names, and ~165 of them were the reason "which voice is good here" was unanswerable. When no best-tier voice is installed, the BEST shelf holds an actionable row: *⬇ Get Siri voices — free download*, whose commit asks the bridge's `POST /voices/install` to open the macOS voice-download pane: darwin-only, loopback-only, and the argv is a **frozen constant** (`open x-apple.systempreferences:…`) that no byte of any request reaches; the download itself stays a human clicking through, which is the point of the pane. This is the ONE exec a deck may trigger, and it opens a Settings pane and nothing else. A Mac whose best voice speaks Italian must still not narrate an English deck with it. A Siri voice hiding behind a **duplicate display name** (how current macOS lists them) is dropped rather than offered: `say -v` addresses by name, so that row would play a different voice than it names. **macOS 27** changed the listing twice over, and the roster reads it as it is: a plain voice now carries its language (`Daniel (English (UK))`, `Samantha (English (US))`), so a plain twin of `Daniel (Enhanced)` is recognised by its **base name**, under both a quality marker and a language pair, rather than its whole name, which let every one of them through; and some voices are printed twice, line for line, and are offered once (a Siri voice under a plain voice's name differs by its sample, so it is not a repeat and stays the rule above's to drop). Names keep their suffix in the picker, because the suffix selects a different build: `say -v Daniel` speaks the Enhanced one. The bridge still accepts a voice by its **bare name** (`Samantha`), which `say -v` answers to, so a deck that saved one, or a track recorded as one, keeps working on a Mac whose listing grew the suffix; a name with no voice under it is still refused rather than quietly swapped for the system default. A machine with **no best-tier voice** is told, on the caveat channel every engine already has (the bridge's startup line, the deck's toast): Siri voices are a free download away, with the Settings path and the `open "x-apple.systempreferences:…"` command that gets there, suggested, never run, because only a person can click through a voice download. **Windows** is read through PowerShell: the **WinRT** stack first (`Windows.Media.SpeechSynthesis`, projected from Windows PowerShell 5.1), because that is where the **natural** voices live (Aria, Jenny, Guy, the neural ones Narrator and Edge use, and the closest thing Windows has to Siri); `System.Speech`, the 2006 API that sees only David, Zira and Mark, is the fallback for a PowerShell that cannot project. Synthesis goes through whichever stack listed the voice, and a name the machine does not have throws rather than falling back to the default voice. A machine with no natural voice installed is told where they are (Settings → Accessibility → Narrator → *Add natural voices*) on the same caveat channel and with the same picker row as macOS's Siri hint (`start ms-settings:easeofaccess-narrator`, a frozen argv, is the one exec that row may trigger there). Both become real bridge engines (`--tts-engine say|sapi`), synthesizing 24 kHz PCM in a WAV like every other engine, `stylable: false` so the picker skips the tone step. **Android** is detected and refused with the reason: Termux reports `android` and runs Node, but Android's TextToSpeech is an in-process Java API with no command line behind it, so there is nothing for a bridge to call: the honest path there is a recorded track, which needs no bridge. A native voice is the ONLY engine claimed automatically, because it is the only one that needs no setup at all; **piper is never auto-selected even when it is on PATH**, since it needs a toolchain and a ~120 MB model and that choice belongs to the first-run wizard, which saves it. Any `--tts-engine`, `--project`, `GOOGLE_CLOUD_PROJECT` or saved config wins outright and detection is never consulted. When a machine has nothing, the skip line says what THIS machine lacks and names piper. **A missing piper voice is caught before the bridge starts, not by it**: piper installed and chosen but with no model on disk used to bring the bridge up looking healthy and fail on the first sentence: a keypress into silence, for a file that was never there. write mode now checks, names the model, its directory and its size, and on a **TTY** offers to fetch it; accepting re-plans so the bridge joins the session, declining or a non-TTY run keeps the skip line. **Nothing is ever downloaded silently.** The command it runs is chosen for the machine (`tools/tts-engines.mjs`): a python that can already import piper gets `python -m piper.download_voices`, and otherwise `uvx --from piper-tts` runs it inside the isolated venv `uv tool install piper-tts` creates: the plain form cannot work there, which is why it used to fail with `ModuleNotFoundError` on a machine that had just followed decklight's own install instruction. **Setup** (`decklight setup voice`; a bare `decklight tts` that cannot start runs it too, on a terminal): **write mode asks nothing at startup**: with no voice configured, or a piper model not yet downloaded, the banner's skip row names `decklight setup voice`, and the deck's `V` panel says the same, because the deck never collects a key or a project. The setup asks a few plain questions on the terminal instead of exiting with the engine's error: the engine, with the free/offline/cloud trade-offs stated and the default following what the machine already has (an `$ELEVENLABS_API_KEY` outranks everything: nobody exports one by accident; else piper on `PATH`, else a project visible in the environment or gcloud config), then only that engine's prerequisites: a GCP project id (prefilled, validated with the same rule the flags enforce) plus a credentials probe for the cloud engines; for piper the install and voice-model download commands, run only on an explicit yes; for elevenlabs nothing at all when the key is exported (the roster answers "which voice", so it is not asked) and otherwise where to make a key and why setup will not save it for you. Setup proves the choice with one real synthesis of the picker's preview sentence, reporting duration and the engine's cost note, and only a config that has spoken is saved, to `~/.config/decklight/tts.json` (`$XDG_CONFIG_HOME` honored), which `decklight <deck>` reads from then on (as does the bridge run alone); precedence is flags > environment > saved config > built-in default. `decklight setup voice` re-runs the questions, deleting the file resets to first-run, and non-TTY invocations never prompt; exit codes and messages stay as they were. **The voice is the clock**: auto-advance is driven by narration finishing, so when the voice CANNOT be played (a quota 429, an unreachable bridge, a browser that blocked autoplay, a recorded track with no file for this slide), the deck **stops advancing** rather than walking the talk past slides nobody has heard, and says why in a message (`I`) naming the cause and the way out (`--tts-engine chirp` for a 429, opening the deck with `decklight <deck>` for a dead bridge, one click for blocked audio). Narration switches itself off; `V` retries: the picker drills tracks → voice (30 prebuilt Gemini/Chirp names, one piper model, an OS voice, or the ElevenLabs account's own roster) → tone, on any engine `/tts/ping` reports as `stylable` (six presets or a custom typed instruction: a prompt prefix for gemini, a short bracketed audio tag for ElevenLabs v3 and v4). Every voice row carries a ▶ **preview** that speaks an editable test sentence (default "Hey, this is Decklight", input at the top of the voices view, ↺ restores the default) through the bridge in that voice; tone rows preview the drafted voice in that delivery style, and the custom-tone input has a ▶ to audition a typed instruction before committing it. After a preview plays, the rest of its roster prefetches sequentially in the background (all voices neutrally, or all tones for the drafted voice). Two preview caches: the default sentence's cache is permanent once built; the custom sentence's cache holds exactly one sentence and is swapped (old audio freed) when the text changes. **Build-synced auto-advance**: the ⟨CLICK⟩ markers that segment the notes for the speaker view segment the audio too: segment k is synthesized as its own clip and narrates build step k (0 = arrival); when a clip ends the deck reveals the next build, and after the last segment it moves to the next slide, so a deck with well-segmented notes presents itself beat by beat. **More segments than builds** (the commonest case being a slide with no `data-build` at all, which has exactly one step) used to drop every surplus segment: never synthesized, never spoken, never mentioned, while the speaker view went on displaying it, so the presenter read a cue the deck would never say. The surplus now rides on the **last** step. There is nothing left to reveal, so the marker becomes a beat rather than a build trigger: the same call `tools/video.mjs` makes for a count that does not line up, and the same one the panel's `Record this deck…` stitching and the viseme sidecars make, each giving a folded segment a segment-sized silence rather than a sentence-sized one so a recorded take breathes where the live one does. The counts disagreeing is still nearly always an authoring slip, so it is named once per slide in the message log (`I`) and the debug log, never toasted, because it is a note about the deck rather than something to act on mid-sentence. The opposite mismatch needs no rule: fewer segments than builds already advances after a short beat, losing nothing. A segment with no words advances after a short beat; a slide with no notes is skipped; manual navigation mid-clip wins over the pending advance and re-syncs the voice to the new step. **Between sentences the voice breathes 0.25s by default** (the pause a reader takes at a full stop, which a chain of separately synthesized clips otherwise lacks), overridable for the deck (`narration: { sentencePause: 0.5 }`) and per slide (`data-narration-sentence-pause="0"`, where an explicit zero is zero); a typo falls through to the next tier, never to silence. the panel's `Record this deck…` stitches the same breath between sentences, so a recorded take paces a slide exactly as the live voice did. **Every pause resolves the same three tiers**: the slide's attribute, else the deck's `narration: { sentencePause, beatPause, slidePause }`, else the built-in default (0.25s between sentences, **0.5s between builds, 1s before the slide turns**), opt-*out* rather than opt-in, because a deck that talks straight through its own punctuation is the behaviour nobody asks for on purpose; so a deck can breathe uniformly from one line of config and a single slide can still say otherwise, down to `"0"`; an unparseable value at either tier falls through, never to silence. **`data-narration-beat-pause="0.5"`** is the same breath **between builds**: each bullet lands, holds that many seconds, and only then does the voice reveal the next: honored at play time for live and recorded tracks alike, never baked into a recording, and malformed values read as no pause, exactly like its end-of-slide sibling. **`⟨PAUSE⟩` anywhere in the notes** (#560) is a let-it-sink-in hold at that spot: **two beat pauses** (1s by default), so it follows the slide's `data-narration-beat-pause` and the deck's `narration.beatPause`, and a slide that zeroes the one zeroes the other. It is never spoken, captioned, subtitled or written to PowerPoint notes. It belongs to the words before it (between sentences, attached to one, or on a line of its own) except that one before any words of a ⟨CLICK⟩ beat holds after that build lands, so `A. ⟨PAUSE⟩ ⟨CLICK⟩ B.` holds then reveals and `A. ⟨CLICK⟩ ⟨PAUSE⟩ B.` reveals then holds. Mid-sentence, it cuts the sentence there, and several in a row hold that many times. The live voice holds it between clips. Because it sits *inside* a beat, where recorded playback has no seam to hold at, every recording **bakes it in** as silence: the deck's recorder (WAV and viseme sidecar alike), and the synthesis core, which voices the words on either side as separate clips and joins them (a clip in anything but WAV needs ffmpeg to decode). A narrated video therefore gets it from the audio's measured length, and a silent frame adds it to its hold itself. The marker's position is part of the text a slide's hash is taken over, so adding or moving one makes a recorded slide stale and the export re-voices it. A slide with no marker hashes exactly as it did before markers existed, and a change of pause *length* does not stale a take, just as a changed `sentencePause` does not. The `.txt` script beside a clip keeps its markers, since they are part of what was recorded; lip-sync hands Rhubarb the words alone, and subtitles leave each hold uncaptioned. A beat of nothing but `⟨PAUSE⟩` has no take of its own: live it holds instead of the usual short silent beat, and the recorders give it no file. **`data-narration="hold"`** on a section marks it interactive (quiz, exercise, live demo): narration plays whatever notes it has and builds still sync, but the deck never auto-advances *off* it: the presenter moves on manually and narration resumes on the next slide. The spoken unit is a **sentence**: each ⟨CLICK⟩ segment splits into sentences, every sentence is its own TTS call and cache entry (slide, segment, sentence, voice, style), playback chains them and advances only after the segment's last one, so first audio arrives after one short synthesis, never a whole paragraph. While narration is on, a **lookahead buffer** keeps the next 10 sentences synthesized in the background (a few parallel low-priority workers, window re-derived from the current position, results landing in the same cache); an unreachable bridge toasts once and pauses the buffer until the next event. the panel's `Record this deck…` records per-slide `slide-NN.wav` files **stitched from this same sentence cache** (short silences joining sentences and builds): already-heard clips cost nothing, only unheard sentences synthesize. **They are written next to the deck, not downloaded**: in write mode each stitched slide is POSTed to the server that already owns the deck file (`/deck/edit/narration/record`), which writes it, and the character's `slide-NN.visemes.json` sidecar, into the deck's own `narration.files` folder, or `voiceover/` when the deck names none. That is the only place `narration.files` can point at and the only place `decklight bundle` looks, so the recording is finished where the next command reads it; the browser's download folder is neither, and is now the FALLBACK for the cases nothing may write to disk: a `file://` deck, or one served read-only by `decklight <deck> --no-trust`. The player names the folder and never the file: `/deck/edit/narration/record` builds `slide-NN.wav` itself and refuses a folder that resolves outside the served root, so the write surface a recording opens is one directory of one deck. The card that ends the recording says which of the two happened and, on disk, the exact `narration: { files, ext: 'wav' }` line that plays the set back. **`⎵` pauses/resumes** narration while it plays: audio freezes mid-sentence and resumes exactly there, and auto-advance holds while paused. Captions (`C`) follow the voice **sentence by sentence** during live narration (segment-level when narration is off). With nothing configured, `V` opens the picker instead of failing. **The deck announces its own voice**: when a recorded track is configured, a small pill fades in bottom-center about a second after load: *🔊 this deck has a voice-over — `V` plays it*, and clicking it starts narration (the click is itself the user gesture, so the audio is never the blocked-autoplay case). It fades out on its own after ~12s and is written to the message log (`I`) rather than toasted, since the pill is already on screen saying it. It never appears in `?print`, in embedded previews (the theme picker and slide finder boot real decks in iframes), in a render (`?capture`, below), on a load the URL sent past the first build of the first slide (a link into the middle of a talk is somebody presenting, not a first view, the rule the welcome card keeps), under `?voiceover` (which starts on the first gesture anyway), while captions (`C`) hold that same corner, or once narration has been started on this deck, remembered per deck path like every other narration preference. Without it the only proactive surface was the touch sound button, which CSS shows on `pointer: coarse` alone, so a viewer on a laptop could only learn the deck talks from a key nobody had mentioned. Files are generated by **`decklight narrate <deck.html>`** (the dispatcher spawns `tools/voiceover.mjs`, which arg-parses at load and so cannot be imported, the same way `video --voiceover` runs it), the headless counterpart of the panel's `Record this deck…`: the notes, voiced as written, by `--engine piper` (local neural TTS; `--voice` = piper model name), `chirp`, `gemini` or `elevenlabs`. **One synthesis core produces every machine-voiced track** (`tools/narration-synth.mjs`, #555): `voiceover` is its command line, and the export that voices a range before rendering goes through it too, so a track made by one can be refreshed by another. It owns sentence synthesis through the shared clip cache, the ⟨CLICK⟩ beat files, stitching a slide from its beats, encoding, and the skip-by-hash that makes a rerun free; `tools/narration-manifest.mjs` (what a slide's text and hash are) and `tools/tts-cache.mjs` (has anyone paid for these words) stay the identity layer beside it. **A track keeps its format**: `wav`, `m4a` or `mp3`, read off its files: a track the deck's recorder made is wav, and refreshing one of its slides writes wav, where `voiceover` used to write m4a beside it, re-voiced in piper; a fresh track is m4a unless `--format` says otherwise, and wav is written directly, with no encoder. **A folder that already holds a track is refreshed AS that track**: its engine, voice, style and (for ElevenLabs and Gemini) model are the defaults, a flag overrides each, and a header field the core does not own (the recorder's `recorder: 'deck'`) is carried. A slide whose hash still matches and whose file (in the track's format) is on disk is kept, whoever made it. A **`--slides` run in another voice is refused** (a header names one voice, and the slides outside the range would read as stale against it), with the way out: voice the whole track, or give the other voice its own folder. The microphone recorder is untouched: a human voice is the browser's. The built-in speech-synthesis voices were removed: not good enough. `?voiceover` starts narration on the first user gesture. `instance.toggleNarration()` programmatically.
|
|
647
|
-
- **
|
|
648
|
-
- **Character** (`V` → Character…, or palette → Character…): an animated narrator in a stage corner whose lips sync to the narration, fully offline, no cloud service. Two render modes behind one overlay (`.decklight-character`, persisted per deck): **🎭 2D character**: a layered SVG bust (theme-aware clothing/backdrop, blink, idle sway) with one mouth group per Rhubarb shape (`A–H` + `X` rest); a 30 Hz loop maps `narrAudio.currentTime` onto a **viseme timeline** and shows the matching `[data-mouth]` group, so pause (`⎵`) and voice speed (`<`/`>`) sync for free. **🎥 Neural video**: a muted picture-in-picture `<video>` talking head (audio always comes from the narration element; muted video is immune to autoplay policy) generated by Wav2Lip or SadTalker on the presenter's own GPU, kept on what is **heard**, not on the audio element's clock: its target is `audio.currentTime` minus the output delay the browser reports (`AudioContext.outputLatency` + `baseLatency`, tens of ms through speakers, far more through Bluetooth) minus `narration.character.lipOffsetMs` (a hand adjustment, positive = lips later); within 250 ms the video's rate is nudged ±8% until it is within 15 ms, and only a bigger gap seeks (`lipCorrection`), so the mouth never stutters on a seek per tick. Measured on a real clip: the old ±150 ms seek-only rule held the lips a steady ~35 ms ahead of the element clock (worse by the output delay) and let them drift to 212 ms; now a median of 13 ms. The debug log (`D`) names the output delay it used. It mirrors the voice's play/pause/rate. Timelines and clips come from the **lipsync bridge** (`decklight lipsync`; the deck asks its own origin for `/lipsync/*`, which `open` proxies to the bridge it started, and falls back to `http://127.0.0.1:8789` when opened from disk; override via `narration.character.bridgeUrl`; CORS-open, 127.0.0.1-only, disk-cached in `~/.cache/decklight/lipsync` keyed by audio+params hash): `GET /ping` reports which engines actually resolve (the picker greys out the rest), `POST /viseme?text=` (raw WAV body → timeline JSON v1: `{v, duration, cues: [{t, v}]}`, start-time cues, each shape holds until the next), `POST /video?engine=&portrait=` (raw WAV → muted faststart MP4; strictly serial GPU queue), `GET /portrait?name=` (the still the clips are made from). **Set up once, remembered**: `decklight setup face --wav2lip-dir <checkout> --wav2lip-ckpt <wav2lip_gan.pth> --python <its venv python> --portrait me=<photo>` (the bridge's own `--save`, which it still takes) writes `~/.config/decklight/lipsync.json` (`$XDG_CONFIG_HOME` honored) and exits; the bridge reads it under any flag it is not given, `open` starts the bridge for a saved talking head with no flags (rhubarb or not), and `doctor` reports it: one check (`videoSetup`, tools/lipsync-config.mjs) says what stands in the way for all three and the deck's character row, in the same words. **How a clip is made from a photo** (Wav2Lip): a portrait larger than 1024 px is scaled down (S3FD misses the face in a full-size phone photo); its face is found ONCE with Wav2Lip's own detector and cached, then passed as `--box` so no clip detects again; the still is cropped square around the head so the face fills the round overlay (and renders faster); and because Wav2Lip redraws the whole face box at 96 px, only a feathered ellipse over the mouth and chin is taken from its output: everything else stays the sharp photograph (limited-range `yuv420p`). **A portrait can be filmed** (`--portrait me=clip.mp4`, `.mov` `.m4v` `.webm` `.mkv`, 5–10 s facing the camera, mouth relaxed, not talking; its sound is ignored): made ONCE per film and cached by content (`prepareClip`): its first 10 s at 25 fps, scaled like a photo, its face found in one frame a second, cropped square around the head, and played **forward then back** so the loop Wav2Lip makes of it for a long sentence never snaps the head back to the start (Wav2Lip loops its `--face` frames from the first, so a plain film jumps). If the head held still (a face in every sampled frame, its centre wandering less than a tenth of the face width (`steadyBox`)), the union of those boxes goes to Wav2Lip as `--box` and only the mouth is laid over the film, frame for frame (Wav2Lip's frame i is the loop's frame i); a head that moves is left to Wav2Lip's own per-frame detection, the whole face redrawn and softer, and the bridge says so. The film's first frame is the still under the video. Veo is not asked to animate a film, and SadTalker gets that first frame. The bridge prepares every portrait when it starts, not on the talk's first sentence. **Or filmed in the deck**: V → Character → *📹 Film yourself* opens the camera in the medallion's own circle (mirrored, as a face expects; the film is not), with what to do (face the camera, mouth relaxed, don't talk, head still), then a 3-2-1 and `narration.character.filmSeconds` (default 8) of recording, a review of the take (⏎ use it, R retake, Esc cancel), and `POST /portrait?name=filmed` (the MediaRecorder's own mp4 or webm) to the lip-sync bridge. The bridge prepares it like any film, keeps it beside `lipsync.json` (`portraits/filmed.mp4`, a retake replacing it), remembers it there, with the bridge's own Wav2Lip setup where none was saved, and offers it at once, no restart; the deck switches the character to it. A film with no face is refused in a sentence and the card offers a retake; a camera refused or absent is said as what to do. The row shows whenever the bridge can take a film (`/ping` `film`, or `filmWhy`), and a bridge with Wav2Lip and no portrait yet still starts, so filming is how the first portrait gets made (the video row then points at it). **A recorded track needs no pre-rendered clips**: in video mode the deck plays `slide-NN.mp4` beside the track when it exists (`decklight lipsync` renders them as a batch); when the server says it does not, a track you just recorded, and the bridge makes video, the head gets a clip made from the very audio file that plays (`POST /video` with that file; one per beat on a beat-paced track, keyed by the file, cached by content on the bridge), synced to it exactly as a live sentence is, with the rest of the slide and the next one warmed ahead in playing order. Until a clip lands the photo shows, never the previous beat's mouth. A request that cannot be made at all (a deck on file://) trusts the sidecar, as before; the check is a GET with the body dropped, since `open` answers HEAD 405. **The medallion is never black**: in video mode the character shows that same still (`/portrait`) under the video, and the video fades in only while a clip is playing (`playing` → shown, `ended`/`emptied` → the photo again): a clip that is still rendering when its sentence is spoken leaves the photo, not an empty circle. In **live voice** mode the sentence is the unit here too: the lookahead buffer that keeps 10 sentences of audio warm hands each synthesized sentence's WAV to the bridge, so lip-sync data prefetches through the same window, workers, and promise-cache dedup as the voice. And playback NEVER waits on lip-sync (a late timeline lands mid-sentence; until then the **fallback** animates: `amplitude` (default) drives a coarse 4-shape mouth from a WebAudio analyser, `hide` shows the idle face). In **recorded** mode the overlay loads per-slide sidecars from the track's dir: `slide-NN.visemes.json` / `slide-NN.mp4`, generated by `decklight narrate <deck> --face [--video]` (`tools/lipsync.mjs`: rhubarb + optional SadTalker/Wav2Lip batch, hash-incremental like voiceover.mjs), preferring an inline `<script type="application/json" data-decklight-visemes="slide-NN">` block when present (`decklight bundle` inlines viseme JSONs; fetch is blocked on `file://`). the panel's `Record this deck…` exports `slide-NN.visemes.json` alongside each stitched WAV (same sentence cache, same silence gaps) so a recorded set is character-ready with zero extra synthesis. **Solo** (`N` → Character… → Solo, or palette → "Character solo"): the narrator takes the stage: the slide content, progress bar and slide number step aside (`visibility: hidden` on `.decklight-stage`, which the overlay is a sibling of) and the character centers, sized to the stage (`--character-solo-size`, default `min(74vh, 74vw)`). A talking-head slide with nothing else on it, without authoring one. Works with either render mode, persists per deck alongside `mode`, and is a *presentation* state, not a layout: the root's `decklight-solo` class is only ever set while the character is actually on screen, so turning the character off, or stopping the narration, can never leave a blank stage behind. Turning solo ON shows the character immediately (idling, blinking) rather than waiting for `V`. **Motion** (`decklight lipsync --veo`, SPEC PRESENTING): Wav2Lip repaints the lip region and leaves the rest of its source untouched: from a still photo that is a frozen stare with a moving mouth. With `--veo` the bridge animates each portrait ONCE through Veo image-to-video on Vertex AI (`veo-3.1-lite-generate-001` by default; 4/6/8s; `generateAudio: false`, the deck owns the voice, and it is the cheaper rate) and gives Wav2Lip that clip as its `--face`, so the head turns and blinks under the new mouth. The unit is the PORTRAIT, not the sentence: the player asks for video once per sentence through a 10-sentence lookahead, so a Veo call per sentence would be both unusably slow (~40s) and a runaway bill. Instead each portrait's motion clip is bought on first use, deduped in flight, and cached on disk (keyed by portrait+model+seconds+prompt), so a deck of any length costs exactly one call per portrait, ever. Delete the cache entry to re-roll the performance. The clip is cropped square around the head (the overlay is a circle) and scaled to 640px (s3fd misses faces in a large frame). SadTalker is excluded: it generates its own head motion and wants a still. A refusal by Veo's person-generation filter surfaces as an error naming the cause, never an empty clip; a misconfigured `--veo` disables only itself and leaves visemes and still-portrait video working. It is the only part of the bridge that leaves the machine, so it is opt-in, and write mode passes it straight through. Config (`narration.character`, all optional): `mode: 'off'|'viseme'|'video'` (picker overrides, persisted), `solo: boolean` (default false; picker overrides, persisted), `bridgeUrl`, `position: 'br'|'bl'|'tr'|'tl'`, `size` (design px, default 220), `svg` (custom art: inline markup, `'#id'` ref, or URL, contract: `[data-mouth="A"…"X"]` groups; optional `[data-eyelid]`/`[data-idle]` get the blink/sway), `sprites: {A: url, …}` (image frames instead), `engine`/`portrait` (video mode; Wav2Lip suits live: static pose, seamless per-sentence cuts; SadTalker suits batch clips), `fallback: 'amplitude'|'hide'`. Bundles: viseme JSONs inline (1–4 KB/slide); per-slide MP4s stay external with a CLI notice: video cannot inline sanely.
|
|
1456
|
+
- **Narration**: `⎵` plays and pauses the voice; `V` opens the panel (persisted per deck), which asks **two questions and nothing else first: who speaks, and who is on screen** (#919, then the one-panel redesign). A voice is yours or an AI's; whether it is saved with the deck or generated as you present is not a choice made up front but a line under its name, with the button that takes it from one to the other. A line under the title says it in words (`speaking now: Chris · AI voice · saved with the deck`). Under **who speaks**, `Nobody` comes first, then **your own voice** (a row that is there before the voice exists: `My voice`, *not recorded yet*, with a **Record…** button, so recording has no door to find first), then every **AI voice saved with the deck** (and a hosted one), then the **AI voice that is not saved** (the live voice: *needs a connection while you present*, with **Change…** to pick another from the roster and **Save with the deck** where it can be done). There are no Recorded and Live sections and no *Add a voice*: the row's own line says which it is. Each voice row shows the voice's name (a label that is only its folder names the voice its manifest records; the engine a label carries is said on the line below instead), a tag (`your voice` or `AI voice`), and a line saying what made it, that it is saved, and whether it still matches the notes (`ElevenLabs · saved with the deck · 109 of 113 slides out of date`, `113 slides, up to date` for your own; a hosted track's signature). Folder paths are on the card, not the row. A voice row has three targets: the row selects the voice (a click, or `⏎`); a named button acts on it (**Re-record** for your own voice out of date, **Regenerate** for an AI one, **Record…** before your voice exists; the unsaved AI voice's **Change…** and **Save with the deck**); and the `›` at its right opens the voice's **card** (a click, or `→`; `←` and `Esc` come back). A card is one layout for every voice: its name and both tags, a short list of facts (made with, saved in, how many slides, what is out of date and why), then its actions. A track's card offers its fix first when it has one, then recording or regenerating other slides, *Listen from slide N* and *Use this voice*; the unsaved AI voice's card offers a change of voice and tone and *Save with the deck…* (the synthesized recorder, blocked with its reason where there is no voice service to generate with). Opening a card never changes which voice plays. Under **who is on screen**, one list of four, drawn as the voices are: `Nobody` (slides only); **My camera** (you, as filmed while you read, `FACE_LAYOUT`: it belongs to your own voice, and the row says so, or that no slide was filmed yet, where it cannot be chosen); **A cartoon character** (the drawn narrator); and **A talking head of me** (rendered from a portrait, with **Make my portrait…** on the row). Once somebody is on screen, **Where…** is the one control for where (below). Then **▶ Preview slide N** plays the two answers together on the slide in front of you, from its first beat, and stops at the end of that slide (blocked, with its reason, while nobody speaks), and, where a server can render one, **Export video…** opens the export card (`PRESENTING_OUTPUT`), which carries these two answers. Below them, **options**: *Captions* (a switch) and, while captions are on, *Caption size* (small, medium, large or extra large, remembered per deck), *Speed* (a `−` value `+` stepper that `←` and `→` turn) and *Writing tools…*. The two recorders open on the same frame: the voice's tags and three steps, *plan*, then *record* (your voice) or *generate* (an AI voice), then *review*. The words follow the cost: your own voice is **recorded** and **re-recorded** at a microphone; an AI voice's recording is **generated** and **regenerated** by an engine paid per character; "record" is never said of an engine. The palette's *Record this deck…* opens your own voice's card, or the panel on the `My voice` row when there is none; *AI voice…* opens the roster, and *On screen…* the panel on the second question's answer. **The voice ends with the talk**: narration that runs past the last slide turns itself off and says so (`🔚 end of the talk — narration off`), instead of staying "on" in silence; and `⎵` where the live voice has nothing left to say (the last build of the last slide, its notes all spoken on earlier builds) says that (`nothing left to say — this is the end of the talk · ← goes back, Home starts over`) rather than switching the voice on into silence. **Narration is OFF until somebody picks**, however much audio the deck ships: a deck is opened to be read far more often than to be played, and defaulting to the first track made "chosen" indistinguishable from "shipped", the distinction every other decision here needs. `⎵` belongs to the voice only once a track is CHOSEN (in the panel, or restored from a previous visit, both deliberate) or the voice is already running or parked; a deck that merely carries a track keeps `⎵` for advancing, so a presenter talking over their own slides cannot start the narration by pressing it. The panel's first voice is `🔇 Silent`, current when nothing is chosen, and picking it stops the voice and hands `⎵` back. The choice is written as `off` rather than left implied, so a later change to what "no choice" means cannot start a deck talking that somebody switched off. Two entry points are themselves the choosing and select a track rather than refusing: `?voiceover`, where the url is the request, and the touch sound button, where a speaker icon has one meaning and the phone tapping it has no `V` key to be redirected to; neither persists, being a request for this visit rather than every future one. Two sources. **Recorded**: pre-rendered per-slide audio (`<dir>/slide-NN.m4a`, 1-based like `state.slide`), synced to slide changes; the deck configures **one track** as `narration: { files: '<dir>', ext, segments }` (`ext` defaults to `m4a`; this is the line `voiceover`, `record` and the deck's recorder all print) or **several** as `files: [{ label, dir, ext, segments }, …]`, the same fields once per track; the runtime and the edit server normalise the first to a one-item list of the second. **A recorded track can pace the builds, not just the slides.** `tools/voiceover.mjs` already writes one file per `⟨CLICK⟩` segment (`<dir>/slide-NN-KK.m4a`, KK 1-based over the segments that produced audio: empty segments produce none, so the file number is not the step number) and lists them as `slides[i].segments`; a track carrying them reveals build step k when segment k ends, which is the build-synced pacing the live voice has, from a recording. On a **directory** track it is opt-in: `narration: { files: '<dir>', segments: true }`, off again with `segments: false`, because the runtime cannot see the folder and must not guess. A **manifest** track needs no flag, the manifest being the list of what exists; except on a *signed* one, where a segment counts only if it carries a `url` of its own. `publish-voices.mjs` writes those urls (every beat is uploaded and signed alongside its slide) and the rule stands anyway, because a manifest published before it did lists beats whose bytes never left the author's disk, and a signature is the only thing that tells the two apart. Whether a track paces itself is settled **once**, when narration starts, from what the track declares, never by probing for a file, which neither `file://` nor a CORS-less bucket can answer. A slide recorded whole inside such a track still plays as one file and then advances; a surplus `⟨CLICK⟩` beyond the slide's builds is chained onto the last step exactly as the live voice chains it. A missing FIRST segment falls back to the whole-slide file; one missing mid-slide has nothing to fall back to, so the deck stops and names it. The voice is the clock. The character keeps up: `tools/lipsync.mjs` cuts a sidecar per beat too (`slide-NN-KK.visemes.json`, from that beat's own `slide-NN-KK.txt` as the dialog hint), the synthesized recorder writes them beside its beat WAVs, and `decklight bundle` inlines them under the same stem. A beat with no sidecar animates from amplitude rather than replaying the slide's timeline, which would start at zero against every beat and be confidently wrong. The talking-head *video* stays per slide: a clip is minutes of GPU time and the element mirrors the audio's transport rather than seeking a timeline, so cutting it per beat would cost a great deal to fix a smaller error. **Both recorders write those beats.** the panel's *Save with the deck* stitches them from the live voice's own sentence cache alongside the whole-slide file it always wrote (so a synthesized track gains build-pacing for free, with no second pass) and writes the folder's `manifest.json` after every slide (engine, model, voice, style, one entry per slide with the hash of the notes it was voiced from and its beat files, the shape `decklight narrate` writes, hashed by the same `tools/narration-manifest.mjs` from the deck file's notes, so an aborted take is a valid partial, `decklight video` and the export dialog take the folder as a track, and re-recording the same engine and voice refreshes that folder instead of minting `voices/<voice>-2`, #535). **Its done card says what the take cost** (#565): `N clips · R reused · S sent to <engine> · ~$X`, counted for THAT run and not the session: a clip already in the window (played, or warmed by the lookahead) and one the bridge replayed from its own disk cache (`x-tts-cached: 1`) are both *reused*, so `reused + sent` is every clip the take voiced, and the spend is what the bridge priced the sent ones at, `$0` on a free or offline engine rather than blank. Re-recording an edited slide into an existing track is the case it answers: nearly everything reused, and a bill only for what changed. The your-voice recorder voices nothing, so it shows no such line, and **the panel records them in your own voice** (`My voice` → **Record…**, or your voice's card), for which `decklight narrate --mic <deck.html>` is the door: a browser will not open a microphone for a `file://` page (getUserMedia needs a secure context, and `http://127.0.0.1` is one), so the command serves the deck and opens it at `?record`. Your-voice recorder on a `file://` deck says exactly that instead of failing silently. The deck is the teleprompter: it shows one ⟨CLICK⟩ beat at a time at the build that beat plays over, and `→` ends the take *and* reveals the next build, one gesture, so the timing you record is the timing you will present. With `--remote` the phone's next and retake do the same (Phone remote, above), for a take with no keyboard in it. **A take is a slide, or a beat**: the plan card's **take** choice (under **How**), and `narrate --mic --takes slide|beat` (`?takes=`), both for one visit only: **every visit opens per slide**, since per beat is the mode you drop into to fix something, and a choice remembered from last week would count every beat in one by one when you came back to read straight through (a `takes` an older recorder stored is ignored, and dropped at the next click). **Per slide**, the default, a slide is read straight through: `→` reveals the next build and cuts the beat file there while the recording runs on, so nothing said across the key is lost and nothing stops between beats; the card shows the rest of the slide's beats under the one on screen, `⌫` retakes the whole slide from its first beat, and `←` goes to the slide before. **The recording card** keeps the words you read as the largest thing on it; around them, in order: a strip with the red REC dot and the take's running clock (the count-in in their place before a take), `slide N · beat k of M`, and the level meter, so a muted microphone shows as a flat bar beside the words rather than under them; a bar across the slides of this take; the beats already read, ticked off and dimmed above the one on screen with the moment `→` cut them (`[click] · you pressed → at 0:09`, per slide); the beats still to come under it with the `[click]` divider where `→` will cut; and a legend of the keys whose wording does not change mid-take, swapped for the count-in's own (`←`, `Esc`, and that the key pressed is not in the take) while it counts. **Per beat**, each beat is its own take, counted in and retaken on its own. The files are the same either way. **Every take is counted in**: 3, 2, 1 on the card before each take, so per slide before a slide's first beat only (after Enter, `→`, `⌫` or `←`), and nothing is captured while it counts, so the keystroke is not in the take. The length is the plan card's **count-in** (under **How**; 3 s, the default, 1 s, or off, remembered with the microphone's choices), and `narrate --mic --countdown N` (`?countdown=N`, 0 to 9) sets it for one visit until the card is clicked; off starts the take on the key, as before the count-in existed; a red REC dot replaces the count once it runs. `→` and `⌫` wait for the take to start. **`←` goes back**: per beat, mid-slide to the slide's first beat (its takes are only written when the slide is done, so they are dropped), and on a first beat to the slide before, which is recorded again over its own files; the done card counts a slide recorded twice once. **The plan card**, the recorder's first, asks what to record, how, and where, in that order, and checks the microphone before Start. **What to record** is a row of scopes — **Whole deck**, **Only missing or changed · N** (offered when the folder already holds a take of yours with something missing or out of step), **This slide**, and **Slides…**, which opens the range picker — over a list of every slide with its title, its beat count and what the folder holds for it: recorded, not recorded, the notes or the [click] split moved since it was recorded (the server's drift, below), builds with no [click] in the notes to pace them (said here, before the take, rather than slide by slide during it), out of step (below), or no notes · skipped; a click on a slide starts the take there, and a line under the list estimates the reading (`N slides · N beats · about N min`). **Out of step** (#929), above the list, names every slide the take would record whose notes have a [click] and whose [click] markers do not match its build clicks, counted from the live deck so a provider's steps count (`slide 43: 2 [click] markers, 3 build clicks`, with the likely cause when it is one of the two that occur: an empty build group, or a [click] with nothing before it). A slide with no [click] makes no claim and is never listed; a [click] on a slide with no builds is. Each has three ways on: **Fix the notes** (write mode: the recorder closes, the notes card opens on that slide, and the recorder comes back on the same scope and choices when the card closes, across the reload a save causes), **Skip it** (the rest is recorded, and the slide's row says skipped), or **Record anyway** (the row says `recording anyway · 2 [click], 3 builds`, the take's header says `out of step: …` on that slide, and the done card's row says `recorded anyway`). A choice can be changed, and Start (and Enter) waits until every one is made. **How** holds the take, count-in, noise-suppression and sample-rate choices behind one summary line (`One take per slide · 3 s count-in · noise suppression on · 24 kHz`), each with its reason once opened. **Where** is the folder, as a sentence with the field in it and what a take of yours already there means (the slides recorded again replaced, the rest kept). **Microphone** shows the level live from the moment the card opens, with the input picked from the inputs the browser lists (remembered with the microphone's other choices and asked for, never demanded, so an unplugged one falls back), so a muted microphone is found before the first slide rather than after it; a microphone that will not open says why on that row, and Start says it again. The microphone's two choices are remembered for every deck rather than per deck since they are about the microphone and the room: **noise suppression** on (the default) or off, and **24 kHz** (the default, like every engine) or **48 kHz**, about 5.8 MB a minute instead of 2.8 with nothing above 12 kHz thrown away. Echo cancellation and auto gain stay on either way. A bundle that re-encodes audio still resamples to 24 kHz; `original` keeps the take as recorded. `⌫` retakes the beat just read (per slide, the slide), `Esc` stops (every slide already finished is already written). **`E` edits the words** where they fail aloud, a sentence that does not read or a missing "and": during a take or its count-in, it drops the take and puts the beat on screen into a box (markers as the author writes them, `[pause]`), and `Enter` writes them to the deck's notes through the notes card's own route (`⇧Enter` a new line, `Esc` back unchanged), so the file, every open view and the manifest's hash have the new words, then the beat is recorded again, counted in; per slide, the beats before it are kept. Words only: a `[click]` typed into the box would move a build the takes cannot follow, and an emptied beat is no beat, so both are refused on the card with the reason. Offered only with the server behind the deck, which writes the notes. Capture is WebAudio → 16-bit PCM → `stitchWav`, at 24 kHz mono like every engine's output: not MediaRecorder, whose webm/opus nothing else here reads, and not an AudioWorklet, whose module would have to come from a `blob:` URL that the no-trust mode's `script-src 'self' 'unsafe-inline'` forbids. Each slide is written twice by EITHER recorder: one `slide-NN-KK.wav` per beat, and the whole-slide `slide-NN.wav`, so `lipsync.mjs`, `video.mjs` and a deck that never opts in all keep working: the layout on disk says nothing about which recorder made it. A beat file carries neither the segment-sized silence that separates beats (it belongs between them, not at the head of one) nor the slide's trailing `data-narration-pause`, and neither does the **whole-slide file**, nor the viseme timeline beside it: `advanceFrom` honours every pause at play time for recorded and live tracks alike, so baking one into a file as well would hold twice (which the whole-slide file quietly did until the pause gained a non-zero default and the double showed). A slide the tool would not have segmented (fewer than two beats with words in them) is one take and no segment files, the same threshold `tools/voiceover.mjs` gives up at; a slide with builds but no ⟨CLICK⟩ is recorded whole and says so on the card, because that is an authoring gap and the moment you are reading its notes aloud is the moment to learn about it. Files are written through the edit server (`POST /deck/edit/narration/record`, which is told a folder and a beat number and builds the name itself), and fall back to the browser's download folder when there is none, **saying which of the three reasons** applies, because where the files went is not something a presenter can act on and why they went there is. Whether a server exists is **awaited, never sampled**: the probe answers asynchronously and a recorder that read it early sent whole takes to the download folder because the answer had not arrived yet, not because there was no server. A deck opened with `?record` that finds no server is the loud case: that parameter means one was started, so something else is holding the port for another deck, and it says so on the plan card, before the first beat rather than after the last. **A TRACK IS A FOLDER**, and the recorders name it after the voice: a deck carries as many tracks as you have voices (several cloned ones, the system voice, two takes of your own) and `N` is the switcher, so a single `voiceover` default meant recording a second voice erased the first with nothing said. The folder is chosen by four rules in order: `--dir`/`?dir=` (asked for out loud); a folder whose `manifest.json` names this same engine and voice (a re-record **refreshes** its take rather than accumulating `-2`, `-3`); the deck's own single configured folder (a deck that names one place has decided); else `voices/<voice>`, suffixed past anything already there. **Your own voice is `voices/me`**: after `--dir`, no other rule applies, and recording again refreshes that folder rather than proposing `voices/me-2`. The deck's configured folder is not used for it, because that folder is usually an engine's track, and a take of yours written into it replaced the engine's files. `GET /deck/edit/narration/tracks` is how the deck finds out what exists (it cannot see the filesystem, which is why `segments: true` is opt-in at all) and the proposal is shown on the card as an **editable field** before recording starts, because a proposal that cannot be corrected is a decision made somewhere else. The done card then **offers to point the deck at what it just wrote**: `POST /deck/edit/narration` **adds** the track to `narration.files` (updating in place when that folder is already listed, never duplicating a row) through the same `applyEdit` door every other edit uses; the one-string form becomes a one-element list carrying the same `ext`/`segments`, which is the shape `narrationTracks()` normalises it to anyway, so the undo chord takes it back and live-reload shows it. A button rather than automatic: editing someone's deck the moment a recording ends is the wrong default even with undo behind it, and the offer is absent exactly where it could not work (no edit server → the card prints the line, as before). **The done card is a review, not a receipt**: under `N slides · N files · 9 min 12 s · saved next to the deck in voices/me/` (and, stopped early, how many slides were not reached and are left as they were), one row per slide recorded this run with its title, its length, what happened to it (recorded again with the last take kept, or builds with no [click] to pace them), a `▶` that plays the whole-slide file the server just wrote back, and a `redo` that reopens the plan card on that slide; then the offer, **Use my voice in this deck**, in its own box with what it does (one edit to the deck file, which the undo chord takes back); then **Record again from a slide…**, which reopens the plan card; and the config line for a deck edited by hand behind a disclosure (`Editing the deck by hand instead? The line to add`), rather than in the way. The call site is located by the same classifier `audit` and `upgrade` use, and its argument walked with strings skipped, because `{ title: 'Acme (Inc)' }` is a deck that did nothing wrong. A deck that builds its config elsewhere (`const cfg = {…}; Decklight.init(cfg)`) has no literal to edit: that is **refused with the reason**, never guessed at. `decklight narrate --mic --slides a-b` re-records a range and leaves every other slide's files alone: recording starts at slide 1 and cannot skip, so without it a fluffed beat on slide 30 costs 29 slides of reading. **Part of a slide** is the finer grain: `--slides N --beats k-l` (refused unless `--slides` names one slide; a beat the slide does not have is refused on the card with the slide's count, and nothing starts) re-records only those beats, and the plan card (a click on a slide, or its **start at** row: `‹ ›`, or `←` `→` before Enter) starts the take at any beat of any slide in the range, and the row's **to beat** stepper (`‹ ›`, or `⇧←` `⇧→`) ends it at any later beat of that slide: the beats after it are kept, the take stops there, and the chosen beats' opening words are listed under the row so the pick can be checked against the notes; left at the slide's last beat, the take runs on into the slides after it, as a start point alone does. Entering a slide past its first beat, or by `--beats`, records it in part: its beat files are read back first, every one of them since the whole-slide file is rebuilt from all of them (a beat with no file, or beats at two rates, is refused and the card says to record the slide from beat 1), the microphone opens at their rate whatever the card chose, and each new beat is written as it is taken with `slide-NN.wav` rebuilt around it (per slide, the beats of the take are written together when it ends, since a write mid-take would stall the capture). So the beats not redone are never written, and Esc partway leaves the slide consistent. Per beat, `←` inside it goes back to the first beat redone, and `--beats` stops after its last beat. **Your own voice keeps its script** (#850): after each slide the recorder posts the folder's manifest with `mine: true`, which needs no engine; the server writes `recorder: 'mic'`, the notes hash `decklight video` checks, and each slide's `beats` as they read when it was taken (`slideBeats`). A folder recorded before this is seeded from the files already in it (`folderNarration`), so writing slide 6's entry never hides slides 1 to 5 from a render. `scriptDrift` compares a slide's recorded beats with its notes now: in step, **the words changed**, or **only the [click] split moved** (`was`/`now` beat counts), which matters for a take and not for an engine. A recorded beat is cut where you pressed `→`, so moving the marker cannot move the build, and the only fix is to read those beats again. The tracks route reports each track's `drift`. The V panel says it once, on the line under the track's name (`slide 6 out of date`, `ElevenLabs · 3 of 40 slides out of date`), beside the row's named fix (**Re-record**, **Regenerate**), and the track's card opens on the fix, naming every slide that drifted and why. The two fixes have two names everywhere, the panel, `narrate --check` and `video`'s refusal alike: your own voice is **re-recorded** (the card opens the mic recorder on that folder, scoped to those slides), a synthesized track is **regenerated** (the command line still says *re-voiced*; after one confirmation inside the card that names the characters it costs, and as the engine, voice and style its manifest records, whatever the live voice is set to). The panel offers each fix as an action and never as a command to paste. `decklight narrate <deck> --check [--dir NAME]` says the same for every track beside the deck and exits 1 when anything is out of step. **Recordings follow their slides** (#916): a track is matched to the deck by position (manifest entry n is slide n, its files `slide-NN…`), so every slide op in write mode (new, duplicate, delete, up, down, move, and the template insert) renumbers each of the deck's voice folders in the same step: files renamed in two phases so no rename lands on a file that has not moved yet, manifest entries shifted with their `file` and `segments` names, a new or duplicated slide given `null` (the copy has no take of its own), and a deleted slide's files moved to the folder's `.trash/`, never deleted. The undo entry holds the renumbering itself, not a copy of the folder, so `Z` and `⇧Z` move the folders with the deck as they are at that moment: a take recorded since moves along with its manifest entry, and one recorded on an inserted slide goes to `.trash/` and comes back with `⇧Z`. A rename that would land on a file outside the plan refuses the op and says which file, and nothing changes. The voice folders are the ones the deck's `narration.files` names, plus every folder two levels down holding a manifest or a slide file when the deck is the only one in its directory. An agent's edit that adds, removes or moves slides does the same as it lands (#920): where each slide went is read off the sections before and after, not the audio, so a stale take moves with its slide too; the folders' moves ride in the edit's own undo entry, the agent's report says them (`voices/me: 25 recordings moved with the new slide 32`), and a folder that cannot follow is left as it was and said. So does an edit made to the file from outside the server while it runs (#954), a terminal agent's or an editor's: it is read against the last deck the server read or wrote, never git HEAD, when the file watch sees it or when an outside agent commits through `POST /deck/edit/commit`, whichever comes first; the moves are their own undo entry, so `Z` puts the files back with the deck, the reload's reason says them, and an outside edit that moves no slide renumbers nothing and records nothing. A reorder made while no server ran (an editor, a checkout) is caught by a **realign**: each manifest entry is placed on the slide whose words it was recorded from (its `beats`, else its `hash`); an entry whose words really changed follows its neighbours and stays flagged, and where its neighbours moved differently (a slide put in or taken out beside it) it is read loosely by its saved script (`slide-NN.txt`, else its beats) against the notes now, and one that still cannot be placed is named (`slides 32–56 could not be placed (their notes changed): check them`), never left silently on a wrong slide; the take of a slide deleted elsewhere is set aside in `.trash/`, and the V panel offers it (`↔ 26 recordings look shifted by one from slide 30, move them?`, undone by `Z`); `--check` says the same, and `decklight narrate <deck> --realign [--dir NAME]` does it. A slide with no recorded script, and a folder with no manifest at all, is unknown and never flagged. A `dir` may be an absolute URL, so a **public** bucket has always served a track with no extra machinery (`dir: 'https://storage.googleapis.com/…/algenib'`: media elements load cross-origin without asking). **Manifest tracks** exist for the case a `dir` cannot express: `[{ label, manifest: 'voices/algenib/manifest.signed.json' }, …]` fetches a small JSON list once when narration starts and plays each slide's URL **verbatim**, because a presigned URL carries its signature in the query string and a query string can never be a directory prefix. The manifest is the file `tools/voiceover.mjs` already writes (`{engine, voice, style, slides: [{file, hash}]}`), extended with an optional per-slide `url` and a top-level `expires` (ISO 8601); a slide with no `url` resolves its `file` next to the manifest, so an unsigned `manifest.json` in a public bucket is a track for free, and a `null` slide (no notes, no file) is silence rather than a failure. `tools/publish-voices.mjs <dir> --bucket gs://… [--sign 7d]` uploads the files whose hash moved (the last `manifest.signed.json` is the record of what is already up there; `--all` overrides), signs every one through `gcloud storage sign-url`, never our own key handling, and writes `manifest.signed.json` to deploy beside the deck while the megabytes stay in the bucket. It refuses a `--sign` longer than **7 days**, the V4 signing scheme's own ceiling, and names the public-bucket alternative for audio that must outlive a week. Signatures expiring is one more way for the voice to be unplayable, so it behaves like all the others: the expiry is checked before the first clip, narration turns off, auto-advance stops, and the message names the track, the date, and the literal re-sign command (the manifest records the `source`, `bucket` and `signDuration` it was made with, so it is a line to re-run and not a shape to fill in). A signed file that fails to load is treated the same way: a media element cannot report an HTTP status, so a 403 for a lapsed signature is indistinguishable from any other failure, and naming the only cause worth naming beats staying silent. `N` shows a manifest track with a ☁ and the time left. `decklight bundle` **inlines the manifest** under its own path (`data-decklight-voices`), like the viseme sidecars, because `fetch` is dead on `file://`; the audio stays in the bucket, which is the whole point. One honest caveat: the character overlay's fallbacks read the audio through WebAudio (the loudness mouth) and `fetch` (the mouth read from the voice), and cross-origin media taints the one and refuses the other unless the bucket sends CORS headers; the mouth then rests. Viseme sidecars are same-origin JSON and are unaffected. **Live voice**: the player synthesizes each slide's notes on the fly through the local bridge (`decklight tts`; the deck asks its own origin for `/tts`, which `open` proxies to the bridge it started, a deck never spells a port, and falls back to `http://127.0.0.1:8787/tts` when opened from disk; override via `narration.liveUrl`). The bridge speaks with one engine at a time, six built in (`--engine`, tools/tts-engines.mjs), plus any installed one, and the deck can change which: **gemini** (gemini-2.5-{pro,flash}-tts on Vertex AI: a delivery style always reaches it; no free tier, and a fresh project's per-minute quota 429s under the lookahead's bursts), **chirp** (Chirp 3: HD on the Cloud Text-to-Speech API; the same 30 star-named voices, ~1s a sentence, 1M characters a month free, no style channel), **piper** (a local neural model: offline, unlimited, free, no credentials; one voice per installed model, and the process is held RESIDENT because piper reloads its ~120 MB model on every start), or **elevenlabs** (your own ElevenLabs account's voices, the ones you *cloned* included, which is the reason it exists). The first three know their roster up front; ElevenLabs cannot, because the interesting voices are yours, so it fetches the account's list once and `/tts/ping` and `/tts/voices` await it: **your** voices first (cloned, then professional, then premade), each tagged with where it came from, and the picker's default is the first of them. The player sends a voice NAME; a `voice_id` pasted from the dashboard resolves too. Its key is read from `$ELEVENLABS_API_KEY` and is **never written to `tts.json`**; decklight remembers the choice and leaves the secret to your environment. The model is `eleven_v4_turbo` by default (`--tts-model eleven_v4`, `eleven_v3` or `eleven_multilingual_v2` otherwise; a track keeps the model it was voiced with, so the default moving re-voices nothing). Style reaches it only on a tag model, v3 or v4 (`stylable` and `audioTags` follow the model chosen, not just the engine): it reads a short bracketed **audio tag** ahead of the sentence as performance direction, never the Gemini-shaped prose instruction (each built-in tone carries a few-word cue for it, chosen from the tone's name whatever text was saved when it was picked; a typed tone past 40 characters is cut at the last word that fits, a trailing comma or connective going with it, and the cut is said in the tone row, once a session as a toast, and at the start of `decklight narrate`), and never sent to any other ElevenLabs model, where the brackets would just be read aloud as words instead of shaping them. In the notes themselves, `[click]` is decklight's marker on every engine, never sent; `[pause]` and `[long pause]` are sent to a tag model as those tags, where the voice holds them itself, and held by decklight for every other voice (DECK_ANATOMY); any other bracketed tag reaches a tag model as written and is taken out for every other voice. An optional `--tts-stability creative|natural|robust` (v3 and v4; refused up front on any other model rather than silently doing nothing) trades how hard the model follows the tag against how much it drifts, for every sentence. Unasked, the account's own setting is left alone (no `voice_settings` sent at all) except for a sentence under 60 characters, which goes at `robust`: short input is where a tag model is least stable, and how "You ask, it answers." once came back as "You ask, you ask, it answers". **A take is checked before it is kept.** On an engine that samples (ElevenLabs, Gemini), the bridge and `decklight narrate` compare each take's length with its text's (characters at a per-engine pace, a band of half to twice that, never tighter than a second over); a take outside it, the shape of a repeated or dropped phrase, is synthesized once more, and when the retry is outside too the one nearer the text's pace is kept. Either way it is said: the bridge's log and the deck's debug log name the slide and the sentence with both lengths, `narrate` ends its run with the list, and `narrate --check` lists the clips of a recorded track whose length does not fit their script, so a track can be audited after the fact. Engines that say a sentence the same way every time are not checked: a retry would buy the same take. Both the tag and the sentence it directs are billed as the characters actually sent, and it is metered in characters against a plan rate decklight cannot see, so the bridge reports characters rather than inventing a dollar figure. Audio is `pcm_24000` wrapped as WAV like every other engine; `--tts-format mp3` is the escape hatch for plans without PCM output and costs you the panel's *Save with the deck* offline recording and the lip-sync bridge, both of which read WAV, so it is opt-in, never a silent downgrade. `GET /ping` reports `{engine, model, voices, stylable}` and the picker offers exactly those voices, skipping the tone step when the engine cannot be told how to speak: a roster the bridge cannot pronounce would be a silent lie. **Which engine is itself a choice the deck can make**: `GET /tts/engines` lists every engine with its price note and, for the ones this machine cannot use, what is missing. **Voices by language** (ElevenLabs): the bridge reports the languages each account voice speaks, what ElevenLabs verified it for and what its labels name (`voiceLangs`), as the roster's fourth element, `[name, flavor, group, langs]`, shown after the flavor (`cloned · en fr`) and matched by the filter's `lang:` term. The voices view carries a **🌐 Language** row (the same `lang:` term, chosen from a list: the deck's language first, then what your voices speak with a count each, then the languages ElevenLabs speaks), and **opens on the deck's own language** (`<html lang>`, once per open, never English) because a deck translated to Spanish wants a Spanish voice. The account's voices are mostly English, so the view ends with **🔎 Find <language> voices in the ElevenLabs library…**: `GET /tts/voices/library?language=&search=` (the bridge asks `/v1/shared-voices`; free, changes nothing), each voice with ElevenLabs' own sample on ▶ (played as hosted, no synthesis). The first ⏎ on one ARMS it ("⏎ again adds “Mateo” to your ElevenLabs voices — it uses one of your plan's voice slots"); the second is `POST /tts/voices/library/add { engine, owner, id, name }` (`/v1/voices/add/{owner}/{id}`), the one call that changes the account; the roster is fetched afresh and the voice picked like any other. A plan with no free slot says so; any other engine answers 404 "has no voice library — ElevenLabs does". **The choice belongs to the tab, not the bridge**: one bridge serves every open tab (a deck, its speaker view, a second deck) so the bridge holds every engine it is asked for side by side, built once, and each tab names its engine on every request (`GET /tts/ping?engine=`, `/tts/voices?engine=`, `/tts/engines?engine=` marks that tab's engine current, `POST /tts { …, engine }`). A deck restores the engine its saved live voice was picked on by asking for it by name, and picking another in the picker does the same; neither switches anything for another tab. (They used to switch the bridge itself, and a second tab restoring its own engine on load silently took the voice from the first.) An engine this machine cannot run is refused with its blocker (409), and the deck speaks with the bridge's default and says so. A request naming no engine gets the default, the one the bridge started with; `POST /engine {engine}` still moves that default, for decks built before `?engine=`. The picker hangs off the voices view (`N` → live voice → *engine*), because the engine decides the whole roster and that is the screen where you notice the names are not the ones you wanted. It is drawn as a **bar at the top of the voices card**, above the filter: `ENGINE elevenlabs eleven_v4_turbo … change engine ›`, the model named only where it is a real choice (ElevenLabs, Gemini, Chirp; for say, SAPI and piper it is merely the default voice), so the one control that decides every voice below it is not one more line among them; it is still the first row, so ↑/↓ and ⏎ reach it. The engines view lists the **ready** engines first, then the ones that **need setup**, each group under its own heading with its one-line fix, and the V panel's *Live voice* row names the engine and voice in use. **The readiness check is shared with write mode** (`engineStatus`, tools/tts-engines.mjs) and only its phrasing differs (a picker offering an engine `open` would have refused to start is a picker that lies) and it is asked BEFORE the engine is built, because gemini and chirp construct perfectly well against an unchecked project and fail on the first sentence, which mid-talk is a keypress into silence. A swap re-runs the same stale-voice rule a first probe does, and the response cache is keyed by engine name, so switching back replays instantly rather than re-billing. **Synthesis is cached on disk, for every engine including the paid ones** (`$XDG_CACHE_HOME/decklight/tts`, oldest dropped past 400 MB, `--no-cache` to opt out). The key is `(engine, model, format, voice, style, text)` and it is one function shared by the bridge and `decklight narrate` (`clipKey`, tools/tts-cache.mjs), because those are separate processes and a deck previewed sentence by sentence in the browser and then batch-recorded was billed twice for identical words. The **model** is in the key, which is what makes caching a cloud engine safe rather than reckless: a server that changes its model underneath us produces a MISS, not a stale clip filed under today's name. **Style is in the key only when the engine can act on it**: every engine but gemini and ElevenLabs v3 ignores a delivery instruction, the deck usually sends none and the CLI defaults to a paragraph, so keying on a style nobody read would make identical audio hash two ways and miss every clip. `voiceover`'s manifest hash is that same key, shortened, so the folder-level skip and the content-level cache cannot disagree about whether a slide changed. **The voice is asked for the deck's language**: `--lang`, else the deck's `<html lang>` when the deck is not in English, else the language saved by `setup voice --lang`. `decklight narrate` reads it from the file and `decklight <deck>` starts both bridges with it. ElevenLabs is sent it as `language_code` on the models that take one (the tag models, `eleven_turbo_v2_5`, `eleven_flash_v2_5`), because a beat that is a product name or a number is the text a model guesses the language of wrongly; chirp names its voice by it (`fr` is `fr-FR`, `fr-CA` is taken at its word, a language it cannot place is refused rather than spoken in English); `say` and SAPI shelve their voices by it; gemini and piper are told nothing. **English is told nothing, on purpose**: `en` is what `init` writes into every deck, so it does not outrank a saved language, and it is what every engine assumed before, so no take recorded then goes stale. **A language an engine was told is in the key**, and in the manifest header as `lang` (inherited by a refresh of a track that has none, like its format): "Six." in French is not served the English clip. The same language picks Rhubarb's recogniser, by sound (`phonetic`) for anything but English, whose default recogniser hears English words; and a sentence, for the live voice and for captions, takes its closing guillemet with it and ends at full-width punctuation (`。!?`) too. **A deck in another language has its own tracks.** `talk.fr.html` beside `talk.html` is the same deck in French when its name says so and its `<html lang>` agrees (`talk.old.html` is another deck, as it always was); nothing is configured. The two count as one deck for the rule that lets a recording follow its slide, so adding the French file does not switch that off. A track's language is its folder's (`voices-fr/anna`), else the `lang` in its manifest. The French deck lists, checks, renumbers and gives a face to the tracks in French only, and its new takes go to `voices-fr/<voice>` (`voices-fr/me` for your own voice, `voices-fr/voiceover` where `decklight narrate` and `decklight video` would use `voiceover`), so two languages recorded in one voice never share a folder. The deck with no language in its name keeps every track that is not one of theirs, and a folder a deck's `narration.files` names is always its own. A deck with no other language beside it sees what it always saw. **The live voice's row says the language it is told** (`ElevenLabs · French`), and on a deck that is not in English says when it is told none (`piper · not told the deck is French`): a French deck read by a voice nobody told is worth seeing before the room hears it. The browser's own voice carries no such line: it is picked by the deck's language already, and its name says it. **An engine that cannot be used is shown, dimmed, with the terminal command that fixes it** (hiding it would answer "where did ElevenLabs go?" with silence) and every fix is something you do in a terminal: the deck lists what is missing and never collects it, because a key or a project id typed into a web page (even one on loopback) is a different thing from one exported in a shell, and a deck under `--remote` is reachable from a phone. **The deck remembers the engine with its live voice**, and nothing else does: a voice name only means something on the engine it came from, so the deck's saved live voice carries its engine, and the next session's probe asks the bridge for that engine before it reads the roster: a bridge restarted on its default engine would otherwise find the saved voice missing and replace it. A saved engine the bridge refuses (the key is gone, the model deleted) is said out loud and the deck speaks with what the bridge has. `tts.json` is still never written from the deck: it is what the CLI and the wizard write and what the next write-mode start uses for *every* deck, and an experiment two minutes before a talk must not quietly become every deck's default. The bridge is probed when live narration **starts**, not only when the picker opens, and a saved voice the live bridge does not have is treated as **stale rather than chosen**: it came from a different engine (the star roster is the default, and an ElevenLabs key knows none of those names), so the bridge's first voice takes over, is persisted, and the swap is announced: a voice changing on its own must never be silent. **The voice already on the machine**: with no engine chosen, none saved, and no cloud project, write mode asks the operating system what it can speak with before defaulting to an engine that would only be skipped. **macOS** is read through `say -v '?'`: the roster mixes twenty years of engines, so voices are ranked and shown by **quality category**: *best* (a **Personal Voice** the user recorded, and **Siri** voices, recognisable on current macOS only by their sample sentence, the name markers having disappeared from the listing), *good* (Premium/Neural, then Enhanced), *average* (plain built-ins, and the **robots**: Albert, Zarvox, Bad News and the rest of the novelty/formant roster, pinned there by name and listed last, because they sort alphabetically first and once narrated decks by default). The categories render as labelled shelves in the picker, and only the deck's language gets them: the **novelty tail** (robots and the 2022 persona family: Eddy, Flo, Grandma, Grandpa, Reed, Rocko, Sandy, Shelley) and **every other-language voice** each fold to a single expandable row (`‣ novelty voices (26)` · `‣ other languages (140)`), expanded per picker-open and never persisted: a real Mac answers ~184 names, and ~165 of them were the reason "which voice is good here" was unanswerable. When no best-tier voice is installed, the BEST shelf holds an actionable row: *⬇ Get Siri voices — free download*, whose commit asks the bridge's `POST /voices/install` to open the macOS voice-download pane: darwin-only, loopback-only, and the argv is a **frozen constant** (`open x-apple.systempreferences:…`) that no byte of any request reaches; the download itself stays a human clicking through, which is the point of the pane. This is the ONE exec a deck may trigger, and it opens a Settings pane and nothing else. A Mac whose best voice speaks Italian must still not narrate an English deck with it. A Siri voice hiding behind a **duplicate display name** (how current macOS lists them) is dropped rather than offered: `say -v` addresses by name, so that row would play a different voice than it names. **macOS 27** changed the listing twice over, and the roster reads it as it is: a plain voice now carries its language (`Daniel (English (UK))`, `Samantha (English (US))`), so a plain twin of `Daniel (Enhanced)` is recognised by its **base name**, under both a quality marker and a language pair, rather than its whole name, which let every one of them through; and some voices are printed twice, line for line, and are offered once (a Siri voice under a plain voice's name differs by its sample, so it is not a repeat and stays the rule above's to drop). Names keep their suffix in the picker, because the suffix selects a different build: `say -v Daniel` speaks the Enhanced one. The bridge still accepts a voice by its **bare name** (`Samantha`), which `say -v` answers to, so a deck that saved one, or a track recorded as one, keeps working on a Mac whose listing grew the suffix; a name with no voice under it is still refused rather than quietly swapped for the system default. A machine with **no best-tier voice** is told, on the caveat channel every engine already has (the bridge's startup line, the deck's toast): Siri voices are a free download away, with the Settings path and the `open "x-apple.systempreferences:…"` command that gets there, suggested, never run, because only a person can click through a voice download. **Windows** is read through PowerShell: the **WinRT** stack first (`Windows.Media.SpeechSynthesis`, projected from Windows PowerShell 5.1), because that is where the **natural** voices live (Aria, Jenny, Guy, the neural ones Narrator and Edge use, and the closest thing Windows has to Siri); `System.Speech`, the 2006 API that sees only David, Zira and Mark, is the fallback for a PowerShell that cannot project. Synthesis goes through whichever stack listed the voice, and a name the machine does not have throws rather than falling back to the default voice. A machine with no natural voice installed is told where they are (Settings → Accessibility → Narrator → *Add natural voices*) on the same caveat channel and with the same picker row as macOS's Siri hint (`start ms-settings:easeofaccess-narrator`, a frozen argv, is the one exec that row may trigger there). Both become real bridge engines (`--tts-engine say|sapi`), synthesizing 24 kHz PCM in a WAV like every other engine, `stylable: false` so the picker skips the tone step. **Android** is detected and refused with the reason: Termux reports `android` and runs Node, but Android's TextToSpeech is an in-process Java API with no command line behind it, so there is nothing for a bridge to call: the honest path there is a recorded track, which needs no bridge. A native voice is the ONLY engine claimed automatically, because it is the only one that needs no setup at all; **piper is never auto-selected even when it is on PATH**, since it needs a toolchain and a ~120 MB model and that choice belongs to the first-run wizard, which saves it. Any `--tts-engine`, `--project`, `GOOGLE_CLOUD_PROJECT` or saved config wins outright and detection is never consulted. When a machine has nothing, the skip line says what THIS machine lacks and names piper. **A missing piper voice is caught before the bridge starts, not by it**: piper installed and chosen but with no model on disk used to bring the bridge up looking healthy and fail on the first sentence: a keypress into silence, for a file that was never there. write mode now checks, names the model, its directory and its size, and on a **TTY** offers to fetch it; accepting re-plans so the bridge joins the session, declining or a non-TTY run keeps the skip line. **Nothing is ever downloaded silently.** The command it runs is chosen for the machine (`tools/tts-engines.mjs`): a python that can already import piper gets `python -m piper.download_voices`, and otherwise `uvx --from piper-tts` runs it inside the isolated venv `uv tool install piper-tts` creates: the plain form cannot work there, which is why it used to fail with `ModuleNotFoundError` on a machine that had just followed decklight's own install instruction. **Setup** (`decklight setup voice`; a bare `decklight tts` that cannot start runs it too, on a terminal): **write mode asks nothing at startup**: with no voice configured, or a piper model not yet downloaded, the banner's skip row names `decklight setup voice`, and the deck's `V` panel says the same, because the deck never collects a key or a project. The setup asks a few plain questions on the terminal instead of exiting with the engine's error: the engine, with the free/offline/cloud trade-offs stated and the default following what the machine already has (an `$ELEVENLABS_API_KEY` outranks everything: nobody exports one by accident; else piper on `PATH`, else a project visible in the environment or gcloud config), then only that engine's prerequisites: a GCP project id (prefilled, validated with the same rule the flags enforce) plus a credentials probe for the cloud engines; for piper the install and voice-model download commands, run only on an explicit yes; for elevenlabs nothing at all when the key is exported (the roster answers "which voice", so it is not asked) and otherwise where to make a key and why setup will not save it for you. Setup proves the choice with one real synthesis of the picker's preview sentence, reporting duration and the engine's cost note, and only a config that has spoken is saved, to `~/.config/decklight/tts.json` (`$XDG_CONFIG_HOME` honored), which `decklight <deck>` reads from then on (as does the bridge run alone); precedence is flags > environment > saved config > built-in default. `decklight setup voice` re-runs the questions, deleting the file resets to first-run, and non-TTY invocations never prompt; exit codes and messages stay as they were. **The voice is the clock**: auto-advance is driven by narration finishing, so when the voice CANNOT be played (a quota 429, an unreachable bridge, a browser that blocked autoplay, a recorded track with no file for this slide), the deck **stops advancing** rather than walking the talk past slides nobody has heard, and says why in a message (`I`) naming the cause and the way out (`--tts-engine chirp` for a 429, opening the deck with `decklight <deck>` for a dead bridge, one click for blocked audio). Narration switches itself off; `V` retries: the picker drills tracks → voice (30 prebuilt Gemini/Chirp names, one piper model, an OS voice, or the ElevenLabs account's own roster) → tone, on any engine `/tts/ping` reports as `stylable` (seventeen presets under three headings, *presenting* (Warm senior engineer, Professional, Calm explainer, Conversational, Keynote, Documentary, Storyteller, Plain and brisk), *moods* (Joyful, Super excited, Sad) and *for a laugh* (Too serious, Deadpan, Breaking news, Whisper, Sports commentator, Noir detective), or a custom typed instruction under *your own*: a prompt prefix for gemini, a short bracketed audio tag for ElevenLabs v3 and v4). Every voice row carries a ▶ **preview** that speaks an editable test sentence (default "Hey, this is Decklight", input at the top of the voices view, ↺ restores the default) through the bridge in that voice; tone rows preview the drafted voice in that delivery style, and the custom-tone input has a ▶ to audition a typed instruction before committing it. After a preview plays, the rest of its roster prefetches sequentially in the background (all voices neutrally, or all tones for the drafted voice). Two preview caches: the default sentence's cache is permanent once built; the custom sentence's cache holds exactly one sentence and is swapped (old audio freed) when the text changes. **Build-synced auto-advance**: the ⟨CLICK⟩ markers that segment the notes for the speaker view segment the audio too: segment k is synthesized as its own clip and narrates build step k (0 = arrival); when a clip ends the deck reveals the next build, and after the last segment it moves to the next slide, so a deck with well-segmented notes presents itself beat by beat. **More segments than builds** (the commonest case being a slide with no `data-build` at all, which has exactly one step) used to drop every surplus segment: never synthesized, never spoken, never mentioned, while the speaker view went on displaying it, so the presenter read a cue the deck would never say. The surplus now rides on the **last** step. There is nothing left to reveal, so the marker becomes a beat rather than a build trigger: the same call `tools/video.mjs` makes for a count that does not line up, and the same one the panel's *Save with the deck* stitching and the viseme sidecars make, each giving a folded segment a segment-sized silence rather than a sentence-sized one so a recorded take breathes where the live one does. The counts disagreeing is still nearly always an authoring slip, so it is named once per slide in the message log (`I`) and the debug log, never toasted, because it is a note about the deck rather than something to act on mid-sentence. The opposite mismatch needs no rule: fewer segments than builds already advances after a short beat, losing nothing. A segment with no words advances after a short beat; a slide with no notes is skipped; manual navigation mid-clip wins over the pending advance and re-syncs the voice to the new step. **Between sentences the voice breathes 0.25s by default** (the pause a reader takes at a full stop, which a chain of separately synthesized clips otherwise lacks), overridable for the deck (`narration: { sentencePause: 0.5 }`) and per slide (`data-narration-sentence-pause="0"`, where an explicit zero is zero); a typo falls through to the next tier, never to silence. the panel's *Save with the deck* stitches the same breath between sentences, so a recorded take paces a slide exactly as the live voice did. **Every pause resolves the same three tiers**: the slide's attribute, else the deck's `narration: { sentencePause, beatPause, slidePause }`, else the built-in default (0.25s between sentences, **0.5s between builds, 1s before the slide turns**), opt-*out* rather than opt-in, because a deck that talks straight through its own punctuation is the behaviour nobody asks for on purpose; so a deck can breathe uniformly from one line of config and a single slide can still say otherwise, down to `"0"`; an unparseable value at either tier falls through, never to silence. **`data-narration-beat-pause="0.5"`** is the same breath **between builds**: each bullet lands, holds that many seconds, and only then does the voice reveal the next: honored at play time for live and recorded tracks alike, never baked into a recording, and malformed values read as no pause, exactly like its end-of-slide sibling. **`⟨PAUSE⟩` anywhere in the notes** (#560) is a let-it-sink-in hold at that spot: **two beat pauses** (1s by default), so it follows the slide's `data-narration-beat-pause` and the deck's `narration.beatPause`, and a slide that zeroes the one zeroes the other. It is never spoken, captioned, subtitled or written to PowerPoint notes. It belongs to the words before it (between sentences, attached to one, or on a line of its own) except that one before any words of a ⟨CLICK⟩ beat holds after that build lands, so `A. ⟨PAUSE⟩ ⟨CLICK⟩ B.` holds then reveals and `A. ⟨CLICK⟩ ⟨PAUSE⟩ B.` reveals then holds. Mid-sentence, it cuts the sentence there, and several in a row hold that many times. The live voice holds it between clips. Because it sits *inside* a beat, where recorded playback has no seam to hold at, every recording **bakes it in** as silence: the deck's recorder (WAV and viseme sidecar alike), and the synthesis core, which voices the words on either side as separate clips and joins them (a clip in anything but WAV needs ffmpeg to decode). A narrated video therefore gets it from the audio's measured length, and a silent frame adds it to its hold itself. The marker's position is part of the text a slide's hash is taken over, so adding or moving one makes a recorded slide stale and the export re-voices it. A slide with no marker hashes exactly as it did before markers existed, and a change of pause *length* does not stale a take, just as a changed `sentencePause` does not. The `.txt` script beside a clip keeps its markers, since they are part of what was recorded; lip-sync hands Rhubarb the words alone, and subtitles leave each hold uncaptioned. A beat of nothing but `⟨PAUSE⟩` has no take of its own: live it holds instead of the usual short silent beat, and the recorders give it no file. **`data-narration="hold"`** on a section marks it interactive (quiz, exercise, live demo): narration plays whatever notes it has and builds still sync, but the deck never auto-advances *off* it: the presenter moves on manually and narration resumes on the next slide. The spoken unit is a **sentence**: each ⟨CLICK⟩ segment splits into sentences, every sentence is its own TTS call and cache entry (slide, segment, sentence, voice, style), playback chains them and advances only after the segment's last one, so first audio arrives after one short synthesis, never a whole paragraph. While narration is on, a **lookahead buffer** keeps the next 10 sentences synthesized in the background (a few parallel low-priority workers, window re-derived from the current position, results landing in the same cache); an unreachable bridge toasts once and pauses the buffer until the next event. the panel's *Save with the deck* records per-slide `slide-NN.wav` files **stitched from this same sentence cache** (short silences joining sentences and builds): already-heard clips cost nothing, only unheard sentences synthesize. **They are written next to the deck, not downloaded**: in write mode each stitched slide is POSTed to the server that already owns the deck file (`/deck/edit/narration/record`), which writes it, and the character's `slide-NN.visemes.json` sidecar, into the deck's own `narration.files` folder, or `voiceover/` when the deck names none. That is the only place `narration.files` can point at and the only place `decklight bundle` looks, so the recording is finished where the next command reads it; the browser's download folder is neither, and is now the FALLBACK for the cases nothing may write to disk: a `file://` deck, or one served read-only by `decklight <deck> --no-trust`. The player names the folder and never the file: `/deck/edit/narration/record` builds `slide-NN.wav` itself and refuses a folder that resolves outside the served root, so the write surface a recording opens is one directory of one deck. The card that ends the recording says which of the two happened and, on disk, the exact `narration: { files, ext: 'wav' }` line that plays the set back. **`⎵` pauses/resumes** narration while it plays: audio freezes mid-sentence and resumes exactly there, and auto-advance holds while paused. Captions (`C`) follow the voice **sentence by sentence** during live narration (segment-level when narration is off). With nothing configured, `V` opens the picker instead of failing. **The deck announces its own voice**: when a recorded track is configured, a small pill fades in bottom-center about a second after load: *🔊 this deck has a voice-over — click to hear it, `V` for the voices*, and clicking it plays the deck's own voice: the click is the choice, as the touch sound button's is, where it used to answer "no voice chosen" to the one person who had just asked (and the click is itself the user gesture, so the audio is never the blocked-autoplay case). It fades out on its own after ~12s and is written to the message log (`I`) rather than toasted, since the pill is already on screen saying it. It never appears in `?print`, in embedded previews (the theme picker and slide finder boot real decks in iframes), in a render (`?capture`, below), on a load the URL sent past the first build of the first slide (a link into the middle of a talk is somebody presenting, not a first view, the rule the welcome card keeps), under `?voiceover` (which starts on the first gesture anyway), while captions (`C`) hold that same corner, or once narration has been started on this deck, remembered per deck path like every other narration preference. Without it the only proactive surface was the touch sound button, which CSS shows on `pointer: coarse` alone, so a viewer on a laptop could only learn the deck talks from a key nobody had mentioned. Files are generated by **`decklight narrate <deck.html>`** (the dispatcher spawns `tools/voiceover.mjs`, which arg-parses at load and so cannot be imported, the same way `video --voiceover` runs it), the headless counterpart of the panel's *Save with the deck*: the notes, voiced as written, by `--engine piper` (local neural TTS; `--voice` = piper model name), `chirp`, `gemini` or `elevenlabs`. **One synthesis core produces every machine-voiced track** (`tools/narration-synth.mjs`, #555): `voiceover` is its command line, and the export that voices a range before rendering goes through it too, so a track made by one can be refreshed by another. It owns sentence synthesis through the shared clip cache, the ⟨CLICK⟩ beat files, stitching a slide from its beats, encoding, and the skip-by-hash that makes a rerun free; `tools/narration-manifest.mjs` (what a slide's text and hash are) and `tools/tts-cache.mjs` (has anyone paid for these words) stay the identity layer beside it. **A track keeps its format**: `wav`, `m4a` or `mp3`, read off its files: a track the deck's recorder made is wav, and refreshing one of its slides writes wav, where `voiceover` used to write m4a beside it, re-voiced in piper; a fresh track is m4a unless `--format` says otherwise, and wav is written directly, with no encoder. **A folder that already holds a track is refreshed AS that track**: its engine, voice, style and (for ElevenLabs and Gemini) model are the defaults, a flag overrides each, and a header field the core does not own (the recorder's `recorder: 'deck'`) is carried. A slide whose hash still matches and whose file (in the track's format) is on disk is kept, whoever made it. A **`--slides` run in another voice is refused** (a header names one voice, and the slides outside the range would read as stale against it), with the way out: voice the whole track, or give the other voice its own folder. The microphone recorder is untouched: a human voice is the browser's. The built-in speech-synthesis voices were removed: not good enough. `?voiceover` starts narration on the first user gesture. `instance.toggleNarration()` programmatically.
|
|
1457
|
+
- **A saved AI voice has an identity.** The browser recorder and `decklight narrate` resolve the voice before synthesis and save its name and ID (`voice`, `voiceId`) in the track’s manifest, including when the engine chose its default. Regeneration looks up that ID first, so renaming a voice keeps the track attached to it. If the stored voice is unavailable, Decklight names it and stops. The voice panel marks older tracks with no identity as **voice not recorded**. **Set the track’s voice…** saves the user’s choice without generating audio, and regenerating such a track opens that same picker before asking for confirmation. There is no preselected voice. At the command line, pass `--voice` to regenerate a track with no saved identity.
|
|
1458
|
+
- **The Writing picker** (`src/core/writing.js`): the writing tools have one home, a card that asks two things in turn, which tool, then which slides, the same from every entry point: the `/` palette row *Writing tools…* (and one row per tool, *Rewrite the script…*, *Add audio tags to the script…*, *Write the script for the ear…*, *Match the script to the slide…*, which open the card on its slides step), `V` → *✍ Writing tools…*, the notes editor's **Writing tools…** button (which saves the box first, so the agent reads the notes as the file holds them), and *Writing tools…* on the slide background's right-click menu. The tools are listed in their groups (*script, the speaker notes*: ✨ rewrite, ✨ add audio tags, 🗣 write it for the ear, ⇄ match the slide; *slide text, the words on the slide*: the four tools of PRESENTING_WRITING); the scopes are **this slide · n**, **module “…” · count** (only when the deck has chapters, DECK_ANATOMY) and **whole deck · count**, led, for a tool that can work on part of the notes (rewrite, the tags, written for the ear) opened from the notes card, by **the selection · n words** when words are selected there, or **this build · …** in its per-build view, which is then the row selected; the foot names the agent that will be asked. `↑`/`↓` choose, `⏎` picks, `←` (or `Esc` on the slides step) goes back to the tools, `Esc` closes. Write mode only, with an agent CLI on the dev machine: elsewhere the row is blocked with a sentence.
|
|
1459
|
+
- **Enhance the script** (`decklight enhance deck.html --slides <n|a-b|a,b> | --all [--dry-run] [--agent <name>]`; in write mode the Writing picker above, *✨ add audio tags*): adds the audio tags ElevenLabs v4 performs (`[thoughtful]`, `[sighs]`, `[excited]`, DECK_ANATOMY) to the speaker notes. The prompt is **ElevenLabs' own**, the one its [best practices](https://elevenlabs.io/docs/overview/capabilities/text-to-speech/best-practices#prompting-eleven-v4) publish for having an LLM enhance a script, verbatim (`cli/enhance.mjs`), plus a short decklight addendum: one narrator, keep every `[click]` on its own line and every `[pause]`, keep the line breaks, answer with the script only. The **locally installed agent** answers it with the same read-only argv the commit subjects use (one ask per slide, three at a time, two minutes each) and is never let near the file. **Decklight writes, and only what passes a check**: after tags, markers, case and punctuation are set aside the words must be the same words in the same order (the prompt allows only tags, capitals, `!`, `?` and `…`), the `[click]` beats the same count, and no beat may lose a `[pause]` (adding `[short pause]` / `[long pause]` is allowed). A slide whose answer fails is left exactly as it was and the result says why; the paragraphs stay a blank line apart. In write mode the run is `POST /deck/edit/enhance { slides: [n…] | 'all' }` (409 while another enhance or an agent edit runs; 400 naming what is missing with no agent; 422 with no notes to enhance), progress rides SSE `enhance` events into one rewriting row, and the answers are **held for review**, never written (#907): against the deck as it is when the run ends (a slide edited meanwhile keeps the edit), the passing slides make the candidate the review view shows side by side, `what` *script: audio tags*, *script: written for the ear* or *script: matched to the slide*, `kind: 'script'`, and `left` listing every slide the run looked at and left as it was with why (an answer that failed its check, a slide edited meanwhile); the `done` event carries `candidate: { id, units }` and the view opens on it; what the author approves is one write and one undo entry, and the commit it drafts names the slides (*script: written for the ear on "Pricing" and "Roadmap"*). The closing line (*enhanced 3 slides — review it before it lands · slide 5 left as it was: …*) says so. Only a deck the review cannot cut slide by slide lands as it used to, in one edit the undo chord takes back. The notes are sent to that agent, and most agents are cloud services; the CLI's help says so. **Written for the ear** (`--spoken`; in write mode the Writing picker's *🗣 write it for the ear*): the other rewrite, with its own prompt (`SPOKEN_PROMPT`, cli/enhance.mjs): terse, written-style notes turned into sentences a person would say out loud ("Fluffed a line? Backspace retakes it." → "And if you fluff a line, just press Backspace to take it again."), every fact kept, nothing added, symbols said as words, about as long as it was. It REWORDS, so its check is not "same words": the same `[click]` beats (the builds), no `[pause]` lost, no beat emptied, and a length between half and two and a half times the original: an answer outside that is commentary or a dropped point, and the slide is left as it was. **Matched to the slide** (`--match-slide`, `kind: 'match-slide'`; in write mode the Writing picker's *⇄ match the slide*): the mirror of PRESENTING_WRITING's *match the script*, with its own prompt (`MATCH_SLIDE_PROMPT`, cli/enhance.mjs) and the slide's own text sent along under `# Slide`, its runs one per line (the same runs the slide-text tools see, so never the notes, code or SVG): the notes reworded to use the slide's terms, names and numbers, to follow its order and speak to every point it makes (where the two disagree, the slide wins), keeping what the script adds beyond the slide, still written for the ear and not read off the bullets, about as long as it was. It rewords, so it is checked exactly as *written for the ear* is. **Rewritten** (`--rewrite`, `kind: 'rewrite'`; in write mode the notes card's *Rewrite* and the picker's *rewrite*): its own prompt (`REWRITE_PROMPT`, cli/enhance.mjs), the same meaning said more clearly and more naturally, nothing added or dropped, about as long as it was; it rewords, so it is checked as *written for the ear* is. **A passage of the notes**: rewrite, the tags and written for the ear can work on part of one slide's notes (the notes card's selection, or a build's part), sent as `passage: { from, to, text }`. The server finds the words in the notes as the file has them (the offsets when they still point at the words, else the words found once; refused with a sentence when they are not there once, and refused for *match the slide*, which reads the whole script against the whole slide). The agent is shown the whole script with the passage between `⟦` and `⟧` and asked for the passage alone (`PASSAGE_NOTE`); decklight puts the answer back in its place and checks it twice, as a passage (its own beats and pauses, its length) and as the script it makes, and the candidate is the slide's whole notes with only that passage changed. **Every rewrite offers three scopes**, the picker's: this slide, this slide's **module** (the `data-module` chapter it is in, DECK_ANATOMY, offered only when there is one), or every slide with notes. From the notes editor, whatever the scope, the box is saved first (the agent reads the notes as the file holds them, and the candidate merges against that file) and the review opens on the answer, over the card. **⌘⏎ saves the notes editor from wherever the focus is** while it is up: the box, a button in it, its background, or (docked) the slide beside it. A save that silently did nothing, with the text still in the box, read as a save (#646). A typing box of its own (the agent ask, the commit window, the content editor) keeps its own ⌘⏎, and the read-only card (`--no-trust`, `--no-trust`) has no save to reach. **A save does not reload the page**: the notes came from the page, so `POST /deck/edit/slide/notes` writes quietly (the watcher skips the reload for exactly those bytes) and broadcasts the slide's new notes as a `notes` event. Every open view of the deck puts them in place: narration and captions read the new text, the speaker view re-reads it, and a notes card open on that slide in another tab follows them unless it holds edits of its own. The page that saved keeps its card exactly as it was, caret and scroll included, and its own echo (`from` names the page) leaves the box as typed rather than as the file normalised it. Any other change to the file (an undo, an agent's edit, an editor's save) still reloads. Should a save's write reload anyway, the card is reopened on that slide with the caret and the scroll restored, docked or floating as it was, from a record kept in sessionStorage for a minute; Esc or × leaves none, so a card closed on purpose stays closed. **● unsaved** sits beside the heading, at full strength while the heading is dimmed, whenever the box differs from the file; it reads **saving…** while the request is in flight and clears once the box matches the file (a save that wrote, or one that had nothing to write). A failed save leaves it up. **Reset, and changes, in the notes editor**. Above the box sit the switches for what it shows, **✎ edit / ⇄ changes** (the lit half is the view on screen) and *whole slide / per build*, with **↺ reset** at the end of the row (in a side panel, its arrow alone, its title saying what it does); below the box, the agent's rewrites, at a size a pointer finds (13px, 32px tall). **↺ reset** puts the box back to the notes **as the card opened on this slide** (or moved to it): every change made since dropped, typed or rewritten by the agent, and when the file has moved on meanwhile (the quiet time wrote the typing, or the rewrite saved itself) the box is written back the same quiet way, the mark saying so. Not against the last save: a card that writes itself whenever the typing stops is its own last save most of the time, and a reset against it would have nothing to drop. A save from another tab that the card followed is the new starting point, and a reset pressed while a save is in flight lets it land with what it sent, then writes the reset after it. **⇄ changes** swaps the box for a word-level diff against the same starting point, the notes as the card opened on this slide (src/core/worddiff.js: a longest common subsequence over words and the whitespace between them, so line breaks and `[click]` lines survive; whole lines past a size cap), removed words struck through, added words highlighted, with the counts; Esc or ✎ edit goes back to the box. Not against the last save, for reset's reason: the quiet time writes the typing within a second, and a diff against it had nothing to show. Both are inert while the box says what the card opened on. When a rewrite lands in the box, the changes view opens on it.
|
|
1460
|
+
- **Character** (`V` → who is on screen, or palette → On screen…): an animated narrator in a stage corner whose lips sync to the narration, fully offline, no cloud service. The panel names its modes by what the audience sees: *A cartoon character* is `viseme`, and `video` is *My camera* when the voice that plays was filmed (a filmed clip always wins) and *A talking head of me* otherwise. Two render modes behind one overlay (`.decklight-character`, persisted per deck): **🎭 2D character**: a layered SVG bust (theme-aware clothing/backdrop, blink, idle sway) with one mouth group per Rhubarb shape (`A–H` + `X` rest); a 30 Hz loop maps `narrAudio.currentTime` onto a **viseme timeline** and shows the matching `[data-mouth]` group, so pause (`⎵`) and voice speed (`<`/`>`) sync for free. **🎥 Neural video**: a muted picture-in-picture `<video>` talking head (audio always comes from the narration element; muted video is immune to autoplay policy) generated by Wav2Lip or SadTalker on the presenter's own GPU, kept on what is **heard**, not on the audio element's clock: its target is `audio.currentTime` minus the output delay the browser reports (`AudioContext.outputLatency` + `baseLatency`, tens of ms through speakers, far more through Bluetooth) minus `narration.character.lipOffsetMs` (a hand adjustment, positive = lips later); within 250 ms the video's rate is nudged ±8% until it is within 15 ms, and only a bigger gap seeks (`lipCorrection`), so the mouth never stutters on a seek per tick. Measured on a real clip: the old ±150 ms seek-only rule held the lips a steady ~35 ms ahead of the element clock (worse by the output delay) and let them drift to 212 ms; now a median of 13 ms. The debug log (`D`) names the output delay it used. It mirrors the voice's play/pause/rate. Timelines and clips come from the **lipsync bridge** (`decklight lipsync`; the deck asks its own origin for `/lipsync/*`, which `open` proxies to the bridge it started, and falls back to `http://127.0.0.1:8789` when opened from disk; override via `narration.character.bridgeUrl`; CORS-open, 127.0.0.1-only, disk-cached in `~/.cache/decklight/lipsync` keyed by audio+params hash): `GET /ping` reports which engines actually resolve (the picker greys out the rest), `POST /viseme?text=` (raw WAV body → timeline JSON v1: `{v, duration, cues: [{t, v}]}`, start-time cues, each shape holds until the next), `POST /video?engine=&portrait=` (raw WAV → muted faststart MP4; strictly serial GPU queue), `GET /portrait?name=` (the still the clips are made from). **Set up once, remembered**: `decklight setup face --wav2lip-dir <checkout> --wav2lip-ckpt <wav2lip_gan.pth> --python <its venv python> --portrait me=<photo>` (the bridge's own `--save`, which it still takes) writes `~/.config/decklight/lipsync.json` (`$XDG_CONFIG_HOME` honored) and exits; the bridge reads it under any flag it is not given, `open` starts the bridge for a saved talking head with no flags (rhubarb or not), and `doctor` reports it: one check (`videoSetup`, tools/lipsync-config.mjs) says what stands in the way for all three and the deck's character row, in the same words. **How a clip is made from a photo** (Wav2Lip): a portrait larger than 1024 px is scaled down (S3FD misses the face in a full-size phone photo); its face is found ONCE with Wav2Lip's own detector and cached, then passed as `--box` so no clip detects again; the still is cropped square around the head so the face fills the round overlay (and renders faster); and because Wav2Lip redraws the whole face box at 96 px, only a feathered ellipse over the mouth and chin is taken from its output: everything else stays the sharp photograph (limited-range `yuv420p`). **A portrait can be filmed** (`--portrait me=clip.mp4`, `.mov` `.m4v` `.webm` `.mkv`, 5–10 s facing the camera, mouth relaxed, not talking; its sound is ignored): made ONCE per film and cached by content (`prepareClip`): its first 10 s at 25 fps, scaled like a photo, its face found in one frame a second, cropped square around the head, and played **forward then back** so the loop Wav2Lip makes of it for a long sentence never snaps the head back to the start (Wav2Lip loops its `--face` frames from the first, so a plain film jumps). If the head held still (a face in every sampled frame, its centre wandering less than a tenth of the face width (`steadyBox`)), the union of those boxes goes to Wav2Lip as `--box` and only the mouth is laid over the film, frame for frame (Wav2Lip's frame i is the loop's frame i); a head that moves is left to Wav2Lip's own per-frame detection, the whole face redrawn and softer, and the bridge says so. The film's first frame is the still under the video. Veo is not asked to animate a film, and SadTalker gets that first frame. The bridge prepares every portrait when it starts, not on the talk's first sentence. **Or filmed in the deck**: V → *A talking head of me* → **Make my portrait…** opens the camera in the medallion's own circle (mirrored, as a face expects; the film is not), with what to do (face the camera, mouth relaxed, don't talk, head still), then a 3-2-1 and `narration.character.filmSeconds` (default 8) of recording, a review of the take (⏎ use it, R retake, Esc cancel), and `POST /portrait?name=filmed` (the MediaRecorder's own mp4 or webm) to the lip-sync bridge. The bridge prepares it like any film, keeps it beside `lipsync.json` (`portraits/filmed.mp4`, a retake replacing it), remembers it there, with the bridge's own Wav2Lip setup where none was saved, and offers it at once, no restart; the deck switches the character to it. A film with no face is refused in a sentence and the card offers a retake; a camera refused or absent is said as what to do. The row shows whenever the bridge can take a film (`/ping` `film`, or `filmWhy`), and a bridge with Wav2Lip and no portrait yet still starts, so filming is how the first portrait gets made (the video row then points at it). **A recorded track needs no pre-rendered clips**: in video mode the deck plays `slide-NN.mp4` beside the track when it exists (`decklight lipsync` renders them as a batch); when the server says it does not, a track you just recorded, and the bridge makes video, the head gets a clip made from the very audio file that plays (`POST /video` with that file; one per beat on a beat-paced track, keyed by the file, cached by content on the bridge), synced to it exactly as a live sentence is, with the rest of the slide and the next one warmed ahead in playing order. Until a clip lands the photo shows, never the previous beat's mouth. A request that cannot be made at all (a deck on file://) trusts the sidecar, as before; the check is a GET with the body dropped, since `open` answers HEAD 405. **The medallion is never black**: in video mode the character shows that same still (`/portrait`) under the video, and the video fades in only while a clip is playing (`playing` → shown, `ended`/`emptied` → the photo again): a clip that is still rendering when its sentence is spoken leaves the photo, not an empty circle. In **live voice** mode the sentence is the unit here too: the lookahead buffer that keeps 10 sentences of audio warm hands each synthesized sentence's WAV to the bridge, so lip-sync data prefetches through the same window, workers, and promise-cache dedup as the voice. And playback NEVER waits on lip-sync (a late timeline lands mid-sentence; until then the **fallback** animates: `voice` (default) reads the mouth from the audio itself, below, with the coarse loudness mouth while it is read; `amplitude` is that loudness mouth alone, a 4-shape mouth from a WebAudio analyser; `hide` shows the idle face). In **recorded** mode the overlay loads per-slide sidecars from the track's dir: `slide-NN.visemes.json` / `slide-NN.mp4`, generated by `decklight narrate <deck> --face [--video]` (`tools/lipsync.mjs`: rhubarb + optional SadTalker/Wav2Lip batch, hash-incremental like voiceover.mjs), preferring an inline `<script type="application/json" data-decklight-visemes="slide-NN">` block when present (`decklight bundle` inlines viseme JSONs; fetch is blocked on `file://`). the panel's *Save with the deck* exports `slide-NN.visemes.json` alongside each stitched WAV (same sentence cache, same silence gaps) so a recorded set is character-ready with zero extra synthesis. A sidecar belongs to one recording (#1244): each carries `audio`, the hash of the audio it was cut from (stamped by `tools/lipsync.mjs` and by the deck's record endpoint), and writing new audio for a slide or beat removes its old sidecar. `decklight video` checks every sidecar against the audio it plays beside (that stamp, else the `lipsync.json` hash, and always the length: more than a second apart is another take); one that is missing or out of step is remade by `tools/lipsync.mjs` (the log says how many): with Rhubarb when it is installed, and otherwise **read from the voice** (below). Should even that fail, the export reads the mouth from the voice itself, in memory, as a last resort; only audio that cannot be read at all stops it, naming `decklight narrate <deck> --face`. In the deck, a recorded beat's sidecar whose length disagrees with its audio is dropped for the **fallback**, never played against the wrong take. **The mouth read from the voice** (`tools/mouth.mjs`, shared by the deck and `decklight video`) is that fallback where there is no sidecar, no bridge, or another take's sidecar: the audio at 16 kHz (a WAV is read directly, in the deck and in Node alike, with no decoder; anything else the deck decodes through an offline audio context at that rate, and Node through ffmpeg, a file it cannot read being skipped and named rather than ending the run), then about 100 times a second its loudness, its hiss above 3.5 kHz and its first two formants (from an LPC envelope, placed within that voice's own range) choose one of Rhubarb's shapes: silence rests (`X`), a short silence or quiet hum between sounds closes the lips (`A`), hiss shows teeth (`B`), and a vowel opens by its F1 and rounds or spreads by its F2 (`C`, `D`, `E`, `F`, or `B` for "ee"); a shape shorter than 60 ms is folded into its neighbour. It recognises no speech, so it is less exact than Rhubarb (an *m* and a *t* look alike to it), and it never replaces a sidecar Rhubarb made. `tools/lipsync.mjs` writes its sidecars when Rhubarb is not installed (`source: 'builtin'`, stamped like Rhubarb's, each line `N cues → … · read from the voice`), so `decklight lipsync`, `decklight narrate --face`, the voicing step and the voice card's *Update lip-sync* all work without Rhubarb; and once Rhubarb runs here every reader (the tool, the voice card, the export's check) takes such a sidecar as out of date (`visemeMismatch`'s `rhubarb`), so the next run replaces it with Rhubarb's; on 60 single words from four macOS voices it showed the right kind of mouth (teeth, open or rounded) for 44, where the loudness mouth showed it for 22. About 3 ms a second of audio. **Lip-sync follows the audio**: on a deck whose configured character is 2D (`narration.character.mode: 'viseme'`), every path that writes machine-voiced audio cuts its sidecars afterwards from the audio now on disk (`tools/lipsync-auto.mjs`): `decklight narrate` (and the export's voicing step, which runs it), the export's re-voicing of stale slides, and *Save with the deck*, whose sidecars the bridge did not cut (bridge down) are cut by the edit server from the saved WAVs. Only the stems whose sidecar is missing or another recording's are cut, by `tools/lipsync.mjs --remake`, several files at once (`--jobs`, default a quarter of the cores, 1–4), each line saying how far along it is (`[3/12]`); `--no-face` skips it. Without Rhubarb the sidecars are still made, read from the voice, and the run says once that Rhubarb would make them more exact and how to get it. A slide filmed with your face plays the film, so it is never counted or cut, and a microphone take is not touched by any of this. **The voice card shows stale lip-sync** the way it shows stale slides: the edit server's track list (`GET /deck/edit/narration/tracks?character=viseme`) checks each track's sidecars with the same rule as the export (`visemeMismatch`: the stamp, then the `lipsync.json` hash, then the length) and the card says how many files are out of date, with one action, *Update lip-sync*, which cuts them on the server in the background (`POST /deck/edit/narration/lipsync?dir=`; the card follows its progress) and re-records nothing. **Solo** (`V` → Where… → *Fill the screen*, a switch, or palette → "Narrator fills the screen"): the narrator takes the stage: the slide content, progress bar and slide number step aside (`visibility: hidden` on `.decklight-stage`, which the overlay is a sibling of) and the character centers, sized to the stage (`--character-solo-size`, default `min(74vh, 74vw)`). A talking-head slide with nothing else on it, without authoring one. Works with either render mode, persists per deck alongside `mode`, and is a *presentation* state, not a layout: the root's `decklight-solo` class is only ever set while the character is actually on screen, so turning the character off, or stopping the narration, can never leave a blank stage behind. Turning solo ON shows the character immediately (idling, blinking) rather than waiting for `V`. **Motion** (`decklight lipsync --veo`, SPEC PRESENTING): Wav2Lip repaints the lip region and leaves the rest of its source untouched: from a still photo that is a frozen stare with a moving mouth. With `--veo` the bridge animates each portrait ONCE through Veo image-to-video on Vertex AI (`veo-3.1-lite-generate-001` by default; 4/6/8s; `generateAudio: false`, the deck owns the voice, and it is the cheaper rate) and gives Wav2Lip that clip as its `--face`, so the head turns and blinks under the new mouth. The unit is the PORTRAIT, not the sentence: the player asks for video once per sentence through a 10-sentence lookahead, so a Veo call per sentence would be both unusably slow (~40s) and a runaway bill. Instead each portrait's motion clip is bought on first use, deduped in flight, and cached on disk (keyed by portrait+model+seconds+prompt), so a deck of any length costs exactly one call per portrait, ever. Delete the cache entry to re-roll the performance. The clip is cropped square around the head (the overlay is a circle) and scaled to 640px (s3fd misses faces in a large frame). SadTalker is excluded: it generates its own head motion and wants a still. A refusal by Veo's person-generation filter surfaces as an error naming the cause, never an empty clip; a misconfigured `--veo` disables only itself and leaves visemes and still-portrait video working. It is the only part of the bridge that leaves the machine, so it is opt-in, and write mode passes it straight through. Config (`narration.character`, all optional): `mode: 'off'|'viseme'|'video'` (picker overrides, persisted), `solo: boolean` (default false; picker overrides, persisted), `bridgeUrl`, `position: 'br'|'bl'|'tr'|'tl'`, `size` (design px, default 220), `svg` (custom art: inline markup, `'#id'` ref, or URL, contract: `[data-mouth="A"…"X"]` groups; optional `[data-eyelid]`/`[data-idle]` get the blink/sway), `sprites: {A: url, …}` (image frames instead), `engine`/`portrait` (video mode; Wav2Lip suits live: static pose, seamless per-sentence cuts; SadTalker suits batch clips), `fallback: 'voice'|'amplitude'|'hide'`. Bundles: viseme JSONs inline (1–4 KB/slide); per-slide MP4s stay external with a CLI notice: video cannot inline sanely.
|
|
649
1461
|
- **Engine wizard** (`ENGINES#WIZARD`; write mode only). A capability ships with its affordance always present (`V`/`N`, `A`, the palette entries) and **no bundled provider**; first use opens a wizard that installs and configures one. **The door is the `/` palette**: the edit server's ping advertises every engine a registered marketplace declares a wizard for (`wizards`, beside its `agents`), and each gets a contextual `Voice: Configure ⟨engine⟩…` row that opens the form, named by **qualified** ref (`engine@marketplace`), so two catalogs sharing a bare name cannot silently resolve to whichever registered first. Without a server the list is empty and the rows are ABSENT, not disabled (same reasoning as the gate below). `instance.wizard(⟨engine⟩)` is the programmatic door, for drivers that cannot click. **Core renders; a plugin only declares**: a schema of questions, field types and a validation path, never markup. The field vocabulary is **closed** (`secret`, `text`, `choice`, `path`, `boolean`) and that is the mechanism, not a style rule: "the wizard appears only in write mode" is enforceable exactly as long as no plugin can put its own markup on a slide. Unknown keys are refused rather than ignored (a silently dropped key is a wizard asking for less than its author believed), a `secret` may not carry a `default` (a placeholder to be pasted over, or a key baked into a catalog; the second is bad enough to refuse the first), and `validate` is a **path** the plugin chooses on an origin it does not (a schema that could name where to send a freshly pasted key would be an exfiltration primitive with a config file for a delivery mechanism). A schema is vetted on the way **out** of the server as well as on the way in, because a catalog is a file someone else wrote. **Credentials**: pasted in the player, posted to the edit server, and stored under the config home beside `marketplaces.json` **restricted to the account that pasted them**, and re-restricted on every write, since `writeFileSync`'s mode is ignored for a path that already exists. What that restriction IS is per-platform, and decklight says which: `0600` on POSIX, where the mode is the whole of the protection; on Windows an explicit ACL, because a mode there is a number with no meaning and inheriting whatever the user profile hands out is not a decision decklight ever made. That ACL is set in three steps and the third is the one that matters: `/inheritance:r` drops what was inherited, `/grant:r` puts this account on, and then **every other principal is removed by name**, including `SYSTEM` and the Administrators group, since an administrator can take ownership whatever the DACL says. The usual one-line recipe stops after the first two and silently does nothing at all on a file whose entries are already explicit; a Windows CI run is the only thing that can tell the difference, which is why one gates this. Every sentence printed about this (the wizard's own destination line, the edit server's log, `report-bug`'s environment block) is derived from the file **read back**, never from what the write intended: a key with weak permissions is bad, and a key with weak permissions under a CLI reporting `0600` is worse. A machine with no ACLs to set (a FAT volume, a share) is not an error and is not silently accepted either: it is reported as inherited, in those words. Never logged, never in the response (redaction is **one** function, so a key cannot reach a debug panel two features later), never written into the deck, never read by `bundle`. **Never outside write mode**: the routes are `/deck/edit/*`, so `allowRemote` refuses them off-loopback unconditionally and `--no-trust` registers nothing resembling them: a credential prompt in a deck you were emailed is a phishing primitive, and the player gate refuses *before* it builds a single input. Install and configure are one flow with **three distinguishable answers**: `unreachable` (wait), `rejected` (fix the key, the answers, or the plugin's schema), and "no such engine" (add the marketplace, named, not one of the two failures). Nothing is stored on any failing path, and answers that fail the schema never cost a network call. Recorded narration needs none of this: a deck with a voice track plays from files with no engine installed.
|
|
650
1462
|
|
|
1463
|
+
### PRESENTING_BROWSER_VOICE · The browser's own voice, when no bridge answers
|
|
1464
|
+
|
|
1465
|
+
The live voice is synthesized by the local bridge (`decklight tts`, `PRESENTING_VOICE`). A deck opened with no bridge behind it (a static copy on decklight.io, a bundle sent by mail, a phone) used to have no live voice at all: the picker offered the built-in Gemini roster and the first sentence failed with *bridge unreachable*. Every browser that runs a deck already carries a speech synthesizer, the Web Speech API's `speechSynthesis`, and on a desktop it speaks with the voices the operating system has installed, the same ones the bridge's `say` and `sapi` engines reach. So when the bridge does not answer, the browser is the engine.
|
|
1466
|
+
|
|
1467
|
+
- **A fallback, never a choice over the bridge.** The bridge is asked first, always (`/ping`). Only when it does not answer, and the browser has `speechSynthesis` with at least one voice, does the live voice take the engine `browser`. A bridge that comes up later wins at the next probe. The engine is not offered in the engines view, because there is nothing to switch to: it is what is left when nothing else answers.
|
|
1468
|
+
- **The roster is the browser's.** `speechSynthesis.getVoices()`, read after `voiceschanged` (Chrome fills the list late, Safari at once; a list still empty after two seconds is no browser voice). Each voice is a row named by the browser's own name, with its language for the filter, and `this machine` or `online` as its flavor: a voice the browser says is not local (Chrome's Google voices, Edge's Natural ones) needs the network, and says so. Voices in the deck's language sort first, the browser's default voice first among them. A saved voice the browser does not have gives way to the first row, said out loud, exactly as a stale bridge voice does.
|
|
1469
|
+
- **Sentence by sentence, like the bridge.** The sentence pipeline does not change: each sentence of a beat is one utterance, captions follow it, the sentence, beat, slide and ⟨PAUSE⟩ holds are decklight's own, and builds advance when the last sentence of a beat ends. Speed is the utterance's `rate`. `⎵` pauses and resumes the utterance; navigation cancels it. Audio tags are taken out, as for every engine that cannot act on them, and there is no tone: the browser cannot be told *how* to say a sentence, so the tone row is not offered.
|
|
1470
|
+
- **Ending is watched, not trusted.** An utterance whose `end` event never fires (a Chrome voice dropped mid-sentence, an utterance collected before it finished) must not park the talk for ever. The engine also watches `speechSynthesis.speaking`, and a sentence that has stopped speaking counts as ended.
|
|
1471
|
+
- **It cannot be recorded.** The browser speaks straight to the speakers and gives no audio back. So the browser voice does live narration, captions and the ▶ preview, and nothing that needs the sound itself: the synthesized recorder, the video export and publishing refuse it with the command that starts a bridge, and the character's mouth rests, since there is no sound for lip-sync to read. A recorded track, or the bridge, is still how a deck ships a voice that sounds the same for everyone.
|
|
1472
|
+
- **What it sounds like is the viewer's.** The same deck speaks with different voices on different machines and browsers. That is the trade: a voice everywhere, against a voice the author picked. The engine bar names it (`browser · <voice>`), so nobody mistakes it for the bridge's.
|
|
1473
|
+
- **It fails loudly, like the bridge.** An utterance that errors stops the narration and says so (`🔇 the browser's voice failed`), and an utterance the browser refuses before any gesture (`not-allowed`) gets the same message as blocked audio: click the deck once, then V. The voice is the clock, here as with the bridge.
|
|
1474
|
+
|
|
1475
|
+
### FACE_LAYOUT · Your face, filmed with the recording
|
|
1476
|
+
|
|
1477
|
+
The your-voice recorder (`PRESENTING_VOICE`) can film your face while you read, so the talk plays back with you in it: in the character's medallion, full screen on the beats that ask for it, and in the exported video. It is real footage of the take, not a talking head made from a photo, so it needs no lip-sync engine and no GPU. A deck whose narrator is the 2D character instead (`narration.character.mode: "viseme"`) is placed by the same `data-face`, so it too can have a presenter-to-camera moment on the slides that ask for one.
|
|
1478
|
+
|
|
1479
|
+
- **Offered where there is a camera.** The plan card's **Camera** row (`📹 with my camera` · `voice only`) shows only when the browser's device list names a video input, which it does before any camera is allowed, so the row costs no permission prompt. It is off until turned on, then remembered for every deck with the microphone's choices; `decklight narrate --mic --camera` (`?camera`) turns it on for one visit. On, the camera opens on the card and its mirrored preview sits there, then beside REC in the recording strip while you read (the film itself is not mirrored). The camera is a stream of its own: the voice is still WebAudio PCM, and the film carries no sound.
|
|
1480
|
+
- **Cut where the audio is cut.** One MediaRecorder per beat (`src/core/facecam.js`), started with the beat's audio and stopped at the same `→`; per slide, the next beat's is started in the same tick, as the audio runs on. A retake, `⇧⌫`, `←` or `E` drops the film with the audio, since the clip is simply never used. A slide's clips are uploaded after its WAVs (`/deck/edit/narration/record?kind=face&seg=k`), then joined (`kind=face-join&segs=1,2,…`): `slide-NN-KK.mp4` beside each beat's `slide-NN-KK.wav`, and `slide-NN.mp4` beside the slide's (a one-beat slide has only that). The server makes every clip with ffmpeg (`tools/face-clip.mjs`): H.264, 25 fps, no sound, and **exactly as long as its WAV**, cut or held on its last frame, because MediaRecorder starts a few frames late and runs at a variable rate, and a tenth of a second per beat is a visible drift by the end of a slide. A part re-record (`--beats`) films the beats it redoes and joins them with the ones it keeps.
|
|
1481
|
+
- **Never at the cost of the take.** A camera refused, busy or absent is said on the Camera row in the camera's own words, and the take records the voice alone; the done card says the face was not filmed. With no ffmpeg the server answers 501 and keeps nothing of the face, and the done card says so. A slide one of whose beats has no clip (recorded before the camera was on) cannot be joined: its `slide-NN.mp4` is taken away rather than left to show a face saying something else, and the done card names the beats.
|
|
1482
|
+
- **The manifest says it.** A filmed slide's entry carries `face: true`. Recording it again without the camera removes its beat clips, and its slide clip when the manifest said it was filmed; a talking head `decklight lipsync` rendered there is not the recorder's to remove. `decklight lipsync --video` keeps a filmed slide's clip (`video filmed with the recording, kept`) instead of rendering a likeness over the real thing.
|
|
1483
|
+
- **Played in the medallion.** A take with a face switches the character to video mode, so it shows the moment the track plays. On a recorded track in video mode, a beat plays its own `slide-NN-KK.mp4` when there is one, held to the audio like any clip (`PRESENTING_VOICE`, Character); otherwise the slide's clip, then the bridge, as before. A filmed clip holds its last frame between beats rather than fading to the portrait under it.
|
|
1484
|
+
- **`data-face` places it**, slide by slide and beat by beat, on the `<section>`:
|
|
1485
|
+
- `corner` (the default, and what no attribute or an unreadable one means): the medallion, where the deck keeps the character (`narration.character.position`).
|
|
1486
|
+
- `top-left`, `top-right`, `bottom-left`, `bottom-right`: the medallion, in that corner for the beat. It takes no zoom.
|
|
1487
|
+
- `hide`: no face for the beat; the voice plays on.
|
|
1488
|
+
- `full`, optionally with a zoom from 1 to 4 (`full 1.4`, `full 1.4x`): the face fills the deck, cropped to cover it and zoomed on itself around `50% 40%`, and the slide steps aside the way solo does (`decklight-face-full` on the root, set only while the face is on screen). The 2D character is not cropped: it takes solo's treatment, the whole bust centred at the solo size (`--character-solo-size`), and the zoom scales it up to at most 96% of the stage's shorter side, so the face never leaves the frame. Its mouth, blink and sway carry on as in the corner.
|
|
1489
|
+
- `k:` starts a value at beat k, and each holds until the next: `data-face="hide 3:full 1.5 4:corner"` is hidden for beats 1 and 2, full screen at 1.5× for beat 3, the medallion from beat 4. Beats are counted as the recorder counts them (`beat 3 of 4`), the beats of the notes that have words.
|
|
1490
|
+
- It places the character in every mode, the 2D character as well as a filmed or rendered face: on a recorded track per beat file, on the live voice per sentence, at the beat the sentence is said on. A stopped narration, or the character turned off, is always the corner, so it never leaves a blank stage. With solo on, the 2D character already owns the stage on every slide and a slide's placement does nothing; a video face's full screen still takes the frame over solo. One reader, `tools/face-layout.mjs`, serves the deck and the video export, so the two cannot disagree.
|
|
1491
|
+
- **Placed from the panel, after the take.** The panel's **Where…** row (`PRESENTING_VOICE`), offered whenever somebody is on screen, is one view for whoever that is, your camera, the cartoon character or the talking head. A sketch of the slide takes a click on a corner; **on every slide**, *Fill the screen* (a switch: solo, a choice of this browser that saves nothing) and *Default corner…*; then **on slide N**, in the corner, full screen (its zoom from 1× to 4×, by preset or in halves, which `←` and `→` turn) or hidden. The stage previews the draft under the panel as it changes. *Save for slide N* writes one slide-wide `data-face` through `POST /deck/edit/slide/face` (`{ slides, face }`, one undo step however many slides; a value the reader below cannot read is refused); *Save for every filmed slide* (your camera) does it for each slide you filmed; *Use the default corner on this slide* removes the slide's own. *Default corner…* opens the same view for the deck: *Save as the default corner* writes `narration.character.position`, the corner of every slide without a place of its own. A slide placed beat by beat says so, since saving here replaces that with one placement, and with *Fill the screen* on the view says a slide's own place waits. Nothing is filmed again. It replaces *Place my face…* on your voice's card and the character's *Solo* row, which were this one question asked in two places.
|
|
1492
|
+
- **Keep part of the slide on screen.** On a `data-face="full"` slide, put `data-face-keep` on an element such as `<h2 data-face-keep>Part two</h2>`. Its subtree keeps its layout, builds and animations above the narrator. A design template can mark a slot wrapper the same way. Set `data-face-keep="none"` on the section to suppress all its keeps, including template defaults. To leave space above a centred 2D character, set `--character-solo-size` on the deck root (for example `.decklight { --character-solo-size: 58vh; }`). The bundle uses the same playback layout. PDF and PowerPoint use the placement at the final build and show the resting 2D character or a frame from the recorded clip.
|
|
1493
|
+
- **Previewed while editing.** Write mode shows a dimmed, closed-mouth 2D character or a same-size placeholder for filmed slides on the chosen track. The preview uses the current beat's placement and follows unsaved picker changes. Hidden beats show nothing. Full-screen placements have an outline and zoom label, showing the same kept elements as playback. The overlay is editor chrome and passes clicks through. **Who is on screen, while editing** in Settings (also in the palette) is on by default and remembered per deck in this browser. The preview is absent during playback when the live overlay takes over, and in fullscreen, presenting and exports.
|
|
1494
|
+
- **In the video.** `decklight video` composes the face into each narrated frame of a filmed slide, from the clip beside that frame's audio, as the slide's `data-face` places it for that beat: the round medallion bottom right, or in the corner the slide names (220 px, 28 px from the corner, as the deck draws it), the full-screen face at its zoom with any kept content above it, or nothing. It holds its last frame through the slide's breath. Only a slide the manifest says was filmed gets one. The 2D character is drawn into every narrated frame when it is who is on screen (`--character viseme`, which the export card sends, or the deck's own `narration.character.mode`), from the beat's viseme sidecar, where the slide's `data-face` places it for that beat: in a corner, full screen at its zoom, or, `hide`, not at all. `--no-face` leaves it out, and the export card sends it whenever the deck has nobody on screen (`PRESENTING_OUTPUT`: the video carries who is on screen in the deck).
|
|
1495
|
+
|
|
651
1496
|
### PRESENTING_FIT · Keeping a slide on the slide
|
|
652
1497
|
|
|
653
|
-
- **Overflow guardrail**: content that exceeds the slide flex-shrinks into a scroll box and reads as clipped. The engine warns (`console.warn`) and marks the section with a `data-overflow` attribute, on each slide activation, and for the whole deck in `?print`. The mark is **live, not latched**: layout is not final when a slide activates (a webfont resolves, an image decodes, a chart or terminal mounts), so the active slide is watched and the check re-runs whenever its content changes size or shape. It never waits on a frame: headless renders run out of frames once the page goes idle, and an unmeasured slide is indistinguishable from a clean one. The warning fires on the way in only, so one clipped slide is one line, not one per re-check. So authoring agents can assert `[data-overflow]` is absent in their headless verification (`decklight pdf` does this for a whole deck in one pass and names the offending slides). Overflow always goes **down**, never up: a slide centers its content with `safe center`, so content taller than the slide falls back to top alignment instead of overflowing symmetrically. Plain centering would push half the excess out of the top of the box, through the padding a pinned title reserves for itself, and render the first content element on top of the title.
|
|
1498
|
+
- **Overflow guardrail**: content that exceeds the slide flex-shrinks into a scroll box and reads as clipped. The engine warns (`console.warn`) and marks the section with a `data-overflow` attribute, on each slide activation, and for the whole deck in `?print`. The mark is **live, not latched**: layout is not final when a slide activates (a webfont resolves, an image decodes, a chart or terminal mounts), so the active slide is watched and the check re-runs whenever its content changes size or shape. It never waits on a frame: headless renders run out of frames once the page goes idle, and an unmeasured slide is indistinguishable from a clean one. The warning fires on the way in only, so one clipped slide is one line, not one per re-check. So authoring agents can assert `[data-overflow]` is absent in their headless verification (`decklight pdf` does this for a whole deck in one pass and names the offending slides). **Any box that hides or scrolls its overflow can clip**, not only the slide (#1183): a design-system slot is often a plain block with `overflow: hidden`, and a diagram taller than the room it is given is cut by the slot while the slide's own height never shows it. So every box on the slide is measured, and the mark names what is cut and by how much: `data-overflow="a diagram"` (or a list, a code block, an image, a paragraph; `content` when nothing has a name) and `data-overflow-by="77"` in deck px. `decklight check`, `decklight pdf` (`⚠ slide 4 overflows: a diagram runs 77px past what the slide shows`), Check deck and write mode's clipped badge all say the same thing. **A template slot's one diagram or picture takes the room it is given**: an `<svg>`, `<img>` or `<picture>` that is a slot's only block gets `max-height: 100%` of the slot and scales into it, keeping its aspect ratio, so a title that wraps to a second line shrinks the diagram instead of cutting off its bottom. A slot with no definite height is left as it was, and content that still cannot fit is flagged as above. **So does a slide's main visual in the author's own wrapper, or alone in a split column**: an `<svg>`, `<img>` or `<picture>` that is a block of the slide, or sits at the end of a chain of wrappers (a `<div>`, a `<figure>`) each holding nothing else, or is the only thing in a `data-layout="split"` column, is measured when the slide is clipped and shrunk, keeping its aspect ratio, to the largest size at which nothing is cut (`data-fit-scale` on it says by how much). A slide that fits is never touched, one that still cannot fit at 30% of the size is left as it was and flagged, and a picture that shares its box with words or another block is never resized: its room is theirs too, so it is reported instead. Overflow always goes **down**, never up: a slide centers its content with `safe center`, so content taller than the slide falls back to top alignment instead of overflowing symmetrically. Plain centering would push half the excess out of the top of the box, through the padding a pinned title reserves for itself, and render the first content element on top of the title.
|
|
1499
|
+
- **Invisible in print**: once every build is complete and the deck's own CSS animations are finished (ELEMENT_ANIMATIONS), `?print` marks a slide on which content still does not show: an element with words or a picture at computed `opacity: 0` (multiplied down its ancestors) or `visibility: hidden`, as `data-invisible="a box “Batch” (opacity 0)"` naming the first and `data-invisible-more` counting the rest (#1184). Not counted: what is hidden on purpose (`display: none`, `hidden`, `aria-hidden="true"`, a build still to come, the notes and callout asides, the steps strip) and what the engine makes (a slide background, a travel token, a code walk's callouts, a terminal's insides); inside a diagram only the diagram itself counts. `data-invisible-ok` on an element says it is meant. `decklight check` reports a marked slide as `invisible-in-print`, a **warning** naming the element, and `decklight pdf` names it on stderr: the PDF would have a hole there. The Check deck… panel (PRESENTING_EDITING) lists it in the same words, judged on the print view in a hidden frame rather than on the live deck, whose entrances have not run yet. Usually it is an entrance written as keyframes that does not end visible; the fix is a build (BUILDS).
|
|
654
1500
|
- **Pinned titles**: `pinTitles: true | false | <px>` keeps slide titles at one vertical position instead of drifting with content height. **On by default** (`true`); `pinTitles: false` restores the drift-with-content centering deck-wide. `true` pins at **99px** from the stage top (design coordinates, the natural title position of the course's "The Single-Agent Limit" diagram slide, the chosen reference); a number pins at that Y. The leading `h1`/`h2` of each **pinnable** section is absolutely positioned at the pin Y; the section reserves `pin Y + measured title height + 18px` of top padding so the remaining content centers below. Pinnable = has a leading `h1`/`h2` AND content beyond it (`ul, ol, svg, pre, table, .terminal, img, .columns` outside the notes); title cards and quote/statement slides stay centered. Per-slide: `data-pin` forces a pin (even when the config is off), `data-pin="none"` opts out, `data-pin="<px>"` overrides the Y. Titles are re-measured on `sync()` and when webfonts finish loading; print uses the same layout. A detected **subtitle** (DECK_ANATOMY) joins the pinned header block: absolutely positioned directly beneath the title (6px gap) and included in the reserved padding, so content centers below title + subtitle.
|
|
655
1501
|
- **Terminal footprint**: a terminal's screen area has a stable size: a **16:9 aspect floor** (width-driven) clamped by the `data-rows` cap as the max, so the box arrives full-size before anything plays and never resizes as steps stream in (output beyond the box scrolls). Real print expands casts fully.
|
|
656
|
-
- `Decklight.init(config)` options: `transition`, `hash` (default true), `controls` (default true: prev/next chevrons; the progress bar is a palette toggle, above), `slideNumber` (default `false | 'n' | 'n/N'`), `width/height` design resolution (default 1280×720, scaled to fit), `themes` (array of theme names for the picker/cycle; default: all shipped themes), `markedThemes` (the marketplace themes the deck marks, as `name@marketplace`) and `themeSources` (where each of those marketplaces comes from, THEME_DISTRIBUTION), `playlist` (multi-deck navigation, above), `pinTitles` (pinned titles, above), `concepts` (diagram concept-color pinning, SVG_DIAGRAMS), `logo` (brand mark, above).
|
|
1502
|
+
- `Decklight.init(config)` options: `transition`, `hash` (default true), `controls` (default true: prev/next chevrons; the progress bar is a palette toggle, above), `slideNumber` (default `false | 'n' | 'n/N'`), `width/height` design resolution (default 1280×720, scaled to fit), `themes` (array of theme names for the picker/cycle; default: all shipped themes), `markedThemes` (the marketplace themes the deck marks, as `name@marketplace`) and `themeSources` (where each of those marketplaces comes from, THEME_DISTRIBUTION), `playlist` (multi-deck navigation, above), `pinTitles` (pinned titles, above), `concepts` (diagram concept-color pinning, SVG_DIAGRAMS), `roleConcepts` (a conversation's roles as concepts, DECK_ANATOMY), `logo` (brand mark, above).
|
|
657
1503
|
|
|
658
1504
|
### PRESENTING_OUTPUT · Print, export and hand-over
|
|
659
1505
|
|
|
660
|
-
- **Print/PDF**: `?print` renders all slides sequentially, every build complete, terminal casts fully expanded, one slide per page (`@media print` CSS). No JS needed after layout. Background media (DECK_ANATOMY) prints as a still: no `<video>` element is ever created in print: the slide's `data-background-poster` renders as the background image instead. Two handout variants restructure the same fully-built render onto portrait pages (one `.print-page` per sheet): `?print=handout` groups slides three to a page, each scaled slide beside a column of ruled note-taking lines (page count = ⌈N/3⌉); `?print=notes` gives one page per slide with that slide's speaker notes rendered underneath. Slides without notes keep their page with an empty notes block. Both are palette rows too (**Print with notes**, **Print handout**), beside the plain print view, so a presenter reaches them without knowing the query string. **Page count equals slide count** (⌈N/3⌉ for handout): the page box has no margin, so the document has none either: the UA's default body margin would push the last slide's final pixels past the last page box and emit a blank final sheet. **`decklight pdf <deck.html>`** writes that render to a file without a print dialog: headless Chrome over the deck's own `?print`, one slide per 1280×720 page (960×540 pt), `-o` for the path, `--theme` to export in another theme (it rides `?theme=`), `--wait` for decks that need longer to settle. Slides the overflow guardrail flagged are named on stderr by slide number: the PDF is still written, because a clipped slide is worth knowing about, not worth refusing. No Chrome, or no file produced, exits non-zero rather than leaving a silent empty PDF. In write mode each of the three PDFs is a palette row of its own (**Export to PDF…**, **Export a PDF with notes…**, **Export a PDF handout…**), beside **Export to PowerPoint…** and named apart from the *print view* rows above, which open the same pages in a tab rather than writing a file anybody can be sent. Chrome is **awaited, not blocking** (`runAsync`): not for the deadlock reason `pptx` has, but because the edit server runs `pdfMain` in its own process for those rows, and a synchronous child would freeze live reload, the SSE stream and the page itself for as long as Chrome takes to print.
|
|
661
|
-
- **PowerPoint export**: **`decklight pptx <deck.html>`** writes a `.pptx` in which every slide is a picture (rendered at 1280×720 with its builds complete, through the deck's own served page so relative assets resolve) and every speaker note is a real note. It is **lossy by design** and `NON_GOALS` says why: the round-trip is not a goal, and the audience for the command is the people around a decklight user who ask for "the file". `-o` for the path, `--theme` to export in another, `--wait` per slide. **Hidden slides are not in the file** (`HIDDEN_SLIDES`), the same rule `pdf`, `video` and `voiceover` keep, and not merely as a preference: a deep link onto a hidden slide lands on its nearest shown neighbour, so exporting one wrote that neighbour's picture a second time under the hidden slide's notes. The numbering closes up in the exported file; a deck with nothing shown is a refusal rather than an empty one. The deck is served from the **current directory** when it lives under it (so a deck in a subdirectory still reaches the `dist/` and `themes/` at the top of its project) and from **its own directory** otherwise: a deck elsewhere is served, not refused. In write mode it is also a palette row, **Export to PowerPoint…**, because a presenter who needs the file needs it from where they are: the row asks the edit server (`POST /deck/edit/export`, `{ kind, theme | gen }`: `pptx`, `pdf`, `pdf-notes`, `pdf-handout`, `video`, `bundle`), which runs the same command in the same process: never an edit, so it takes no undo entry and leaves the deck byte-for-byte as it was. **Every export is in the theme on screen** (#547): the render is a fresh browser that cannot see the pick saved in this one, so the row names it (`theme`, a theme name and nothing else) and the server passes it on as `--theme`. A theme that lives only in this browser (a saved custom theme, an unsaved ⌃T roll) has no name a fresh render would know, so it goes as its **tokens** (`gen`: base64url JSON `{ name, tokens }`, at most 16 KB, the form the picker's previews already load) and the server passes that on as `--gen`, which each render tool puts on the deck URL as `?gen=`; the runtime vets every token before it becomes CSS (`safeTokens`). `video`, `pptx` and `pdf` take `--gen` from the command line too, and refuse it alongside `--theme`: one theme per render. **One export at a time**, whatever the kind (a second is refused, not queued): two exports at once is still two browsers on one machine, and the second would only be slower. A machine with no Chrome gets a sentence rather than a dead edit server, because the export must not take the session down with it. An export is tens of seconds, so the server **says where it is**: each slide is announced on the `export` channel of the same SSE stream the agent chip rides, and the deck rewrites its one progress row from it: one row that keeps telling the truth, never a toast per slide. **Bundle into one file…** is the row for the file most often sent: `decklight bundle`, run in the edit server, writing `<deck>-standalone.html` beside the deck: the CLI's own name, so the row and the command write the same file. It **carries every marked theme** and **opens on the theme on screen** (`--theme`, written into the bundle's configuration block), and because a bundle *carries* its themes where a render only shows one, it asks first about a theme on screen the deck does not mark: a marketplace theme as every row does, and a **shipped** one too, unless it is the deck's configured theme (every bundle carries that one): `409 { unmarked }`, the row arms, the second press marks it and carries on (THEME_DISTRIBUTION). It launches no browser, so it needs no Chrome; it refuses a generated theme on screen with a sentence, because a bundle embeds files and a roll is tokens in one browser (save it with ⌃⇧T and `theme add` it); and a deck that is already one file is told so rather than bundled again. On a deck with a recorded track the row first asks what the file carries of it, on a card that gives each answer **the size the file would come out at**: leave it beside the deck, as recorded, AAC, Opus. The figures come from `GET /deck/edit/export/estimate` (`{ base, audio }`): the bundle built in memory without its audio and without writing anything, in the theme on screen (in the deck's own when that one cannot be bundled yet), plus what each way adds. `original` is exact, and a codec is estimated from each file's duration (ffprobe) at its bitrate and container overhead, never above the file itself. A codec this machine's ffmpeg lacks is shown dimmed with the reason rather than hidden. The answer is remembered per browser and sent as the export's `audio` (`--audio` and its value); a deck with no recorded audio bundles straight away.
|
|
662
|
-
- **Video export**: `decklight video deck.html -o deck.mp4` (tools/video.mjs) renders the deck to one narrated mp4: a full-resolution still per FRAME (each a one-shot headless Chrome against `#/<n>/<step>`, the shot.mjs mechanism), muxed with the audio into a single file. A **narrated** slide is one still, fully built, held for the duration of its audio plus a 0.4s tail (plus the slide's hold: the built-in 1s, or whatever `data-narration-pause="2"` asks for instead), so the mp4 breathes where the live deck does. (`video.mjs` reads sections, not the boot call, so the deck-wide `narration.slidePause` tier is not seen there; the attribute is.) (That attribute is the narrated counterpart of `data-video-hold`, which paces a *silent* slide: a slide with no narration has no narration to pause after.) A **silent** slide BUILDS as it goes: one still per build step, then the finished slide. How far each slide builds is asked of the deck itself in one extra load: the grouping is the runtime's (`src/core/builds.js`), and a second counter written in Node would be a copy that drifts; a deck that does not answer falls back to one fully-built still per slide, and every slide's final frame is captured at the oversized `#/<n>/999` regardless, so a miscount can shorten a build-up but can never lose the finished slide. Both render tools (video and `tools/shot.mjs`) capture the deck **served over `http://127.0.0.1` under the `PRESENT` CSP**, the same loopback core `--no-trust` uses (`serveForRender`), never over `file://` with `--allow-file-access-from-files`: that flag lets an unvetted deck's own JavaScript read any local file it can name and exfiltrate it, and these tools run on decks nobody has audited (a repro deck off an issue, or one screenshot before it is presented). As with `--no-trust`, the served root is the current directory and the deck must sit inside it, so its relative assets resolve as URLs and a read cannot escape the served tree. **A render is declared, not inferred** (#548): every frame of a video, every slide of the pptx export and a plain `shot` (one with no `--drive` or `--keys`) loads the deck with **`?capture`**, which says this load is a picture, not a live session, so nothing that exists to talk to a person in the room is photographed into it: no toast (still written to the message log), no voice-over hint, no welcome card or tip, no chevrons. Each frame is a fresh one-shot load that has never used the voice, so before this the voice-over hint was burned into every frame of a video of a deck that carried a track. It is its own flag rather than `?embedded` (the picker previews' mode, which brings their postMessage and preference rules with it) or `?print`, which reveals every build and changes the layout. A driven `shot` stays a live load, because the toast a feature raises may be the very thing the screenshot is for. **A track is checked against the deck before a frame is rendered** (#536): each manifest slide carries the hash of the notes it was voiced from, the exporter recomputes it from the deck's current notes (`tools/narration-manifest.mjs`, the same extraction and key `voiceover` writes with, the pre-`model` form of the hash accepted as `voiceover` accepts it) for the slides being rendered, names every slide whose audio no longer matches: `slide 4: narration was recorded from different notes`, and then **re-voices them, when it can** (#553): a track whose manifest header names an engine was machine-voiced, and when that engine is available here (its binary and model, its key, its project) the stale slides (only those, ⟨CLICK⟩ beats and all) are voiced again in the track's own engine, model, voice and style, into its own format and file names, by a range-scoped call into the synthesis core every producer of a track shares; every other slide is untouched, and the check runs again on what that wrote. Before synthesizing it says how many clips it will ask for and from which engine (on a cloud engine that is money; any sentence already voiced comes from the clip cache). What cannot be re-voiced (a track with no engine, such as a take in somebody's own voice, or an engine this machine cannot run, named with what is missing: `it was voiced by elevenlabs, which needs $ELEVENLABS_API_KEY — export it…`) is refused with the way out (`re-record those slides (V → Record this deck… → slides a-b) or pass --allow-stale`); `--allow-stale` renders it and still prints the list, and `--no-revoice` leaves even a machine-voiced track's stale slides to that refusal. Entries with no hash (a take in your own voice) are noted, not refused. `--voiceover` refreshes the track in its own voice and format too, since `voiceover` reads the track's header. The export card carries the same check: a stale track is offered marked `recorded from older notes on N slides` (or, machine-voiced, `N slides from older notes, re-voiced first`); picking it says so on the export's own line, and the render is told the mark was seen. Narration resolves `--narration <dir>` → `<deckdir>/voiceover/manifest.json` (the artifact tools/voiceover.mjs writes) → a fully silent deck; slides without narration hold `--hold` seconds (default 5, per-slide override `data-video-hold="8"` on the section) over a silent audio segment (anullsrc), so the concatenated audio track stays continuous. **Every frame of a silent slide holds that long, builds included**, so a build lands at the pace the rest of the deck moves at and a deck gets longer the more it builds; `--build-hold <s>` paces the build-up frames alone, for builds quicker (or slower) than the slides around them. Splitting the hold across a slide's frames instead, fixing the deck's length, reads far too fast: the more a slide has to say, the less time each beat of it gets, which is backwards. Flags: `-o/--out`, `--narration`, `--no-narration` (silent even with a `voiceover/` beside the deck), `--format mp4|mov|webm` (H.264/AAC in mp4 and mov, VP9/Opus in webm; read off `-o`'s extension when that names one, and refused when a name and the flag disagree), `--quality draft|standard|high` (encoder quality and audio bitrate; `standard` mp4 is what the command always wrote), `--subtitles none|embed|file` (the narration's words, the script `voiceover` wrote beside each clip, else the deck's notes for that beat, split into sentences exactly as the live captions split them and timed against each beat's real audio, shared out by length within it, with no caption over the breath after a slide; `embed` adds a track the player can turn on, `mov_text` in mp4 and mov and WebVTT in webm, and `file` writes a `.srt` beside the video, `.vtt` for webm; a render with nothing spoken writes none and says so; the vocabulary is `tools/video-options.mjs`, read by the flags, the edit server and the export card alike), `--size 1280x720`, `--fps 30`, `--hold`, `--build-hold`, `--theme <name>` or `--gen <b64url>` (applied as `?theme=` / `?gen=` on the deck URL, as `pdf`, `pptx` and `shot` do too, so it reaches an inline or added theme block as well as a `themes/<name>.css` file: it used to inject a link to that file, which on a deck of inline blocks pointed at nothing), `--slides a-b`, `--voiceover` (runs the voiceover batch first, over the same `--slides` range, so rendering five slides of a forty-slide deck synthesises five: `tools/voiceover.mjs --slides a-b` voices only that range and leaves every other slide's files and manifest entry as they were, the promise `decklight narrate --mic --slides` makes for your own voice). A range renders to `<deck>.slides-a-b.mp4` (`-o` still wins), so re-rendering five slides never overwrites the whole talk. In write mode it is also a palette row, **Export a video…**, which asks **which slides** before anything renders: all, this slide, this chapter (`data-module`), from here to the end, up to here, or a typed range (`src/core/ranges.js`, the same picker the recorders use). And **which voice** it carries, on the same card, alongside its **format**, **quality** and **subtitles** (the flags below), four rows above the ranges that ↑ reaches and ← → turn, the last three remembered per browser for the next export. The voice row offers every folder beside the deck `decklight video` can render from (one with a manifest; your own takes leave none), **the live voice** the deck speaks with in `V` (the engine and model the bridge answered with, the voice and tone picked), or **silence** by name. It starts on the voice already chosen (the live voice when `V` is set to it, the track `V` plays, the `voiceover/` a render would have found on its own, else silence), and never on a paid engine nobody picked. The row asks the edit server (`POST /deck/edit/export`, `{ kind: 'video', theme | gen, slides, format, quality, subtitles }` plus one of `narration`, `synthesize: { engine, model, voice, style, dir }` or `silent`), which checks every field before anything runs, then runs `decklight narrate` (when synthesizing) and `decklight video` as **child processes**, not through their `main`s as `pptx` and `pdf` are: those `main`s exit the process on every refusal, which would take the session down. A synthesized voice is written exactly as `decklight narrate -o` writes one (per slide and per ⟨CLICK⟩ beat, through the shared clip cache, with the engine settings the bridge itself reads (the environment, then `tts.json` for that engine), so a sentence already heard live costs nothing), into `voices/<voice>`, or refreshed in place where this engine and voice recorded before, so a second export re-pays nothing for slides that did not change. It **never lands on a take somebody recorded**: a folder that already holds audio is refreshed only when its manifest names this engine and voice, and the export refuses otherwise. The two phases report separately (`voicing slide n of N`, then the render's slides), read from the tools' own output (`voiceover` ends its plan line `· N to voice`), and a refusal is the tool's own sentence. Needs ffmpeg + ffprobe: missing tools are a hard, friendly error naming what to install (the voiceover encoder-detection policy). Honest MVP limits: frames are stills, so the **character overlay appears but frozen** and terminals render fully expanded rather than typing (animated capture needs a CDP screencast, a named Node ≥22 follow-up), and a build **cuts rather than animating** (the frame is a still of each step, not a capture of the transition between them). A **narrated** slide builds too where its notes say so: `⟨CLICK⟩` segments the speaker notes, `tools/voiceover.mjs` synthesises one audio file per segment (same characters, so the same cost: the per-slide `slide-NN.m4a` is *concatenated* from them, and every existing consumer of it is untouched), and segment k narrates build step k for that segment's ffprobe'd duration. This is the recorded mirror of a rule that already ships: `src/core/narration.js` speaks live narration the same way, and captions, rehearse mode and the notes editor share the segmentation. A marker count that does not match the build count **warns naming the slide and renders the old way**, a wrong sync baked into an mp4 is worse than no sync, and a manifest written before this renders exactly as it did.
|
|
663
|
-
|
|
1506
|
+
- **Print/PDF**: `?print` renders all slides sequentially, every build complete, terminal casts fully expanded, one slide per page (`@media print` CSS). No JS needed after layout. Background media (DECK_ANATOMY) prints as a still: no `<video>` element is ever created in print: the slide's `data-background-poster` renders as the background image instead. Two handout variants restructure the same fully-built render onto portrait pages (one `.print-page` per sheet): `?print=handout` groups slides three to a page, each scaled slide beside a column of ruled note-taking lines (page count = ⌈N/3⌉); `?print=notes` gives one page per slide with that slide's speaker notes rendered underneath. Slides without notes keep their page with an empty notes block. Both are palette rows too (**Print with notes**, **Print handout**), beside the plain print view, so a presenter reaches them without knowing the query string. **Page count equals slide count** (⌈N/3⌉ for handout): the page box has no margin, so the document has none either: the UA's default body margin would push the last slide's final pixels past the last page box and emit a blank final sheet. **`decklight pdf <deck.html>`** writes that render to a file without a print dialog: headless Chrome over the deck's own `?print`, one slide per 1280×720 page (960×540 pt), `-o` for the path, `--theme` to export in another theme (it rides `?theme=`), `--wait` for decks that need longer to settle. Slides the overflow guardrail flagged are named on stderr by slide number: the PDF is still written, because a clipped slide is worth knowing about, not worth refusing. So are slides that print with a hole (PRESENTING_FIT, `invisible-in-print`): a deck's own CSS animations are finished before the page is printed (ELEMENT_ANIMATIONS), because Chrome lays the page out again for print and a running animation's value does not survive it, so an entrance written as keyframes prints arrived; what still does not show is named. No Chrome, or no file produced, exits non-zero rather than leaving a silent empty PDF. A deck whose file name starts with a dot is refused before Chrome starts, with the reason: the render server never serves a dotfile (`PRESENTING_MODES`), and Chrome would print its refusal as one blank page. A render that finds no slides in a file that has them says so, and the page count is held to the file's. In write mode each of the three PDFs is a palette row of its own (**Export to PDF…**, **Export a PDF with notes…**, **Export a PDF handout…**), beside **Export to PowerPoint…** and named apart from the *print view* rows above, which open the same pages in a tab rather than writing a file anybody can be sent. Chrome is **awaited, not blocking** (`runAsync`): not for the deadlock reason `pptx` has, but because the edit server runs `pdfMain` in its own process for those rows, and a synchronous child would freeze live reload, the SSE stream and the page itself for as long as Chrome takes to print.
|
|
1507
|
+
- **PowerPoint export**: **`decklight pptx <deck.html>`** writes a `.pptx` in which every slide is a picture (rendered at 1280×720 with its builds complete, through the deck's own served page so relative assets resolve, loaded with `?capture=print` so each picture is the slide as it prints: a stepped code block whole, CODE_AND_MATH) and every speaker note is a real note. It is **lossy by design** and `NON_GOALS` says why: the round-trip is not a goal, and the audience for the command is the people around a decklight user who ask for "the file". `-o` for the path, `--theme` to export in another, `--wait` per slide. **Hidden slides are not in the file** (`HIDDEN_SLIDES`), the same rule `pdf`, `video` and `voiceover` keep, and not merely as a preference: a deep link onto a hidden slide lands on its nearest shown neighbour, so exporting one wrote that neighbour's picture a second time under the hidden slide's notes. The numbering closes up in the exported file; a deck with nothing shown is a refusal rather than an empty one. The deck is served from the **current directory** when it lives under it (so a deck in a subdirectory still reaches the `dist/` and `themes/` at the top of its project) and from **its own directory** otherwise: a deck elsewhere is served, not refused. In write mode it is also a palette row, **Export to PowerPoint…**, because a presenter who needs the file needs it from where they are: the row asks the edit server (`POST /deck/edit/export`, `{ kind, theme | gen }`: `pptx`, `pdf`, `pdf-notes`, `pdf-handout`, `video`, `bundle`), which runs the same command in the same process: never an edit, so it takes no undo entry and leaves the deck byte-for-byte as it was. **Every export is in the theme on screen** (#547): the render is a fresh browser that cannot see the pick saved in this one, so the row names it (`theme`, a theme name and nothing else) and the server passes it on as `--theme`. A theme that lives only in this browser (a saved custom theme, an unsaved ⌃T roll) has no name a fresh render would know, so it goes as its **tokens** (`gen`: base64url JSON `{ name, tokens }`, at most 16 KB, the form the picker's previews already load) and the server passes that on as `--gen`, which each render tool puts on the deck URL as `?gen=`; the runtime vets every token before it becomes CSS (`safeTokens`). `video`, `pptx` and `pdf` take `--gen` from the command line too, and refuse it alongside `--theme`: one theme per render. **One export at a time**, whatever the kind (a second is refused, not queued): two exports at once is still two browsers on one machine, and the second would only be slower. A machine with no Chrome gets a sentence rather than a dead edit server, because the export must not take the session down with it. An export is tens of seconds, so the server **says where it is**: each slide is announced on the `export` channel of the same SSE stream the agent chip rides, and the deck rewrites its one progress row from it: one row that keeps telling the truth, never a toast per slide. **Every long job can be stopped without stopping the server**: while an export (but a bundle, which is seconds), an agent's edit, a script rewrite or an agent review runs, the palette's first row is **Stop …**, naming it, and the progress row says so. **An agent is stopped where it is watched** too: the agent's chip at the bottom of the deck and its running row in the agent panel each carry a **Stop** button, the same stop; what it had written by then stays, one undo away. It asks the edit server (`POST /deck/edit/export/stop`, `POST /deck/edit/agent/stop`; both answer while the deck is locked, because a stop writes nothing), which kills the job's children (Chrome, ffmpeg, the agent CLI: SIGTERM, then SIGKILL a few seconds later) and answers at once; the job's own reply is what says it stopped (`{ stopped: true }`, and `stopped` on its `done` event). A stopped export leaves **no file**, not even a half-written one, and no scratch frames (`decklight video` answers SIGTERM by killing its own Chrome and ffmpeg and clearing up); a voice it had already synthesized stays in its folder, where the next export finds it done. A stopped rewrite or review writes nothing; a stopped agent edit keeps whatever it had written, one undo away. `/deck/ping` carries what is running (`exportBusy`, `enhanceBusy`, `reviewBusy`, beside `agentBusy`), so a page that loads mid-job can still stop it. **Bundle into one file…** is the row for the file most often sent: `decklight bundle`, run in the edit server, writing `<deck>-standalone.html` beside the deck: the CLI's own name, so the row and the command write the same file. **A deck in chapters is asked first what goes in**: the whole deck, then each `data-module` chapter (DECK_ANATOMY) with its number, its slides and how many, the card opening on the chapter of the slide on screen (on the whole deck before the first one); a deck without chapters is not asked. A chapter is `--module`, sent as the export's `module` (and the estimate's `?module=`) by its **number**, never its title: `--module` takes a full title too, but the number is the one thing the card and the bundler count the same way, and anything but a whole number from 1 is refused before the bundler runs. It bundles exactly what the command does, narration renumbered, into the command's own name, `<deck>-<chapter>.html`, which never overwrites the whole deck's. The export answers with the notes the command prints after the file (`notes`), and the row repeats the two that say what was handed over: which chapter, as slides of the deck and of the bundle, and whether the narration audio stays beside the deck. A chapter the bundler refuses (none by that number, or a deck with none) is its sentence on the row, and no file. It **carries every marked theme** and **opens on the theme on screen** (`--theme`, written into the bundle's configuration block), and because a bundle *carries* its themes where a render only shows one, it asks first about a theme on screen the deck does not mark: a marketplace theme as every row does, and a **shipped** one too, unless it is the deck's configured theme (every bundle carries that one): `409 { unmarked }`, the row arms, the second press marks it and carries on (THEME_DISTRIBUTION). It launches no browser, so it needs no Chrome; it refuses a generated theme on screen with a sentence, because a bundle embeds files and a roll is tokens in one browser (save it with ⌃⇧T and `theme add` it); and a deck that is already one file is told so rather than bundled again. On a deck with a recorded track the row first asks what the file carries of it, on a card that gives each answer **the size the file would come out at**: leave it beside the deck, as recorded, AAC, Opus. The figures come from `GET /deck/edit/export/estimate` (`{ base, audio }`): the bundle built in memory without its audio and without writing anything, in the theme on screen (in the deck's own when that one cannot be bundled yet), plus what each way adds. `original` is exact, and a codec is estimated from each file's duration (ffprobe) at its bitrate and container overhead, never above the file itself. A codec this machine's ffmpeg lacks is shown dimmed with the reason rather than hidden. The answer is remembered per browser and sent as the export's `audio` (`--audio` and its value); a deck with no recorded audio bundles straight away.
|
|
1508
|
+
- **Video export**: `decklight video deck.html -o deck.mp4` (tools/video.mjs) renders the deck to one narrated mp4: a full-resolution picture per frame from headless Chrome, muxed with the audio into a single file. A narration filmed with your face shows it in those frames, placed as each slide says (`FACE_LAYOUT`; `--no-face` leaves it out). A **narrated** slide is one still, fully built, held for the duration of its audio plus a 0.4s tail (plus the slide's hold: the built-in 1s, or whatever `data-narration-pause="2"` asks for instead), so the mp4 breathes where the live deck does. (`video.mjs` reads sections, not the boot call, so the deck-wide `narration.slidePause` tier is not seen there; the attribute is.) (That attribute is the narrated counterpart of `data-video-hold`, which paces a *silent* slide: a slide with no narration has no narration to pause after.) A **silent** slide BUILDS as it goes: one still per build step, then the finished slide. How far each slide builds is asked of the deck itself in one extra load: the grouping is the runtime's (`src/core/builds.js`), and a second counter written in Node would be a copy that drifts; a deck that does not answer falls back to one fully-built still per slide, and every slide's final frame is captured at the oversized `#/<n>/999` regardless, so a miscount can shorten a build-up but can never lose the finished slide. Both render tools (video and `tools/shot.mjs`) capture the deck **served over `http://127.0.0.1` under the `PRESENT` CSP**, the same loopback core `--no-trust` uses (`serveForRender`), never over `file://` with `--allow-file-access-from-files`: that flag lets an unvetted deck's own JavaScript read any local file it can name and exfiltrate it, and these tools run on decks nobody has audited (a repro deck off an issue, or one screenshot before it is presented). As with `--no-trust`, the served root is the current directory and the deck must sit inside it, so its relative assets resolve as URLs and a read cannot escape the served tree. **A render is declared, not inferred** (#548): every frame of a video, every slide of the pptx export and a plain `shot` (one with no `--drive` or `--keys`) loads the deck with **`?capture`**, which says this load is a picture, not a live session, so nothing that exists to talk to a person in the room is photographed into it: no toast (still written to the message log), no voice-over hint, no welcome card or tip, no chevrons. It is its own flag rather than `?embedded` (the picker previews' mode, which brings their postMessage and preference rules with it) or `?print`, which reveals every build and changes the layout. A driven `shot` stays a live load, because the toast a feature raises may be the very thing the screenshot is for. **A track is checked against the deck before a frame is rendered** (#536): each manifest slide carries the hash of the notes it was voiced from, the exporter recomputes it from the deck's current notes (`tools/narration-manifest.mjs`, the same extraction and key `voiceover` writes with, the pre-`model` form of the hash accepted as `voiceover` accepts it) for the slides being rendered, names every slide whose audio no longer matches: `slide 4: narration was recorded from different notes`, and then **re-voices them, when it can** (#553): a track whose manifest header names an engine was machine-voiced, and when that engine is available here (its binary and model, its key, its project) the stale slides (only those, ⟨CLICK⟩ beats and all) are voiced again in the track's own engine, model, voice and style, into its own format and file names, by a range-scoped call into the synthesis core every producer of a track shares; every other slide is untouched, and the check runs again on what that wrote. Before synthesizing it says how many clips it will ask for and from which engine (on a cloud engine that is money; any sentence already voiced comes from the clip cache). What cannot be re-voiced (a track with no engine, such as a take in somebody's own voice, or an engine this machine cannot run, named with what is missing: `it was voiced by elevenlabs, which needs $ELEVENLABS_API_KEY — export it…`) is refused with the way out (`re-voice them from the deck (V, then ⋯ on <track>) or pass --allow-stale`, *re-record* for a take in your own voice); `--allow-stale` renders it and still prints the list, and `--no-revoice` leaves even a machine-voiced track's stale slides to that refusal. Entries with no hash (a take in your own voice) are noted, not refused. `--voiceover` refreshes the track in its own voice and format too, since `voiceover` reads the track's header. The export card carries the same check: under its Narrator line a stale track is marked `recorded from older notes on N slides` (or, machine-voiced, `N slides from older notes are regenerated first, in the same voice`); exporting it says so on the export's own line, and the render is told the mark was seen. Narration resolves `--narration <dir>` → `<deckdir>/voiceover/manifest.json` (the artifact tools/voiceover.mjs writes) → a fully silent deck. A `--narration` folder with no manifest is **read off the disk** (`folderNarration`): its `slide-NN` files and their `slide-NN-KK` beats are the slides, which is what your own voice (`narrate --mic`) leaves. With no notes hash it is counted as recorded by hand and never called stale, and the export card takes it as it takes a manifest track; a folder of beats with no whole-slide file renders nothing, and the card says the video will be silent; slides without narration hold `--hold` seconds (default 5, per-slide override `data-video-hold="8"` on the section) over a silent audio segment (anullsrc), so the concatenated audio track stays continuous. **Every frame of a silent slide holds that long, builds included**, so a build lands at the pace the rest of the deck moves at and a deck gets longer the more it builds; `--build-hold <s>` paces the build-up frames alone, for builds quicker (or slower) than the slides around them. Splitting the hold across a slide's frames instead, fixing the deck's length, reads far too fast: the more a slide has to say, the less time each beat of it gets, which is backwards. Flags: `-o/--out`, `--narration`, `--no-narration` (silent even with a `voiceover/` beside the deck), `--format mp4|mov|webm` (H.264/AAC in mp4 and mov, VP9/Opus in webm; read off `-o`'s extension when that names one, and refused when a name and the flag disagree), `--quality draft|standard|high` (encoder quality and audio bitrate; `standard` mp4 is what the command always wrote), `--subtitles none|embed|file` (the narration's words, the script `voiceover` wrote beside each clip, else the deck's notes for that beat, split into sentences exactly as the live captions split them and timed against each beat's real audio, shared out by length within it, with no caption over the breath after a slide; `embed` adds a track the player can turn on, `mov_text` in mp4 and mov and WebVTT in webm, and `file` writes a `.srt` beside the video, `.vtt` for webm; a render with nothing spoken writes none and says so; the vocabulary is `tools/video-options.mjs`, read by the flags, the edit server and the export card alike), `--size 1280x720`, `--fps 30`, `--hold`, `--build-hold`, `--theme <name>` or `--gen <b64url>` (applied as `?theme=` / `?gen=` on the deck URL, as `pdf`, `pptx` and `shot` do too, so it reaches an inline or added theme block as well as a `themes/<name>.css` file: it used to inject a link to that file, which on a deck of inline blocks pointed at nothing), `--slides a-b`, `--voiceover` (runs the voiceover batch first, over the same `--slides` range, so rendering five slides of a forty-slide deck synthesises five: `tools/voiceover.mjs --slides a-b` voices only that range and leaves every other slide's files and manifest entry as they were, the promise `decklight narrate --mic --slides` makes for your own voice). A range renders to `<deck>.slides-a-b.mp4` (`-o` still wins), so re-rendering five slides never overwrites the whole talk. In write mode it is also a palette row, **Export a video…**, which opens a card that asks **which slides**: all, this slide, this chapter (`data-module`), from here to the end, up to here, or a typed range (`src/core/ranges.js`, the same picker the recorders use). Then, under **Narrator**, what the video carries of the deck's voice: **the card does not ask who speaks or who is on screen, it shows them**. One line, naming the voice as the panel names it (`My voice · with my camera`, `Chris · AI voice · slides only`), with **Change…**. A deck with nothing chosen and voices to choose from says `No narration selected`, with **Choose a voice…** and how many saved voices the deck has, rather than a bare "silent"; `Nobody · slides only` is a deck with nothing to choose. **Change… is a round trip**: the card leaves for the panel (`PRESENTING_VOICE`) with what it held, the range and every setting; the panel says where it came from (`‹ Back to the export · slides 4–8`, in place of its own *Export video…* row); and that row, `Esc` or `V` reopens the card on the same range and settings. An answer does not: the panel stays open after one, because changing narrator is often two answers (from your filmed recording to an AI voice and a cartoon character), and coming back after the first sent you to the export halfway through. A preview from the panel plays the slide and opens the panel again when the slide ends, the way back still in it. Leaving for a recorder does not come back. The video is the deck as it plays: the voice `V` is set to, and never one nobody picked; your camera's footage on the slides you filmed; the cartoon character where it is who is on screen (sent as `character`, since a fresh browser cannot see the panel's choice); and nobody on screen where the deck has nobody. A rendered talking head is made as the deck plays and is not put in a video, and the card says so beside its **Preview slide in deck** button (`The exported video will show slides only`), before the click, since the preview is the deck playing. The cartoon character mouths from a viseme sidecar per clip, and the render stops at the first one missing, so an export that has the character **makes them first** (the render checks each against its audio and remakes what is missing or out of step, `PRESENTING_VOICE`; the track list reports the clips with none as `nolips`), and the card says so (`the character's lip-sync is made first, for N clips that have none`). Lip-sync files are Rhubarb's, so the track list also says whether this machine can make them (`visemes`: a reason, or null), and where it cannot the card says, before the click, that the lip-sync is read from the voice instead (*Fix and export* makes those files) (`the character's lip-sync is read from the voice, less exactly than Rhubarb would · Rhubarb is not installed`). Under that line the card says what happens before anything is spent: an AI voice that is not saved yet *is saved with the deck first*, with the folder and how many characters that sends; slides of an AI recording voiced from older notes *are regenerated first, in the same voice*; your own voice *recorded from older notes on N slides*; a voice that cannot go in a video, and that the video will be silent. A **Missing** line names the slides that have notes and no recording **in the range chosen**, said again whenever the range changes (`slide 3 has notes and no recording · silent in the video`, or `none in these slides`), with **Record them…** (your voice, where a microphone can open) or **Regenerate them…** (an AI recording). **Preview** plays the slide in front of you as the video will have it, and **Sound** (*With the narration*, or *Without sound · this video only*) is the one answer about the narrator the card takes itself, never remembered. Below, under **Options**, its **format**, **quality**, **render mode** and **subtitles** (the flags below), rows that ← → turn, remembered per browser for the next export. Choosing a range only chooses it (marked ✓, and named on the button); nothing renders until the card's **Export video** button is pressed, as the recorder's card waits on its Start. The card opens with that button selected, so exporting what is already chosen is one Enter, and Enter on a range chooses it and moves on to the button. The voice it sends is a folder beside the deck `decklight video` can render from (one with a manifest; your own takes leave none), **the unsaved AI voice** the deck speaks with in `V` (the engine and model the bridge answered with, the voice and tone picked), or **silence** by name. The row asks the edit server (`POST /deck/edit/export`, `{ kind: 'video', theme | gen, slides, format, quality, render, subtitles, face, character }` plus one of `narration`, `synthesize: { engine, model, voice, style, dir }` or `silent`; `character` is `viseme` or `off`, the command's `--character`, which overrides the deck's own `narration.character.mode` for this render), which checks every field before anything runs, then runs `decklight narrate` (when synthesizing) and `decklight video` as **child processes**, not through their `main`s as `pptx` and `pdf` are: those `main`s exit the process on every refusal, which would take the session down. A synthesized voice is written exactly as `decklight narrate -o` writes one (per slide and per ⟨CLICK⟩ beat, through the shared clip cache, with the engine settings the bridge itself reads (the environment, then `tts.json` for that engine), so a sentence already heard live costs nothing), into `voices/<voice>`, or refreshed in place where this engine and voice recorded before, so a second export re-pays nothing for slides that did not change. It **never lands on a take somebody recorded**: a folder that already holds audio is refreshed only when its manifest names this engine and voice, and the export refuses otherwise. The two phases report separately (`voicing slide n of N`, then the render's slides), read from the tools' own output (`voiceover` ends its plan line `· N to voice`), and a refusal is the tool's own sentence. Needs ffmpeg + ffprobe: missing tools are a hard, friendly error naming what to install (the voiceover encoder-detection policy). **A slide that moves is filmed moving** (#914). The same extra load reports, per slide, whether it animates (an SVG `<animate*>`/`<set>`, or a CSS animation below the section that loops or outlasts a build's window), only builds (a step that starts a transition or animation), or neither. A still slide keeps the cheap path (one screenshot, `-tune stillimage`). A moving frame is a numbered PNG sequence at exactly `--fps` from one page held open over the Chrome DevTools Protocol (`tools/cdp.mjs`, Node ≥22's own WebSocket, no dependency, the same loopback deck URL under the CSP): every animation is paused and the clock is set by hand, tick by tick (`svg.setCurrentTime` for SMIL, `currentTime` for CSS animations and transitions), so the output is the same every run and a loop starts from its beginning when the slide appears, not mid-cycle from page load. An animating slide moves for its whole hold, and across its builds its clock carries on rather than restarting; a slide that only builds plays each build's own transition, stepped through the deck (`goto`, as a click does: a hash change is a jump and applies builds without animating) from the step before, over the first second of its frame (`MOTION_WINDOW_S`), then holds the last picture. Either way a moving segment lasts exactly as long as the still would have, so audio and `⟨CLICK⟩` timing never move. Limits: the cut between slides stays a cut (the slide's own entry animation is finished, not played), and what a page drives from script rather than the animation clock is not on that clock: terminals render fully expanded rather than typing. Below Node 22 (no WebSocket client), ordinary moving slides render as stills. A **narrated** slide builds too where its notes say so: `⟨CLICK⟩` segments the speaker notes, `tools/voiceover.mjs` synthesises one audio file per segment (same characters, so the same cost: the per-slide `slide-NN.m4a` is *concatenated* from them, and every existing consumer of it is untouched), and segment k narrates build step k for that segment's ffprobe'd duration. This is the recorded mirror of a rule that already ships: `src/core/narration.js` speaks live narration the same way, and captions, rehearse mode and the notes editor share the segmentation. A marker count that does not match the build count **warns naming the slide and renders the old way**, a wrong sync baked into an mp4 is worse than no sync, and a manifest written before this renders exactly as it did.
|
|
1509
|
+
|
|
1510
|
+
**Render mode** is `--render exact` by default. Each beat loads once, seeks its character pose and animations at each output frame, and encodes the audio once. Slides render in parallel and join in deck order. `--parallel 1` runs serially. Exact reuses completed slides from a cache beside the output keyed by slide markup, timing, render settings, media and browser resources. `--no-cache` forces a fresh render. `--render live` plays the chosen timeline in one browser viewport against the narration audio clock. It preserves live transitions and builds, takes the length of the talk to record, and reports dropped frames. A failed capture starts again from the beginning. Live capture and frame-by-frame character export require Node 22 or later.
|
|
1511
|
+
- **Single-file bundling**: `decklight bundle <deck.html> [-o out.html] [--audio [original|aac|opus]] [--themes current|all|a,b,…]` flattens a deck into one self-contained HTML: runtime and structure CSS inlined, selected themes embedded as inline-theme blocks, `data-cast` terminals converted to `data-cast-inline`, images (`<img src>`, `data-background-image`, `data-background-poster`) to data: URIs. Background videos stay external with a notice, the same posture as character MP4s. Playlist links can't resolve inside a single file; the CLI lists them as a notice. **Narration audio goes in only when asked.** By default a recorded track's files (a `narration.files` folder, a local manifest's `file` entries) stay beside the deck, and the CLI names the folders to send with the bundle. **`--audio [original|aac|opus]`** inlines each one as a `data-decklight-audio` block keyed by the URL the track would play (`voices/slide-01.m4a`); the runtime decodes it into a blob URL and plays that in place of the path, so the file speaks from disk with nothing beside it. It is a choice because a talk's voice is tens of MB, and base64 adds a third. **`original`** (what `--audio` alone means) carries the files as recorded. **`aac`** re-encodes each one through ffmpeg to mono AAC at 32 kbps, about 4 KB a second of voice, and plays in every browser. **`opus`** re-encodes to mono Opus at 24 kbps in WebM (constrained VBR, so the size stays near the bitrate whatever was recorded), about 3 KB a second and the smallest, for Safari from 17. A recorder WAV is about forty times the AAC. A file a re-encode would not shrink is kept as it was, the key stays the URL the track plays whatever the bytes became, and with no ffmpeg (or no encoder for the codec asked) it refuses with a sentence naming `--audio original`. A manifest entry with its own `url` (a bucket, often signed) stays where it is. `--no-audio` is the default, said explicitly. **`--module <title | n>`** bundles one chapter of the deck rather than all of it: the sections from its `data-module` marker up to the next one (DECK_ANATOMY), named by title (case ignored) or by number, the slides before the first marker belonging to none; the file is `<deck>-<chapter>.html` unless `-o` says otherwise, and its `<title>` names the chapter. **Its narration comes with it, renumbered**, because a track's files are named by slide number and the runtime counts the chapter's slides from 1 again: a folder track's `slide-NN[-KK]` files and the character's viseme timelines move down by the chapter's offset (slide 7 of a chapter that starts at slide 5 is `slide-03`), a manifest is cut to the chapter's entries, and anything outside the chapter is left out. Nothing is re-voiced: the clips are the same bytes under the number the bundle asks for, carried inside with `--audio` or counted beside it without. Character MP4s stay external and keep the deck's numbering, so a notice says the chapter's character plays from its visemes. A deck with no chapters, or no chapter by that name, is refused with the list of the ones it has; `--module` takes one deck, and with `--all` it points at the playlist module's own file, which is bundled as it is.
|
|
664
1512
|
- **Runtime upgrade**: `decklight upgrade <deck.html> [--dry-run]` brings a self-contained deck's embedded runtime up to the installed package (a deck that is data, or one that *links* the runtime, is always current: `upgrade` only refreshes the version it records itself as written for, in the configuration block or on the `<script src>`, the thing `--no-trust --audit` compares; and **`--link`** is the reverse of `bundle`: the deck becomes data (`DECK_ANATOMY`): the embedded or referenced runtime and stylesheet go, the active theme becomes the block's `theme` and the other shipped themes are dropped because the servers link any of them, a theme that is not decklight's is kept embedded, and the `Decklight.init(…)` argument becomes the block when it is a literal, while a call whose argument is code stays as the escape hatch; everything the author wrote survives byte-for-byte): the runtime css + js blocks are swapped for the installed `dist/` builds and re-marked `data-decklight-runtime="css|js"` (decks from before the marker are recognized too: the first head `<style>` carrying the structural css, and the `<script>` defining `Decklight` before the `Decklight.init` call), and `<style data-theme>` blocks refresh from the installed `themes/`, preserving which one is active. A block naming a theme not in `themes/` is always kept as-is, with a warning that says which of two things this is (MARKETPLACE.md `OPEN` 1): carrying `data-theme-added` (`theme add`/Browse's own marker, THEME_DISTRIBUTION) means the theme was never decklight's to begin with, so there is no "upstream" copy to refresh it from: `upgrade` never fetches one, the same registered-not-fetched posture `MARKETPLACE_REGISTRY` already holds elsewhere, and a deck records no version for it to pin or refuse a stale one against; an entry's `version` (`UNIT_VERSIONS`) is an install fact, and the path to a newer one is the installed unit, never the deck; without the marker, it is a theme decklight's own shipped set has since dropped. Everything the author wrote survives byte-for-byte. In place, `<deck>.html.bak` written first; `--dry-run` prints the plan and touches nothing; a second run reports "already current". Non-decklight files (no `Decklight.init`) are refused. A **multi-module
|
|
665
1513
|
deck** (`bundle --all`, recognisable by its `data-module` markers) upgrades
|
|
666
1514
|
like any other deck, with a note that a later re-merge would overwrite it: the
|
|
@@ -668,7 +1516,7 @@ refusal that used to stand there assumed the per-module sources still existed,
|
|
|
668
1516
|
and a multi-module deck hand-edited ever since with those files long gone IS the
|
|
669
1517
|
source of truth. The refusal was protecting a workflow nobody had. `init` marks the blocks it writes with the same attribute.
|
|
670
1518
|
- **Merged single-file presentation**: `decklight bundle <deck.html> --all [--title "…"]` follows the deck's playlist and concatenates EVERY module's sections into one deck (explicit form: `decklight bundle a.html b.html … -o one.html`). A deck that links the runtime and ships none of it bundles from the installed package: `decklight.js`, `decklight.css` and each theme, said in a note per file, so what a bundle carries is what the deck was playing with; a copy beside the deck wins, and `--themes all` lists the shipped themes when there is no `themes/` folder to list. Each module's first section is marked `data-module="<title>"`; embedded cast ids are prefixed per module to stay unique; relative asset refs are rebased onto the first deck's directory; the per-module `playlist` config is stripped. **In-file module navigation**: `data-module` sections are ordinary slides, so the finder (`G`) already finds them by title or body text and `goto()`s them with no page load; the chrome module tag shows the module of the current slide (nearest preceding marker).
|
|
671
|
-
- **Publish (GitHub Pages)**: `decklight publish <deck.html> [--branch gh-pages] [--remote origin] [--no-bundle] [--path <subdir>]`: bundles the deck (single-file, via the bundler above; `--no-bundle` pushes the file as-is) to `index.html` + `.nojekyll` and pushes them to the branch on the remote, then prints the site URL derived from the remote URL: `git@github.com:owner/repo.git` and `https://github.com/owner/repo(.git)` both → `https://owner.github.io/repo/`, an `owner.github.io` repo → `https://owner.github.io/`, and a non-GitHub remote just prints the pushed ref. The commit is built with git plumbing (`hash-object → mktree → commit-tree → push <sha>:refs/heads/<branch>`), so the author's working tree, index, and checked-out branch are never touched. The first publish creates the branch as an orphan and prints where to enable Pages in the repo Settings; every later publish fetches the remote branch and parents on it, history, not force-push, and the sign-off in the commit message comes from `git config user.name/user.email`. `--path <subdir>` publishes under a subdirectory, preserving whatever else the branch already carries. Zero new dependencies: plain git. In write mode it is a palette row too, **Publish this deck…**, and the only hand-over row that reaches off the machine: every other one writes a file beside the deck, this one puts up a page no undo can take back. So it is **two presses**: the first asks the server for the plan (`GET /deck/edit/publish/plan`: the remote, the branch, the URL somebody will be sent, whether the deck still needs bundling, and whether this machine can sign) and shows it; the second, within the arming window, publishes (`POST /deck/edit/publish`). Doing nothing disarms it. The arming lives in the deck, not the server: an unarmed POST publishes, exactly as the command line does, because a confirmation belongs to the surface that can show a person what they are agreeing to. Two things the route decides so a presenter does not have to: a deck that is **already one file** is published as it is (the bundler would refuse it, which is a sentence about a flag, not an answer), and a machine **without the sigstore client** is told so at the plan, with the command that fixes it, rather than after a confirmation the publish was never going to honour; publish signs by default and refuses rather than publishing unsigned (INTEGRITY). `GIT_TERMINAL_PROMPT=0` for the push: publish pushes with a synchronous git, so a credential prompt would not be asking anybody anything; it would hang the write-mode session on a terminal nobody is watching.
|
|
1519
|
+
- **Publish (GitHub Pages)**: `decklight publish <deck.html> [--branch gh-pages] [--remote origin] [--no-bundle] [--path <subdir>]`: bundles the deck (single-file, via the bundler above; `--no-bundle` pushes the file as-is) to `index.html` + `.nojekyll` (**`--audio [original|aac|opus]`** passes through to the bundler, so the narration plays from the published page; without it the clips stay beside the deck, which a published site does not carry, and the page plays no voice; refused with `--no-bundle`) and pushes them to the branch on the remote, then prints the site URL derived from the remote URL: `git@github.com:owner/repo.git` and `https://github.com/owner/repo(.git)` both → `https://owner.github.io/repo/`, an `owner.github.io` repo → `https://owner.github.io/`, and a non-GitHub remote just prints the pushed ref. The commit is built with git plumbing (`hash-object → mktree → commit-tree → push <sha>:refs/heads/<branch>`), so the author's working tree, index, and checked-out branch are never touched. The first publish creates the branch as an orphan and prints where to enable Pages in the repo Settings; every later publish fetches the remote branch and parents on it, history, not force-push, and the sign-off in the commit message comes from `git config user.name/user.email`. `--path <subdir>` publishes under a subdirectory, preserving whatever else the branch already carries. Zero new dependencies: plain git. In write mode it is a palette row too, **Publish this deck…**, and the only hand-over row that reaches off the machine: every other one writes a file beside the deck, this one puts up a page no undo can take back. So it is **two presses**: the first asks the server for the plan (`GET /deck/edit/publish/plan`: the remote, the branch, the URL somebody will be sent, whether the deck still needs bundling, and whether this machine can sign) and shows it; the second, within the arming window, publishes (`POST /deck/edit/publish`). Doing nothing disarms it. The arming lives in the deck, not the server: an unarmed POST publishes, exactly as the command line does, because a confirmation belongs to the surface that can show a person what they are agreeing to. Two things the route decides so a presenter does not have to: a deck that is **already one file** is published as it is (the bundler would refuse it, which is a sentence about a flag, not an answer), and a machine **without the sigstore client** is told so at the plan, with the command that fixes it, rather than after a confirmation the publish was never going to honour; publish signs by default and refuses rather than publishing unsigned (INTEGRITY). `GIT_TERMINAL_PROMPT=0` for the push: publish pushes with a synchronous git, so a credential prompt would not be asking anybody anything; it would hang the write-mode session on a terminal nobody is watching.
|
|
672
1520
|
- **Publish targets** (`--target gh-pages|netlify|vercel`, default `gh-pages`; MARKETPLACE.md ENGINES): where the bundled page goes is a choice, not only a place. gh-pages, the bullet above, unchanged, needs git auth and no credential, so it stays core. Netlify and Vercel need a token, so they follow the rule anything on the authoring path needing a credential becomes a marketplace engine behind a core affordance: the affordance is `--target`, and each declares a real `ENGINES#WIZARD` schema (`cli/wizard.mjs` `validateSchema`), so a missing or malformed answer is refused by the exact validation a browser-wizard engine goes through, not a bespoke check. **The token is never a terminal prompt and never the browser wizard**: `publish` is a one-shot, often-headless command (CI has no browser to paste a key into, and no `/deck/edit/wizard` to post it to, since that endpoint is served by the edit server, which `publish` never starts), so it is read from the **provider's own CLI env var** (`NETLIFY_AUTH_TOKEN` + `NETLIFY_SITE_ID`, `VERCEL_TOKEN` + `VERCEL_PROJECT` + optional `VERCEL_TEAM_ID`), matching the ElevenLabs precedent (`tools/elevenlabs-tts.mjs`): a key is not boring, so the environment remembers it and it is never written to `~/.decklight/`. `--branch`/`--remote` are refused alongside a non-gh-pages target rather than silently ignored, since they would otherwise appear to do something. Netlify deploys as a single zip (`cli/zip.mjs`, the `skills --pack` container plumbing); Vercel takes the same files inline as base64 in one JSON POST, per its own API shape. **S3 is deliberately not a target yet**: the one provider needing request signing (SigV4) rather than a bearer token, and a hand-rolled signer nobody can exercise against a real bucket in CI is a correctness claim not worth shipping unverified; Netlify and Vercel are what prove the shape generalizes (MARKETPLACE.md `OPEN`).
|
|
673
1521
|
|
|
674
1522
|
## REVIEW · Reviewer comments
|
|
@@ -797,17 +1645,38 @@ Rows are built as nodes, never `innerHTML`: a comment is somebody else's text th
|
|
|
797
1645
|
author's server exposes the same store under the same append-only rule (`GET`/`POST /deck/review/comments`).
|
|
798
1646
|
|
|
799
1647
|
**The panel sits beside the slide, not over it.** Reviewing is writing about what is on screen, so the overlay
|
|
800
|
-
is **non-modal**: it never dims or covers the deck.
|
|
801
|
-
|
|
1648
|
+
is **non-modal**: it never dims or covers the deck. One button in its header, drawn as where the panel sits
|
|
1649
|
+
now, opens the places it can sit as a strip of five named choices under the header: **float** (a movable card,
|
|
1650
|
+
dragged by its header), docked **left**, **right** or **bottom**, or a **window** of its own. Docked, it
|
|
802
1651
|
reserves a gutter (`--dock-left/right/bottom` on the root) and the stage reflows into what is left through the
|
|
803
|
-
same `rescale` that fits the slide to the window. The
|
|
1652
|
+
same `rescale` that fits the slide to the window. The deck's own chrome keeps clear of that gutter too: the
|
|
1653
|
+
editing bar centres on the slide, not on the window, and the slide number, the arrows and the character move in
|
|
1654
|
+
from the edge the panel took, where they used to sit under it. **A docked panel is resized by its inner edge**:
|
|
1655
|
+
drag it (a short grip marks the middle, the edge lights under the pointer) and a side panel is wider or
|
|
1656
|
+
narrower, the bottom tray taller or shorter, the slide refitting beside it as it goes. It stops at a least
|
|
1657
|
+
size (320px wide, the six tabs on one line; 160px tall) and before the slide is squeezed out (70% of the window,
|
|
1658
|
+
and never less than 320px of slide beside a side panel or 200px above the tray). A double-click on the edge
|
|
1659
|
+
puts back the size it opens at (360px wide, 320px tall, less in a small window); from the keyboard the edge is
|
|
1660
|
+
a separator that takes the arrows (16px a press, 64 with Shift), Home and End for its limits, Enter for the
|
|
1661
|
+
usual size. The size is kept with the placement, one width and one height per deck for every panel, and read
|
|
1662
|
+
against the window each time, so one set in a wide window still leaves a slide in a narrow one. The placement is **remembered per deck** in `localStorage`,
|
|
804
1663
|
like the clock and the character. **One slot, one placement** (`src/core/dock.js`): the comments, the notes,
|
|
805
1664
|
the inspector, the sources, the agent ask and the HTML editor share it. They share ONE placement per deck
|
|
806
|
-
(`decklight-panel-dock:`;
|
|
807
|
-
|
|
1665
|
+
(`decklight-panel-dock:`; until one is moved, every panel opens docked **right**, beside the slide: each
|
|
1666
|
+
used to have its own default, the notes at the bottom, the inspector right, the rest afloat, so switching
|
|
1667
|
+
tabs before a choice threw the panel from place to place), opening one closes whichever other holds the slot, and every header carries a
|
|
808
1668
|
row of **tabs** to the others this deck offers (the agent only in write mode, the sources where they can be
|
|
809
1669
|
written; the HTML editor opens on an element, so it has no tab). Six panels used to keep six placements,
|
|
810
|
-
any number open at once on any sides.
|
|
1670
|
+
any number open at once on any sides. **One frame for all of them.** The tabs are one line across the top of
|
|
1671
|
+
the panel, in the order of the work whichever panel was built first: Notes, Inspector, Check, Comments, Sources,
|
|
1672
|
+
Agent. Under them, one line says what the panel is on (*Slide 3*, *5 issues on 4 slides*, *2 open*), then the
|
|
1673
|
+
panel's own buttons, the placement button and the close. The tab already names the panel, so the line does not
|
|
1674
|
+
repeat it; a panel that is the only one on offer has no tabs, and its header names it instead. The keys a panel
|
|
1675
|
+
takes are listed at its **foot**, each drawn as a key, pinned to the panel's bottom edge: they used to be a
|
|
1676
|
+
heading in one panel, a paragraph in the middle of another, small capitals in a third. Floating, every panel
|
|
1677
|
+
with tabs is one width, so the tabs stay under the pointer from one panel to the next. Along the bottom the
|
|
1678
|
+
tray is wide and short, so lists run in columns (the inspector's facts, the check's findings) and the notes'
|
|
1679
|
+
switches and rewrites share one row above the box. Because the panel is non-modal the deck keeps the keyboard: the panel owns
|
|
811
1680
|
the arrows only while you are working **in** it (your last click or focus was the card), and hands them back to
|
|
812
1681
|
the slides the moment you touch the deck, so you walk the deck with `←`/`→` while the panel stays up. The
|
|
813
1682
|
composer's target **follows the slide you are on while the box is empty, and locks to it once you start typing**
|
|
@@ -828,6 +1697,306 @@ This persists where ink (PRESENTING) is deliberately ephemeral, and the two must
|
|
|
828
1697
|
vocabulary either: ink is the **presenter** marking a slide during a talk and is cleared on every slide change;
|
|
829
1698
|
a review comment is a **reviewer** writing to the author before one. Different actor, different lifetime.
|
|
830
1699
|
|
|
1700
|
+
## TRANSLATIONS · A deck in several languages
|
|
1701
|
+
|
|
1702
|
+
The code: `cli/translate-core.mjs` (units, record, matching, writing the translation), `cli/translate.mjs` (the
|
|
1703
|
+
command and the agent), `cli/translate-files.mjs` (where a language lives, and `decklight check`'s rules),
|
|
1704
|
+
`cli/edit-translate.mjs` and `src/core/languages.js` (Languages… and the switch).
|
|
1705
|
+
|
|
1706
|
+
A talk given in English is asked for in French, and the usual answer is a copy: `talk-fr.html`, translated
|
|
1707
|
+
once, and wrong from the first edit to the original, with nothing to say which slides are wrong. A decklight
|
|
1708
|
+
translation is therefore **not a copy somebody maintains**. It is the source deck with its words replaced,
|
|
1709
|
+
regenerated whenever either side changes, and the replacing is recorded so that decklight can always say what
|
|
1710
|
+
is behind, without a model and without anybody remembering.
|
|
1711
|
+
|
|
1712
|
+
**Three files, one of them written by hand.** `talk.html` is the **source**: the only file whose structure
|
|
1713
|
+
anybody edits. `talk.fr.html` is the **translation**: a whole deck, a sibling of the source, opened, checked,
|
|
1714
|
+
voiced, bundled and published like any other, with `<html lang="fr">`. `talk.fr.translation.json` is the
|
|
1715
|
+
**record** (`TRANSLATION_RECORD`): every piece of source text the translation was made from, beside the text
|
|
1716
|
+
it was given. All three are committed. The language in the two names is a BCP 47 tag as the author wrote it
|
|
1717
|
+
(`fr`, `pt-BR`, `zh-Hans`). The source says which languages it has, `"languages": ["fr", "es"]` in its
|
|
1718
|
+
configuration block (DECK_ANATOMY), and a translation says what it is one of, `"translationOf": "talk.html"`,
|
|
1719
|
+
which decklight writes and nobody types, with a `<link rel="alternate" hreflang>` in its `<head>` for every
|
|
1720
|
+
language of the deck, the source's included (TRANSLATION_SWITCH). The source may be in any language:
|
|
1721
|
+
`<html lang>` on the source is what the translation is made *from*, and a language written right to left gets
|
|
1722
|
+
`dir="rtl"` too.
|
|
1723
|
+
|
|
1724
|
+
**The translation takes its structure from the source, always.** Every section, attribute, class, build,
|
|
1725
|
+
image, chart and diagram in `talk.fr.html` is the source's, re-read at every run; only the units below
|
|
1726
|
+
differ. A slide added, moved, restyled or rebuilt in the source is added, moved, restyled or rebuilt in every
|
|
1727
|
+
language by the next `decklight translate`, at no model cost when its words did not change. This is what
|
|
1728
|
+
PRESENTING_WRITING already guarantees for one slide (an agent that is shown text runs can only change words),
|
|
1729
|
+
applied to a whole deck and kept.
|
|
1730
|
+
|
|
1731
|
+
**So a translation is edited in its words, and only there.** A French title that reads badly is fixed in
|
|
1732
|
+
`talk.fr.html`, in write mode or in an editor, and the fix is kept (`TRANSLATION_RECORD`). A French slide that
|
|
1733
|
+
needs a different layout cannot have one: write mode on a deck with `translationOf` offers the text and notes
|
|
1734
|
+
editors and refuses the tools that change structure (add, delete, move, layout, element edits), saying which
|
|
1735
|
+
file to make the change in. `decklight translate` never silently overwrites a structural difference it finds
|
|
1736
|
+
in a translation: it stops, names the slide, and goes ahead only with `--discard-structure`. A slide that
|
|
1737
|
+
overflows in French is fixed by shorter French, which is the authoring skill's rule for any language (rewrite
|
|
1738
|
+
until it fits, do not shrink the type).
|
|
1739
|
+
|
|
1740
|
+
### TRANSLATION_UNITS · What is translated
|
|
1741
|
+
|
|
1742
|
+
A **unit** is one piece of text with a kind. A slide's units, in order:
|
|
1743
|
+
|
|
1744
|
+
- **`run`**: each text run of the slide, exactly as PRESENTING_WRITING cuts them: the text between tags,
|
|
1745
|
+
outside the notes, code, `pre`, `kbd`, `samp`, scripts, styles and SVG, in reading order.
|
|
1746
|
+
- **`beat`**: each beat of the speaker notes, the notes cut at `[click]` (DECK_ANATOMY). The markers are not
|
|
1747
|
+
part of a unit and cannot be translated away: a translated slide has the source's beats, in the source's
|
|
1748
|
+
order, by construction. Inside a beat, every `[pause]` and every audio tag (`[whispers]`) must come back,
|
|
1749
|
+
spelled as it went, since a tag is a direction to the voice and not prose; paragraphs stay a blank line apart.
|
|
1750
|
+
- **`attr`**: the words a slide carries in attributes: `alt`, `aria-label`, `title`, `data-module`,
|
|
1751
|
+
`data-steps` and `data-step`. The last three are matched to each other across slides by their text
|
|
1752
|
+
(DECK_ANATOMY), which holds in translation because the same source text is given the same translation
|
|
1753
|
+
(`TRANSLATION_RECORD`).
|
|
1754
|
+
- **`label`**: the words in a diagram or a chart: SVG `<text>` (SVG_DIAGRAMS), and a chart's title, axis
|
|
1755
|
+
titles, category and series names (CHARTS). Numbers are data and are not units.
|
|
1756
|
+
|
|
1757
|
+
The deck has two units of its own: its `<title>`, and the language itself (`<html lang>`, and `dir="rtl"` on
|
|
1758
|
+
`<html>` for a language written right to left).
|
|
1759
|
+
|
|
1760
|
+
**Never translated:** code and `pre` blocks, math, terminal recordings (a cast is a recording of what was
|
|
1761
|
+
typed, TERMINAL_RECORDINGS), URLs, file names, and the pixels of an image or a video. `decklight translate`
|
|
1762
|
+
lists the slides carrying a cast or an image so the author knows where the source language still shows; it
|
|
1763
|
+
does not guess whether an image has words in it.
|
|
1764
|
+
|
|
1765
|
+
### TRANSLATION_RECORD · The record, and what "behind" means
|
|
1766
|
+
|
|
1767
|
+
```json
|
|
1768
|
+
{
|
|
1769
|
+
"version": 1,
|
|
1770
|
+
"source": "talk.html",
|
|
1771
|
+
"from": "en",
|
|
1772
|
+
"lang": "fr",
|
|
1773
|
+
"glossary": { "build": "build", "deck": "présentation" },
|
|
1774
|
+
"slides": [
|
|
1775
|
+
[
|
|
1776
|
+
{ "kind": "run", "state": "reviewed", "source": "Ship on Friday", "target": "Livraison vendredi" },
|
|
1777
|
+
{ "kind": "run", "state": "machine", "source": "Three things changed", "target": "Trois changements" },
|
|
1778
|
+
{ "kind": "beat", "state": "machine", "source": "We ship on Friday. [pause] Here is why.", "target": "Nous livrons vendredi. [pause] Voici pourquoi." }
|
|
1779
|
+
]
|
|
1780
|
+
],
|
|
1781
|
+
"structure": ["3b6469b532c1"]
|
|
1782
|
+
}
|
|
1783
|
+
```
|
|
1784
|
+
|
|
1785
|
+
One array per slide, in the translation's slide order, one unit per line so a re-translated sentence is a
|
|
1786
|
+
one-line diff. `source` is the text the unit was translated **from**, kept whole and not as a hash, because
|
|
1787
|
+
the two questions a hash cannot answer are the ones that matter: *what did it say when this was translated*,
|
|
1788
|
+
and *what should the model be shown as the previous version*. `target` is what decklight last wrote into the
|
|
1789
|
+
translation. `state` is `machine` (a model's answer, unread as far as decklight knows), `reviewed` (a person
|
|
1790
|
+
wrote or changed it) or `pending`: a unit a run could not translate (no agent, or an answer that failed its
|
|
1791
|
+
check), whose `target` is what the translation shows meanwhile and which keeps, as `was`, the version it is to
|
|
1792
|
+
start from. `structure` is each slide's shape as written, the slide with its units' text taken out, hashed: a
|
|
1793
|
+
slide of the translation that no longer has its shape was changed in more than its words. The deck's own units
|
|
1794
|
+
(its title) are under `deck`.
|
|
1795
|
+
|
|
1796
|
+
**Slides are matched by what they say.** A slide has no stable identity (REVIEW), and the record does not
|
|
1797
|
+
invent one. For each slide of the source, decklight looks for the record's slide holding the same units
|
|
1798
|
+
(all of them, then most of them, a slide being claimed once); a unit is `current` when that slide holds a
|
|
1799
|
+
pair with its kind and exactly its source text. A unit whose slide was not found, or was found without it,
|
|
1800
|
+
is looked up across the whole record by kind and source text, a `reviewed` pair before a `machine` one, then
|
|
1801
|
+
the first in order. So a moved slide, a duplicated slide and a sentence lifted from one slide to another are
|
|
1802
|
+
all `current`, and cost nothing. What is left is one of two things:
|
|
1803
|
+
|
|
1804
|
+
- **`changed`**: the matched slide holds a pair of the same kind in the same place whose source text is no
|
|
1805
|
+
longer in the source. The unit was reworded. The old pair is the previous version: it goes to the model with
|
|
1806
|
+
the new text, so a one-word edit to a sentence gets a one-word edit to its translation and not a new one.
|
|
1807
|
+
- **`missing`**: there is nothing to start from.
|
|
1808
|
+
|
|
1809
|
+
A language is **behind** when it has a unit that is `changed` or `missing`. That is computed from the two
|
|
1810
|
+
files and the record, by string comparison, on every `decklight check`, `translate --status` and open in write
|
|
1811
|
+
mode: it needs no model, no network and no timestamp, and it cannot be wrong about a deck somebody edited by
|
|
1812
|
+
hand, in a rebase, or on another machine.
|
|
1813
|
+
|
|
1814
|
+
**A person's correction is kept, and is known to be one.** Before anything else, a run reads the translation
|
|
1815
|
+
as it stands: a unit whose text is no longer the record's `target` was edited by somebody, so the record takes
|
|
1816
|
+
the new text and marks it `reviewed`. Nothing is asked of the author to make this work: fixing the French is
|
|
1817
|
+
editing the French. A `reviewed` unit is never re-asked while its source text stands. When its source is
|
|
1818
|
+
reworded it is `changed` like any other, re-asked with the person's translation as the previous version, comes
|
|
1819
|
+
back `machine`, and the run's report names it (*slide 7: a reviewed translation was redone, the source
|
|
1820
|
+
changed*), because that is the one case where a model's words replace a person's.
|
|
1821
|
+
|
|
1822
|
+
**The glossary** is the record's own: source term to target term, a term mapped to itself being one that
|
|
1823
|
+
stays as it is (product names, `build`). It is sent with every ask and checked on every answer. An agent may
|
|
1824
|
+
propose entries on a first run; from then on it is the author's, edited in the file.
|
|
1825
|
+
|
|
1826
|
+
**A translation that is behind still opens, and says so.** A run with no agent, or one whose answer failed,
|
|
1827
|
+
leaves a `changed` unit showing its previous translation and puts the source text in for a `missing` one: a
|
|
1828
|
+
deck with one English sentence in it is better than a deck that will not open, as long as nothing pretends
|
|
1829
|
+
otherwise. `decklight check` on a translation fails on either (`translation-stale`, `translation-missing`,
|
|
1830
|
+
naming the slide and quoting the source text), on a structure that is not the source's
|
|
1831
|
+
(`translation-structure`) and on an `<html lang>` that is not the record's (`translation-lang`). On the source
|
|
1832
|
+
it warns, per language, how many units are behind (`translation-behind`): the source is not broken by having
|
|
1833
|
+
been edited.
|
|
1834
|
+
|
|
1835
|
+
### TRANSLATE_CLI · `decklight translate`
|
|
1836
|
+
|
|
1837
|
+
```
|
|
1838
|
+
decklight translate <deck.html> [--to fr,es] [--slides 3,5-8] [--agent <name>] [--agent-model <m>]
|
|
1839
|
+
[--status | --check] [--dry-run] [--no-agent] [--discard-structure]
|
|
1840
|
+
```
|
|
1841
|
+
|
|
1842
|
+
`<deck.html>` is the source (a translation given by mistake is resolved to its source, and said). With no
|
|
1843
|
+
`--to`, every language in `languages`; a language named for the first time is added there. The run, per
|
|
1844
|
+
language: read back the author's corrections; match; ask for the units that are `changed` or `missing`; check
|
|
1845
|
+
the answers; write the translation and the record together; render the translation and re-ask for what does
|
|
1846
|
+
not fit.
|
|
1847
|
+
|
|
1848
|
+
- **Decklight does not translate, an agent does, and decklight writes the file.** The agent is the one
|
|
1849
|
+
`enhance` and the writing tools use (PRESENTING_VOICE, PRESENTING_WRITING): a coding agent's CLI, run
|
|
1850
|
+
read-only, one ask per slide, three at a time. There is no translation API key to configure and no call
|
|
1851
|
+
from the runtime, ever: a deck is translated while it is written, and what the audience opens is text.
|
|
1852
|
+
- **One ask carries a whole slide.** Its runs, beats, attributes and labels go together, numbered, with the
|
|
1853
|
+
deck's title, the glossary, the previous version of each `changed` unit, and the authoring skills' notes for
|
|
1854
|
+
the target language where they have any (lengths, spacing and number conventions, which terms stay in
|
|
1855
|
+
English). The slide and its script are translated in one breath so that they agree on their terms, which a
|
|
1856
|
+
listener notices at once when they do not.
|
|
1857
|
+
- **Only what passes a check is written** (`translateProblem`): every unit answered and none emptied; no
|
|
1858
|
+
markup in an answer; a beat's `[pause]` markers and audio tags all present; every glossary term rendered as
|
|
1859
|
+
the glossary says; an answer in the target language's script where the source's differs. A slide whose
|
|
1860
|
+
answer fails keeps what it had and the run says why, as an enhance does; the run exits 2.
|
|
1861
|
+
- **Fit is measured, not estimated.** Text grows in translation by an amount no rule predicts (a three-word
|
|
1862
|
+
English title can double in German), so the run renders the translated deck headlessly and reads the same
|
|
1863
|
+
overflow mark PRESENTING_FIT sets. A slide that overflows is asked again for shorter text, the limit named
|
|
1864
|
+
in characters, twice at most; one that still overflows is written and reported, and fails `check` as any
|
|
1865
|
+
overflowing slide does. Decklight never shrinks the type to make a translation fit.
|
|
1866
|
+
- `--status` prints, per language, the units `current`, `changed`, `missing` and `reviewed`, and the slides
|
|
1867
|
+
behind; `--check` is the same with exit 1 when any language is behind, for CI. Neither starts an agent.
|
|
1868
|
+
`--dry-run` runs the agent and prints what would change. `--no-agent` regenerates the translations from the
|
|
1869
|
+
record alone: the structure catches up, the words that need a model stay behind and are counted.
|
|
1870
|
+
|
|
1871
|
+
### TRANSLATE_PANEL · Languages…, in write mode
|
|
1872
|
+
|
|
1873
|
+
Everything `decklight translate` does can be done without leaving the deck. While authoring, `/` →
|
|
1874
|
+
**Language: Languages…** (write mode only, so never under `--no-trust`) is the one screen for a deck's
|
|
1875
|
+
languages, opened from the source or from any of its translations and showing the same thing from each. It is
|
|
1876
|
+
a second door to the command, not a second implementation: every run it starts is the `decklight translate`
|
|
1877
|
+
it would be at a terminal, with the same matching, the same checks and the same report.
|
|
1878
|
+
|
|
1879
|
+
**The list asks no model anything** (`GET /deck/edit/translations`, which is `translate --status` as JSON):
|
|
1880
|
+
the source first, then one row per language in `languages`, each named in its own language with its tag
|
|
1881
|
+
(*Français · fr*). A row says one of three things: ✓ *up to date*; ↑ *behind*, with the count and the slides
|
|
1882
|
+
(*4 sentences behind on "Pricing" and "Roadmap"*, a slide named by its title as everywhere else); ○ *not
|
|
1883
|
+
translated yet*. Under it, how much a person has read (*212 of 240 reviewed*), and the corrections made in the
|
|
1884
|
+
file since the last run, which that run keeps; the slides the last run left overflowing (the record's
|
|
1885
|
+
`overflow`, kept until a run measures again); and the slides whose recorded takes the language's script has
|
|
1886
|
+
moved away from (its own tracks' manifests, read against its notes), since a re-translated beat is a take to
|
|
1887
|
+
record again and the panel is where that becomes true. The last row is **Add a language…**.
|
|
1888
|
+
|
|
1889
|
+
**The keys.** **⏎** updates the selected language; **A** updates every language that is behind; **N** updates
|
|
1890
|
+
the selected one without the agent (`--no-agent`); **O** opens the selected language's deck at the slide you
|
|
1891
|
+
are on (`TRANSLATION_SWITCH`); **S** narrows the next run to the slide on screen. **Add a language…** takes a
|
|
1892
|
+
BCP 47 tag, shows its name and which file it will write (`talk.de.html`), and its first run adds it to
|
|
1893
|
+
`languages`. Removing a language is not a key: it is deleting two files and one word of the
|
|
1894
|
+
configuration, which git already does well and a panel would only make easy to do by accident.
|
|
1895
|
+
|
|
1896
|
+
**Before a run starts the panel says what it will send and to whom**: the slides' text and notes, to your
|
|
1897
|
+
coding agent (the one the writing tools use, PRESENTING_WRITING), with the number of pieces behind; a second ⏎
|
|
1898
|
+
starts it. Most agents are cloud services, and a deck's words leaving the machine is a thing to be told once
|
|
1899
|
+
per run, not discovered. A run with no agent on the machine ends saying so, and **N** is the run that needs
|
|
1900
|
+
none (structure catches up, words stay behind).
|
|
1901
|
+
|
|
1902
|
+
**A run** is `POST /deck/edit/translate { to: [lang…], slides?: [n…], agent?: false }` (409 while another
|
|
1903
|
+
translate runs; 400 for a language that is not a tag), started as the command in a child process. Its lines
|
|
1904
|
+
ride SSE `translate` events into the language's own row (`start`, `line`, `done`), three slides at a time,
|
|
1905
|
+
and **Esc** while it runs stops it after the slides in flight (`POST /deck/edit/translate/stop`, which the
|
|
1906
|
+
command reads on its input): what was answered and passed is written, the rest stays behind and is counted.
|
|
1907
|
+
The closing toast is the command's report (*French (talk.fr.html): 4 pieces translated · slide 5 left as it
|
|
1908
|
+
was: piece 2 lost or changed a bracketed direction such as [pause]*).
|
|
1909
|
+
|
|
1910
|
+
**The answers are written, not held.** A rewrite of the open deck is held for review because it changes the
|
|
1911
|
+
file in front of the author (PRESENTING_WRITING). A translation is another file: the open deck is not
|
|
1912
|
+
touched, the run is one commit's worth of change in `talk.fr.html` and its record, and what tells a person
|
|
1913
|
+
which of it is unread is the record's `state`, kept for exactly this. Undo is git's, and the panel does not
|
|
1914
|
+
pretend to another.
|
|
1915
|
+
|
|
1916
|
+
**Reading a translation is done in the translation.** The panel opened on a translation lists the slides with
|
|
1917
|
+
unread (`machine`) units, in order, and shows the slide on screen piece by piece, each source sentence beside
|
|
1918
|
+
its translation from the record (`GET /deck/edit/translation/slide?slide=n`), the unread ones marked, so
|
|
1919
|
+
nobody needs two windows to check a translation; it follows the slide as you move. On the slide itself, each
|
|
1920
|
+
unread piece of its text is marked where it stands (a dotted rule under it, `.decklight-unread`), in write mode
|
|
1921
|
+
only: a render, a bundle and an audience have no edit server to ask. Editing a unit makes it `reviewed`, as the
|
|
1922
|
+
record already says; **R** marks what is on the slide `reviewed` without changing it
|
|
1923
|
+
(`POST /deck/edit/translation/reviewed { slide }`), because agreeing with a sentence is also reading it.
|
|
1924
|
+
|
|
1925
|
+
**The source tells you when it has left a language behind, and does nothing about it.** Saving an edit to
|
|
1926
|
+
the source that puts a language behind posts one message (*French and Spanish are now 2 pieces behind · / →
|
|
1927
|
+
Languages…*, a `translate` event of state `behind`), once per language until it is caught up, and the palette gains **Language: Update
|
|
1928
|
+
translations** while any is behind. Nothing is translated on save: a run costs an agent and sends the deck's
|
|
1929
|
+
words out, and neither happens because somebody fixed a typo.
|
|
1930
|
+
|
|
1931
|
+
**Where the tools that change structure are refused** on a translation (`TRANSLATIONS`), the edit server
|
|
1932
|
+
answers 409 before the route runs (`STRUCTURAL_ROUTES`, cli/edit-translate.mjs: slide, element, look and
|
|
1933
|
+
configuration edits; the text and notes editors, find and replace and the writing tools stay open). The
|
|
1934
|
+
refusal names the source file, and is said on the page however the write was sent (a `translate` event of
|
|
1935
|
+
state `refused`), with one button, **Open talk.html**, that opens the source at the same slide.
|
|
1936
|
+
|
|
1937
|
+
### TRANSLATION_VOICE · Voice, captions and video per language
|
|
1938
|
+
|
|
1939
|
+
A translation is a deck, so everything in PRESENTING_VOICE applies to it unchanged: its notes are its script,
|
|
1940
|
+
its captions are its notes, and a take is stale when the beat it was voiced from changes, which a
|
|
1941
|
+
re-translated beat does. What a second language in the same folder needs:
|
|
1942
|
+
|
|
1943
|
+
- **A take belongs to a language** (PRESENTING_VOICE). A track's language is its folder's
|
|
1944
|
+
(`voices-fr/anna`), else the `lang` in its manifest, and a deck lists, checks, renumbers and gives a face to
|
|
1945
|
+
the tracks in its own language only; a track that says no language is the source's. A translation's tracks
|
|
1946
|
+
are written to `voices-<lang>/<voice>` beside the source's `voices/<voice>` (`voices-fr/me` for your own
|
|
1947
|
+
voice in French), so two languages recorded in the same voice never share a folder.
|
|
1948
|
+
- **A deck and its translations count as one deck** for the rule that lets a recording follow its
|
|
1949
|
+
slide when slides move (PRESENTING_VOICE): adding `talk.fr.html` beside `talk.html` does not switch it
|
|
1950
|
+
off, and a slide moved in the source moves each language's takes at the `decklight translate` run that
|
|
1951
|
+
moves the slide in that language (read off the translation's sections before and after, as an agent's edit
|
|
1952
|
+
is).
|
|
1953
|
+
- **The engine is told the language**. The deck's `<html lang>` goes with every synthesis to an
|
|
1954
|
+
engine that takes one and is in the cache key, so a sentence spelled alike in two languages is not served
|
|
1955
|
+
one language's clip in the other. An engine with one voice per language picks the language's own when none
|
|
1956
|
+
is named: piper reads a French deck with `fr_FR-siwis-medium`, not the English default (`PIPER_VOICES`,
|
|
1957
|
+
tools/tts-engines.mjs, each a key of piper's catalog; a language it does not list keeps the default).
|
|
1958
|
+
- **Captions are cut for the language**: sentence ends and closing quotation marks follow the deck's language,
|
|
1959
|
+
and so does a video's cue length: two lines of 42 for a language written in words, of 13 for Japanese and
|
|
1960
|
+
16 for Chinese and Korean, cut by character where there are no spaces (`cueMaxChars`, tools/video.mjs).
|
|
1961
|
+
**Lip-sync** uses the recogniser that does not assume English for any other language.
|
|
1962
|
+
- **One video per language**: `decklight video talk.fr.html` writes `talk.fr.mp4` and its captions as
|
|
1963
|
+
`talk.fr.vtt`, the language tagged in both (the audio and subtitle streams' ISO 639-2 tag, and a
|
|
1964
|
+
`Language:` line in the WebVTT header).
|
|
1965
|
+
- **A video voiced by an AI voice says so in its metadata**, by default and in any language, source deck
|
|
1966
|
+
included: the file's comment tag names the engine and that the voice is synthetic. `--disclose` adds a
|
|
1967
|
+
visible line along the bottom of the first slide, in the deck's language; `--no-disclose` writes neither.
|
|
1968
|
+
A take in your own voice (`voices/me`, `voices-<lang>/me`) carries nothing. A `--render live` video gets
|
|
1969
|
+
both, through the same last ffmpeg pass.
|
|
1970
|
+
- **Pronunciation is fixed by rewording**, as in any deck: the notes are also the captions, so they are never
|
|
1971
|
+
respelled for the voice.
|
|
1972
|
+
|
|
1973
|
+
### TRANSLATION_SWITCH · Changing language while presenting
|
|
1974
|
+
|
|
1975
|
+
A deck with `languages`, and each of its translations, shows **Language** rows in the `/` palette: the
|
|
1976
|
+
source's language and each translation's, each named in its own language. The source's rows come from its
|
|
1977
|
+
`languages` and its own name (`talk.html` → `talk.fr.html`); a translation's from its `<link rel="alternate"
|
|
1978
|
+
hreflang>`, which every run of `decklight translate` keeps current in every translation. Choosing one opens that file at the same slide and step, which is the same place because
|
|
1979
|
+
the structure is the same. It is a link to a sibling file: nothing is fetched, merged or translated in the
|
|
1980
|
+
page, and no-trust mode needs no new permission for it (PRESENTING_MODES). A translation that is behind says
|
|
1981
|
+
so beside its name in write mode and nowhere else, and write mode adds the rows that open the panel
|
|
1982
|
+
(`TRANSLATE_PANEL`). **A bundled or published file travels alone unless asked otherwise.** `bundle` and `publish` take
|
|
1983
|
+
`--languages all|fr,es`: each language named is written as its own self-contained file beside the output
|
|
1984
|
+
(`out.html`, `out.fr.html`; `index.fr.html` beside `index.html` for `publish`), and the switch in each links
|
|
1985
|
+
the others. Without the option the file is one language and shows no switch, since a link to a file that did
|
|
1986
|
+
not travel is a dead row.
|
|
1987
|
+
|
|
1988
|
+
**What this is not.** Not translation at presentation time: no model, no network call and no browser
|
|
1989
|
+
translation runs in front of an audience. Not one file holding every language: a language is a deck, with its
|
|
1990
|
+
own history, review file (`talk.fr.review.jsonl`, anchored to the French text as REVIEW anchors any comment)
|
|
1991
|
+
and voice. Not an interchange format: the record is decklight's own, and XLIFF or gettext export is left to
|
|
1992
|
+
whoever needs to send a deck to an agency. Not live interpretation of a speaker.
|
|
1993
|
+
|
|
1994
|
+
**Decided, and deferred.** Structure is the source's with no per-language exception: no swapped image, no
|
|
1995
|
+
slide for one market. The first deck that needs one is the argument for designing it. Right-to-left is
|
|
1996
|
+
written (`dir="rtl"`) but no theme has been verified right to left, and a caption in a language written
|
|
1997
|
+
without spaces is cut by character, not at a word: a segmenter that knows where its words end is not named
|
|
1998
|
+
here.
|
|
1999
|
+
|
|
831
2000
|
## JS_API · Public JS API
|
|
832
2001
|
|
|
833
2002
|
```js
|
|
@@ -841,7 +2010,7 @@ instance.theme(name) // switch theme programmatically
|
|
|
841
2010
|
instance.themePicker.open() / .close()
|
|
842
2011
|
instance.generateTheme() // ⌃T programmatically; returns the autoname
|
|
843
2012
|
instance.cycleFont(dir) // [ / ] programmatically (±1)
|
|
844
|
-
instance.cycleLayout(dir) //
|
|
2013
|
+
instance.cycleLayout(dir) // cycle the slide's layout programmatically (±1; write mode only)
|
|
845
2014
|
instance.layoutRing(slide?) // the layout ring a slide would cycle (skips applied)
|
|
846
2015
|
instance.currentTheme() // the theme on screen, by name
|
|
847
2016
|
instance.toggleNarration() // V programmatically
|
|
@@ -888,7 +2057,7 @@ a deck whose every slide is hidden do. A silent drop is the failure that
|
|
|
888
2057
|
matters here: a chart that quietly vanishes from slide 14 is discovered on
|
|
889
2058
|
stage, so every drop is reported with its slide number and, where decklight has
|
|
890
2059
|
a native answer, what to rebuild it with (`chart dropped — rebuild as
|
|
891
|
-
data-chart`).
|
|
2060
|
+
data-chart`). For the separate PowerPoint export, see `decklight pptx` (PRESENTING).
|
|
892
2061
|
|
|
893
2062
|
The runtime is not involved: `import` is CLI-only, adds nothing to
|
|
894
2063
|
`dist/`, and reads the archive with `tools/zip.mjs` + `tools/ooxml.mjs`, about
|
|
@@ -920,7 +2089,9 @@ A **design system** is what a company publishes once so that every deck built on
|
|
|
920
2089
|
palette: [{ group, label, token }] or a palette of scales,
|
|
921
2090
|
{ colors: { <name>: { label, weights } } }, and themes: [{ name,
|
|
922
2091
|
title, mode, tokens }] drawn from it (apiVersion 2, BRAND_PALETTE),
|
|
923
|
-
recommendedThemes: ["…"] (advice only)
|
|
2092
|
+
recommendedThemes: ["…"] (advice only),
|
|
2093
|
+
migrations: { "<version>": { skill, roles, tokens, classes,
|
|
2094
|
+
themes } } (DESIGN_SYSTEM_MIGRATIONS)
|
|
924
2095
|
design-system.css always-on styles: prefixed tokens, component and per-template rules;
|
|
925
2096
|
url()s resolve relative to this file (url(assets/…))
|
|
926
2097
|
templates.html inert <template data-template="…"> blocks, one per template
|
|
@@ -939,14 +2110,14 @@ Applying is **offered, never automatic**: the page and the type are the author's
|
|
|
939
2110
|
|
|
940
2111
|
**`data-ds-bleed`** on a template's **top-level** element (at most one per template) marks it as the slide's art: its background (colour, image, size, position, repeat) is painted on the screen-sized bleed layer instead of inside the stage (`DECK_ANATOMY` Bleed), so a 16:9 slide's art reaches the edges of a 16:10 or 4:3 screen while the slots stay on the stage. Its own size and position are resolved against the viewport: a `100% 100%` background stretches to the screen's height. `design-system gate` refuses it anywhere else (`bleed-placement`) or twice in a template (`bleed-twice`).
|
|
941
2112
|
|
|
942
|
-
A template carries **structure only**: containers marked `data-slot="<name>"` (children are the default content), `data-slot-hint` (what an author is expected to put there, e.g. `h1,h2`), `data-slot-required`, and at most one `data-slot-default` (where unslotted content lands). Backgrounds and per-template tokens live in the CSS, keyed on the slide's namespaced template (`.decklight section[data-template="acme/section-divider"] { background-image: url(assets/divider.svg) }`), so every `url()` resolves inside the package.
|
|
2113
|
+
A template carries **structure only**: containers marked `data-slot="<name>"` (children are the default content), `data-slot-hint` (what an author is expected to put there, e.g. `h1,h2`), `data-slot-required`, and at most one `data-slot-default` (where unslotted content lands). Backgrounds and per-template tokens live in the CSS, keyed on the slide's namespaced template (`.decklight section[data-template="acme/section-divider"] { background-image: url(assets/divider.svg) }`), so every `url()` resolves inside the package. A template built round one large number holds a figure (DECK_ANATOMY) as a slot's default content, `<div data-slot="figure" data-slot-hint="div.figure" data-slot-required><div class="figure"><p data-figure>42%</p><p>What it counts</p></div></div>`, and its CSS may size it, `.decklight section[data-template="acme/figure"] { --figure-size: 6em }`; a template may hold a run's strip (DECK_ANATOMY) in an empty `<div data-slot="steps"></div>`, where the runtime draws it in place of the top of the slide, and the CSS may restyle `.decklight-steps` and its `.steps-current`, `.steps-done` and `.steps-count` (Northwind's walkthrough template does both); the value's colour is the theme's accent, which a design system with roles maps to one (DESIGN_SYSTEM_ROLES), and a colour a slide writes on a figure by hand is held to the roles like any other (`off-role`).
|
|
943
2114
|
|
|
944
2115
|
**`DESIGN_SYSTEM_API_VERSION`** (2: a palette of scales and the themes drawn from it, BRAND_PALETTE) is the format's own counter, additive only, the doctrine `UNIT_COMPAT` sets for `TRANSFORM_API_VERSION`: bumped only when the format would break an existing package. A package's `apiVersion` above it is refused ("needs a newer decklight"). The package's semver `version` is a different fact (`UNIT_VERSIONS`).
|
|
945
2116
|
|
|
946
2117
|
**`decklight design-system gate <dir>`** is the admission gate a catalog's CI runs, in the mould of `library gate transform` (`EXTENSIONS_CHECK`): ✔ and a summary (tokens, templates and their slots, assets) and exit 0, or ✘ naming the file, the line and the rule for every problem and exit 1, never a stack. The rules, all in `tools/design-system-format.mjs` (pure over texts, so the serving path and the engine run the same ones):
|
|
947
2118
|
|
|
948
2119
|
- **the manifest**: valid JSON; the fields and shapes above; `apiVersion` not above this decklight's; `styles` and `templates` present and inside the package (no scheme, not absolute, no `..`);
|
|
949
|
-
- **the CSS**: no `@import`; no `url()` that names a scheme (`https:`, `data:`, any), is absolute or contains `..`; every relative `url()` a file in the package (a `#fragment` is fine); every custom property **declared** (not merely read through `var()`) starts with the `tokenPrefix
|
|
2120
|
+
- **the CSS**: no `@import`; no `url()` that names a scheme (`https:`, `data:`, any), is absolute or contains `..`; every relative `url()` a file in the package (a `#fragment` is fine); every custom property **declared** (not merely read through `var()`) starts with the `tokenPrefix`, but for the runtime's open knobs a template may set as they are (`--code-max-size` and `--code-callout-width`, CODE_AND_MATH; `--figure-size`, and a run's strip's `--steps-top`, `--steps-bottom`, `--steps-inset`, `--steps-align` and `--steps-size`, DECK_ANATOMY); a **theme-contract token** (`THEMING`) is set only with a `/* ds-exception: --token reason */` comment, the `rule-exception:` idiom, and every declared exception is printed on every run so it stays reviewable;
|
|
950
2121
|
- **the templates**: everything inside `<template data-template>` blocks; no `script`, `style`, `iframe`, `object`, `embed`, `foreignObject`, `link`, `meta`, `base`, `frame`; no `on*` attribute, no `srcdoc`, no `javascript:` URL (entities decoded first); no `src`/`href`/`srcset`/`poster` reference other than a `#fragment`: art lives in the CSS; template ids and slot names `[a-z][a-z0-9-]*`, template ids unique, a slot name once per template, at most one `data-slot-default`;
|
|
951
2122
|
- **SVG assets**: no `<script>`, no `<foreignObject>`, no `on*` attribute, no `href`/`xlink:href` other than a `#fragment`;
|
|
952
2123
|
- **the palette**: a list palette's every `token` is defined in the CSS; a palette of scales and its themes are held to BRAND_PALETTE's rules;
|
|
@@ -968,7 +2139,9 @@ A template carries **structure only**: containers marked `data-slot="<name>"` (c
|
|
|
968
2139
|
|
|
969
2140
|
**Its files** are answered under `decklight-design-system/<marketplace>/<name>/<path>`, a **terminal** namespace in `staticFiles`: answered from the package or not at all, so a file a deck folder happens to hold at that path never answers. Every path segment is `[\w-]+` (the extension apart, so no dotted segment, decoded or not); the extension is in the asset allowlist, or the file is the package's own stylesheet (`templates.html`, the manifest, any other `.css` are never served); the package must resolve and still pass its check; and the file's **real path** must stay under the package's real directory, so a symlink cannot reach out. MIME is fixed per extension, never sniffed; every response carries `X-Content-Type-Options: nosniff`, and an SVG also `Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'`: a document served same-origin must not script. **Every refusal is the same plain 404** a missing path gets: a probe learns nothing.
|
|
970
2141
|
|
|
971
|
-
**While authoring**, `/` → **Design systems…** lists every design system the registered marketplaces offer, from the cache, grouped by catalog (● this deck uses it, ○ it does not, an unusable one saying why
|
|
2142
|
+
**While authoring**, `/` → **Design systems…** lists every design system the registered marketplaces offer, from the cache, grouped by catalog (a heading only over a catalog offering more than one; ● this deck uses it, ○ it does not, one marker and no other; the name with its version set apart; the description one line, the whole of it the row's tooltip; an unusable one saying why; a marketplace not fetched yet said plainly and one whose cached catalog no longer reads as a warning, each with its `marketplace update`), and the selected row says what **Space** would do ("Space: stop using", with how many slides stand on its templates; "Space: use, with its themes and fonts (⇧ alone)"), the footer naming only the keys. **Space** (or ⏎) toggles it through `POST /deck/edit/design-system/mark { ref, used }` (`GET /deck/edit/design-system/browse` lists): the twin of `/deck/edit/theme/mark`, refusing by the same check as the command line (400 with `problems`, 404 unknown, 409 unresolvable or a name clash), one undo entry, and the reload that brings the deck back with it linked. Referencing one changes nothing on screen by itself (a design system styles only the slides that name its templates), so the toast points at **Use slide template…**. the no-trust mode has neither route.
|
|
2143
|
+
|
|
2144
|
+
**A marketplace can be registered from the deck** (#838): the add view of **Marketplaces…** (`MARKETPLACES_SCREEN`, which has the flow). The empty **Design systems…** (*No registered marketplace offers a design system.*) offers it as a row, and ⏎ on it opens that view on its own and comes back to the list once the marketplace is in.
|
|
972
2145
|
|
|
973
2146
|
**`decklight check` reads design-system use before the talk.** Every mistake below renders (the engine shows the content plainly or in the unslotted box rather than losing it), so each is a **warning** (exit code unchanged: errors only), one per slide, from the file half (no Chrome; it runs under `--no-render`), naming what was written and what the design system offers: `ds-unknown-system` (a slashed `data-template` naming a design system the deck does not reference: what it does reference, and the `design-system add` that would), `ds-unknown-template` (the template ids it does define), `ds-unknown-slot` (the template's slots, required ones marked `*`), `ds-slot-twice` (one slot filled by two elements, decided from the file alone, except the template's default slot, which is meant to take several), and `ds-required-empty`. The deck's design systems are resolved the way the servers resolve them (checkouts and cache, never a fetch, and through `check`) and injected into `staticFindings` (`designSystems`, beside `exists`), so the rules are testable without a marketplace on disk. One this machine cannot read is a single head-level `ds-unresolved` warning, and its slides' templates and slots are **skipped, not guessed**. A deck that references no design system resolves nothing. The render half adds nothing: `data-ds-missing` slides are already named from the file, and a machine with Chrome must not count a deck's findings differently from one without.
|
|
974
2147
|
|
|
@@ -998,7 +2171,7 @@ The section gets `data-ds-expanded="<template>@<version>"`, and a later `sync()`
|
|
|
998
2171
|
|
|
999
2172
|
**When the template is not there** (the design system is not on the page, or has no such template), the section gets `data-ds-missing="<reason>"` and its content stays where it was written, so it renders plainly and nothing is lost. While authoring, the slide carries a badge with the reason and the deck says it once (together with any `decklight-design-system-missing` meta); presenting falls back silently.
|
|
1000
2173
|
|
|
1001
|
-
**Editing a design-system slide edits the file's content, never the template's structure.** Element edit mode, the double-click inline editor, a dropped image and the colour picker all address an element through `authoredTop` / `authoredIndex` (`src/core/design-system.js`): the authored element a click lands in (on an expanded slide, wherever expansion put it) at its index **in the file**, recorded before expansion reordered the DOM, so the server needs nothing new. A click on the template's own decoration (`data-ds-injected`) addresses nothing; the colour picker's path into an element never crosses an injected node. An element-content write that would **drop the `data-slot`** an element on such a slide carries is refused (409, "keep data-slot=…"): an edit may change what an element says, or move it to another slot, never silently send it to the unslotted box (`cli/design-system-edit.mjs` `slotWriteProblem`).
|
|
2174
|
+
**Editing a design-system slide edits the file's content, never the template's structure.** Element edit mode, the double-click inline editor, a dropped image and the colour picker all address an element through `authoredTop` / `authoredIndex` (`src/core/design-system.js`): the authored element a click lands in (on an expanded slide, wherever expansion put it) at its index **in the file**, recorded before expansion reordered the DOM, so the server needs nothing new. A click on the template's own decoration (`data-ds-injected`) addresses nothing; the colour picker's path into an element never crosses an injected node. A diagram the author put in a slot is the author's: inside it a click picks the drawn node, a double-click edits a label, a shape takes a concept and `check` lints the `<svg>`, exactly as on a plain slide, because only the `<svg>` itself or a node between it and the one pointed at can be decoration (`src/core/pick.js` `injectedIn`); the slot container above it holds the diagram, it is not it. An element-content write that would **drop the `data-slot`** an element on such a slide carries is refused (409, "keep data-slot=…"): an edit may change what an element says, or move it to another slot, never silently send it to the unslotted box (`cli/design-system-edit.mjs` `slotWriteProblem`).
|
|
1002
2175
|
|
|
1003
2176
|
**`/` → Use slide template…** (write mode) lists the deck's design systems' templates from the page's meta, grouped by design system, each with its slots (`*` required), and a **live preview**: a scaled slide in that template, expanded by the engine itself, its slots at their default content (an empty one labelled with its name). Choosing a template offers, for the current slide:
|
|
1004
2177
|
|
|
@@ -1006,7 +2179,7 @@ The section gets `data-ds-expanded="<template>@<version>"`, and a later `sync()`
|
|
|
1006
2179
|
- **switch** it (from another slide template): only the attribute changes: content stays by slot name, and slots the new template lacks are reported (that content shows in the unslotted box);
|
|
1007
2180
|
- **insert** a new slide in the template after it: one element per **required** slot, by its hint, saying the slot's name; every other slot shows the template's defaults until filled;
|
|
1008
2181
|
|
|
1009
|
-
and, when the current slide uses one, **take it out**: the attribute goes, `data-slot` attributes stay (harmless on a plain slide, and what a later convert reads). Each is one `POST /deck/edit/slide/template { slide, template | null, insert? }
|
|
2182
|
+
and, when the current slide uses one, **take it out**: the attribute goes, `data-slot` attributes stay (harmless on a plain slide, and what a later convert reads). Each is one `POST /deck/edit/slide/template { slide, template | null, insert? }` or `{ slide, template: null, layout }` (`layout?` names a built-in layout, and goes only with `template: null`: out of the template and into it in the same edit, PRESENTING_EDITING), one undo entry, and a sentence saying what went where (`h2 → title (hint h1,h2) · ul → body (the default slot)`). The server reads the template from the package on disk (the deck's own design systems, through the same resolver and check every server uses), never from the page that asked; a template the deck's design system does not have, or a design system the deck does not use, is refused by name.
|
|
1010
2183
|
|
|
1011
2184
|
**Slot names are the design system's contract.** A slide addresses a template only by its template id and slot names, so renaming either is a breaking change for the design system's author; a version that keeps them re-lays-out every slide that uses the template on the next load, by design, with the deck file untouched.
|
|
1012
2185
|
|
|
@@ -1084,7 +2257,7 @@ A switch between two design systems that both use them loses nothing, and the se
|
|
|
1084
2257
|
|
|
1085
2258
|
- `?gen=` and `?theme=` are **exempt**: each is one view asked for by name (a picker preview, an export's `--theme`, a link someone made), and neither is saved.
|
|
1086
2259
|
- **The saved pick** is passed over when it is not one of the brand's themes: a theme this browser chose before the deck kept to its brand is not one it reopens on.
|
|
1087
|
-
- **The configured `theme`** opens the deck only when it is one of the brand's themes. A deck configured on another one (written by `T` while the deck was unlocked, or by an earlier `"brandThemesOnly": false`, and kept when the lock went back on) opens on **the brand's first theme** instead, unsaved. While authoring it says so once a session (*"theme": "eclipse" is not one of Acme Brand's themes — opened on acme-dark*), and `decklight check` warns (`theme-off-brand`, ⚠, at the head), naming the brand's themes and `"brandThemesOnly": false` as the way to keep the configured one.
|
|
2260
|
+
- **The configured `theme`** opens the deck only when it is one of the brand's themes. A deck configured on another one (written by `T` while the deck was unlocked, or by an earlier `"brandThemesOnly": false`, and kept when the lock went back on) opens on **the brand's first theme** instead, unsaved. While authoring it says so once a session, in a toast that points at **Check deck…** (*"theme": "eclipse" is not one of Acme Brand's themes — opened on acme-dark · 1 problem with a fix*), whose `theme-off-brand` row offers the fix: the theme a design system's migration renames the configured one to, else the brand's first (`PRESENTING_EDITING`); and `decklight check` warns (`theme-off-brand`, ⚠, at the head), naming the brand's themes and `"brandThemesOnly": false` as the way to keep the configured one.
|
|
1088
2261
|
- **No configured theme** opens on the brand's first theme too, never on decklight's default.
|
|
1089
2262
|
|
|
1090
2263
|
Unlocked, every step is as it was: the deck opens on whatever its configuration names.
|
|
@@ -1138,6 +2311,47 @@ A role a theme leaves out is refused (`theme-role-missing`), and so is a value t
|
|
|
1138
2311
|
|
|
1139
2312
|
**`design-system gate`** gains these rules: `role-redefined`, `theme-role-missing`, `theme-role-unknown` (✘), `component-off-role` (⚠), with a malformed `roles` or `contract` refused as `manifest-field`. `decklight check` gains `off-role` (⚠).
|
|
1140
2313
|
|
|
2314
|
+
### DESIGN_SYSTEM_MIGRATIONS · A design system's major versions, and the deck that took an older one
|
|
2315
|
+
|
|
2316
|
+
A design system's major version may rename what decks write: a role, a token, a component class, a theme. A deck behind it does not fail; it loses colours, silently, because an undefined `var()` falls back. So a deck **records the version it took**, a package **declares what each major renamed**, and decklight says *migrate* once, where the author is, instead of N unrelated warnings.
|
|
2317
|
+
|
|
2318
|
+
**The deck records its version.** `"designSystemVersions": { "<ref>": "5.0.0" }` in the configuration block, keyed by the deck's own spelling of the reference. `design-system add` (and the edit server's add, and `init --design-system`) writes it with the reference, `remove` drops it with the reference, and `migrate` moves it forward. `design-system apply` writes it for a deck that records none, as `add` does for a deck that already used the design system, unless the deck, or a stylesheet it links, still uses a name a migration renamed: recording the new version would hide that the deck is behind. This is the deck's fact and travels with it. The ledger (`~/.decklight/installed.json`, UNIT_VERSIONS) is one machine's and says nothing about a deck written elsewhere, so nothing below reads it. A bundle already carries the version it inlined (`data-design-system-version`).
|
|
2319
|
+
|
|
2320
|
+
**The package declares its migrations** in `design-system.json`, keyed by the version that made the change:
|
|
2321
|
+
|
|
2322
|
+
```json
|
|
2323
|
+
"migrations": {
|
|
2324
|
+
"6.0.0": {
|
|
2325
|
+
"skill": "acme-migrate",
|
|
2326
|
+
"roles": { "text-diagram-blue": "text-diagram-default" },
|
|
2327
|
+
"tokens": { "--acme-font-size-body-lg": "--acme-font-size-body-xl" },
|
|
2328
|
+
"classes": { "acme-tile--zest": "acme-tile--secondary-3" },
|
|
2329
|
+
"themes": { "acme-devrel": "acme-dark" }
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
```
|
|
2333
|
+
|
|
2334
|
+
Every rename is a whole name: a role by its id (a slide writes its token, `--<prefix>color-<role>`), a custom property, a class (no dot), a theme. `skill` names a marketplace skill (`UNITS#REST`) for what a rename cannot decide, a name removed with no successor. The **gate** refuses (`migration`, ✘) a key that is not semver or is later than the package's `version`, a field it does not know, a malformed name, and, against the package as it now is, an old name it still defines (a rename that leaves the name is not one) or a new name it does not define, unless a later migration renamed it again. Roles are read from `roles`; tokens from the stylesheet, the palette and the roles; classes from the stylesheet's selectors and the templates' `class` attributes; themes from the brand's themes and `recommendedThemes`. The report prints one line per migration.
|
|
2335
|
+
|
|
2336
|
+
**Behind** means the deck records an older major than the package this machine serves, or uses (in its own markup or a stylesheet it links from its folder, `<link rel="stylesheet" href="course.css">`) a name that a migration since its recorded version renamed. A deck that records no version is held to every migration. Renames are composed in version order, so a name renamed in 5.0.0 and again in 6.0.0 is said, and moved, straight to the last one.
|
|
2337
|
+
|
|
2338
|
+
**Said where the author is**, in the same words everywhere: *written for acme 5.0.0, this machine serves 6.0.0: 14 renamed names (text-diagram-blue → text-diagram-default, …). Migrate with the acme-migrate skill, or decklight design-system migrate acme@acme-mkt talk.html*.
|
|
2339
|
+
|
|
2340
|
+
- `decklight check`: **one** head-level warning, `ds-behind` (⚠), per design system. The names it counts are not each warned again as `off-role`. An `off-role` that still meets a renamed role names its successor (*was renamed text-diagram-default in 6.0.0*) instead of the nearest role.
|
|
2341
|
+
- **Write mode**: the servers pass the sentence to the page in `<meta name="decklight-design-system-behind" data-ref data-version>`, read from the same input as `check` (the deck and the stylesheets it links), and the runtime says it once a session while authoring, like the off-brand theme, in a toast that **stays** until the author dismisses it: a pointer (*Acme Brand: this deck is behind the version this machine serves — 1 problem with a fix*) whose button opens **Check deck…** on the `ds-behind` row, where the whole sentence is, and **Migrate** is that row's fix (`PRESENTING_EDITING`). Presenting, a render and a preview say nothing.
|
|
2342
|
+
- **After an update.** The Marketplaces screen's update answers with the design systems the open deck is now behind (`behind`, read as above), and its what's new says each in the same sentence with **Migrate** (M), so nobody has to reload to learn it (`MARKETPLACES_SCREEN`).
|
|
2343
|
+
- **`marketplace update`**: a newer design system whose package declares migrations since the version installed says what that means instead of only the reinstall hint: `acme@acme-mkt 5.0.0 → 6.0.0 (major: decks that use it need migrating, with the acme-migrate skill) — decklight check finds them; decklight design-system migrate acme@acme-mkt <deck.html> moves one`. The screen's *newer than what you installed* row says the same.
|
|
2344
|
+
- **`design-system list <deck>`**: the deck's recorded version against the catalog's, `5.0.0 → 6.0.0 (major: migrate)`. A deck that records none shows the catalog's version and says so.
|
|
2345
|
+
|
|
2346
|
+
**`decklight design-system migrate <ref> <deck.html>`** applies the renames pending since the deck's recorded version: roles and tokens wherever they stand as whole names, classes in `class` attributes and CSS selectors, and the configured `theme`. It edits the deck and the stylesheets it links from its folder (never a URL, a design system's own link or a theme), renames every file in memory before writing any, records the package's version, and prints the renames by kind. A deck already on the version is left byte for byte (*nothing to migrate*). It decides nothing a rename cannot: the migration's `skill` is named for that, and it is a marketplace skill an agent loads like any other (`UNITS#REST`).
|
|
2347
|
+
|
|
2348
|
+
**Migrate, while authoring**, is a job the author watches in the docked agent panel, not a silent rewrite (`POST /deck/edit/design-system/migrate { ref, agent? }`). The panel opens on it and stays open across the reload it causes.
|
|
2349
|
+
|
|
2350
|
+
- **With a skill and an agent.** When the pending migrations name a `skill` and an agent is installed, Migrate is an ask like any other, to that agent: its prompt names the design system, the versions, the deck and the skill, and asks it to run `design-system migrate` for the declared renames and then the skill's checks (renders before and after) and judgement calls (a name removed with no successor), and to report the renames with their counts, each call it made, and what it left alone. **A skill the agent does not load yet is offered first**, before anything runs: the route answers `{ choose: 'skill', skills, places }` and the page asks where it goes, **every project** (Claude's config home, `~/.claude/skills/<name>/`, the one recommended and selected), **this project only** (`.claude/skills/<name>/`), or **not now**, and posts again with `place: 'global' | 'project' | 'none'`. An install takes the skill into the library from its catalog entry when it is not there yet, then copies it as `library add skill` does, one folder per skill as Claude reads them, and listed in every AGENTS.md carrying the Decklight section; a skill the agent already has is never asked about. The prompt points at the skill where the agent loads it, else where it already is on this machine (the library's copy, else its marketplace's checkout, `~/.decklight/marketplaces/<name>/…/SKILL.md`), and only in that last case, not now, is the folder given to the agent to read (`--add-dir` for Claude Code, which reads nothing outside the project otherwise): a skill installed for the agent needs no extra reach. Not now installs nothing anywhere. `decklight design-system migrate` and `decklight library add skill` ask the same on a terminal (Enter is every project), and say how to install it when there is none. It names the commit that holds the deck as it was, for the skill's *before* render; and it says that only the deck and its stylesheets change, so the agent leaves no copy or render behind. That report is what the panel shows, and the commit carries the migration's own subject, whole.
|
|
2351
|
+
- **Otherwise** the edit server runs the migration itself and records it in the same panel as an entry by *decklight*: the renames by kind, the count and the files, the version recorded, and the skill named for what a rename cannot decide. With no agent CLI on the machine the panel still opens, to show it.
|
|
2352
|
+
- **Either way it is one step.** Outstanding work is committed first, so the migration gets its own commit (*decklight: migrate talk.html to acme 6.0.0*), stylesheets included. One undo entry holds the deck and the stylesheets it links, so one Z puts them all back and one redo takes them forward. The reload says why: *migrated to acme 6.0.0*.
|
|
2353
|
+
- **Then the deck is no longer behind**: it records the version, so neither the toast nor the what's-new line comes back. A Migrate on a deck already there is *nothing to migrate*.
|
|
2354
|
+
|
|
1141
2355
|
## FONTS · Fonts: a typeface's files, by reference
|
|
1142
2356
|
|
|
1143
2357
|
A theme **names** its type, `--font-body` is a list of family names, and cannot carry it: a family the machine does not have comes from a Google Fonts `@import` that needs the network (and a page policy that allows it), or not at all, and `bundle` cannot help, since the `@import` still points at Google. A **font package** carries the faces themselves, from a marketplace, by reference, so a deck (and its bundle) has them wherever it is opened. It makes a FAMILY available; it does not restyle anything by itself: a theme that names the family gets it, the font picker offers it, and the deck's `font` default or the viewer's pick applies it.
|
|
@@ -1162,6 +2376,24 @@ A theme **names** its type, `--font-body` is a list of family names, and cannot
|
|
|
1162
2376
|
|
|
1163
2377
|
**While authoring**, **Font…** lists every font the registered marketplaces offer (`GET /deck/edit/font/browse`, cache-only, with each face's `decklight-font/` URL), linking an offered font's faces into the page on demand so the selection can preview it; **Space** references it through `POST /deck/edit/font/mark { ref, used, quiet?, use? }` (the same check as the command line, one config entry, one undo), quietly, so the picker stays open. A marketplace with nothing to offer yet is named (`not listed: … — decklight marketplace update`). Presenting, the picker lists the stacks and the deck's own fonts only.
|
|
1164
2378
|
|
|
2379
|
+
## MARKETPLACES_SCREEN · Marketplaces…: every catalog, which are behind, what's new
|
|
2380
|
+
|
|
2381
|
+
While authoring, `/` → **Marketplaces…** (write mode only, so never under `--no-trust`, whose server has none of these routes) is the one screen for the catalogs this machine has registered (PLATFORM `MARKETPLACE_REGISTRY`). It replaced the **Add a marketplace…** card and palette row: adding is one of its views. Every network act on it is the `decklight marketplace` command it would be at a terminal, run by the edit server as a child process, so the registry cannot tell which door anything came in by.
|
|
2382
|
+
|
|
2383
|
+
**The list** is the cache's, and asks no source anything (`GET /deck/edit/marketplaces`): one row per marketplace, sorted by name, with one mark and its state beside the name (*first-party* set apart), its source with the pinned `#ref` and the `@commit` the cached catalog came from, what it offers per kind (*offers 1 design system, 2 fonts*), and how many of your installs it now has newer (`UNIT_VERSIONS`). A marketplace never fetched says so (○ *not fetched yet*), one whose cached catalog no longer reads is a warning, and one nobody has checked says exactly that (· *not checked: C asks its source*). The selected row says what ⏎ would do, and that a remote update is a clone with your git credentials. The last row is **Add a marketplace…**.
|
|
2384
|
+
|
|
2385
|
+
**Which are out of date.** **C** runs `decklight marketplace outdated --json` (`POST /deck/edit/marketplace/check`): a remote is asked where its ref points now (`git ls-remote`, no prompt, nothing written) and held against the recorded commit (the commit a clone would land on: a branch before a tag of the same name, an annotated tag peeled); a local directory's manifest is compared with the cached copy, with no network at all. Each row then says ✓ *up to date*, ↑ *update available @a1b2c3d → @e4f5a6b* (a local one: *changed on disk*), or why it could not tell (unreachable, a pinned tag that is gone, a catalog fetched before commits were recorded), and a summary line says *checked just now: 1 of 3 out of date*. Every answer is recorded on this machine (`~/.decklight/marketplace-check.json`: when, and each marketplace's state), whoever asked, so the list opens on the last one (*checked 3 min ago: 1 of 3 out of date*) without a C. Opening a screen is not consent to reach the network, so the check does not run by itself until the author says it may (below). At the command line, `decklight marketplace outdated [<name>]` prints the same, each behind one with the update that takes it.
|
|
2386
|
+
|
|
2387
|
+
**Checking when decklight starts.** **O** turns on *Check for updates when decklight starts* (`POST /deck/edit/marketplace/auto-check { on }`; `decklight marketplace auto-check on|off` at a terminal, and `marketplace list` says which it is). It is per machine, kept in `marketplaces.json` beside the marketplaces it is about, and **off until it is turned on**: turning it on is the consent the check otherwise lacks, and while it is off nothing runs. While it is off the screen asks once, ever, on its footer: *Check automatically when decklight starts? O turns it on*. While it is on, an edit server that starts runs the same `decklight marketplace outdated --json` that C runs, in the background, never on the critical path (the server starts and serves without waiting, the shape of the decklight update notice), and at most once in 12 hours, measured from the recorded answer, so restarting during a session does not ask every remote again. Turning it on runs one that is due at once. A source that does not answer is a row on the screen and nothing anywhere else. When the answer lands the server tells the open pages, and the startup log names what is out of date.
|
|
2388
|
+
|
|
2389
|
+
**What it offers.** When the recorded answer has a marketplace behind its source (one never fetched is not an update to something you have), the deck in write mode says so in **one toast that stays** (`GET /deck/edit/marketplace/auto-check`, read from the record, asking nothing): *decklight-confluent has an update: this deck uses confluent-developer (design system) from it*. A check asks where a ref points and reads no catalog, so what it can name is not the version the update brings but what the open deck uses from that marketplace; the version, a major, its migrations and *this deck is now behind* are what's new after the update. **Update** opens the screen and updates that row as ⏎ does, what's new and **Migrate** included; **Marketplaces…** opens the screen; several marketplaces behind are named together, with **Marketplaces…** alone. **Dismiss** is remembered at the commit it was offered for (`{ dismiss, remote }`), so the same update is not offered again and the next one is. With nothing out of date it says nothing. It never updates by itself: an update is still the author's ⏎, because it re-clones with their git credentials and changes what every deck on the machine is served.
|
|
2390
|
+
|
|
2391
|
+
**Updating.** **⏎** updates the selected marketplace and **U** every one the check found out of date or never fetched, one after another (`POST /deck/edit/marketplace/update { name }` runs `decklight marketplace update <name>`: the same re-clone at the same pinned ref, the same refusals, and a failure leaves cache and checkout as they were, said in a toast with the command's reason). Afterwards the theme picker, the font picker and **Design systems…** ask the edit server again, so the catalog as it now is is in them without a reload. Nothing in the deck changes, so there is no undo entry and no reload.
|
|
2392
|
+
|
|
2393
|
+
**What's new.** An update records what it changed on the marketplace's registry entry (`changes`: when, the commit before and after, and the entries **added**, **removed**, and whose `version` moved, `catalogChanges` in `cli/marketplace.mjs`); a first fetch is marked as one rather than reported as forty new entries. `update` prints it (`+ frost@acme 0.1.0 (theme)`, `− old@acme (theme) — no longer offered`, `↑ nord@acme 1.0.0 → 1.1.0`), and the screen opens it after ⏎: grouped *new*, *new versions*, *no longer offered*, then *newer than what you installed*, each with the command that takes it, since an update refreshes the catalog and taking a version stays your call (a design system with migrations says decks need migrating, `DESIGN_SYSTEM_MIGRATIONS`). When the update left the open deck behind one of its design systems, *this deck is now behind* follows, in the sentence `check` says, with **Migrate** (a button, or **M**), which closes the screen and runs in the agent panel. **W** reopens it for a row's last update, from the record, any time later. Esc goes back to the list.
|
|
2394
|
+
|
|
2395
|
+
**Adding** (**A**, or ⏎ on the last row) asks for what `decklight marketplace add` takes: an `owner/repo`, a git URL, or a path, a relative one read from the deck's folder, and its `--branch <ref>` after any of them (a branch or a tag, `acme/themes --branch v2.1.0`, parsed from the field the way the command line reads it). One example of each sits under the field; clicking one puts it in the field to start from. The first ⏎ only says what it is about to do (*Clone https://github.com/acme/brand-kit.git with your git credentials on this machine*, or *Register /talks/northwind, read in place, nothing is fetched*) and touches nothing; the second runs the command, so the result is the same registration the command line makes. The pickers ask again, the toast counts what it offers (*registered northwind: 1 design system, 1 theme, 1 font*), and the list comes back with it selected. A failure (unreachable, no credentials, not a marketplace, a malformed manifest) is the command's own sentence with its reason, shown in the view with the source kept to correct, and registers nothing. `POST /deck/edit/marketplace/add { spec, ref?, confirm? }`: without `confirm`, `{ plan }` (400 for what is not a source, for a ref `--branch` would refuse, or for a ref on a local directory, which has none); with it, `{ name, counts, refreshed }` or 409 with the reason.
|
|
2396
|
+
|
|
1165
2397
|
## REPO_LAYOUT · Repository layout & tooling
|
|
1166
2398
|
|
|
1167
2399
|
```
|
|
@@ -1186,13 +2418,16 @@ decklight/
|
|
|
1186
2418
|
palette's Design systems… list and Use slide template…), design-system.js (a slide's slide template, expanded
|
|
1187
2419
|
into slots in the DOM — never the file), fonts.js (the [ / ] stacks and the deck's font
|
|
1188
2420
|
packages, and the Font… picker that previews, FONTS), bleed.js (the current slide's background
|
|
1189
|
-
art on a screen-sized layer behind the stage, DECK_ANATOMY), film.js (
|
|
2421
|
+
art on a screen-sized layer behind the stage, DECK_ANATOMY), film.js (Make my portrait: the camera,
|
|
1190
2422
|
a take, and the upload to the lip-sync bridge), editbar.js (the bar that names every door of write
|
|
1191
2423
|
mode), pick.js (what a pointer means inside a diagram), style-clip.js (Copy style and Paste style),
|
|
1192
2424
|
concepts.js + concept-tools.js (the deck's concepts, and putting shapes into one, SVG_DIAGRAMS),
|
|
1193
|
-
deckcheck.js (Check deck…) + density.js (SLIDE_DENSITY, measured), dock.js (the panel beside the
|
|
1194
|
-
slide), choice.js (one answer on a card),
|
|
1195
|
-
|
|
2425
|
+
deckcheck.js (Check deck…) + fixreview.js (a quick fix reviewed side by side before it lands) + density.js (SLIDE_DENSITY, measured), dock.js (the panel beside the
|
|
2426
|
+
slide), choice.js (one answer on a card), marketplaces.js (the Marketplaces… screen, MARKETPLACES_SCREEN),
|
|
2427
|
+
stroke-geometry.js (a hidden shape's stroke length, for a draw build the browser will not measure), ranges.js (a slide range, picked), prefs.js (the deck's
|
|
2428
|
+
memory, where localStorage may throw), undo-chord.js (the undo chord as this machine spells it),
|
|
2429
|
+
languages.js (the Languages… panel and language switch, TRANSLATIONS), layout-picker.js
|
|
2430
|
+
(layout and template previews), letter-writing.js (letter-by-letter builds, BUILDS)
|
|
1196
2431
|
— plus autoanimate, builds, print, svg, charts, media,
|
|
1197
2432
|
speaker, annotate, character, character-art, devmode, themegen, voicetrack
|
|
1198
2433
|
src/math/ LaTeX math on data-math slides (Temml → MathML Core)
|
|
@@ -1212,7 +2447,8 @@ decklight/
|
|
|
1212
2447
|
theme.mjs (validate + install a theme, THEMING), import.mjs (PowerPoint/Keynote/Google Slides →
|
|
1213
2448
|
deck, JS_API), pdf.mjs (the print variants, PRESENTING) + pptx-export.mjs (deck → PowerPoint,
|
|
1214
2449
|
NON_GOALS), publish.mjs, marketplace.mjs (register catalogs, MARKETPLACE_REGISTRY; entry versions and
|
|
1215
|
-
the install ledger, UNIT_VERSIONS)
|
|
2450
|
+
the install ledger, UNIT_VERSIONS) + marketplace-autocheck.mjs (the opt-in check when a server
|
|
2451
|
+
starts, MARKETPLACES_SCREEN), enhance.mjs (the notes rewritten by your agent: audio tags, or
|
|
1216
2452
|
written for the ear — checked before a byte is written), design-system.mjs (the design-system
|
|
1217
2453
|
admission gate, and add/remove/list/templates, DESIGN_SYSTEMS) + design-system-refs.mjs (a deck's
|
|
1218
2454
|
design systems: resolution, injection, and serving the package) + design-system-edit.mjs
|
|
@@ -1227,9 +2463,9 @@ decklight/
|
|
|
1227
2463
|
core), deck-routes.mjs (the deck's channel, both modes'), edit.mjs (the one server, write mode and no-trust mode: a route table, with the slide-mutation routes in
|
|
1228
2464
|
edit-slides.mjs, the look routes in edit-look.mjs, the hand-over routes in edit-handover.mjs, the commit and history routes in edit-git.mjs), open.mjs, remote.mjs, agents.mjs (AI-agent roster), git.mjs (the
|
|
1229
2465
|
commit-mode decision table: on your word, or the timer), update-check.mjs (the "a newer decklight exists" notice), qr.mjs,
|
|
1230
|
-
port-conflict.mjs, supervise.mjs, skill-content.mjs (the agent skill's shipped text), start.mjs (a bare
|
|
2466
|
+
port-conflict.mjs, supervise.mjs, skill-content.mjs (the agent skill's shipped text) + skills/*.md (the two writing skills beside it: slide content and voiceover), start.mjs (a bare
|
|
1231
2467
|
`decklight`: start a deck here, or open the one that is), doctor.mjs (what this machine can do),
|
|
1232
|
-
check.mjs (one deck linted headlessly — the file half and one --dump-dom of ?print, in one
|
|
2468
|
+
check-fixes.mjs (the quick fixes Check deck… offers for check's findings: which, and the renames they apply), fix-review.mjs (a quick fix held for review: the candidate, its slide-by-slide merge, the commit it drafts), check.mjs (one deck linted headlessly — the file half and one --dump-dom of ?print, in one
|
|
1233
2469
|
exit code, PRESENTING), open-browser.mjs (hand a URL to the platform launcher), banner.mjs (the
|
|
1234
2470
|
startup banner), runtime-link.mjs (a deck as data: the runtime linked in on the way out,
|
|
1235
2471
|
DECK_ANATOMY), clone-deck.mjs (a git URL as the deck), trust.mjs (a deck's code, trusted by its
|
|
@@ -1242,20 +2478,25 @@ decklight/
|
|
|
1242
2478
|
a tree built without the working tree), comments.mjs + review-store.mjs + review-ref.mjs +
|
|
1243
2479
|
review-routes.mjs + review-submit.mjs + review-remote.mjs (REVIEW: the comment store, a review
|
|
1244
2480
|
as a branch, its routes, sending it back and what is waiting), agent-review.mjs (Check deck…'s
|
|
1245
|
-
review by the local agent), bundle-audio.mjs (a bundle's narration audio)
|
|
2481
|
+
review by the local agent), bundle-audio.mjs (a bundle's narration audio) + bundle-module.mjs (one
|
|
2482
|
+
chapter as its own bundle, its narration renumbered), report-bug.mjs,
|
|
2483
|
+
translate.mjs + translate-core.mjs + translate-files.mjs (translation, its records and checks)
|
|
2484
|
+
+ edit-translate.mjs (the Languages… panel's routes, TRANSLATIONS)
|
|
1246
2485
|
tools/ theme-check.mjs (the THEMING token contract + WCAG gates, as a function) + color.mjs (contrast math), local-voice.mjs (what this OS can say: macOS say / Windows SAPI, PRESENTING), zip.mjs (read an Office archive) + ooxml.mjs (a small XML reader) + pptx.mjs (PowerPoint → sections, JS_API) + template-theme.mjs (a .pptx theme part → a gated theme, DECK_IMPORT) + pptx-write.mjs (the other direction: slides as pictures, notes as notes), voiceover.mjs (batch TTS) + voiceover-server.mjs (tts bridge), publish-voices.mjs (track → bucket + signed manifest, PRESENTING), publish-targets.mjs (Netlify/Vercel deploy adapters, PRESENTING), exec.mjs (one bounded subprocess: every hang names itself), atomic-write.mjs (a temp sibling and a rename, so a
|
|
1247
|
-
crash never truncates a deck), tts-cache.mjs (a sentence is synthesized once — the on-disk cache every engine shares), tts-engines.mjs (gemini/chirp/piper/elevenlabs/say/sapi) + gemini-tts.mjs, elevenlabs-tts.mjs, lipsync.mjs (batch visemes/video) + lipsync-server.mjs (lipsync bridge) + lipsync-engines.mjs (rhubarb, Wav2Lip, SadTalker, and preparing a photo or a film) + lipsync-config.mjs (the talking-head setup, saved once), visemes.mjs (timeline v1), design-system-format.mjs (the design-system package rules, pure, DESIGN_SYSTEMS) + font-format.mjs (the font package rules and the one @font-face writer, pure, FONTS) + semver.mjs (versions and their precedence, UNIT_VERSIONS), video.mjs (deck → narrated mp4, PRESENTING)
|
|
2486
|
+
crash never truncates a deck), tts-cache.mjs (a sentence is synthesized once — the on-disk cache every engine shares), tts-engines.mjs (gemini/chirp/piper/elevenlabs/say/sapi) + gemini-tts.mjs, elevenlabs-tts.mjs, lipsync.mjs (batch visemes/video) + lipsync-server.mjs (lipsync bridge) + lipsync-engines.mjs (rhubarb, Wav2Lip, SadTalker, and preparing a photo or a film) + lipsync-config.mjs (the talking-head setup, saved once), visemes.mjs (timeline v1), design-system-format.mjs (the design-system package rules, pure, DESIGN_SYSTEMS) + design-system-migrations.mjs (what a major renamed, and applying it, DESIGN_SYSTEM_MIGRATIONS) + font-format.mjs (the font package rules and the one @font-face writer, pure, FONTS) + semver.mjs (versions and their precedence, UNIT_VERSIONS), video.mjs (deck → narrated mp4, PRESENTING)
|
|
1248
2487
|
themes/ 46 × <name>.css (the graded + reveal-compat sets; the homage packs moved to the
|
|
1249
2488
|
marketplace, THEME_DISTRIBUTION) + packs.json + gallery.html
|
|
1250
2489
|
dist/ decklight.js (IIFE, global Decklight), decklight.css
|
|
1251
2490
|
demo/ smoke.html (the render harnesses' deck — every feature, including deliberate regression
|
|
1252
|
-
fixtures) + intro.html, features.html, pitch.html, showcase.html + assets/
|
|
2491
|
+
fixtures) + intro.html, features.html, pitch.html, showcase.html + assets/ + northwind/ (an
|
|
2492
|
+
invented company's design system, as a local marketplace) + postmortem/ (the talk the showcase
|
|
2493
|
+
tells, at every stage, and its casts)
|
|
1253
2494
|
test/ node:test units (ansi, builds, math, cast format, the CLI, the marketplace, the pieces lifted out
|
|
1254
2495
|
of engine.js), found by run.mjs rather than a shell glob + 30 headless-Chrome harnesses (render,
|
|
1255
2496
|
player, narration × 5 — live/picker/recorded/segments/record, engine × 8 — themes/palette/
|
|
1256
2497
|
narration/navigation/handover/sources/authoring/builds, record, review, character, pin,
|
|
1257
2498
|
overflow, split, strict, shot, plugin, extension-check, deckfile, pdf, pptx-render, import,
|
|
1258
|
-
theme-config) +
|
|
2499
|
+
theme-config) + verify-shard.mjs (VERIFY_SHARD=i/n: the harnesses dealt out, for CI) +
|
|
1259
2500
|
contrast.mjs and palette-rules.mjs (every shipped theme through tools/theme-check.mjs, and the house palette bar) + the two manual end-to-end scripts neither
|
|
1260
2501
|
blessed suite runs: soak.mjs (pack, install, walk the journey — the release gate) with its
|
|
1261
2502
|
soak-platform.mjs, and video-e2e.mjs (a real ffmpeg render)
|