Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For issue #9949 - Bookmarks/History deletion inconsistencies #12630

Conversation

BMEduard
Copy link
Contributor

  • Added a new check inside the "deleteMulti" method from BookmarkFragment that calls the showRemoveFoldersDialog to prevent the user from being able to delete one or more bookmark folders without being asked for confirmation, as in [Library] Deleting is inconsistent between history/bookmarks #8648.

  • Added the undo action for deleting individual history items by creating a new field to the history state containing the id's of the history items that are pending for deletion; This field is used inside the update function from the view to show/hide the items.

  • In order to show the correct headers while items are being hidden/deleted, a map was added in the adapter that keeps the position of the headers and updates it as items are pending for deletion/deleted.

  • In addition, the state's modes have been reduced to "Normal" and "Editing", since the "Deleting" mode's UI updates (showing and hiding the deletion progress bar) is doesn't overlap the other states.

Pull Request checklist

  • [ X ] Tests: This PR includes thorough tests or an explanation of why it does not
  • [ X ] Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • [ X ] Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

After merge

  • Milestone: Make sure issues finished by this pull request are added to the milestone of the version currently in development.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

After merge

  • Milestone: Make sure issues finished by this pull request are added to the milestone of the version currently in development.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2020

Codecov Report

Merging #12630 into master will decrease coverage by 0.10%.
The diff coverage is 3.80%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #12630      +/-   ##
============================================
- Coverage     25.82%   25.72%   -0.11%     
  Complexity      890      890              
============================================
  Files           396      396              
  Lines         15837    15888      +51     
  Branches       2038     2042       +4     
============================================
- Hits           4090     4087       -3     
- Misses        11432    11486      +54     
  Partials        315      315              
Impacted Files Coverage Δ Complexity Δ
...ozilla/fenix/library/bookmarks/BookmarkFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...rg/mozilla/fenix/library/history/HistoryAdapter.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...g/mozilla/fenix/library/history/HistoryFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/org/mozilla/fenix/library/history/HistoryView.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...y/history/viewholders/HistoryListItemViewHolder.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...illa/fenix/library/history/HistoryFragmentStore.kt 57.14% <13.33%> (-20.28%) 1.00 <0.00> (ø)
...illa/fenix/library/bookmarks/BookmarkController.kt 83.01% <100.00%> (ø) 0.00 <0.00> (ø)
...ix/library/bookmarks/BookmarkFragmentInteractor.kt 79.48% <100.00%> (ø) 25.00 <0.00> (ø)
...nix/components/toolbar/BrowserToolbarController.kt 67.26% <0.00%> (-2.39%) 0.00% <0.00%> (ø%)
...ug/java/org/mozilla/fenix/DebugFenixApplication.kt 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2fe17a6...18afafa. Read the comment docs.

@BMEduard BMEduard requested review from ekager and kglazko July 16, 2020 09:20
Copy link

@eliserichards eliserichards left a comment

Choose a reason for hiding this comment

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

This looks great! A few nits, but otherwise 👍

@BMEduard BMEduard force-pushed the For/#9949-bookmarks_history_inconsistencies branch 2 times, most recently from a8a6697 to aa3e538 Compare July 17, 2020 06:42
…ncies

 - Added the undo action for deleting individual history items by creating a new field to the history state containing the id's of the history items that are pending for deletion; This field is used inside the update function from the view to show/hide the items.

 - Added a new check inside the "deleteMulti" method from BookmarkFragment that calls the showRemoveFoldersDialog to prevent the user from being able to delete one or more bookmark folders without being asked for confirmation, as in mozilla-mobile#8648.
@BMEduard BMEduard force-pushed the For/#9949-bookmarks_history_inconsistencies branch from aa3e538 to 18afafa Compare July 17, 2020 08:03
Copy link

@eliserichards eliserichards left a comment

Choose a reason for hiding this comment

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

🔥 💯 👍

@eliserichards eliserichards merged commit 1823fdb into mozilla-mobile:master Jul 17, 2020
@liuche liuche mentioned this pull request Jul 20, 2020
9 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Library] Possible inconsistencies between deleting history/bookmark items
3 participants