Skip to content

refactor(archive): peel diff and rename into views/archive/ helpers (Phase 4 pt 2)#2525

Draft
ebuzerdrmz44 wants to merge 5 commits into
borgbase:masterfrom
ebuzerdrmz44:refactor/archive-tab-split
Draft

refactor(archive): peel diff and rename into views/archive/ helpers (Phase 4 pt 2)#2525
ebuzerdrmz44 wants to merge 5 commits into
borgbase:masterfrom
ebuzerdrmz44:refactor/archive-tab-split

Conversation

@ebuzerdrmz44

@ebuzerdrmz44 ebuzerdrmz44 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Description

Phase 4 part 2 of the Archive tab refactor. Part 1 (#2519) converted the table to QAbstractTableModel + QTableView and peeled the first two operations (mount/unmount, extract) into views/archive/ collaborator classes. This PR continues that exact pattern, peeling diff and rename off the orchestrator into focused helpers:

  • views/archive/archive_diff.pyArchiveDiff (diff_action, list_diff_result, show_diff_result)
  • views/archive/archive_rename.pyArchiveRename (cell_double_clicked, on_name_edited, _revert_name, rename_result)

ArchiveTab stays 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 / ArchiveMount convention from #2519. The context menu stays in ArchiveTab since it just dispatches to the other helpers.

delete and check/compact/prune are 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.

⚠️ Stacked on #2519. As a fork PR the base has to be master, so #2519's commits currently show up in this diff. The changes that belong to this PR are just:

  • src/vorta/views/archive/archive_diff.py (new)
  • src/vorta/views/archive/archive_rename.py (new)
  • the src/vorta/views/archive_tab.py deltas (and the two test call-site updates)

The overlap disappears once #2519 merges — I'll rebase onto master then.

Related Issue

Part of #2361 (Phase 4 — split large tabs into parts). Builds on #2519.

Motivation and Context

archive_tab.py was 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, keeping ArchiveTab as 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 --check clean. Test call-sites updated to the new entry points (tab.archive_diff.diff_action, tab.archive_rename.{cell_double_clicked,rename_result}); _resultwindow is 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

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

Copy link
Copy Markdown
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.

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.

1 participant