feat: Preview files in new transfert#628
Conversation
f628c89 to
7dbc019
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the file-details UI to support previewing (opening) locally picked files while creating a new transfer, while keeping download behavior for existing transfers.
Changes:
- Replace
isDownloadButtonVisiblewith anisNewTransferflag across file list components/screens. - In “new transfer” mode, tapping a file now opens the local URI instead of triggering download UI.
- Minor call-site refactors (parameter reordering, trailing lambda usage) in transfer screens.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/filesdetails/NewTransferFilesDetailsScreen.kt | Passes isNewTransfer = true into the shared files details UI for new transfers. |
| app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transfers/TransfersScreenWrapper.kt | Adjusts argument passing and refactors ExistingTransferFilesDetailsScreen invocation. |
| app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/components/ExistingTransferFilesDetailsScreen.kt | Updates to isNewTransfer = false for existing transfers; adjusts parameter order. |
| app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt | Updates file list to isNewTransfer = false in transfer details. |
| app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/FilesDetailsScreen.kt | Updates API to require withFileSize/withSpaceLeft/isNewTransfer; forwards to FileItemList. |
| app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItemList.kt | Implements “open local file” click behavior for new transfers; adjusts list API. |
| app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItem.kt | Minor parameter reordering in composables. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR Reviewer Guide 🔍(Review updated until commit b547669)Here are some key observations to aid the review process:
|
|
Failed to generate code suggestions for PR |
|
Persistent review updated to latest commit 69f7085 |
|
Persistent review updated to latest commit b547669 |
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Failed to generate code suggestions for PR |
1 similar comment
|
Failed to generate code suggestions for PR |
33e8346 to
326753f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItemList.kt:140
- Inside
produceState,value = uri.toString()will turn anullUri?into the literal string "null". That makes the UI treat it as a real thumbnail URL/URI and will trigger a failed image load before falling back. Prefer keeping the statenullwhen the flow emitsnullso the preview logic can short-circuit cleanly.
previewUriForFile = produceState(file.thumbnailPath ?: file.localPath) {
transferFlow.collectLatest { transfer ->
previewUriForFile(transfer, file).collect { uri: Uri? ->
value = uri.toString()
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItemList.kt:148
uriis nullable here, buturi.toString()will produce the literal string "null" whenuri == null, which then gets treated as a real thumbnail URI (and will trigger a failed image load). Set the produced state tonullwhen the flow emitsnull(e.g., useuri?.toString()).
previewUriForFile = produceState(file.thumbnailPath ?: file.localPath) {
transferFlow.collectLatest { transfer ->
previewUriForFile(transfer, file).collect { uri: Uri? ->
value = uri.toString()
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
206c8dd to
6e3e58f
Compare
|



No description provided.