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

Fixes #1223: Merge our two "sticky headers" on scroll #1274

Merged
merged 5 commits into from Nov 13, 2020

Conversation

PedroFonsecaDEV
Copy link
Contributor

@PedroFonsecaDEV PedroFonsecaDEV commented Nov 2, 2020

Issue This PR Addresses

Fixes: #1223

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

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

  • Quality: This PR builds and passes our npm test and works locally
  • 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 (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@manekenpix
Copy link
Member

manekenpix commented Nov 2, 2020

I really like this, and I have 2 questions:

  • Could ScrollAction and BackToTopButton be just one component that would scroll up or down depending on a passed prop?
  • Should ScrollAction and BackToTopButton (or the combination of both if merged) use the same colour that we use in the header?

Copy link
Contributor

@humphd humphd left a 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:

Screen Shot 2020-11-02 at 7 54 39 PM

Next, I don't love how we've lost all the padding around the post header.

Screen Shot 2020-11-02 at 7 57 37 PM

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?

scrolling

You can't see it great in this GIF, but on my machine it bounces as it changes.

UI and Frontend automation moved this from In progress to Review in progress Nov 3, 2020
src/frontend/src/components/Post/Post.jsx Show resolved Hide resolved
@@ -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}>
{' '}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not &nbsp; for these spaces?

import React from 'react';
import PropTypes from 'prop-types';

const ScrollAction = (props) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

const ScrollAction = ({ children }) => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Sorry.

Copy link
Contributor

@agarcia-caicedo agarcia-caicedo left a 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)

image
image
image

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

image

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.

image

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

image

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
    image

  • 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.

image
image

@humphd
Copy link
Contributor

humphd commented Nov 3, 2020

@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 :)

@PedroFonsecaDEV
Copy link
Contributor Author

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.
But I think the author and date are small too. Let's increase it.
I will improve and fix everything.

@PedroFonsecaDEV
Copy link
Contributor Author

I'm still working on it. The last commit doesn't represent the final work.

@PedroFonsecaDEV
Copy link
Contributor Author

@humphd @manekenpix @cindyledev

  • All bugs are fixed.
  • Rebased.
  • Good to go!

This is just the beginning for a better UX. I hope more people jump into our frontend with more improvements.
Thanks.

@PedroFonsecaDEV
Copy link
Contributor Author

@humphd
Thanks.
Issue:
#1329

UI and Frontend automation moved this from Review in progress to Reviewer approved Nov 11, 2020
manekenpix
manekenpix previously approved these changes Nov 11, 2020
UI and Frontend automation moved this from Reviewer approved to Review in progress Nov 11, 2020
@manekenpix
Copy link
Member

@PedroFonsecaDEV it's better if you rebase, don't merge master into your branch
image

@PedroFonsecaDEV
Copy link
Contributor Author

PLEASE DON'T MERGE THIS PR.
I WILL START ANOTHER ONE TOMORROW.

Thanks.

@manekenpix
Copy link
Member

@PedroFonsecaDEV you don't need to submit another PR, just remove the last commit (git reset HEAD~1) and rebase. I'll add the blocked label.

@manekenpix manekenpix added the Blocked Can't do this, until something else is done label Nov 11, 2020
      *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)
@PedroFonsecaDEV
Copy link
Contributor Author

@humphd @manekenpix

Rebased and good to go.

@PedroFonsecaDEV PedroFonsecaDEV removed the Blocked Can't do this, until something else is done label Nov 12, 2020
Copy link
Contributor

@humphd humphd left a 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?

UI and Frontend automation moved this from Review in progress to Reviewer approved Nov 13, 2020
@PedroFonsecaDEV PedroFonsecaDEV merged commit f4274ab into Seneca-CDOT:master Nov 13, 2020
UI and Frontend automation moved this from Reviewer approved to Done Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Merge our two "sticky headers" on scroll
4 participants