1
0
Fork 0
polaris-task-force/src
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
..
app feat(intelligence): show derived faction relations on the faction and relations pages 2026-11-18 14:13:20 -05:00
arena feat(minigames): superuser developer console dock across all ten games 2026-10-20 12:48:27 -04:00
assets/images feat: application staging deployment (ensure better commits after this) 2025-12-15 01:14:30 -05:00
bot docs(bot): record the interaction ack and error-path rules 2026-11-03 12:50:29 -05:00
collections refactor(intelligence): drop the factions.relationships array in favour of the ledger 2026-11-18 14:13:29 -05:00
components feat(wiki): replace textarea overlay with a CodeMirror markdown editor 2026-11-18 15:12:22 -05:00
hooks feat(minigames): add Ordnance Disposal (bomperator) multiplayer drill 2026-10-16 00:32:52 -04:00
lib feat(wiki): replace textarea overlay with a CodeMirror markdown editor 2026-11-18 15:12:22 -05:00
migrations refactor(intelligence): drop the factions.relationships array in favour of the ledger 2026-11-18 14:13:29 -05:00
permissions feat(intelligence): add the faction relation ledger collection and score math 2026-11-18 14:13:20 -05:00
scripts feat(dev): add seed-attendance bin for random mission attendance 2026-11-02 10:01:32 -05:00
tools feat(intelligence): add undiscovered faction state with read masking 2026-11-18 09:19:57 -05:00
utils feat(map-objectives): superuser-authored strategic objectives on mission maps 2026-10-27 02:12:31 -04:00
payload-generated-schema.ts feat(intelligence): add the faction relation ledger collection and score math 2026-11-18 14:13:20 -05:00
payload-types.ts feat(intelligence): add the faction relation ledger collection and score math 2026-11-18 14:13:20 -05:00
payload.config.ts feat(intelligence): add the faction relation ledger collection and score math 2026-11-18 14:13:20 -05:00