Skip to content

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

Merged
m3nu merged 1 commit into
borgbase:masterfrom
ebuzerdrmz44:refactor/archive-delete-checks
Jul 25, 2026
Merged

refactor(archive) tab split (phase 4 pt 3) : delete + maintenance helpers#2526
m3nu merged 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
@ebuzerdrmz44
ebuzerdrmz44 requested a review from m3nu July 15, 2026 21:18
@ebuzerdrmz44

Copy link
Copy Markdown
Contributor Author

@m3nu rebased onto master now that #2525 is in and addressed the review nits. The old approval got auto-dismissed when I pushed, so this should just need a quick re-confirm, not a full re-review.

Also heads up: #2523 is waiting on this one. It deletes ArchiveSortProxyModel and touches the same import block in archive_tab.py, so we can rebase it once this lands instead of fighting the same conflict twice.

@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.

Re-reviewed the current head after the rebase onto master. The pt-3 move is faithful and correct — approving.

What I verified:

  • ArchiveDelete / ArchiveMaintenance follow the stateless-collaborator pattern from archive_extract.py / archive_mount.py, and both are held as strong attributes on the tab, so the job.result.connect(...) lifetimes are sound.
  • Selection goes through self.tab.selected_archives()ArchiveRole, so the proxy mapToSource footgun is handled.
  • Every call site is updated: the bDelete / compactButton / bPrune / bCheck connections, the archiveitem_contextmenu button_connection_pairs list, the prune-interval valueChanged connections, and both test files. No stale references left.
  • test_populate_does_not_overwrite_prune_keep_within (the #2493 regression) exercises the real signal path rather than patching the method, so it still guards after the move.
  • toggle_compact_button_visibility correctly stayed on the tab — application.py calls archiveTab.toggle_compact_button_visibility() directly.

Two things from my earlier review are still open on this head — please fix before you hit merge:

  1. The PR description still lists toggle_compact_button_visibility as moving into ArchiveMaintenance. It didn't, and that's the right call. Worth correcting so future archaeology isn't misled.
  2. The application.py string-literal hunk (line 303, implicit concat → single literal) is still in the diff. Runtime-identical and harmless to the .ts catalogs, but unrelated to the tab split. Drop it or split it out.

Neither blocks, hence the approval rather than another round.

Optional, pre-existing gap: check_action / compact_action / prune_action still have no direct coverage. A smoke test each, mirroring test_archive_delete, would be cheap insurance now that they live in a new module.

Merge order note: #2523 conflicts on the archive_tab.py import block, so it rebases after this lands.

@m3nu
m3nu merged commit ca7f6aa into borgbase:master Jul 25, 2026
5 checks passed
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