oficina / slides Public

Editor: the notes' state and height are cookies the server renders

The server painted the notes open at the default height and the bundle
then closed or resized them: a flash under a slow bundle, and a moving
stage since the height is remembered. Ruling R21: they are now the
slides-notes (open|closed) and slides-notes-height (whole px) cookies,
Path=/, a year, Lax, Secure on https, as slides-inspector is. editor.go
reads them; the template renders the card's data-state, the View row's
check and the height, clamped to 105..2000, as a custom property in a
style attribute (the CSP keeps style-src 'unsafe-inline', and
render.Slide sets a slide's theme the same way). An old localStorage
preference is honoured once, moved to the cookies and removed. With
cookies blocked the card still works for the page (final review,
finding 6).

pref-cookie.mjs is the cookie read and write head.mjs and
notes-card.mjs share. TestEditorTidyNotesState covers each cookie value
and garbage; TestTidyNotesFirstPaint checks the paint with the bundle
blocked and that binding moves nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev ce7c9ff586bfd8279870e63e55be692886d7bef9 parent c73ca7f
11 files changed, +433 −85
  • fixtures/head.mjs +5 −17
  • fixtures/notes-card.mjs +44 −12
  • fixtures/notes-card.test.mjs +107 −37
  • fixtures/pref-cookie.mjs +31 −0
  • fixtures/pref-cookie.test.mjs +31 −0
  • internal/slides/credits/assets.json +1 −1
  • internal/slides/editor.go +59 −0
  • internal/slides/static/{editor.130d6c72326c9dc7.js => editor.a3f0007e07ab9e46.js} +15 −15
  • internal/slides/templates/editor.html +7 −3
  • internal/slidestest/browser_editor_tidy_test.go +65 −0
  • internal/slidestest/editor_tidy_test.go +68 −0
fixtures/head.mjs

Loading diff…

fixtures/notes-card.mjs

Loading diff…

fixtures/notes-card.test.mjs

Loading diff…

fixtures/pref-cookie.mjs

Loading diff…

fixtures/pref-cookie.test.mjs

Loading diff…

internal/slides/credits/assets.json

Loading diff…

internal/slides/editor.go

Loading diff…

internal/slides/static/{editor.130d6c72326c9dc7.js => editor.a3f0007e07ab9e46.js}

Loading diff…

internal/slides/templates/editor.html

Loading diff…

internal/slidestest/browser_editor_tidy_test.go

Loading diff…

internal/slidestest/editor_tidy_test.go

Loading diff…