1
0
Fork 0
polaris-task-force/src/components
Z8MB1E 5e1f200261 feat(wiki): replace textarea overlay with a CodeMirror markdown editor
The body editor painted highlighted markdown in a div behind a transparent-text
textarea, so the painted text and the caret were two different layout engines.
Any wrap-point difference (borders, scrollbar gutters, engine rounding, trailing
newlines) shifted the overlay by whole lines once content soft-wrapped, making
clicks land on the wrong glyph and the document end feel unreachable. The CSS
patch that preceded this reduced the drift but could not remove the class of bug.

CodeMirror 6 owns text and caret together, so the failure mode is gone by
construction rather than by maintenance. The body remains a markdown string, so
prepareMarkdown, ::: directives, wikilinks, templates, revisions and the preview
pipeline are untouched, with no data migration.

- WikiMarkdownEditor: EditorView lifecycle, theme and markdown HighlightStyle
  bound to the app's CSS tokens, history, line wrapping, IME-safe keymap.
- markdownCommands: one pure command table shared by toolbar buttons and keys.
- editorChange: toolbar updates dispatch only the differing span, keeping undo
  granular and selections outside the edit intact.
- Removes WikiEditorHighlightLayer, editorMetrics, lib/wiki/editorHighlight,
  useEditorHistory and the now-dead textarea selection reader.
- Adds e2e proof: glyph-precise clicks across wrapped paragraphs, list items,
  image markdown and scrolled documents land at the exact clicked offset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-11-18 15:12:22 -05:00
..
admin feat(npc-dialogue): AI-assisted conversation drafting behind the review gate 2026-11-12 12:26:35 -05:00
awards/ribbonDesign feat(awards): brass-emboss ribbon devices, swap arrow for valor V 2026-10-27 01:47:10 -04:00
command-palette feat(garage): grid UI with dispatch and store, replacing deployed vehicles list 2026-10-13 16:02:58 -04:00
frontend feat(wiki): replace textarea overlay with a CodeMirror markdown editor 2026-11-18 15:12:22 -05:00
graphics feat: application staging deployment (ensure better commits after this) 2025-12-15 01:14:30 -05:00
static fix(version): compose version+commit label when git describe is unavailable 2026-09-06 17:23:03 -04:00
ui feat(analytics): add first-party analytics collector, SDK, rollups, and admin dashboard 2026-10-14 12:12:53 -04:00