Repository navigation
feat: add lightweight text editing from the preview - #218
Merged
Merged
Conversation
North in the text preview enters a line-based edit mode that reuses the on-screen keyboard. Only files that round-trip byte for byte are editable; Start saves after confirmation through an atomic replace that keeps encoding, BOM, line endings and a .controlfs.bak copy, warns when the file changed on disk, and Back asks before discarding changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
nextestudios
force-pushed
the
feature/62-text-editing
branch
from
September 27, 2026 23:04
e7c52cb to
35ae807
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TextEditDocument(Core) loads the whole file and keeps each line's text and terminator, the encoding and BOM; it refuses binary, > 1 MB, > 10,000 lines and anything that would not be written back byte for byte (untouched lines never change). Read-only files are refused. Edited lines never gain line breaks.AtomicFileWriterwrites a.controlfs-edit-*.partin the same folder (registered in the temporaries journal before creation), WriteThrough + flush, thenFile.Replace(keeps attributes/ACLs) leaving the original asname.controlfs.bak. If size/date changed since editing started, an explicit "Substituir mesmo assim" is required. IO/permission errors keep the edits and show the reason.mt-text-editcapture. Docs: GUIDE (both), CHANGELOG (both), security-model, ui-redesign, TESTING.Tested in CI
TextEditDocumentTests: BOM + mixed CRLF/LF + no final newline round-trip and single-line change; refusals (binary, oversized, non-round-trip UTF-8).TextEditJourneyTests: edit via keyboard, insert below the last line (ending handling), delete + undo, nothing written before save, confirm + atomic save with backup and no leftover temp, preview reloaded; Back asks before discarding; changed-on-disk warning never overwrites silently; read-only refused.Manual checks (docs/TESTING.md, "Edição de texto (#62)")
Closes #62
🤖 Generated with Claude Code