{# WORKSPACE CENTER FILE PANE — preview + edit body. Swapped into the center overlay's #ws-editor-body when a tree file is CLICKED (GET /workspace/{key}/edit?path=…&mode=preview|edit). The overlay SHELL (the sliding pane that covers the center) lives in _scope.html; this fragment is the header + content + footer that fill it. Two modes (server-rendered; the Edit/Preview toggle re-fetches this route): - PREVIEW (edit_mode false) — read-only. · excalidraw file → its DRAWING, rendered to SVG from the real scene · text file → monospace body + line-number gutter Header carries an "Edit" button (text + non-truncated only). - EDIT (edit_mode true) — an editable monospace
UTF-8 · edits are saved straight to the worktree{% if file.is_excalidraw %} · editing raw source{% endif %}
{% elif file.is_excalidraw %} {# PREVIEW · excalidraw — a LIVE Excalidraw canvas (the vendored React build), exactly like Obsidian's view+edit: the user views AND draws on the canvas; the header "Save" persists the scene back into the Obsidian .excalidraw(.md) wrapper via the existing write route; closing WITHOUT save discards (the canvas state is the only home for unsaved edits). The raw source text is handed to the JS as `file.content`; it parses the scene (compressed-json / json / raw) and preserves the front-matter + Text-Elements on save. A