From 05c8613279e6ca63b483df10ea4ffcf208228936 Mon Sep 17 00:00:00 2001 From: Christian Visintin Date: Thu, 2 Oct 2025 20:58:26 +0200 Subject: [PATCH] fix: Report a message while calculating total size of files to transfer. (#362) * fix: Report a message while calculating total size of files to transfer. Currently, in case of huge transfers the app may look frozen while calculating the transfer size. We should at least report to the user we are actually doing something. closes #361 * ci: windows runner --- .github/workflows/windows.yml | 2 +- CHANGELOG.md | 1 + src/ui/activities/filetransfer/session.rs | 21 +++++++++++++++++---- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1f4235c..cc45cc1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -15,7 +15,7 @@ env: jobs: build: - runs-on: windows-2019 + runs-on: windows-latest steps: - uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index a7ab1ce..d0f40c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ Released on 20/09/2025 - [Issue 356](https://github.com/veeso/termscp/issues/356): Fixed SSH auth issue not trying with the password if any RSA key was found. - [Issue 334](https://github.com/veeso/termscp/issues/334): SMB support for MacOS with vendored build of libsmbclient. - [Issue 337](https://github.com/veeso/termscp/issues/337): Migrated to libssh.org on Linux and MacOS for better ssh agent support. +- [Issue 361](https://github.com/veeso/termscp/issues/361): Report a message while calculating total size of files to transfer. ## 0.18.0 diff --git a/src/ui/activities/filetransfer/session.rs b/src/ui/activities/filetransfer/session.rs index f2e34e0..d58ac8d 100644 --- a/src/ui/activities/filetransfer/session.rs +++ b/src/ui/activities/filetransfer/session.rs @@ -1260,7 +1260,10 @@ impl FileTransferActivity { /// Get total size of transfer for host_bridgehost fn get_total_transfer_size_host(&mut self, entry: &File) -> usize { - if entry.is_dir() { + // mount message to tell we are calculating size + self.mount_blocking_wait("Calculating transfer size…"); + + let sz = if entry.is_dir() { // List dir match self.host_bridge.list_dir(entry.path()) { Ok(files) => files @@ -1281,12 +1284,18 @@ impl FileTransferActivity { } } else { entry.metadata.size as usize - } + }; + self.umount_wait(); + + sz } /// Get total size of transfer for remote host fn get_total_transfer_size_remote(&mut self, entry: &File) -> usize { - if entry.is_dir() { + // mount message to tell we are calculating size + self.mount_blocking_wait("Calculating transfer size…"); + + let sz = if entry.is_dir() { // List directory match self.client.list_dir(entry.path()) { Ok(files) => files @@ -1307,7 +1316,11 @@ impl FileTransferActivity { } } else { entry.metadata.size as usize - } + }; + + self.umount_wait(); + + sz } // file changed