fix: hide non-functional "Move to" action in the recycle bin#1086
Open
MiMoHo wants to merge 1 commit into
Open
fix: hide non-functional "Move to" action in the recycle bin#1086MiMoHo wants to merge 1 commit into
MiMoHo wants to merge 1 commit into
Conversation
In the fullscreen viewer, the overflow "Move to" item and the opt-in bottom-action Move button were shown for recycle-bin items, but moving is disabled from the bin (copyMoveTo only shows a "use Restore" toast). Guard both with !getIsInRecycleBin(), matching the adjacent rename/hide/ favorite items and the grid CAB, which already hide move in the bin. Copy stays visible since copying from the bin is functional.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change(s)
What changed and why
In the fullscreen viewer (
ViewPagerActivity), the overflow Move to item and the opt-in bottom-action Move button were shown even when viewing an item inside the recycle bin. Moving is not supported from the bin: tapping Move to callscopyMoveTo(), which detectscurrPath.startsWith(recycleBinPath)and only shows the toast "Moving recycle bin items is disabled. Please use Restore." before returning. So the action appeared functional but did nothing (this is the German toast shown in the issue screenshot).This adds the missing
!currentMedium.getIsInRecycleBin()guard to both the overflow item (menu_move_to) and the bottom-action Move button, matching the pattern already used by the neighbouring rename / hide / unhide / favorite items and thebottomRename/bottomFavoritebuttons, and consistent with the grid CAB which already hidescab_move_toin the bin.Copy to is intentionally left visible, because copying from the recycle bin is functional —
copyMoveTo()blocks only the move operation.Tests performed
Built the
fossDebugvariant and verified on an Android 15 (API 35) emulator:Deleted an image to recycle bin; opened it fullscreen; overflow menu had NO 'Move to' (count 0) but had 'Copy to' and 'Restore this file'. Regression: opened a normal (non-bin) image fullscreen -> overflow HAS 'Move to' (count 1) plus 'Rename'.
Also confirmed
detekt,lint, unit tests and the build all pass locally (CI-equivalent).Closes the following issue(s)
Checklist
CHANGELOG.md(if applicable).Coded with Opus 4.8 ultracode.