Skip to content

Three canvas densities, medium by default - #220

Open
grunion-ai wants to merge 1 commit into
mainfrom
canvas-density
Open

grunion-ai wants to merge 1 commit into
mainfrom
canvas-density

Conversation

@grunion-ai

Copy link
Copy Markdown
Owner

What changes

A deck can now choose how much page it has, separately from how much a slide carries.

canvas: 'low' | 'medium' | 'high' in the model, or --canvas on create and new. Medium is the default.

canvas size side margin Body reads as, on the 960 scale point caps, speaker / reading
low 720×405 56 24 3 / 4
medium 960×540 60 16 3 / 8
high 1280×720 32 10.5 6 / 24

The tier sets the canvas, margin, role sizes, foot band and word caps. Library layouts and templates are cut from the margins inward with a piecewise map, so a full-bleed row stays full bleed and a style kit written for 960 works on all three. --space still wins on size.

density keeps its meaning: speaker and reading say how much a slide carries.

Script-blocked viewers

Claude's browser pane shows a local file outside the project as a static snapshot. Scripts do not run there, yet the parser still keeps the <noscript> still as text, and display:contents painted that text as raw markup.

The deck now hides that text and says the viewer blocks scripts. With JavaScript fully off, the still of slide 1 renders as before. A script-blocked viewer gets the message, not a slide. Hosting with bin/serve.mjs is the route to a working deck in the pane.

Evidence

  • npm test: 737 of 737 pass after rebasing on Store repair after a late save from another window #218. The Firefox and WebKit checkout test (test/checkout-live.test.mjs) each failed once in earlier full runs and passed when rerun alone, so it looks flaky under load.
  • test/canvas-density.test.mjs is new. It holds medium to the same geometry as a deck with no canvas, and covers the tiers, the map, the caps and the errors.
  • Three mock decks with the same content built on the tiers (7, 5 and 3 pages) pass validate --strict and verify --strict in Chromium and WebKit.
  • The blocked-script fix was checked in Chromium with a script-src 'none' policy, not in the pane itself, because the pane's tools cannot inspect a snapshot tab.
  • deck.html, library.html and schemas/model.schema.json are regenerated. The template change is why the two HTML files differ.

Known limits

  • Low holds less on purpose: 61 of 115 templates fit their sample copy there, against 114 of 115 on medium and high. The one miss on medium and high is the same figure-decision connector warning. On low, validate names the overlap to shorten or split.
  • Role factors and caps are fixed tables per tier. A style kit cannot override them yet.
  • Low sets Stat at 1.4× so library tiles hold it. A hero slide could take more.
  • SKILL.md lost its one-line "A PDF nobody asked for" anti-pattern to stay inside the word budget. Step 6 still says it.

🤖 Generated with Claude Code

A deck can now choose how much page it has, separately from how much a
slide carries. canvas: low | medium | high in the model, or --canvas on
create and new.

low is 720x405 with larger type and margins. high is 1280x720 with smaller
type and 32px margins. medium is 960x540 and is the default; a deck that
names no canvas builds as it always did.

The tier sets the canvas, margin, role sizes, foot band and word caps.
Library layouts and templates are cut from the margins inward with a
piecewise map, so a full-bleed row stays full bleed and a style kit written
for 960 works on all three. --space still wins on size.

Low holds less on purpose: 61 of 115 templates fit their sample copy there,
against 114 of 115 on medium and high. validate names what to shorten.

A viewer that blocks scripts by policy, such as Claude's browser pane on a
local file, keeps the noscript still as text, and display:contents painted
that text as raw markup. The deck now hides it and says the viewer blocks
scripts. With JavaScript fully off the still renders as before.

ponytail:
- lib/layouts.mjs: role factors and caps are fixed tables per tier; a style
  kit cannot override them. Upgrade: read a tier block from style.json.
- lib/layouts.mjs: low uses Stat at 1.4x so library tiles hold it; a hero
  slide wants more. Upgrade: a low-only hero layout or template.
- template.html: a script-blocked viewer gets a message, not a slide.
  Upgrade: make the still real markup that render() replaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant