Skip to content

feat(app): singleton math-field popover - #187

Open
Carter907 wants to merge 9 commits into
bluelearn-org:mainfrom
Carter907:feat/singleton-popover-math-field
Open

feat(app): singleton math-field popover#187
Carter907 wants to merge 9 commits into
bluelearn-org:mainfrom
Carter907:feat/singleton-popover-math-field

Conversation

@Carter907

@Carter907 Carter907 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

This refactor is for the math-field bugs that happen when you attempt to wrap a math-field inside ephemeral (frequent mount and unmounts) React components such as the Radix UI popover.

Instead of rendering a <math-field> inside every individual equation node, the editor renders exactly one globally across the entire editor.

Rather than wrapping the singleton inside a @radix-ui/react-popover, which strictly enforces onInteractOutside rules and requires virtual anchors, I implemented a custom floating <div /> using createPortal.

closes #185
closes #186
closes #209

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Build / tooling / CI
  • Other: _________

Verification

  • pnpm -r typecheck passes
  • pnpm -r build passes
  • Manually verified in a browser (for UI / behavior changes)
  • Followed the app layout conventions
  • No new dependencies, or new dependencies are justified and AGPL-compatible
  • Change does not violate any non-negotiable principle
  • Documentation only, no changes to the codebase, so no tests required

@Carter907 Carter907 self-assigned this Jul 23, 2026
@Carter907 Carter907 added the area:frontend Tasks related to frontend (app) label Jul 23, 2026
Signed-off-by: Carter <speers.carter@gmail.com>
Signed-off-by: Carter <speers.carter@gmail.com>
@Carter907
Carter907 force-pushed the feat/singleton-popover-math-field branch from 6690c03 to 2f9a26e Compare July 23, 2026 04:26
@Carter907 Carter907 changed the title feat(app): singleton math-field popover architecture feat(app): singleton math-field popover Jul 23, 2026
Carter907 and others added 7 commits July 24, 2026 20:46
- Add fontsDirectory configuration for MathLive to resolve 404 errors.
- Pass Lexical nodeKey to MathLiveComponent so it correctly highlights on selection and Ctrl+A.
- Update MathLiveComponent wrapper styles to fix native drag selection trapping on block math.
- Add pointer-events-none to KaTeX inner elements to restore native click to edit behaviour.
- Fix math shortcut detector to correctly ignore escaped dollar signs ($ and $$).

Signed-off-by: Carter <speers.carter@gmail.com>
- Simplify autosave logic to leverage MDXEditor's onChange with an onBlur flusher
- Restore native Markdown toolbar formatting options
- Fix z-index issue overlapping the stepper header

Signed-off-by: Carter <speers.carter@gmail.com>
Extend the contribution editor to support all 6 callout variations in
the toolbar and add a shortcut listener to insert them by typing `:::`.

Signed-off-by: Carter <speers.carter@gmail.com>
Signed-off-by: Carter <speers.carter@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Tasks related to frontend (app)

Projects

None yet

1 participant