trilium/docs/Developer Guide
Elian Doran 649188c5c8
refactor(ckeditor5): fold math into the aggregate package
The last of the ckeditor5-* packages. `packages/ckeditor5-math` had no
consumers outside `@triliumnext/ckeditor5`, was never published, and
carried a ckeditor5-package-generator scaffold that nothing invoked —
including a tsconfig.test.json referencing an uninstalled @types/mocha,
so its tests were never typechecked at all.

Move it to src/plugins/math/, flattening src/ui/ and renaming to the
repo's snake_case convention, with the tests co-located as *.spec.ts.
The `mathlive` and `@ckeditor/ckeditor5-icons` dependencies move onto
this package, which is now the only thing that needs them.

Three things the move surfaced:

- math_input_view.ts re-declared `window.mathVirtualKeyboard`, which
  MathLive declares itself. Harmless in a separate package, a hard
  TS2717/TS2687 here — and it was cascading into a dozen unrelated
  typecheck errors across apps/client and apps/build-docs.
- MathUI binds `mathInputView#value` to the command, but MathInputView
  assigns its own `value` on every MathLive/textarea change, which
  severs the binding. A legacy test asserted the live binding and had
  been passing only by accident of timing. It now asserts the contract
  that holds, and _addFormView()'s seemingly redundant manual push is
  documented as load-bearing.
- The preview element is never actually hidden or removed by hand:
  both call sites look it up after the view containing it has already
  gone. Marked as dead rather than left looking functional.

Coverage: lines and functions 100%, statements 99.91%, branches 98.91%.
The residue is branch permutations in the MathLive sync logic
(main_form_view, math_input_view, math_ui) and still needs tests before
the aggregate's 100% gate passes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 18:11:34 +03:00
..
Developer Guide refactor(ckeditor5): fold math into the aggregate package 2026-08-01 18:11:34 +03:00
!!!meta.json docs(user): update regarding MCP auth 2026-07-25 21:44:29 +03:00
Developer Guide.md docs(developer): revert accidental removal 2026-07-17 11:12:17 +03:00