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

Scroll to Bottom: Function in modal blog view #977

Draft
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

marcustyphoon
Copy link
Collaborator

@marcustyphoon marcustyphoon commented Feb 16, 2023

Description

It doesn't add functionality to work in the modal blog view; that's more complicated.
#976.

This adds scroll to bottom functionality in the mobile blog view. To do so, it adds a duplicate of the round "Back to top" button that's specific to the modal blog view container, and adjusts the scrolled element and observed element in startScrolling depending upon the presence or absence of the modal.

It also replaces the checkForButtonRemoved pageModification callback with a check during the scrollToBottom function.

Testing steps

todo: write all of the tests that this stops scrolling when you would expect it to

@marcustyphoon marcustyphoon changed the title Scroll to bottom: Don't deactivate on modal blog view Scroll to bottom: Function in modal blog view May 9, 2023
@marcustyphoon marcustyphoon marked this pull request as ready for review May 9, 2023 19:44
@AprilSylph AprilSylph self-requested a review May 10, 2023 22:30
@marcustyphoon
Copy link
Collaborator Author

marcustyphoon commented May 25, 2023

Issue with this: because the button color is now customized by the user theme (?), the button color will desync when navigating to a different blog in the modal.

  • address this

@marcustyphoon marcustyphoon changed the title Scroll to bottom: Function in modal blog view Scroll to Bottom: Function in modal blog view Aug 12, 2023
Copy link
Owner

@AprilSylph AprilSylph left a comment

Choose a reason for hiding this comment

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

Nice, it works.

Some details I care about, though:

  • Showing both the regular scroll to top button and the blog view one at the same time is kinda weird. Let's hide the regular button when the blog view modal is open.
  • Only showing the blog view scroll to bottom button when the blog view scroll to top button is visible doesn't make sense to me. Let's match the behaviour of the regular one, where it is shown regardless of scroll position.
  • The active --yellow can't be expected to always contrast against the button's background colour... could we... change the button's background colour to --black when scrolling?
    • I was initially thinking we use the same colour as the BG but apply an invert colours filter on the SVG, but that's probably really weird-looking.

@marcustyphoon
Copy link
Collaborator Author

Showing both the regular scroll to top button and the blog view one at the same time is kinda weird. Let's hide the regular button when the blog view modal is open.

Oh, definitely. Not immediately sure how to do that, so if anyone has any ideas, hit me up.

Only showing the blog view scroll to bottom button when the blog view scroll to top button is visible doesn't make sense to me. Let's match the behaviour of the regular one, where it is shown regardless of scroll position.

You know, I'm not actually sure how to do that either?

@marcustyphoon marcustyphoon added the help wanted Extra attention is needed label Sep 26, 2023
@marcustyphoon
Copy link
Collaborator Author

Note: This can probably take advantage of :has().

@marcustyphoon marcustyphoon marked this pull request as draft March 23, 2024 23:50
@marcustyphoon marcustyphoon added the ff121 Requires Firefox 121+ label Mar 24, 2024
still trying to find a better method for this
@marcustyphoon
Copy link
Collaborator Author

Only showing the blog view scroll to bottom button when the blog view scroll to top button is visible doesn't make sense to me. Let's match the behaviour of the regular one, where it is shown regardless of scroll position.

Yeah, I don't think this is really possible without changing the Tumblr code's handling of the scrollToTopEnabled prop to render-but-hide the back to top button instead of conditionally rendering both it and its container.

@marcustyphoon marcustyphoon removed the help wanted Extra attention is needed label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ff121 Requires Firefox 121+
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants