Skip to content

refactor(archive) tab split (phase 4 pt 3) : delete + maintenance helpers#2526

Open
ebuzerdrmz44 wants to merge 1 commit into
borgbase:masterfrom
ebuzerdrmz44:refactor/archive-delete-checks
Open

refactor(archive) tab split (phase 4 pt 3) : delete + maintenance helpers#2526
ebuzerdrmz44 wants to merge 1 commit into
borgbase:masterfrom
ebuzerdrmz44:refactor/archive-delete-checks

Conversation

@ebuzerdrmz44

Copy link
Copy Markdown
Contributor

Description

Continues the ArchiveTab breakup started in #2519 (pt 1) and #2525 (pt 2, diff + rename). This peels the remaining destructive/maintenance actions out of the god-object into the same collaborator-class pattern under views/archive/:

  • archive/archive_delete.py ArchiveDelete (delete_action / delete_result)
  • archive/archive_maintenance.py ArchiveMaintenance (check, compact, prune actions + results, save_prune_setting, toggle_compact_button_visibility)

archive_tab.py shrinks by 130 lines and now just wires these helpers alongside the pt 2 ArchiveDiff / ArchiveRename.

No behavior change .

Notes

  • Stacks on refactor(archive): peel diff and rename into views/archive/ helpers (Phase 4 pt 2) #2525. Until that merges, this PR's diff includes pt 2's commit; review only the top commit here. Kept as draft for that reason.
  • The helpers call the tab's _set_status / _toggle_all_buttons. De-underscoring that tab/helper boundary is a deliberate later cleanup, kept consistent with pt 2 rather than widened here.
  • Test call sites updated to the new module paths (tests/unit/test_archives.py, tests/integration/test_archives.py).

m3nu
m3nu previously approved these changes Jul 13, 2026

@m3nu m3nu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the pt-3 commit (93a4c93) in depth — it's a faithful, line-by-line move of delete/check/compact/prune into ArchiveDelete/ArchiveMaintenance, matching the extract/mount collaborator pattern. Selection goes through selected_archives() / ArchiveRole, so it's proxy-safe; helpers are strongly referenced on the tab, so the signal lifecycle is sound; all test call sites are updated with no stale patches.

Two nits before merge:

  1. The description says toggle_compact_button_visibility moved into ArchiveMaintenance — it actually stays on the tab, which is correct (application.py calls archiveTab.toggle_compact_button_visibility()), but please fix the description.
  2. The application.py string-literal cleanup hunk is unrelated to this PR. Harmless, but out of scope.

Once #2525 is squash-merged, rebase onto master (the diff collapses to the pt-3 commit) and un-draft — then this is good to go. Optional but cheap: a smoke test each for check_action/compact_action/prune_action, which currently have no direct coverage (pre-existing gap, not something this PR introduced).

@ebuzerdrmz44 ebuzerdrmz44 dismissed m3nu’s stale review July 13, 2026 22:25

The merge-base changed after approval.

@ebuzerdrmz44 ebuzerdrmz44 force-pushed the refactor/archive-delete-checks branch from 93a4c93 to 633de65 Compare July 13, 2026 22:25
@ebuzerdrmz44 ebuzerdrmz44 marked this pull request as ready for review July 13, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants