file upload preview in editor on /new (#171)
CI / test (pull_request) Successful in 32s
CI / docker (pull_request) Skipped

- images render fitted into the editor area (object-fit contain), editor hidden
- text files load content into the editor; title placeholder convention (Python.py, Text.txt fallback)
- title auto-fills only when blank; never overwrites a typed title
- external JS + CSS classes only, CSP-safe (no inline styles/scripts)
This commit is contained in:
fen
2026-09-10 11:08:02 -05:00
parent 5dba356264
commit e23ca6e8d1
3 changed files with 90 additions and 0 deletions
+13
View File
@@ -744,6 +744,19 @@ button[type="submit"]:focus-visible,
background: var(--surface-2);
}
.dropzone.dragover { border-width: 2px; }
/* #171: uploaded-file preview replaces the editor area; image fitted inside */
.file-preview {
flex: 1;
min-width: 0;
min-height: 0;
max-width: 100%;
max-height: 100%;
object-fit: contain;
border-radius: 8px;
}
.editor-wrap.previewing .editor,
.editor-wrap.previewing .gutter { display: none; }
.file-chip {
display: flex; align-items: center; gap: 10px;
border: 1px solid var(--border); border-radius: var(--radius);