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

For #15362: Remove swipe to delete for bookmarks #16646

Merged

Conversation

kleinph
Copy link
Contributor

@kleinph kleinph commented Nov 19, 2020

Closes #15362

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
    This PR does remove a feature and its tests.
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
    no-swipe-delete-bookmarks
  • 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.
    A feature was removed, so accessibility should not change.

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

@kleinph kleinph requested review from a team as code owners November 19, 2020 08:22
@firefoxci-taskcluster
Copy link

No Taskcluster jobs started for this pull request
The `allowPullRequests` configuration for this repository (in `.taskcluster.yml` on the
default branch) does not allow starting tasks for this pull request.

@Mugurell Mugurell self-assigned this Nov 19, 2020
Copy link
Contributor

@Mugurell Mugurell left a comment

Choose a reason for hiding this comment

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

Thank you for helping with this @kleinph!
There is still a little bit of cleanup to do around

  • the onStartSwipingItem, onStopSwipingItem methods from BookmarkView/Interactor/Controller
    • also the tests for these methods
  • and the code related to isSwipeToRefreshEnabled in BookmarkFragmentStore.
    • also the related tests

@kleinph
Copy link
Contributor Author

kleinph commented Nov 19, 2020

@Mugurell should I do the missing pieces in extra commits or can I amend the original commit?
Thanks for reviewing!

@Mugurell
Copy link
Contributor

Mugurell commented Nov 19, 2020

@Mugurell should I do the missing pieces in extra commits or can I amend the original commit?
Thanks for reviewing!

To me a single commit is fine - I see all changes related and all for code cleanup.
So I'd be for amending the original one.

@Mugurell
Copy link
Contributor

Thank you @kleinph for the prompt changes!

After deleting the handleStartSwipingItem & handleStopSwipingItem methods from BookmarkController there are now 2 tests failing in BookmarkControllerTest as they tried testing these 2 methods. These tests probably needs to be removed also.

Looking at the implementation of these two Controller methods I see that their intent was to enable / disable the pull down to refresh functionality while the user does a horizontal swipe, something that was implemented in #12831.
Since after removing this swipe to delete functionality there is no need for having this code to disable pull to refresh anymore (& there are no other methods that would emit that SwipeRefreshAvailabilityChanged Action) we should also cleanup BookmarkFragmentStore and BookmarkFragmentStoreTest of now dead code.
Maybe for these changes a separate commit would make them easier to follow?

If you need any help with this please say. I understand it can be a bit more complex than it appeared at a first look.
You can also use the changes from #12831 as a guide in what to remove.

Also remove now obsolete feature flag and tests.

Closes mozilla-mobile#15362
@kleinph
Copy link
Contributor Author

kleinph commented Nov 21, 2020

Thank you @kleinph for the prompt changes!

After deleting the handleStartSwipingItem & handleStopSwipingItem methods from BookmarkController there are now 2 tests failing in BookmarkControllerTest as they tried testing these 2 methods. These tests probably needs to be removed also.

Sorry, I missed the part about building and the pre push hooks in the Readme, because I followed the link to the contributing guide and never returned. Will fix this and run tests for all commits locally from now on.

Looking at the implementation of these two Controller methods I see that their intent was to enable / disable the pull down to refresh functionality while the user does a horizontal swipe, something that was implemented in #12831.
Since after removing this swipe to delete functionality there is no need for having this code to disable pull to refresh anymore (& there are no other methods that would emit that SwipeRefreshAvailabilityChanged Action) we should also cleanup BookmarkFragmentStore and BookmarkFragmentStoreTest of now dead code.
Maybe for these changes a separate commit would make them easier to follow?

Yes, I also think so.

If you need any help with this please say. I understand it can be a bit more complex than it appeared at a first look.

That's no problem, it just makes it more interesting :-)

You can also use the changes from #12831 as a guide in what to remove.

I now fixed the failing tests and also removed an obsolete import the linter spotted. Cleanup of dead code will follow soon.

…okmarkFragmentState

Also adapt tests and remove obsolete ones.
Copy link
Contributor

@Mugurell Mugurell 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 awesome!
Thank you!

@Mugurell
Copy link
Contributor

bors try

bors bot pushed a commit that referenced this pull request Nov 25, 2020
@bors
Copy link

bors bot commented Nov 25, 2020

try

Build succeeded:

@Mugurell Mugurell added the pr:needs-landing PRs that are ready to land [Will be merged by Mergify] label Nov 25, 2020
@Mugurell
Copy link
Contributor

bors r+

bors bot pushed a commit that referenced this pull request Nov 26, 2020
16646: For #15362: Remove swipe to delete for bookmarks r=Mugurell a=kleinph

Closes #15362



### Pull Request checklist
<!-- Before submitting the PR, please address each item -->
- [x] **Tests**: This PR includes thorough tests or an explanation of why it does not
This PR does remove a feature and its tests.
- [x] **Screenshots**: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
![no-swipe-delete-bookmarks](https://user-images.githubusercontent.com/566413/99639340-c6b92880-2a47-11eb-9686-604f09c07842.gif)
- [x] **Accessibility**: The code in this PR follows [accessibility best practices](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) or does not include any user facing features. In addition, it includes a screenshot of a successful [accessibility scan](https://play.google.com/store/apps/details?id=com.google.android.apps.accessibility.auditor&hl=en_US) to ensure no new defects are added to the product.
A feature was removed, so accessibility should not change.

### 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


Co-authored-by: Philipp Klein <philipptheklein@gmail.com>
@Mugurell Mugurell merged commit 2be3fd0 into mozilla-mobile:master Dec 4, 2020
@Mugurell
Copy link
Contributor

Mugurell commented Dec 4, 2020

Sorry that this took so long @kleinph .
The patches are now merged.
Thank you for helping with this!

@Mugurell Mugurell removed the pr:needs-landing PRs that are ready to land [Will be merged by Mergify] label Dec 4, 2020
pkirakosyan pushed a commit to gexsi/user-agent-android that referenced this pull request Aug 4, 2021
…la-mobile#16646)

Removed now obsolete feature flag and tests.
Removed obsolete swipe refresh state from BookmarkFragmentState
Also adapted tests and remove obsolete ones.
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.

Investigate if we want to keep swipe to delete bookmarks
2 participants