Repository navigation
Description
Stage 3 — Layout and writing preferences
Synopsis
Let users choose whether editable block-equation source appears above or below the rendered preview.
End goal
Equation editing follows the user's preferred visual order without losing source, caret position, or active editing state.
Start after
No prerequisite issue. This work can start independently from freshly fetched origin/main; stage numbering does not require waiting for every earlier milestone. Use the repository's dedicated feature-branch/worktree workflow and record the actual base revision.
Agreed scope
- The option moves the editable source relative to the rendered preview; it does not move the entire equation block within the document.
- Provide above/below choices, retaining the current above-preview arrangement as the initial default.
- Keep original supported math delimiters and literal source intact; no mathematical rewriting is in scope.
- Apply the preference consistently in both editor hosts and independently of the soft-wrap preference.
Acceptance criteria
- The source appears above/below the same preview as selected, and the preference persists.
- Changing placement during editing preserves source text, selection, caret, and active edit mode without causing a premature commit.
- Preview updates, keyboard entry/exit, undo/redo, source switching, and save/reopen retain existing math behavior.
- The presentation preference creates no source edits or undo entries and does not alter exported mathematical content.
Verification
- Exercise single- and multi-line display equations, supported delimiter forms, long expressions, and invalid/in-progress input.
- Change placement during active input and pending preview updates; check focus, scroll, and equation-background synchronization.
- Verify both host preference paths and combinations with soft wrapping once available.
Source pointers
src/webview/editor.jssrc/webview/styles.csssrc/editorProvider.tselectron/src/settings-manager.tspackage.jsontest/specs/equation-background-sync.spec.tstest/specs/equation-compatibility.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