File editor v2: edit & save with conflict detection #20

Closed
opened 2026-10-07 20:04:30 -04:00 by jared · 0 comments
Owner

Source: file viewer/editor design review, 2026-10-07.

  • --fs-write SESSION REL BYTES BASESHA|new, streamed like upload:
    1. Write to a temp file in the same directory.
    2. Re-check the target's sha256; if it changed, return {conflict: true}.
    3. Otherwise keep mode and owner and mv atomically. 0-byte files are allowed.
  • Client:
    • Unsaved-change tracking and Ctrl+S; Esc and Ctrl+S must not reach xterm.
    • A clean file reloads automatically when its sha changes.
    • A dirty file shows a "changed on disk" banner: Reload / Diff / Keep mine.
    • Warn on unload with unsaved changes.
  • Estimate ~2.5 days.
_Source: file viewer/editor design review, 2026-10-07._ - `--fs-write SESSION REL BYTES BASESHA|new`, streamed like upload: 1. Write to a temp file in the same directory. 2. Re-check the target's sha256; if it changed, return `{conflict: true}`. 3. Otherwise keep mode and owner and `mv` atomically. 0-byte files are allowed. - **Client:** - Unsaved-change tracking and Ctrl+S; Esc and Ctrl+S must not reach xterm. - A clean file reloads automatically when its sha changes. - A dirty file shows a "changed on disk" banner: Reload / Diff / Keep mine. - Warn on unload with unsaved changes. - Estimate ~2.5 days.
jared added this to the v0.8.0 editor + inbox milestone 2026-10-07 20:04:30 -04:00
jared added the feature label 2026-10-07 20:04:30 -04:00
jared closed this issue 2026-10-10 20:10:48 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/devdesk#20