feat: add persistent document handling and protect note drafts

Add HTTP PaddleOCR-VL settings and shared document previews for chat and knowledge imports. Preserve attachment originals and parsed assets across drafts, messages and queues; support explicit image OCR, selecting document images into a conversation draft, and restoring queued input for editing.

Protect unsaved note bodies and titles during navigation and asynchronous updates. Match canvas analysis to source revisions, invalidate affected comments, preserve annotations during pagination, and provide a resizable record index with saved width preferences.

Existing OCR settings retain local behavior. Historical attachments without saved originals are not reconstructed. Advanced OCR options depend on the configured service; image sending depends on the effective model and Runtime.

Validation: full typecheck and lint passed; 477 focused tests passed across 12 files; staged whitespace checks passed. The full repository suite was not rerun for this commit.

Release note: Keep note drafts safe while switching workspaces, resize the record index, and revisit saved document attachments with OCR previews and selected images in chat.
This commit is contained in:
mesalogo
2026-09-19 16:51:10 +08:00
parent 17186b0c11
commit 935a8f56bf
95 changed files with 6232 additions and 553 deletions
+15 -1
View File
@@ -67,6 +67,17 @@ records are listed separately and do not introduce another feature status.
model memory after 60 seconds without active or queued work and reloads on
demand; fast text/index modes still skip OCR. See the
[parsing behavior and real-file evidence](./docs/features/document-processing/chat-attachments-technical-design.md).
- [x] **HTTP OCR and persistent attachment previews**: Configure HTTP
PaddleOCR-VL under Settings > Document Parsing, shared by chat documents and
knowledge imports. Saves originals and extracted images and provides
text/image/detail previews, explicit image-to-text actions, and selecting
document images into a named conversation draft before sending. Ordinary chat
images use image input by default, subject to the effective model and Runtime.
This adds no Application Center entry; Local Inference Monitor manages local
services only. Real validation covers Windows, direct visual input, and managed
OpenCode on the shared Linux Host. Deployment-specific advanced OCR models and
other Runtime combinations need separate verification. See
[scope and evidence](./docs/features/document-processing/README.md).
- [x] **Per-file workspace diffs**: Changed files expose separate staged and
unstaged diffs, including deleted, renamed, and untracked files. Refresh
reloads the selected diff, browsed directory, and expanded directories; more than 50 changes
@@ -601,7 +612,10 @@ records are listed separately and do not introduce another feature status.
- [x] **Magic Notes**: A local-first notes and todo workbench with scope
management, editing, filtering, and controlled AI comments. Notes open from a
responsive card overview. Detail displays a continuous stream with independently
collapsible left index and right AI pane. Real first-page thumbnails scroll to
collapsible left index and right AI pane. The index defaults to 168px and supports
pointer and keyboard resizing from 140px to 320px, with saved width preferences;
narrow layouts retain the fixed-width drawer without a resize handle.
Real first-page thumbnails scroll to
records without replacing editors. Successful saves establish the editor's
normalized baseline; only unsaved changes require confirmation on leaving. Opening
a note shows a blank text/canvas composer above the history, and creation resets it