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>
11 files changed,
+433
−85
fixtures/head.mjs+5 −17fixtures/notes-card.mjs+44 −12fixtures/notes-card.test.mjs+107 −37fixtures/pref-cookie.mjs+31 −0fixtures/pref-cookie.test.mjs+31 −0internal/slides/credits/assets.json+1 −1internal/slides/editor.go+59 −0internal/slides/static/{editor.130d6c72326c9dc7.js => editor.a3f0007e07ab9e46.js}+15 −15internal/slides/templates/editor.html+7 −3internal/slidestest/browser_editor_tidy_test.go+65 −0internal/slidestest/editor_tidy_test.go+68 −0
fixtures/head.mjsLoading diff…
fixtures/notes-card.mjsLoading diff…
fixtures/notes-card.test.mjsLoading diff…
fixtures/pref-cookie.mjsLoading diff…
fixtures/pref-cookie.test.mjsLoading diff…
internal/slides/credits/assets.jsonLoading diff…
internal/slides/editor.goLoading diff…
internal/slides/static/{editor.130d6c72326c9dc7.js => editor.a3f0007e07ab9e46.js}Loading diff…
internal/slides/templates/editor.htmlLoading diff…
internal/slidestest/browser_editor_tidy_test.goLoading diff…
internal/slidestest/editor_tidy_test.goLoading diff…