Skip to content

feat: Download all transfer files / folder#359

Merged
PhilippeWeidmann merged 4 commits intoprotected/st-plusfrom
feat/st-plus/download-whole-transfer
Mar 13, 2026
Merged

feat: Download all transfer files / folder#359
PhilippeWeidmann merged 4 commits intoprotected/st-plusfrom
feat/st-plus/download-whole-transfer

Conversation

@PhilippeWeidmann
Copy link
Member

No description provided.

@PhilippeWeidmann PhilippeWeidmann changed the base branch from main to protected/st-plus March 13, 2026 12:55
@PhilippeWeidmann PhilippeWeidmann changed the title feat: download whole transfer feat: Download all transfer files / folder Mar 13, 2026
@github-actions
Copy link

The changes properly inject FileManager dependencies and add v2 API folder download support via the new getFlattenedFiles helper, while cleaning up environment configuration through centralized ApiEnvironment conversion. However, inconsistent error handling (mixing try and try?) risks silently swallowing download failures, and the scattered v1/v2 API branching logic adds unnecessary complexity to the download flow.

#ai-review-summary

private func getFlattenedFiles(for transfer: TransferUi,
files: [FileUi],
fileManager: STCore.FileManager) async throws -> [FileUi] {
guard transfer.apiSource == .v2 else { return transfer.files }

Choose a reason for hiding this comment

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

Add a comment explaining why folder flattening is only required for v2 API source, as this logic assumes v1 transfers never contain folders or don't need expansion.

#ai-review-inline

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates KMP-related dependencies and adjusts the download and injection flows to better support SwissTransfer v2 behaviors (folders / environment bridging) across Core and UI modules.

Changes:

  • Bump several SwiftPM dependencies (ios-features, ios-login, multiplatform-SwissTransfer, swift-collections).
  • Thread STCore.FileManager from SwissTransferInjection into DownloadManager call sites and use it to resolve v2 file/folder selections.
  • Replace hardcoded DEBUG/RELEASE KMP environment selection with ApiEnvironment.current bridged to STCore.ApiEnvironment.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Tuist/Package.resolved Updates dependency versions/revisions.
SwissTransferCoreUI/Components/DownloadButton.swift Passes KMP fileManager into DownloadManager when downloading selection/all.
SwissTransferCoreUI/Components/DownloadableFileCellView.swift Passes KMP fileManager into DownloadManager for single-file/folder downloads.
SwissTransferCore/Utils/SwissTransferInjection+Init.swift Initializes KMP injection environment from ApiEnvironment.current (bridged).
SwissTransferCore/TargetAssembly.swift Adds ApiEnvironment→KMP env bridging and sets default env based on DEBUG/RELEASE.
SwissTransferCore/DownloadManager.swift Adds v2 folder flattening and uses KMP fileManager to fetch v2 transfer files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/st-plus/download-whole-transfer branch from c7b1396 to a367717 Compare March 13, 2026 13:04
🎺 NIIIIINNNN… ninininnin… NIIIIINNNN… ninininnin… 🎶
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/st-plus/download-whole-transfer branch from a367717 to 9bbfe10 Compare March 13, 2026 13:06
@sonarqubecloud
Copy link

@PhilippeWeidmann PhilippeWeidmann merged commit 5060523 into protected/st-plus Mar 13, 2026
9 of 11 checks passed
@PhilippeWeidmann PhilippeWeidmann deleted the feat/st-plus/download-whole-transfer branch March 13, 2026 13:28
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.

3 participants