Replace Monaco with one CodeMirror editor and nest list items with Tab
Phase 4b. DocumentEditor.svelte replaces LiveWriter.svelte and the Monaco EditorHost.svelte. Each open document has one CodeMirror state. Write and Source are two compartment configurations of it, so they share the undo history. editorStates.ts keeps the state while the tab stays open. The Monaco model, the diff bridge, its timers, and sessions.ts are gone. - Source: syntax colors from the theme tokens, lazy language packages, line numbers, folding, and the current line in IDE, wrapped lines in Writing, several carets, and bracket matching and closing. - Lists (card 088e778b): Tab nests a list item and Shift+Tab moves it up, in Write and Source. Both renumber the list. The source keeps "1.". Write and Read show numbers, letters, then Roman numerals. - Indent (card 696c30ce): a fixed 4 spaces in Write and Source. - The code menu uses CodeMirror commands. The command palette item and the Monaco styles, search, theme, and workers are removed. - @codemirror/legacy-modes is pinned to 6.5.4. Version 6.5.5 uses parser types that do not match @codemirror/language 6.12. - 26 smoke tests use CodeMirror instead of Monaco. New tests: editor/listNesting and the markdownLists unit tests. - Docs: development, UI design, plugin host, user guide, and UI-040. pnpm check, pnpm test (341 of 341), and pnpm build pass. The full smoke suite passes, except one template test that passed on retry.
This commit is contained in:
@@ -753,3 +753,23 @@ Native shell, background image, and desktop acceptance remain open.
|
||||
- Evidence: The browser check also covers mixed tabs, pinned tabs, plugin tabs, and Cancel with unsaved edits.
|
||||
- Evidence files: .audit/secondary-last-tab-cancel.png and .audit/compact-tabs-{width}-{theme}.png.
|
||||
- Limits: Desktop calls use browser mocks. Native window closure and active terminal confirmation still need desktop acceptance.
|
||||
|
||||
### UI-040 — Nested lists and one editor for Write and Source
|
||||
|
||||
- Type: Rule change
|
||||
- Date: 2026-10-28
|
||||
- Status: Implemented for user review
|
||||
- Decision source: Cards 088e778b and 696c30ce, and the approved Phase 4 plan of 2026-10-28.
|
||||
- Previous rule: Tab in a list item added indentation and kept the number. Write indented by 2 spaces, and the IDE view by 2 spaces in Monaco.
|
||||
- New rule: Tab in a list item makes a nested item, and Shift+Tab moves it one level up. Both renumber the list.
|
||||
- New rule: Nested ordered lists show decimal numbers at level 1, letters at level 2, and Roman numerals at level 3 in Write and Read. The Markdown source keeps the numbers, for example `1.`.
|
||||
- New rule: The indent is a fixed 4 spaces in Write and Source, with no setting.
|
||||
- New rule: Write and Source are two configurations of one CodeMirror state. They share the undo history.
|
||||
- Reason: Lists behave as in common word processors. One editor removes the Monaco model bridge and its timers.
|
||||
- Scope: Markdown documents in Write and Source, and all source files.
|
||||
- Shared implementation: DocumentEditor.svelte, markdownLists.ts, liveMarkdown.ts, sourceView.ts, codeLanguages.ts, editorStates.ts, and the `.reading ol ol` styles in app.css.
|
||||
- Exceptions: An empty nested item cannot start a list inside a paragraph in CommonMark. Write labels it, and Read shows it as text until the item has text.
|
||||
- Evidence: editor/listNesting.smoke.mjs covers Tab, Shift+Tab, labels, Read letters, the shared history, and the 4-space indent in both themes at 1440 and 600 pixels.
|
||||
- Evidence files: output/smoke/editor/listNesting/.
|
||||
- Replaces / replaced by: None.
|
||||
- Limits: Source has no minimap, no command palette, and no bracket pair colors. Browser checks use desktop service mocks. Native desktop acceptance remains open.
|
||||
|
||||
Reference in New Issue
Block a user