New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ios] Implement the Recently Deleted screen to restore deleted categories #7978
base: master
Are you sure you want to change the base?
[ios] Implement the Recently Deleted screen to restore deleted categories #7978
Conversation
Multiple selections to restore/delete selected files <- This would be great to have for non-deleted lists first, but if you've already implemented it, that's ok. deletion_date can be retrieved by checking the last modified file's time. It is updated when the file is moved, right? Why recently_deleted_id is needed and how it will be retrieved? Please consider keeping the API clean to be compatible with Android. And what about the UI in the main bookmarks and tracks screen? |
Yes.
This ID should be created to track the deleted files. It may be the same as @interface MWMBookmarkGroup : NSObject
@property(nonatomic, readonly) MWMMarkGroupID categoryId; // <--- ID
@property(nonatomic, readonly) NSString *title;
... - (NSString *)getCategoryName:(MWMMarkGroupID)groupId
{
return @(self.bm.GetCategoryName(groupId).c_str());
}
std::string BookmarkManager::GetCategoryName(kml::MarkGroupId categoryId) const It will be easier to implement logic when we can pass only the ID to the core to restore files.
|
Thanks! Will deleted IDs reuse the same API as non-deleted lists? Maybe it would be better to split it? And if it is split, can introducing an intermediate int ID be avoided in favor of using a full file path instead? It may simplify the support. |
The API splittting would be better! And we can use the full path, sure. So the frontend will wait from the core only the category name, path and timeInteraval (date). And we can restore using something like |
1b56238
to
d2f0ac4
Compare
No, cleaning should be easy.
A first version likely can be released with manual deletion only. A presence of the button means that "something is in the trash". Scanning deleted files on each opening of bookmarks to show some counter doesn't make much sense. As people travel and use OM a lot, an automated cleanup can be implemented. Maybe make it in a friendly way: when bookmarks dialog is opened, a confirmation asks to clean up trash, to see the trash, or to ignore and do nothing.
@organicmaps/contributors WDYT on the topic? Any ideas/improvements/suggestions? Can anyone help @kirylkaveryn with the C++ core API design/implementation part, and then with Android part? |
I think a sudden popup could be very disruptive for user's flow. Maybe there could be a red dot on "recently deleted" to attract some attention. |
Overall I think its important to design this feature in a way so that it could support undo deletion of individual bookmarks in the future. |
Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
delete_all, recover, recover_all, bookmarks_recently_deleted Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
- replace #imageLiteral with the convenient UIImage - set the images rendering mode to the `template` to support a programmatically tinting - set the image's tint color directly Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
d2f0ac4
to
acdf9fe
Compare
While the selection mode is active the trailing swipes cannot be triggered in ios. Deletion with a swipe is widely used. I repeated the system's native behavior so the user shouldn't adatp and delete rows as he can make in Mail, Files, Notes, Reminder etc.
Done!
This information should be retrieved as a result of parsing files by the core.
Maybe we can use |
Deleting rows from the trash is not the main function of the trash ) Categories internally in the code are facing users as "Lists" translation. Let's focus again on the main function of the trash: easily restore an accidentally deleted list. Or a recently deleted list. Restoring a recently deleted bookmark or track can also be an option. Any other functionality from the Files app is an unnecessary overhead. Thinking about bookmarks and tracks, can we move them (instead of deleting them) to some pre-defined lists like "Deleted Bookmarks" and "Deleted Tracks"? |
Its an option, but it'd be better to restore a deleted bookmark back to its original list (maybe its possible to store the original list value in some metadata?). Also from a UX POV it could be confusing to see some surrogate "Deleted bookmarks" list amongst other deleted lists :/ IMO for a user it'd be more logical if a deleted bookmark from the "My Places" list could be found under the same "My Places" grouping in "recently deleted". But that means it should be possible to enter "deleted lists" and restore individual items and if the whole deleted list is being restored then it should be merged with the current one with the same name (if exists). Another option is to list deleted bookmarks / tracks at the same level as deleted lists (but still need to preserve the original list). Yet another option is to handle bookmarks deletion very differently via a separate UI, e.g. by marking them as "deleted" inside the list and adding a list action to browse and restore "deleted" items. As this functionality is not needed often then it makes sense to choose the most simple option. |
What if the original list has been deleted/renamed? Generally, I agree that we're overengineering a simple task. Currently, users are complaining only about restoring accidentally deleted bookmarks or lists. So providing an immediate way of restoring something recently deleted could be sufficient and simple enough to release sooner. Another idea:
|
Then the restored bookmark will be the only one in that list. |
Actually my impression is that its mostly about bookmarks. Accidental list deletion is much more rare. And actually an easily accessible autobackup (just to some user-accessible folder on the same device) might be a simpler solution for restoration of whole lists. |
Closes (for iOS) #1026
This PR contains the default implementation of the Recently Deleted Screen in iOS to restore deleted categories.
Key concepts:
.Trash
directory rather than removedbookmarks
directoryRecently deleted
button is visible only when the.Trash
is not emptyfile.kml
and trash contains the file with the same name the new deleted file should be renamed to avoid conflictsfile.kml
from the Recently Deleted andbookmarks
contains the file with the same name the restored file should be renamedFiles structure:
root_directory/
--- bookmarks/
------ file1.kml
------ file2.kml
---.Trash/
------ bookmarks/file3.kml
Todo:
iOS
As a reference the
Files app
recently deleted screen is used.recently deleted
button when there nothing to deleteQuestions:
Core:
At the moment all code related to the
file management
functionality is temporary implemented in theMWMBookmarksManager
but it should be moved to the cpp core.Here the API:
category_path
,category_name
, anddeletion_date
key concepts
@biodranik @rtsisyk please share your thoughts!
Files App (as a reference):
Temporary results: