refactor(archive) tab split (phase 4 pt 3) : delete + maintenance helpers - #2526
Conversation
ae304ba to
93a4c93
Compare
m3nu
left a comment
There was a problem hiding this comment.
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:
- The description says
toggle_compact_button_visibilitymoved intoArchiveMaintenance— it actually stays on the tab, which is correct (application.pycallsarchiveTab.toggle_compact_button_visibility()), but please fix the description. - The
application.pystring-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).
The merge-base changed after approval.
93a4c93 to
633de65
Compare
|
@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
left a comment
There was a problem hiding this comment.
Re-reviewed the current head after the rebase onto master. The pt-3 move is faithful and correct — approving.
What I verified:
ArchiveDelete/ArchiveMaintenancefollow the stateless-collaborator pattern fromarchive_extract.py/archive_mount.py, and both are held as strong attributes on the tab, so thejob.result.connect(...)lifetimes are sound.- Selection goes through
self.tab.selected_archives()→ArchiveRole, so the proxymapToSourcefootgun is handled. - Every call site is updated: the
bDelete/compactButton/bPrune/bCheckconnections, thearchiveitem_contextmenubutton_connection_pairslist, the prune-intervalvalueChangedconnections, 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_visibilitycorrectly stayed on the tab —application.pycallsarchiveTab.toggle_compact_button_visibility()directly.
Two things from my earlier review are still open on this head — please fix before you hit merge:
- The PR description still lists
toggle_compact_button_visibilityas moving intoArchiveMaintenance. It didn't, and that's the right call. Worth correcting so future archaeology isn't misled. - The
application.pystring-literal hunk (line 303, implicit concat → single literal) is still in the diff. Runtime-identical and harmless to the.tscatalogs, 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.
Description
Continues the
ArchiveTabbreakup 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 underviews/archive/:archive/archive_delete.pyArchiveDelete(delete_action/delete_result)archive/archive_maintenance.pyArchiveMaintenance(check,compact,pruneactions + results,save_prune_setting,toggle_compact_button_visibility)archive_tab.pyshrinks by 130 lines and now just wires these helpers alongside the pt 2ArchiveDiff/ArchiveRename.No behavior change .
Notes
_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.tests/unit/test_archives.py,tests/integration/test_archives.py).