Skip to content
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

fix: Android UI bugs #4134

Merged
merged 23 commits into from
Nov 22, 2023
Merged

fix: Android UI bugs #4134

merged 23 commits into from
Nov 22, 2023

Conversation

L03TJ3
Copy link
Collaborator

@L03TJ3 L03TJ3 commented Nov 14, 2023

Description

  • - align buttons on feedmodal
  • - fix buggy animation when slow scrolling feed by using static ref value
  • - don't show toTop button while scrolling is still active

About # (link your issue here)
#4093

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • PR title matches follow: (Feature|Bug|Chore) Task Name
  • My code follows the style guidelines of this project
  • I have followed all the instructions described in the initial task (check Definitions of Done)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added reference to a related issue in the repository
  • I have added a detailed description of the changes proposed in the pull request. I am as descriptive as possible, assisting reviewers as much as possible.
  • I have added screenshots related to my pull request (for frontend tasks)
  • I have pasted a gif showing the feature.
  • @mentions of the person or team responsible for reviewing proposed changes

Copy link

vercel bot commented Nov 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
good-dapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2023 0:29am
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
gooddollar-delta ⬜️ Ignored (Inspect) Visit Preview Nov 22, 2023 0:29am
goodid ⬜️ Ignored (Inspect) Visit Preview Nov 22, 2023 0:29am

@L03TJ3
Copy link
Collaborator Author

L03TJ3 commented Nov 14, 2023

@johnsmith-gooddollar @sirpy

there are two raised 'bugs' on the original issue

  1. bug: slowely scrolling down, around the point where it minimizes the header it becomes quite buggy (if you keep scroll active)
    I have tried using debounce, or the debounce hook for scrolling. but for some reason ( i dont know..) nativeEvent becomes undefined by wrapping the handleScrollEnd. is there another way to handle the crossover from headerlarge > !headerlarge (minimizing header)?

  2. When the feed is still scrolling (android) and you click on to top, it does not jump back (explanation is i think obvious, setting the offset to 0 while scrolling will just update from offset > 0 > new offset during scrolling)
    All the stuff I found about blocking scrolling becomes from my pov quite hacky. on I tried to use state for enabling/disabling scrolling. does not really work. any suggestions?

@sirpy
Copy link
Contributor

sirpy commented Nov 15, 2023

to me it seems the solution is to:
animation - why is it buggy? it seems like it doesnt know if to open or close the top header, so the threshold should be less sensitive or that once an animation has started it needs to finish before try the reverse animation.
scroll to top - only scroll to top if scrolling is not active

src/components/dashboard/Dashboard.js Outdated Show resolved Hide resolved
src/components/dashboard/FeedList.js Outdated Show resolved Hide resolved
src/components/dashboard/Dashboard.js Outdated Show resolved Hide resolved
src/components/dashboard/FeedList.js Outdated Show resolved Hide resolved
@L03TJ3
Copy link
Collaborator Author

L03TJ3 commented Nov 17, 2023

@johnsmith-gooddollar maybe the simple solution is to apply the same logic as now has been done for the scrollToTop button (which uses onMomentumEnd - end of scrolling)
now the callback for position is called throughout scrolling and keeps track of position
maybe we should just stick to only determining position when the scrolling is static again?

@@ -832,7 +833,10 @@ const Dashboard = props => {
const handleScroll = useCallback(
({ ...args }) => {
dispatchScrollEvent()
handleScrollEnd(args)

if (isWeb) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont understand this. does it mean that on native we will not change the header size?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

HandleMomentumScroll is handling the calling for handles rollend.

So it still minimizes, but only after the scrolling has ended (at the same point that we show the toTop button)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a good solution. Most users on mobile simply scroll and do not stay on the exact position where it jitters. So now for most mobile users the UX experience will be worse.
The solution is either to make it less sensitive when it starts the animation or to not toggle the state until the previous animation is over. so once an animation starts (large->small or small->large) you set a reference to true. once the animation ends you set it to false. at any point if the reference is true we do not change the state of the header.

Copy link
Contributor

Choose a reason for hiding this comment

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

so insted of if(isWeb) you would have if(isAnimationInProgress === false)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't understand your concern with the solution.
On momentumScroll is triggered whenever the scrollbar stops scrolling.
The moment this happens, it minimizes the header.

This is the simplest approach out there.

(If it's scrolling and you touch feed again, it's also considered onMomentumScrolEnd)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also the issue is not in the animation running.

It's about an infinite loop where it does not know which animation to run because the condition changes every 1 ms

@L03TJ3 L03TJ3 merged commit 9b783de into master Nov 22, 2023
4 checks passed
@L03TJ3 L03TJ3 deleted the 4093-fix-android-ui-bugs branch November 22, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants