refactor(archive): peel diff and rename into views/archive/ helpers (Phase 4 pt 2)#2525
Draft
ebuzerdrmz44 wants to merge 5 commits into
Draft
refactor(archive): peel diff and rename into views/archive/ helpers (Phase 4 pt 2)#2525ebuzerdrmz44 wants to merge 5 commits into
ebuzerdrmz44 wants to merge 5 commits into
Conversation
Follows the stateless ArchiveExtract/ArchiveMount collaborator pattern: helpers hold only self.tab; transient state (_t, is_editing, renamed_archive_original_name) stays on the tab. Pure structural move, no behavior change.
Contributor
Author
|
@m3nu No rush on this , it's stacked on #2519, so that one's the real dependency (its commits show in this diff until it merges; the new work here is just archive_diff.py,archive_rename.py, and the archive_tab.py ). Flagging it now mainly for a shape check: it follows the ArchiveExtract/ArchiveMount collaborator pattern from #2519, and I kept the context menu in ArchiveTab since it's just glue over the other helpers. I'm holding delete + check/compact/prune for a follow- up so the pattern can be settled here first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Phase 4 part 2 of the Archive tab refactor. Part 1 (#2519) converted the table to
QAbstractTableModel+QTableViewand peeled the first two operations (mount/unmount,extract) intoviews/archive/collaborator classes. This PR continues that exact pattern, peeling diff and rename off the orchestrator into focused helpers:views/archive/archive_diff.py→ArchiveDiff(diff_action,list_diff_result,show_diff_result)views/archive/archive_rename.py→ArchiveRename(cell_double_clicked,on_name_edited,_revert_name,rename_result)ArchiveTabstays the container (populate, selection, context-menu wiring, refresh, status, prune settings). Pure structural move — no behavior change.archive_tab.py: 785 → 633 lines.Helpers follow the existing
ArchiveExtract/ArchiveMountconvention from #2519. The context menu stays inArchiveTabsince it just dispatches to the other helpers.deleteandcheck/compact/pruneare held back for a follow-up PR so the helper shape can be reviewed here first. Happy to redirect the decomposition — this is the cheap point to do it.Related Issue
Part of #2361 (Phase 4 — split large tabs into parts). Builds on #2519.
Motivation and Context
archive_tab.pywas a ~785-line orchestrator mixing the table view with diff, rename, delete and repo-maintenance logic. #2361 calls for converting the table to a model (done in #2519) and then peeling the remaining operations into focused helpers, keepingArchiveTabas the container. This PR does that for diff and rename, making each operation independently readable and shrinking the orchestrator, with no change to runtime behavior.How Has This Been Tested?
uv run pytest tests/unit/test_archives.py tests/unit/test_diff.py— 42 passed.ruff check+ruff format --checkclean. Test call-sites updated to the new entry points (tab.archive_diff.diff_action,tab.archive_rename.{cell_double_clicked,rename_result});_resultwindowis still set on the tab so the diff tests are otherwise unchanged. CI runs the full Borg matrix via nox.Screenshots (if appropriate):
N/A — no UI changes.
Types of changes
Checklist:
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.