Skip to content

Add VisualEditor support for math/chem formulas - #80

Merged
jmnote merged 6 commits into
mainfrom
visualeditor-support
Sep 8, 2026
Merged

jmnote merged 6 commits into
mainfrom
visualeditor-support

Conversation

@jmnote

@jmnote jmnote commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add VisualEditor dialogs, context items, and model/CE nodes for math and chemical formulas (resources/ve/)
  • Add i18n messages for the new VE dialogs: i18n/en.json, i18n/qqq.json, i18n/ko.json
  • Add demo tooling to drive VE and record per-formula insert animations (hack/demo/ve_animation.mjs, hack/demo/demo-animations.yaml), and split existing demo screenshots/gifs by MediaWiki version under docs/
  • Update Makefile and AGENTS.md with the new demo/animation targets

Test plan

  • make checks
  • make demo / make animations against a local MediaWiki instance to confirm the VE math/chem dialogs work as expected

- Add VE dialogs, context items, and model/CE nodes for math and chem
  formulas under resources/ve/
- Add i18n/en.json, i18n/qqq.json, and i18n/ko.json for the new VE
  dialog strings
- Add demo tooling for VE animations (hack/demo/ve_animation.mjs,
  hack/demo/demo-animations.yaml) and split demo screenshots/gifs by
  MediaWiki version under docs/
- Update Makefile and AGENTS.md with the new demo/animation targets
- extension.json: version 1.0.1 -> 1.1.0
- demo-animations.yaml: comment out 1.45, tweak default doc's Korean
  text
- ve_animation.mjs: update recorded page title, minor formatting
- Regenerate docs/animations/1.43/animation-default.gif, drop the
  1.45 one to match demo-animations.yaml

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f74709c8b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread resources/ext.SimpleMathJax.js Outdated
Comment thread resources/ext.SimpleMathJax.js Outdated
- Shorten overly verbose comments in Makefile, hack/demo/render.php,
  and hack/demo/demo.sh without changing behavior
- Remove the screenshot/animation usage paragraphs from AGENTS.md
- Add hack/demo/demo.md documenting the demo/screenshot/animation
  make targets (moved out of AGENTS.md)
- ve_animation.mjs: tweak recorded page title
- Regenerate docs/animations/1.43/animation-default.gif
- script.onerror now rejects scriptLoadPromise and clears the loaded
  flag, so a failed load doesn't leave mw.libs.smj.typeset() callers
  (e.g. ve.ce.MWFormulaNode.afterRender) pending forever, and a later
  call can retry
- The wikipage.content hook now typesets a later fire's own content
  (e.g. a live preview) instead of only ever loading the script once
  and never touching subsequent content
…bled

wgSmjDelimitersEnabled lets $...$/$$...$$ appear as bare text with no
.smj-container wrapper, so scoping a later wikipage.content fire's
typeset call to just .smj-container elements (as the previous fix did)
missed that content entirely when delimiters are on. Pass the whole
$content fragment to MathJax.typesetPromise() in that case, matching
how the initial page load already sets startup.elements to null
(whole document) for the same setting; the opacity fix-up still only
targets whatever .smj-container elements are present.
@jmnote
jmnote merged commit 21000cd into main Sep 8, 2026
1 check passed
@jmnote
jmnote deleted the visualeditor-support branch September 8, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant