Expose Pre-edit Backup discovery and restoration in the TUI #13

Closed
opened 2026-09-03 10:18:50 +00:00 by phg · 0 comments
Owner

Context

Entering Privileged Mode creates a timestamped Pre-edit Backup and HostsManager.restore_backup already exists, but the TUI does not show the backup path or expose restoration. Leaving Privileged Mode clears the tracked path, so users must locate and restore files manually.

The Pre-edit Backup should be a complete user-reachable safety workflow rather than a hidden implementation detail.

Acceptance criteria

  • After entering Privileged Mode, the TUI makes the exact Pre-edit Backup path discoverable.
  • The corresponding backup can be restored through a clear TUI action while it remains associated with the session.
  • Restoration requires explicit confirmation and identifies the source and target paths.
  • Successful restoration reloads the on-disk Hosts File into the interface and leaves application state consistent.
  • Failed restoration preserves the current file and reports an actionable error.
  • Tests mock privileged file operations and never access real sudo or /etc/hosts.
  • User documentation describes the in-app workflow and retains manual recovery only as a fallback.
Context Entering Privileged Mode creates a timestamped Pre-edit Backup and `HostsManager.restore_backup` already exists, but the TUI does not show the backup path or expose restoration. Leaving Privileged Mode clears the tracked path, so users must locate and restore files manually. The Pre-edit Backup should be a complete user-reachable safety workflow rather than a hidden implementation detail. Acceptance criteria - After entering Privileged Mode, the TUI makes the exact Pre-edit Backup path discoverable. - The corresponding backup can be restored through a clear TUI action while it remains associated with the session. - Restoration requires explicit confirmation and identifies the source and target paths. - Successful restoration reloads the on-disk Hosts File into the interface and leaves application state consistent. - Failed restoration preserves the current file and reports an actionable error. - Tests mock privileged file operations and never access real sudo or `/etc/hosts`. - User documentation describes the in-app workflow and retains manual recovery only as a fallback.
phg added the
Kind/Enhancement
Priority
High
labels 2026-09-03 10:18:50 +00:00
phg closed this issue 2026-09-04 19:41:34 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: phg/hosts#13
No description provided.