refactor(diagram): extract diagram_command, push (de)serialization behind diagram_handle #59
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/059-refactor-diagram-extract-diagram-command-push"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
refactor(diagram): extract diagram_command, push (de)serialization behind diagram_handle
Along the way:
Touches 28 files:
ck-editor/src/view/render.rs,ck-markdown/src/paint.rs,ck-typeset/src/laid_out.rs,ck-typeset/src/layout.rs,ckeditor-lint/baseline.toml,ckeditor-lint/baseline_CHANGELOG.mdand 22 more.Mostly there, but the question on
ckeditor/src/app_layout/ai_merge.rsneeds an answer before this lands.@ -0,0 +12,4 @@/// Route an [`AiAction`] emitted by the AI panel to the project-command/// chokepoint or terminal injection. A free function (not a `CkEditorApp`/// method) so the action surface stays off the god-class metrics.pub(crate) fn dispatch_action(dispatch_actionreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?@ -400,3 +368,1 @@// A freshly opened diagram buffer must NOT be dirty even// though the rope was rewritten by load_editor's normalization// step.let buf = Buffer::open(path).expect(EXPECT_LOADS);The expect message on
bufis the only thing a user sees if this fires. Does it say what they should do, or only what we assumed?@ -96,0 +103,4 @@/// non-diagram paths or unparseable contents. Owns the diagram half of/// `buffer::load_editor` so `buffer.rs` only holds the field.#[must_use]pub fn load_into_editor(load_into_editoris public. Does anything outside the crate call it, or is it pub because that was easier? Every public item is a promise.Split. The decision in
dispatch_actionis a pure function now, with its own tests inckeditor/src/app_layout/ai_merge.rs.It said what I assumed. Reworded in
ckeditor/src/buffer.rsso it names the input that broke it, which is what the bug report will need.Nothing outside calls
load_into_editor. It is pub(crate) inckeditor/src/diagram_handle.rsnow.Done, and I added the test for
ckeditor/src/app_layout/ai_merge.rsthat would have caught it.That is it for
ckeditor/src/app_layout/ai_merge.rs. Thanks for the second pass.Looked through
ckeditor/src/app_layout/ai_merge.rsas well. Fine by me.