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
Fixes #1223: Merge our two "sticky headers" on scroll #1274
Fixes #1223: Merge our two "sticky headers" on scroll #1274
Conversation
6f7577b
to
b3bf689
Compare
I really like this, and I have 2 questions:
|
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.
This is heading in a great direction, I love this! Before I review the code, some UX issues I notice.
First, there is a pixel difference between the bottom of the nav bar and the post header when they collapse together:
Next, I don't love how we've lost all the padding around the post header.
I think the look is quite different, and not for the better. Can we do something where it stays the way it is until it collapses into the top?
You can't see it great in this GIF, but on my machine it bounces as it changes.
@@ -100,15 +100,16 @@ const Post = ({ postUrl }) => { | |||
<Typography variant="h1" title={post.title} id={post.id} className={classes.title}> | |||
{post.title} | |||
</Typography> | |||
<Typography variant="h3" className={classes.author}> | |||
<Typography variant={'p'} className={classes.author}> | |||
{' '} |
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.
Why not
for these spaces?
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const ScrollAction = (props) => { |
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.
const ScrollAction = ({ children }) => {
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.
Sure. Sorry.
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.
My main problem with the design, is that it uses elevation in both an unexpected way and unlike how we were using it by relying on material design.
Before even interacting with the design, the expectation is as follows (Taken from the material design website)
The app bar either has the highest elevation going over everything else (like Telescope) , or it doesn't and you scroll away (like Github)
When the user does interact with the design, the app-bar already shows that it is elevated higher than both the hero image and the scroll down button, by the combination of using a shadow and by sliding on top of those components
When the user reaches the spot just before the app bar meets the blog card, there is no indication that the card title occupies a higher elevation than the app bar (which it needs to be able to show the title on the app bar). On the contrary, the app bar has a more prominent shadow that gives the impression of a higher elevation.
However, when the user continues scrolling, it reacts in an unexpected way - The card title begins to merge with the app bar, but they visibly don't have the same elevation (or the card title being at a higher elevation) because of the shadow difference
As the user continues to scroll, the unexpected behaviour continues. There isn't an elevation difference between the card title and the card content. So the expectation would be that both would go over the app bar, but they don't. The card title stays on top of the app bar, but the content goes behind.
In the end, this design choice both break the user's expectations based on their previous experiences with material design, and the expectations set up with this design.
Other minor feedback unrelated to elevation. Mostly
-
The author and the date are a bit too close, which could create an ux issue since the small gap could mean people click on the wrong link.
-
At a certain width the title of the post cuts of the search button
-
Before the card title joins the app bar, the sizing it's ok, but once it goes on the app bar, the font size its too big for its space. Rather than increase the padding, (big app bars are not ideal), the font size could be shrunk. Similar how Github does it.
@agarcia-caicedo have you got ideas on how to do this in a way that stays within the current design? I'm trying you read your comment above so as to find a way forward. I really love how this cleans up the view, but retains the post info. But I get what you're saying too. I guess what I want is my cake and eat it to :) |
I didn't change the font size or spacing, just the padding. So we are seeing the same font and the same size as we see in prod and dev. |
b3bf689
to
7f83f8a
Compare
I'm still working on it. The last commit doesn't represent the final work. |
ba3fecd
to
413ec2e
Compare
@humphd @manekenpix @cindyledev
This is just the beginning for a better UX. I hope more people jump into our frontend with more improvements. |
8d22130
@PedroFonsecaDEV it's better if you rebase, don't merge master into your branch |
PLEASE DON'T MERGE THIS PR. Thanks. |
@PedroFonsecaDEV you don't need to submit another PR, just remove the last commit ( |
*ScrollTop and ScrollDown becomes: ScrollAction (We had repeated code for up and down, now we have only one component) *BackToTop becomes: BackToTopButton - No more coupling with ScrollTop *Merge our two "sticky headers" on scroll (Seneca-CDOT#1223)
8d22130
to
8d744fb
Compare
Rebased and good to go. |
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.
@PedroFonsecaDEV looks good. Did you want to try squashing this too, so you only have 1 commit?
Issue This PR Addresses
Fixes: #1223
Type of Change
Description
Fixes: 1223
*ScrollTop and ScrollDown becomes: ScrollAction (We had repeated code for up and down, now we have only one component)
*BackToTop becomes: BackToTopButton - No more coupling with ScrollTop
*Also updated to ES6 the code that I worked on.
*Merge our two "sticky headers" on scroll (#1223)
Checklist