this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

x-ocaml: make Interactive cells editable

Interactive mode was incorrectly set to read-only, preventing users
from typing in code cells. Interactive cells should be editable with
ephemeral changes (lost on refresh), unlike Exercise cells which
persist edits to localStorage.

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

+4 -4
+1 -1
src/cell.ml
··· 316 316 ?(merlin = true) ?extra_style ?inline_style ~eval_fn ~fmt_fn ~post_fn this = 317 317 let shadow = Webcomponent.attach_shadow this in 318 318 let is_hidden = mode = Hidden in 319 - let is_readonly = mode = Interactive || mode = Test in 319 + let is_readonly = mode = Test in 320 320 321 321 if not is_hidden then 322 322 init_css shadow ~extra_style ~inline_style;
+3 -3
src/cell.mli
··· 3 3 A cell is a single code editor + output region embedded in the page. Each 4 4 cell has a {!mode} that controls its appearance and behaviour: 5 5 6 - - {b Interactive}: visible, read-only. The default for cells without a 7 - [mode] attribute. Shows pre-written code the reader can run but not edit. 6 + - {b Interactive}: visible, editable. The default for cells without a 7 + [mode] attribute. Edits are ephemeral (lost on page refresh). 8 8 - {b Exercise}: visible, editable. The reader writes or modifies code here. 9 9 - {b Test}: visible, read-only. Contains assertions that validate exercise 10 10 code. Linked to an exercise cell and run automatically after it. ··· 32 32 (** {1 Mode} *) 33 33 34 34 type mode = 35 - | Interactive (** Visible, read-only. *) 35 + | Interactive (** Visible, editable. Edits are ephemeral. *) 36 36 | Exercise (** Visible, editable. *) 37 37 | Test (** Visible, read-only. Linked to an exercise cell. *) 38 38 | Hidden (** Invisible. Provides definitions to later cells. *)