A `lightcraft:cmd` whose params were not valid JSON ran the command with `{}`, so a typo acted on the selection. `host::cmd_params` now accepts an object (or empty / null as `{}`) and refuses anything else unrun, as the control channel and MCP do. A `lightcraft:open` larger than a library backup can hold is no longer copied into the app's memory: the parent gets `lightcraft:failed` with the reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AbegtYaPuwqZ81pGfELsFK
A sandboxed iframe (no allow-same-origin) keeps its URL but runs with
the opaque origin "null": window.location.origin still said
http://…, so such a page got a bridge after all. Bridge::new now reads
window.origin, and the start-up warning names both reasons for having
no page to speak to. Checked in Chromium: a sandbox="allow-scripts"
frame posts nothing (no ready, dirty or response); a same-origin frame
is unchanged.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AbegtYaPuwqZ81pGfELsFK
Review follow-up: a page whose origin is "null" (a sandboxed iframe, a
data: page) gets no bridge, since every other opaque-origin window would
pass the origin check as the parent. The docs say responses carry no
request id (as in the sibling bridges) and come back in the order the
commands were sent, one per cmd that had an id.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AbegtYaPuwqZ81pGfELsFK
Review follow-up on the host bridge:
- `lightcraft:failed` is also posted when another tab holds the library
or the page has no canvas, so the parent never waits for a `ready`
that can't come.
- a finished flush asks for a frame, so `lightcraft:dirty {false}`
reaches the parent at once instead of on the next input event.
- the backup's delivery is awaited: "Library backed up" is said once the
page has the zip (or the download started), and a failed handoff
reports as a failed backup.
- docs: `lightcraft:save` carries exports and the library backup; the
preset, keyword and curve file dialogs have no web implementation yet.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AbegtYaPuwqZ81pGfELsFK
A same-origin page that embeds LightCraft in an iframe can now speak to
it over postMessage, with the protocol PdfCraft, GridCraft and DeckCraft
share (deckcraft#983), under lightcraft: message types:
- ready {version} / failed {error} at start-up;
- open {name, bytes} from the page adds a photo, as one dropped on the
window (the name gives the format);
- save {name, bytes} replaces every download: exports, preset and
keyword files, the library backup (handed over as a transferred
ArrayBuffer);
- dirty {dirty} whenever closing the page would start or stop losing
something (a write to browser storage queued or running, or changes
storage refused), so the page can ask before closing a window with
edits;
- cmd {id, params} runs a command like lightcraft.command(..) and is
answered with response {ok, value}.
Only the parent window on the page's own origin is heard or answered.
There is no docClosed: LightCraft has a library, not documents. The
message layer (apps/lightcraft-web/src/host.rs) is plain Rust with
native tests; the postMessage part is wasm32 only.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AbegtYaPuwqZ81pGfELsFK
`cargo xtask ci` fails with the craft-fonts input supplied, which CLAUDE.md says
releases always build with:
ka in Proportional (faces: ["Noto Sans Georgian"]) lack glyphs: ✕
Two strings in ka.json use ✕ (U+2715). Noto Sans Georgian has no glyph for it
and egui's bundled fonts do not either, so a Georgian reader gets a blank where
the text describes the activity stack's stop control. Without the fonts input
those twenty tests skip, so a plain `cargo xtask ci` is green and this stayed
invisible.
The two Georgian values use × (U+00D7) instead: it reads the same at text size
and every face has it. The English keys are untouched — they are the source text
from docs/whats-new.md, and the test checks values, which is the right scope. An
English reader's font covers ✕; the problem is a translation carrying it into a
script whose face does not.
`translated_catalogs_do_not_use_missing_menu_triangles` already forbids ▸ and ▾
in locale JSON for the same reason, so ✕ joins them in one list. That matters
because ✕ is in the English source of those two strings: every language that
translates them next would hit the same failure, and a cheap test now catches it
instead of the font-dependent one.