lumbda/wasm/repl
russell@unturf.com 5de290c662
repl: persist input draft per-tab — recover on refresh
Adds an inputDraft field to each tab and writes the textarea contents
through saveSoon on every input event (paste, type, autocomplete).
renderAll restores the draft into the textarea when a tab becomes
active, so refresh-after-half-typing or switching between tabs and
back lands the user back on what they were composing.

Plumbing:
  * newTab() seeds inputDraft: ""
  * setActiveTab() snapshots the outgoing tab's textarea value before
    swapping (covers the gap between last input event and next
    saveSoon flush)
  * renderAll() writes the active tab's draft back into the textarea
    (+ autosizeInput so a 40-line recovered draft expands to fit)
  * sendInput() clears tab.inputDraft alongside inputEl.value so the
    vault next snapshot doesn't preserve an already-committed entry

Smoke-tested: type a 5-line draft, fresh browser context with same
vault password reopens to the same 5 lines + same 82px height. Per-tab
isolation verified — switching tabs preserves each tab's own draft.
Send empties the draft; subsequent reload shows empty input.
2026-06-15 07:56:37 -04:00
..
crypto.js repl: /repl/ page with encrypted multi-tab sessions 2026-06-14 12:50:35 -04:00
index.html repl: portal save/resume — vault-backed tier checkpoints 2026-06-15 07:43:07 -04:00
repl.css repl: auto-grow input textarea to fit pasted multi-line programs 2026-06-15 07:47:29 -04:00
repl.js repl: persist input draft per-tab — recover on refresh 2026-06-15 07:56:37 -04:00