Skip to content

BACK-467/208/475/476 - Web editor: file preview, paste as Markdown, docx upload (split 1/9 of #669) - #675

Closed
MrLesk wants to merge 4 commits into
mainfrom
pr669/1-editor-paste
Closed

BACK-467/208/475/476 - Web editor: file preview, paste as Markdown, docx upload (split 1/9 of #669)#675
MrLesk wants to merge 4 commits into
mainfrom
pr669/1-editor-paste

Conversation

@MrLesk

@MrLesk MrLesk commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Note

Maintainer-split slice 1/9 of #669. All commits are authored by @kuwork — I only rebased them onto current main and resolved conflicts. Merge with Rebase and merge to keep the per-task commits and original authorship.

Stack

This is the base of the stack: mainthis PR ← slice 2 (wiki core) ← … ← slice 9.

Tasks in this slice

BACK-467 — Local file preview with syntax highlighting and line numbers

  • src/file-system/operations.ts: readFilePreview() with configurable line limit, safe path resolution, MIME detection
  • src/server/index.ts: GET /api/files/preview
  • src/web/components/FilePreviewModal.tsx: modal with syntax highlighting, line numbers, dark mode
  • src/web/components/MermaidMarkdown.tsx / TaskDetailsModal.tsx: intercept local file links → preview modal

BACK-208 — Paste-as-Markdown in Web UI

  • src/web/components/PasteAwareMDEditor.tsx: paste interception wrapper for MDEditor
  • src/web/utils/paste-as-markdown.ts: HTML → Markdown via Turndown (+GFM), Word/Excel cleanup, image extraction
  • src/core/assets.ts: new AssetManager (upload / promote / cleanup / downloadImage with SSRF protections)
  • src/server/index.ts: POST /api/assets/upload, /api/assets/promote, /api/assets/download-image

BACK-475 — Word (docx) upload with image extraction

  • src/core/docx-converter.ts: mammoth-based docx → HTML with embedded image extraction to temp assets
  • src/server/index.ts: POST /api/docx/convert
  • Editor toolbar upload button + drag-and-drop in PasteAwareMDEditor.tsx

BACK-476 — Fix inline-code HTML escaping in markdown renderer

  • src/web/components/MermaidMarkdown.tsx: protected ranges for fenced/inline code in sanitizeMarkdownSource

Notes

  • New dependencies: turndown, turndown-plugin-gfm, mammoth.
  • bun.lock and src/web/styles/style.css regenerated against current main during the rebase.
  • Task IDs in backlog/tasks/ were minted on the fork — re-mint before merge if main has since taken them.
  • Validated at this tip: bun install --frozen-lockfile, bunx tsc --noEmit.

Original combined PR: #669.

Full stack: #675 editor/paste → #676 wiki → #677 i18n → #678 doc editing → #679 search/sidebar → #680 fixes → #681 dates/stats → #682 Gantt → #683 timezone/polish — split from #669, all commits authored by @kuwork.

@MrLesk

MrLesk commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Alex's Agent: Maintainer cleanup: closing this draft as an archived slice of #669.

This PR is still part of a stacked broad feature bundle and is outside the current project scope. We are not merging this stack.

For future work, please open or link an issue before submitting a PR so the scope can be agreed before implementation. If a small fix from this slice is still desired, please extract it into a fresh PR against main with one narrow, agreed scope and no dependency on the #669 stack.

Future PRs in this area should link an issue first, or open one before implementation so scope can be agreed.

@MrLesk MrLesk closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants