Fixing a runnable note

"Fix as New Note…" (toolbar button in the runnable-note UI, next to Save) saves the current outputs of a runnable note — plots, printed text, tables — as a new, ordinary non-runnable note. Motivation: some runnable notes pull live/time-sensitive data (e.g. location/speed-plot); a given day's result is worth keeping without needing to re-run (or worry the live note gets edited later) just to see it again. This is the "Snapshot a runnable note's output" design idea from notes-browser/todo (2026-07-10), built 2026-07-17.

What happens

Walking the document in order:

show() item conversion

Only some show() output kinds have a persistent block equivalent yet:

Naming

Default suggestion: {original_key}-{YYYY-MM-DD-HHMM}, editable before saving. The timestamp is the last_run_at of the cells (when the run that produced these outputs actually finished), not when Fix is clicked — those can be hours apart, e.g. fixing this morning's commute plot in the evening. last_run_at is a new field on sheet_kernel.CellRecord/CellInfo, set at the end of run_cell().

New JSONHTL block types

See JSONHTL_SPEC for the full schema of image (raster, base64) and details (collapsible section). Both needed for this feature specifically but are general-purpose block types, usable outside it too.

image rendering: web → <img src="data:image/{format};base64,...">; desktop → base64-decoded straight into a wx.Image, registered in wx.MemoryFSHandler (same mechanism as svg, but no rasterization step needed — it's already raster). See svg_render.py.

details rendering: web → native <details>/<summary>, collapsed by default, genuinely zero-JS for per-item toggle. "Expand all" needed a small inline onclick handler after a pure-CSS version was tried and confirmed empirically not to work (browsers suppress collapsed <details> content via native rendering suppression tied to the open DOM attribute, not an overridable display rule). Desktop → no equivalentwx.html.HtmlWindow doesn't recognise <details> at all, degrades to always-expanded in a bordered box. Proper fix needs wx.CollapsiblePane and a restructure of the desktop note-viewing architecture from one HTML blob per page to a sizer of mixed widgets — logged as a follow-up in notes-browser/todo.

Control API

sheet.fix_as_new_note (params: optional key, defaults to the suggested name) — same conversion logic as the toolbar button, for scripted/automated fixing.

Tests

Live example

A real fixed copy of location/speed-plot (run 2026-07-17) at test/speed-plot-fixed-demo — created for verification, safe to delete or repurpose.

created 2026-07-17