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).
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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #184.
What
When a file is attached on /new, it takes over the main text editing area:
Title auto-fill only applies when the title is still blank; a typed title is never overwritten.
Notes
Testing
d105a1aeb5to6c1bfaf15e