Repository navigation
Description
Stage 2 — Discoverable GUI editing
Synopsis
Provide underline as an explicit editing feature using documented <u> source representation. Support applying and removing it without losing formatting or content during serialization.
End goal
Underline works through the GUI and survives save/reopen, source switching, undo/redo, and supported nested-formatting cases.
Start after
- Make the standard text-formatting toolbar visible by default #24 — Make the standard text-formatting toolbar visible by default
Start implementation only after every prerequisite is merged into main or has a maintainer-accepted technical freeze recorded in its linked issue. A freeze must identify the exact source/prototype commit and settled contracts; an open draft PR alone is insufficient. For an investigation prerequisite, acceptance must identify the approved design/report revision and prototype commit if one exists.
Fetch current origin/main before branching. If using a freeze, record an integration base containing all required prerequisite changes and link the freeze decisions in the PR. Validate the combined result again after the final prerequisite changes are integrated. The recorded freeze governs any agreed early start while a prerequisite issue remains open.
Agreed scope
- Use
<u>...</u>as the documented HTML-backed representation; do not invent an ambiguous Markdown delimiter. - Add underline to the standard formatting interface and shared action dispatch where appropriate.
- Recognize only the intended supported underline semantics; this change does not authorize arbitrary HTML execution or broad HTML-editor behavior.
- Keep code spans, code blocks, and escaped literal
<u>examples literal. Export compatibility is a separate dependent issue.
Acceptance criteria
- Applying/removing underline to supported selections toggles the intended text and handles partially or already-underlined selections predictably.
-
<u>content loads, renders, serializes, saves, and reopens without losing text or duplicating wrappers. - Underline composes with supported bold/italic/strikethrough/link formatting and works in relevant paragraph, list, and table contexts.
- Literal examples inside code/escaped text remain unformatted, and unrelated Markdown syntax or source whitespace is preserved.
- Undo/redo and source/visual switching retain the intended document; controls and documentation clearly describe the compatibility surface.
Verification
- Add parser/serializer and editing regressions for application/removal, mixed selections, nested formatting, multiline boundaries where supported, literal examples, and unrelated edits.
- Exercise both editor hosts and save/reopen in the packaged extension.
- State editor/source support accurately until the separately tracked export compatibility is complete.
Source pointers
src/webview/editor.jssrc/shared/editor-body-html.jssrc/webview/styles.csssrc/i18n/localestest/specs/roundtrip.spec.tstest/specs/shortcuts.spec.ts
Delivery contract
Implement the shared editor behavior in both VS Code and Electron. View-only settings/actions must preserve Markdown, selection/editing context, clean state, and undo history. For new or changed settings, keep host wiring, manifest descriptions, all supported translations, and documentation consistent. Preserve existing identifiers and defaults except for the deliberate changes specified above.
Work from the repository root using the Node version in .node-version and the maintained instructions in CONTRIBUTING.md, docs/building.md, and docs/testing/README.md; export changes also follow docs/export-verification.md. Run full compilation after webview JavaScript/CSS, shared-module, or translation changes, plus checks that exercise the changed behavior. Rebuild and reinstall for installed-extension evidence. Report failures/skips honestly; follow required CI and review gates. Update affected documentation and review any committed Markdown in source and rendered form.
Link the PR or investigation to this issue. Keep remediation on the same focused work item where practical. Completion requires the stated evidence and accepted outcome; opening a draft PR does not complete the issue. No deadline or assignee is imposed by this issue.
Activity