Skip to content

fix(editing): hide formatting markup while editing page text (#242) - #362

Merged
DWAA1660 merged 1 commit into
AlienTechSoftware:mainfrom
Mathew-D:fix/visible-text-editing/242
Nov 18, 2026
Merged

DWAA1660 merged 1 commit into
AlienTechSoftware:mainfrom
Mathew-D:fix/visible-text-editing/242

Conversation

@Mathew-D

Copy link
Copy Markdown
Collaborator

What and why

Editing a page showed its serialized markup — **bold**, [text](url),
<span style="...">, tag markers — as dimmed text instead of the formatted
result, so users edited source rather than words. Normal block editing now
uses a visible/source split: InlineEdit keeps the parsed Spans as the
document and exposes a visible-text projection to egui, so cursor, selection,
typing, copy/paste and IME all run on visible characters while markup never
enters the buffer. Edits fold back through an LCS-aligned literal mask:
stored literal punctuation (*literal*, $5, [x](y), paths) keeps its
identity while newly typed Markdown still parses. Formatting, link and video
dialog edits mutate spans directly — removing a link leaves identical
visible words, which a text diff could never distinguish. Inline images are
one object character, the editor layouter reuses the preview's span
formatting, and code/math blocks keep source editing. Closes #242.
Only tested on Linux.

Quality level L3 (see SKILLS/nc-devx/SKILL.md)

  • cargo xtask pre-push passes on the current branch before pushing
  • The pre-push hook confirms the validation still matches origin/main
  • CI checks pass for this pull request
  • Coverage: the coverage job's warnings are read; cargo xtask coverage --update is in
    this pull request if coverage rose
  • Docs match the change: docs/commands.md (regenerated), docs/gaps.md,
    docs/testing.md, docs/mcp.md, docs/control-protocol.md, as they apply
  • A new user action is a CommandSpec with a test
  • Page or demo changes: cargo xtask demo-check, the format parity test, and a side by
    side look at both formats
  • UI changes: the pictures were looked at; cargo xtask screenshots if they changed
  • New files under assets/ or docs/images/ have a row in ATTRIBUTION.md

How it was checked

  • cargo test -p notecraft-ui-egui — 420 lib + 325 UI tests, 0 failures,
    including new regression tests for visible-run editing, literal
    preservation, image atomicity, Unicode offsets and live widget typing.
  • cargo xtask ci — all checks passed: fmt, clippy -D warnings,
    workspace tests, ui-tests, i18n-audit, layers, assets, docs, text,
    demo-check.
  • Not checked: cargo xtask pre-push (run after commit, before push) and
    cargo xtask screenshots — the editor's visual output intentionally
    changes (markup hidden, formatting shown), so screenshots should be
    regenerated and reviewed before merge.

…chSoftware#242)

Normal editing now shows the rendered text — marks, link syntax, HTML
tags and tag markers stay out of the editor while their formatting stays
visibly applied. InlineEdit keeps the serialized spans as the document
and exposes a visible-text projection; edits fold back through an
LCS-aligned literal mask so stored literal punctuation keeps its
identity while newly typed Markdown still parses. Inline images are one
object character, caret/selection/copy/paste run on visible characters,
and dialog edits (link, video) splice spans directly so removing a link
works even when the visible words are unchanged.
@DWAA1660
DWAA1660 merged commit 04df9d3 into AlienTechSoftware:main Nov 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formatting markup (HTML tags) shows while editing regular text; seamless text editing and formatting needed

2 participants