Skip to content

Show only offline-available actions when offline in the "create new" menu - #17604

Open
daniele-verducci wants to merge 2 commits into
masterfrom
internal-104930
Open

Show only offline-available actions when offline in the "create new" menu#17604
daniele-verducci wants to merge 2 commits into
masterfrom
internal-104930

Conversation

@daniele-verducci

@daniele-verducci daniele-verducci commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Issue: when the app was offline the bottom sheet was showing all actions for the root directory (also the ones that aren't available offline, like document creators and encrypted folders) and hiding some actions that works also offline for the subdirectories (like scanning a document or uploading from other apps).

This PR makes only offline-available actions visible when offline, and now shown actions matches between root and subfolders.

🖼️ Screenshots

🏚️ Before 🏡 After
image image
image image

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

@daniele-verducci

Copy link
Copy Markdown
Contributor Author

/backport to stable-35.0.x

@github-actions

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/34465424570/artifacts/10149165149
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@github-actions

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/34486697039/artifacts/10156868420
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

…ions between root and subfolders

Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
@github-actions

Copy link
Copy Markdown

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@github-actions

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3535
Correctness5858
Dodgy code195195
Experimental11
Malicious code vulnerability22
Multithreaded correctness2626
Performance3737
Security1919
Total373373

@@ -419,18 +419,14 @@ class OCFileListBottomSheetDialog(
}

private fun filterActionsForOfflineOperations() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can use suspend functions.

private fun filterActionsForOfflineOperations() {
        lifecycleScope.launch {
            val available = fileActivity.connectivityService.isNetworkAndServerAvailableSuspended()
            if (available && (!file.isOfflineOperation || file.isRootDirectory)) {
                return@launch
            }
            hideCreationOptions()
        }
    }
    
    private suspend fun hideCreationOptions() = withContext(Dispatchers.Main) {
        binding.run {
            menuCreateRichWorkspace.visibility = View.GONE
            creatorsOverviewContainer.visibility = View.GONE
            menuEncryptedMkdir.visibility = View.GONE
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants