Skip to content

[Bug] File action sheet shows no actions at all for locked files #17845

Open

Description

@falkloewert

Steps to reproduce

  1. Lock a file (e.g. open a document in the Text or OnlyOffice app, or use "Lock file" from another client).
  2. In the Android app, open the folder that contains the locked file.
  3. Tap the three-dot menu of that file.

Actual behaviour

The bottom sheet shows the file name and a "Locked by the app …" row, but no actions at all — not even edit, rename, download or delete. The sheet is short and cannot be expanded by dragging.

Expected behaviour

The regular action list is shown, plus the lock information row.

Cause

FileActionsBottomSheet.handleState() calls displayLockInfo() before displayActions():

if (state.lockInfo != null) {
    displayLockInfo(state.lockInfo)
}
displayActions(state.titleFile, state.actions)

displayActions() starts with if (binding.fileActionsList.isNotEmpty()) return, so as soon as the lock row has been appended, every action is skipped. Only the lock row ends up in the sheet.

Suggested fix

Render the actions first and append the lock info afterwards:

displayActions(state.titleFile, state.actions)
if (state.lockInfo != null) {
    displayLockInfo(state.lockInfo)
}

This is also what makes the unlock action reachable — see #17838.

Environment

  • Nextcloud Android 35.0.1 (Play) and current master, Android 16, Pixel 9 Pro
  • Server: Nextcloud 34 (AIO), files_lock 34.0.1

🤖 Generated with Claude Code

Activity

  1. alperozturk96 commented on Oct 20, 2026

    @alperozturk96
    Collaborator

    @falkloewert Hey,

    If file is locked why client should show "Delete, Edit, Rename" actions?

  2. falkloewert commented on Oct 20, 2026

    @falkloewert
    Author

    @falkloewert Hey,

    If file is locked why client should show "Delete, Edit, Rename" actions?

    Hi @alperozturk96, you're right: Edit/Rename/Delete on a locked file make no sense, and my report was misleading.

    My actual problem: I open a document on my phone (Text/OnlyOffice), close it, and the file stays locked ("Locked by the app"). The Android app has no unlock action, so I can only release it via the web UI or another client.

    Minimal request: keep the other actions hidden (or greyed out with a lock hint) and show only "Unlock" for the lock owner.
    The suggested reorder is just the smallest change to make the sheet usable, and it also makes the unlock action from #17838 reachable.

    Separate question: why isn't the app lock released when I close the editor on the same device? If that's server-side (files_lock), I'll open a separate issue there.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions