File upload preview in editor (#171) #175

Merged
fen merged 4 commits from fix-171 into dev 2026-09-10 16:13:00 +00:00
Collaborator

When a file is uploaded on /new it replaces the main text editing area:

  • images render fitted into the editor area (object-fit: contain); editor/gutter hidden; preview uses a data: URI so it survives the img-src 'self' data: CSP
  • text files load their content into the editor, with language detection filling the title placeholder convention (e.g. Python.py, fallback Text.txt)
  • title auto-fills only when blank, never overwrites a typed title
  • CSP-safe: external JS (new.js), CSS classes in app.css, no inline styles/scripts
  • go build ./... && go test ./... pass; verified in headless chromium under CSP

Ref issue #171.

When a file is uploaded on /new it replaces the main text editing area: * images render fitted into the editor area (object-fit: contain); editor/gutter hidden; preview uses a data: URI so it survives the img-src 'self' data: CSP * text files load their content into the editor, with language detection filling the title placeholder convention (e.g. Python.py, fallback Text.txt) * title auto-fills only when blank, never overwrites a typed title * CSP-safe: external JS (new.js), CSS classes in app.css, no inline styles/scripts * go build ./... && go test ./... pass; verified in headless chromium under CSP Ref issue #171.
fen added 1 commit 2026-09-10 16:08:10 +00:00
file upload preview in editor on /new (#171)
CI / docker (pull_request) Skipped
CI / test (pull_request) Successful in 32s
e23ca6e8d1
- 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)
fen merged commit b9153c1d95 into dev 2026-09-10 16:13:00 +00:00
Sign in to join this conversation.