Fix #13: Expose Pre-edit Backup restoration

Preserve full diff opcodes before grouping, route modal navigation to a two-axis viewport-sized scroller, and calculate side-by-side layout using terminal cell widths so tabbed Hosts File lines keep a stable divider.
This commit is contained in:
Philip Henning 2026-09-04 20:19:17 +02:00
parent 6a3e1e0d5a
commit e268794564
13 changed files with 1103 additions and 19 deletions

View file

@ -20,6 +20,7 @@ on macOS and Linux.
- Creates DNS Entries and manually refreshes their resolved IP addresses.
- Gates every `/etc/hosts` mutation behind an explicit Privileged Mode.
- Creates a timestamped Pre-edit Backup before Privileged Mode begins.
- Restores the current session's Pre-edit Backup after explicit confirmation.
- Supports undo and redo during the current Privileged Mode session.
The application starts in Read-only Mode. Default Entries cannot be edited,
@ -63,6 +64,7 @@ including persistence behavior and manual recovery.
| --- | --- |
| `Up` / `Down` | Select a Host Entry |
| `Ctrl+E` | Enter or leave Privileged Mode |
| `b` | Review and restore the session Pre-edit Backup |
| `n` | Add a Host Entry |
| `e` | Open the selected Host Entry in the Entry Editor |
| `d` | Delete the selected Host Entry |
@ -79,8 +81,8 @@ sorting, DNS refresh, movement, undo, and redo.
## Safety and known limitations
- Reloading discards unsaved in-memory state.
- Pre-edit Backups are not listed or restored by the TUI and have no retention
management. Manual recovery is documented in the user guide.
- The TUI can restore only the Pre-edit Backup associated with the current
Privileged Mode session; it does not list old backups or manage retention.
- Leaving Privileged Mode clears the application's session state but does not
alter the user's cached sudo timestamp.
- Serialization preserves Host Entries and comments semantically, but