Document Preview
The Backlog.md Web interface supports in-app preview of common Office documents: clicking a document link opens a dedicated preview modal instead of downloading locally. Word and Excel also support editing and writing back to the source file.
Which paths are supported for preview depends on where the link is located:
- Reference fields (project-relative
backlog/...paths written in task / milestone / document metadata, such asbacklog/docs/report.pdf): use the raw-byte endpointGET /api/raw-fileto fetch content (with content-type, restricted to the project data directory), covering any path inside the project. - Body (links in descriptions / comments / notes / document Markdown): only documents under the
assets/...convention (i.e., thebacklog/assets/directory) are supported. If the body directly uses abacklog/...prefix, the link is not intercepted and will result in a browser 404.
Cross-origin documents, modifier-key clicks, or links with target=_blank / download still follow the browser's default behavior.
Word Documents
Rendered with docx-editor, showing real paginated A4 pages.
- Read-only preview by default; click Edit to enter edit mode, showing the toolbar, margin guides, and ruler.
- After editing, Save writes back to the source file through a confirmation guard; Exit edit returns to preview.
- The modal header explicitly shows a status badge: gray
read-only previewin read mode, blueedit modein edit mode—status is not inferred from appearance. - Supports CSS full-screen filling the viewport, with content clipped to rounded corners.
PDF Documents
Based on self-hosted pdf.js (loaded at runtime, not in the initial bundle); pages are drawn to canvas page by page.
- Fit-to-width adapts to the window width, with no horizontal scrolling even when the left outline is expanded.
- PDFs with an outline (table of contents) show a clickable left outline panel; click to scroll to the target page.
- Supports CSS full-screen, with the page area clipped to rounded corners.
PPTX Presentations
Based on @aiden0z/pptx-renderer (Apache-2.0), faithfully restoring OOXML to HTML/SVG, with large documents window-mounted.
- A thumbnail panel lists each slide; click to jump to the main view.
- Presentation mode is edge-to-edge full-screen playback, supporting WPS-style keyboard navigation (→ ↓ Space PageDown Enter for next; ← ↑ PageUp Backspace for previous; Home/End for first/last; Esc to exit).
- Read-only preview only.
Excel Spreadsheets
Based on Univer open-source sheets preset, preserving a readable layout: cell text and values, fonts, fills, borders, alignment, merged regions, column widths, row heights, and number formats.
- Read-only viewing mode by default, with an explicit read-only badge, displaying cached file values (no recalculation).
- Edit mode shows the ribbon, formula bar, and status bar; formula cells show the formula itself rather than the calculated result.
- Save applies an in-place OOXML patch: only edited worksheets' cells and merged regions are rewritten; other content (charts, images, conditional formatting, etc.) is preserved as-is. Saves with no actual changes honestly report "no changes" rather than "success".
- Only
.xlsx/.xlsm; newly added worksheets in the editor are not written back, and cell formatting changes are not written back.
Unsupported Formats
For Office formats the app cannot render (legacy .doc, PowerPoint and Excel family variants, macros, and template variants), clicking does not directly download or open; instead, a prompt suggests converting to .docx or .pdf first. Modifier-key clicks or target=_blank / download still open in a new tab.
Localization
All user-visible text in the four preview modals follows the app language (en / zh-CN / zh-TW / ja), including status badges, buttons, dialogs, and player hints.