[#3] Backup restore UI #3

Closed
opened 2026-07-02 00:49:30 -04:00 by the_og · 0 comments
Owner

Problem

_make_backup() already writes rotating timestamped backups (.bcc_backups/<name>.<timestamp>.json, capped at MAX_BACKUPS=15) on every save. But there is no way to browse or restore one from the GUI — you have to find the file manually. Research repeatedly surfaces "config got corrupted / Claude won't launch after I edited it" as a common failure mode, which is exactly what these backups exist to fix, but the fix is currently inaccessible.

Proposed solution

A Restore from backup… action per profile that:

  1. Lists the backups in .bcc_backups/, sorted newest-first, with human-readable timestamps.
  2. Shows a unified diff of the selected backup vs the current file (inline preview).
  3. Writes the selected backup back through the normal write_config() atomic-write path — so restoring itself creates a new backup of the pre-restore state.

Core logic (listing, diffing, preview generation) lives in bcc_core.py; the dialog lives in bcc.py.

Acceptance criteria

  • Restore is reachable from the profile menu (or a toolbar button).
  • Dialog lists backups with timestamps; selecting one shows a diff.
  • Restoring creates a new backup of the pre-restore state.
  • "No backups yet" is handled gracefully.
  • Core list/diff logic has unit tests.

Relevant code

  • bcc_core.py::_make_backup (line 207)
  • bcc_core.py::write_config (line 226)
  • bcc_core.py::BACKUP_DIRNAME, MAX_BACKUPS constants
## Problem `_make_backup()` already writes rotating timestamped backups (`.bcc_backups/<name>.<timestamp>.json`, capped at `MAX_BACKUPS=15`) on every save. But there is no way to browse or restore one from the GUI — you have to find the file manually. Research repeatedly surfaces "config got corrupted / Claude won't launch after I edited it" as a common failure mode, which is exactly what these backups exist to fix, but the fix is currently inaccessible. ## Proposed solution A **Restore from backup…** action per profile that: 1. Lists the backups in `.bcc_backups/`, sorted newest-first, with human-readable timestamps. 2. Shows a unified diff of the selected backup vs the current file (inline preview). 3. Writes the selected backup back through the normal `write_config()` atomic-write path — so restoring itself creates a new backup of the pre-restore state. Core logic (listing, diffing, preview generation) lives in `bcc_core.py`; the dialog lives in `bcc.py`. ## Acceptance criteria - Restore is reachable from the profile menu (or a toolbar button). - Dialog lists backups with timestamps; selecting one shows a diff. - Restoring creates a new backup of the pre-restore state. - "No backups yet" is handled gracefully. - Core list/diff logic has unit tests. ## Relevant code - `bcc_core.py::_make_backup` (line 207) - `bcc_core.py::write_config` (line 226) - `bcc_core.py::BACKUP_DIRNAME`, `MAX_BACKUPS` constants
the_og added the P0 label 2026-07-02 00:49:30 -04:00
the_og referenced this issue from a commit 2026-07-02 01:22:55 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: the_og/better-claude-config#3