feat: use CodeMirror editor for HTML source view, hide save in preview mode

- HTML preview (iframe) no longer shows Edit/Save toolbar buttons
- Clicking Source toggle opens CodeMirror editor with syntax highlighting
- Save button appears only in source mode, using saveCodeFile()
- Ctrl+S saving supported via CodeMirror keybinding
This commit is contained in:
Timothy Jaeryang Baek committed 2026-03-06 20:00:12 -06:00
1 parent b3622474d7
commit 7806cd5aef
2 files changed
+46 -18

No files matched your search

@@ -388,6 +388,15 @@
class="w-full h-full border-none bg-white"
title="HTML Preview"
/>
{:else if isHtml && showRaw}
<div class="h-full">
<FileCodeEditor
bind:this={fileCodeEditorRef}
value={fileContent ?? ''}
filePath={selectedFile}
{onSave}
/>
</div>
{:else if isMarkdown && !showRaw}
<div bind:this={markdownEl} class="prose dark:prose-invert max-w-full text-sm p-3">
{@html renderedHtml}