From 0404f4122df37af35c3411bdcfaef0551a20f7cf Mon Sep 17 00:00:00 2001 From: tiye Date: Sat, 14 Nov 2026 10:08:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=94=A8=20Respo=20CoordKey=20=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=20Markup=20=E7=8A=B6=E6=80=81=E6=A0=91=E6=A0=B9?= =?UTF-8?q?=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calcit.cirru | 4 ++-- scripts/typed-reel-render.test.mjs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/calcit.cirru b/calcit.cirru index a4778ed..9d239dd 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -191,7 +191,7 @@ :schema $ quote EnumDef 'Store $ %{} 'CodeEntry (:doc |) :code $ quote $ defstruct Store - :states $ Map Dynamic Dynamic + :states $ Map respo.schema/CoordKey Dynamic :examples $ [] :schema $ quote StructDef 'decode-store $ %{} 'CodeEntry @@ -253,7 +253,7 @@ previous $ app.schema/read-editor-data $ get-state-at states (conj cursor :data) assoc store :states $ decode-map-as update-state-tree states cursor $ assoc previous :content content - Map Dynamic Dynamic + Map respo.schema/CoordKey Dynamic (:hydrate-storage data) data :examples $ [] :schema $ quote $ Fn app.schema/Store app.schema/Op String Number (-> app.schema/Store) diff --git a/scripts/typed-reel-render.test.mjs b/scripts/typed-reel-render.test.mjs index def6f11..edada6e 100644 --- a/scripts/typed-reel-render.test.mjs +++ b/scripts/typed-reel-render.test.mjs @@ -47,6 +47,8 @@ test('content edits survive Reel replay and the existing saved-state format', () assert.equal(clt.option_$o_none_$q_(decode_store(clt.parse_cirru_edn('{} (:states $ {} (:cursor |wrong))'))), true); assert.equal(clt.option_$o_none_$q_(decode_store(clt.parse_cirru_edn(PRE_031_ARCHIVE.replace(':cursor $ []', ':cursor |wrong')))), true); assert.equal(clt.option_$o_some_$q_(decode_store(clt.parse_cirru_edn('{} (:states $ {})'))), true); + assert.equal(clt.option_$o_some_$q_(decode_store(clt.parse_cirru_edn('{} (:states $ {} (2 ({})) (|panel ({})))'))), true); + assert.equal(clt.option_$o_none_$q_(decode_store(clt.parse_cirru_edn('{} (:states $ {} (true ({})))'))), true); }); test('hydrates the fixed pre-upgrade archive through the typed Reel update path', () => { From fdd8e2c4bf45059c5e6acd79b178de8e504614c8 Mon Sep 17 00:00:00 2001 From: tiye Date: Sat, 14 Nov 2026 10:09:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A6=86=E7=9B=96=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E5=92=8C=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=B8=B8=E6=A0=87=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=90=8E=E7=9A=84=E5=AD=98=E6=A1=A3=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/typed-reel-render.test.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/typed-reel-render.test.mjs b/scripts/typed-reel-render.test.mjs index edada6e..9e572f6 100644 --- a/scripts/typed-reel-render.test.mjs +++ b/scripts/typed-reel-render.test.mjs @@ -51,6 +51,16 @@ test('content edits survive Reel replay and the existing saved-state format', () assert.equal(clt.option_$o_none_$q_(decode_store(clt.parse_cirru_edn('{} (:states $ {} (true ({})))'))), true); }); +test('updates and restores an editor with string and number cursor keys', () => { + const t = clt.init_tags(['edit-content', 'states', 'data', 'content']); + const edit = clt._PCT__$o__$o_(Op, t['edit-content'], clt._$L_('panel', 2), 'nested'); + const updated = updater(store, edit, 'edit', 1); + const restored = clt.option_$o_unwrap(decode_store(clt.parse_cirru_edn(clt.format_cirru_edn(updated)))); + const field = (value, key) => clt.option_$o_unwrap(clt.get(value, key)); + const editor = field(field(field(field(restored, t.states), 'panel'), 2), t.data); + assert.equal(field(editor, t.content), 'nested'); +}); + test('hydrates the fixed pre-upgrade archive through the typed Reel update path', () => { const field = (value, key) => clt.get(value, clt.init_tags([key])[key]).extra[0]; const legacy = clt.parse_cirru_edn(PRE_031_ARCHIVE);