-
Notifications
You must be signed in to change notification settings - Fork 932
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
Bookmarks: Undo behavior #3828
Bookmarks: Undo behavior #3828
Conversation
b38d8e8
to
cd16c21
Compare
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
62c0291
to
f1133b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few comments I would like to review together:
- Move logic out of the UI, and keep viewmodel methods agnostic.
- We don't have a consitent way to hide savedsites/folders. One implementation for Bookmarks screen, and different implementations for BrowserTab and SystemSearch screens. I think we should unify the logic (posted a proposal, let's review if that will work)
app/src/main/java/com/duckduckgo/app/bookmarks/ui/BookmarksActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/bookmarks/ui/BookmarksActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/systemsearch/SystemSearchActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/systemsearch/SystemSearchViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/bookmarks/ui/BookmarksViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/bookmarks/ui/BookmarksViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/bookmarks/ui/BookmarksActivity.kt
Outdated
Show resolved
Hide resolved
cf0cf20
to
a1db403
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM works great!
app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/systemsearch/SystemSearchViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/systemsearch/SystemSearchViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/test/java/com/duckduckgo/app/systemsearch/SystemSearchViewModelTest.kt
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/systemsearch/SystemSearchActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/systemsearch/SystemSearchActivity.kt
Outdated
Show resolved
Hide resolved
3562a65
to
ffd2edd
Compare
Task/Issue URL: https://app.asana.com/0/488551667048375/1205171041444238/f
Description
This PR changes how undo works at a UI layer level for saved sites.
Until now, when the user wanted to delete a bookmark, we were directly removing it from the DB. In the case that the user were to undo the change, we were adding a new row to the DB. This is problematic in many levels, changing order of Favourites and also triggering unnecessary Sync operations.
Steps to test this PR
All test cases assume that Sync is enabled
Remove Favourite from Bookmarks screen
Remove Bookmark from Browser
Remove Favourite from Browser
Remove Bookmark from Browser
Remove Favourite from New Tab
Remove Favourite from Omnibar Quick Access
Remove Favourite from Favourites Widget