Fix #184: file upload replaces the main editing area on /new #189

Merged
fen merged 1 commits from fix-184 into dev 2026-09-10 16:55:32 +00:00
Collaborator

Closes #184.

What

When a file is attached on /new, it takes over the main text editing area:

  • Images: rendered fitted into the editor area (object-fit: contain; editor + gutter hidden, pre-existing .previewing behavior). The title auto-fills with the file name.
  • Text files: the file content always loads into the editor, replacing any text already there (previously it only filled an empty editor). Language auto-detection and the gutter re-run after loading.

Title auto-fill only applies when the title is still blank; a typed title is never overwritten.

Notes

  • Drawing and cropping tools are noted in the issue as possible future work; intentionally not implemented in this change.
  • No template/CSS/server changes needed: this reuses the #171 preview plumbing (CSP-safe data: URL for image preview) and the #38 multipart create path. All JS stays in external static files per the CSP lockdown.

Testing

  • go build ./... and go test ./... pass (api, lang, store, web suites green, including the no-inline-script CSP regression tests).
Closes #184. ## What When a file is attached on /new, it takes over the main text editing area: - **Images**: rendered fitted into the editor area (object-fit: contain; editor + gutter hidden, pre-existing .previewing behavior). The title auto-fills with the file name. - **Text files**: the file content always loads into the editor, replacing any text already there (previously it only filled an empty editor). Language auto-detection and the gutter re-run after loading. Title auto-fill only applies when the title is still blank; a typed title is never overwritten. ## Notes - Drawing and cropping tools are noted in the issue as possible future work; intentionally not implemented in this change. - No template/CSS/server changes needed: this reuses the #171 preview plumbing (CSP-safe data: URL for image preview) and the #38 multipart create path. All JS stays in external static files per the CSP lockdown. ## Testing - go build ./... and go test ./... pass (api, lang, store, web suites green, including the no-inline-script CSP regression tests).
fen added 1 commit 2026-09-10 16:55:00 +00:00
Fix #184: file upload replaces the main editing area on /new
CI / docker (pull_request) Skipped
CI / test (pull_request) Successful in 48s
6c1bfaf15e
Image files render fitted into the editor area (editor and gutter
hidden); the title auto-fills with the file name. Text files always
load their content into the editor, replacing any text already there,
instead of only filling an empty editor. Title auto-fill still only
applies when the title is blank; a typed title is never overwritten.
Drawing and cropping tools are noted in the issue as possible future
work and are intentionally not implemented here.
fen force-pushed fix-184 from d105a1aeb5 to 6c1bfaf15e 2026-09-10 16:55:00 +00:00 Compare
fen merged commit bb72e09f8f into dev 2026-09-10 16:55:32 +00:00
Sign in to join this conversation.