fix: preserve drafts, canvas edits, and remote Continue tools

Keep paragraph formatting and checklist todos when removing canvas pages,
and preserve accepted undo/redo history after oversized input is rejected.
Merge restored queued text into the latest conversation draft and retain
image delivery when OCR returns image references and generated warnings only.

Deliver session MCP servers to bridged remote Continue Execute while keeping
Ask read-only and preserving local model-profile isolation. Add regression
coverage and update feature documentation. Correct stale conversation-limit
and forced-color assertions and the measured Electron layout test deadline.

Validation: 4,826 tests passed, 67 skipped; full typecheck and lint passed.
Current-source Linux x64 Execute/Ask/Execute MCP delivery passed, using 10
real text-provider requests and no image-provider requests. Image generation
itself was not exercised. Staged whitespace checks passed before commit.

Release note: 修复恢复队列时覆盖新输入、画布删页丢失清单格式及超限输入清空撤销历史的问题;图片 OCR 无正文时保留原图发送方式,远程 Continue Execute 正确保留会话 MCP 工具。
This commit is contained in:
mesalogo
2026-09-19 23:09:48 +08:00
parent 375b2159c8
commit a3b7a27045
29 changed files with 664 additions and 60 deletions
+21
View File
@@ -1,5 +1,26 @@
# Magic Notes Progress
## 2026-09-19: Canvas Content and History Preservation
- Page-break deletion now removes only the embed, retaining existing paragraph
terminators and checklist/heading formats. Mid-line insertion retains Quill's
native paragraph split rather than guessing which newline is disposable.
- Oversized input is rejected before the canvas-local History records it, then
reverted with its inverse Delta. Accepted undo/redo and user selections survive;
normal rich-text editors retain their original History module.
- `npx vitest run tests/canvas-core.electron.test.ts src/renderer/src/magic-canvas`
passed 35 tests across 5 files. Electron exercised actual Quill selection and history, then production
SQLite/file create, update and reopen retained the same checklist todo.
This uses Quill API edits in an isolated Electron window, not physical keyboard
input or the full App/IPC save flow.
- Focused ESLint for the four changed source/test files and `git diff --check`
passed. The integrated full suite passed 4,826 tests with 67 skipped
(405 files passed, 9 skipped); full typecheck and lint passed.
The existing hidden-window layout scenario measured about 63 seconds, so its
child deadline is now 90 seconds with bounded temporary-directory cleanup
retries. All geometry, input and persistence assertions remain intact and passed.
No model calls, persistence/schema changes, remote Runtime changes or commits.
## 2026-09-19: Canvas Image Import Size
- Raised the canvas image file limit to 20 MiB inclusive and updated its error
@@ -228,6 +228,13 @@ PDF text layer. `capturePages()` provides PNG data URLs for AI input, not a PNG
download button. Undo/redo is per annotation page or Quill mode; page operations
and PDF imports are not global undo steps.
Flow page-break removal and rejected-input history handling follow the
[canvas editing and limit rules](../../../src/renderer/src/magic-canvas/README.md#editing-and-assets).
`canvas-core.electron.test.ts` feeds the real Electron flow's before/after content
into production `AssistantDatabase` create/update and reopen, checking that the
derived checklist todo and its identity survive page-break removal. History
coverage exercises accepted typing, rejected overflow, selection and redo.
The [canvas integration reference](../../../src/renderer/src/magic-canvas/README.md)
owns core limits, import behavior and lifecycle details. Vite bundles Fabric,
Quill, jsPDF, PDF.js workers and binary assets; PDF workers use explicit module