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

#2373 Update on github information on mobile view, need update on the titles #2491

Closed
wants to merge 16 commits into from

Conversation

irenejoeunpark
Copy link
Contributor

@irenejoeunpark irenejoeunpark commented Nov 18, 2021

Issue This PR Addresses

#2373 More change is needed after some feedbacks on styles

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

This PR contains an update on the UI for mobile view, to include GitHub information on each post.
When the user clicks on the GitHub icon, it expands the GitHub information of the post.

Need feedback on the icon, design, and the idea of using Accordion.
Need to fix the title and the author name position on mobile view - need some advice on it.

Screen Shot 2021-11-18 at 3 20 35 PM

Screen Shot 2021-11-18 at 3 20 43 PM

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 -> Not a functional change, no need of functional tests to be added.
  • 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) -> UI change, not applicable

@gitpod-io
Copy link

gitpod-io bot commented Nov 18, 2021

@humphd
Copy link
Contributor

humphd commented Nov 18, 2021

I think the idea is good. The details need some work, but having it expand vertically to reveal the GitHub info is interesting. We need to find a way to use the space more efficiently on mobile (not jammed to the right). Also, I'm not sure where the GitHub icon should go, or what it should look like. It might need some text to indicate there is More... somehow.

I would focus on figuring out how to arrange this same info in a smaller space efficiently on mobile (e.g., what's in the revealed area).

Copy link
Contributor

@DukeManh DukeManh 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 awesome.

I'm just thinking about whether we should display the github info at the bottom of each post by default vs make users click a button and see a layout shift.

src/web/src/components/Posts/GitHubMobile.tsx Outdated Show resolved Hide resolved
src/web/src/components/Posts/GitHubMobile.tsx Outdated Show resolved Hide resolved
src/web/src/components/Posts/GitHubMobile.tsx Outdated Show resolved Hide resolved
src/web/src/components/Posts/GitHubMobile.tsx Outdated Show resolved Hide resolved
src/web/src/components/Posts/GitHubMobile.tsx Outdated Show resolved Hide resolved
src/web/src/components/Posts/GitHubMobile.tsx Outdated Show resolved Hide resolved
src/web/src/components/Posts/GitHubMobile.tsx Outdated Show resolved Hide resolved
src/web/src/components/Posts/Issues.tsx Outdated Show resolved Hide resolved
src/web/src/components/Posts/PullRequests.tsx Outdated Show resolved Hide resolved
@irenejoeunpark
Copy link
Contributor Author

I think the idea is good. The details need some work, but having it expand vertically to reveal the GitHub info is interesting. We need to find a way to use the space more efficiently on mobile (not jammed to the right). Also, I'm not sure where the GitHub icon should go, or what it should look like. It might need some text to indicate there is More... somehow.

I would focus on figuring out how to arrange this same info in a smaller space efficiently on mobile (e.g., what's in the revealed area).

I found another method for collapsable, called Colllapse in material-UI, here is an example of the usage.
https://codesandbox.io/s/77r47?file=/src/App.js:0-41
Should I use this to collapse the info horizontally?
I am also thinking that no one would notice that the GitHub icon is for expanding information, and people would rarely click it.
So, I am changing it to ... which seems more reasonable and could lead more people to click it.

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.

I think this needs more UX work. Here's the comparison of what we have now (left) with what this does (right):

Screen Shot 2021-11-23 at 12 38 59 PM

I think adding another ... clutters the view. Here's my suggestion instead:

  • Make the entire header (avatar logo, title, name, etc) a single clickable area
  • If there is GitHub data to show, add a small GitHub icon to the right of the person's name, which would indicate that there is GitHub data to reveal
  • Touching the header would open the header to a larger size

The current layout of the GitHub data isn't going to work on mobile:

Screen Shot 2021-11-23 at 12 40 59 PM

We need to use the entire width somehow. cc @Meneguini, @PedroFonsecaDEV for ideas.

@irenejoeunpark
Copy link
Contributor Author

I think this needs more UX work. Here's the comparison of what we have now (left) with what this does (right):

Screen Shot 2021-11-23 at 12 38 59 PM

I think adding another ... clutters the view. Here's my suggestion instead:

  • Make the entire header (avatar logo, title, name, etc) a single clickable area
  • If there is GitHub data to show, add a small GitHub icon to the right of the person's name, which would indicate that there is GitHub data to reveal
  • Touching the header would open the header to a larger size

The current layout of the GitHub data isn't going to work on mobile:

Screen Shot 2021-11-23 at 12 40 59 PM

We need to use the entire width somehow. cc @Meneguini, @PedroFonsecaDEV for ideas.

It seems like a good design. I will try to make the whole title container a clickable area and add a GitHub icon if there's any GitHub link attached.

@irenejoeunpark
Copy link
Contributor Author

I think this needs more UX work. Here's the comparison of what we have now (left) with what this does (right):

Screen Shot 2021-11-23 at 12 38 59 PM

I think adding another ... clutters the view. Here's my suggestion instead:

  • Make the entire header (avatar logo, title, name, etc) a single clickable area
  • If there is GitHub data to show, add a small GitHub icon to the right of the person's name, which would indicate that there is GitHub data to reveal
  • Touching the header would open the header to a larger size

The current layout of the GitHub data isn't going to work on mobile:

Screen Shot 2021-11-23 at 12 40 59 PM

We need to use the entire width somehow. cc @Meneguini, @PedroFonsecaDEV for ideas.

@humphd I have revised the code to make the title container clickable, and show the GitHub icon beside the author name when there is any GitHub info available.

Now I faced another challenge, which the title container, which has been pinned to the top before I make the change, is now scrolled down with the post content. I tried a few different things, but it never gets pinned on top even though I only updated it to put the whole thing in the AccordionSummary. <- might be related to the issue?
I will ask for other reviews in the slack.

@humphd
Copy link
Contributor

humphd commented Dec 8, 2021

Excellent, thank you. Can you rebase to pick up the changes to src/web/src/components/Posts/*?

@humphd
Copy link
Contributor

humphd commented Dec 16, 2021

This isn't perfect, but it's better. The mechanism of showing/hiding the info is working well. I'm not sure about the font size change on the header text. And the layout of the inner contents are still not right for mobile.

I'll be interested to see further improvements and hear more from other reviewers.

Copy link
Contributor

@DukeManh DukeManh 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 getting closer. I left some reviews.

@@ -15,6 +15,10 @@ const useStyles = makeStyles((theme: Theme) =>
lineHeight: 'normal',
fontSize: '1.2rem',
},
GitHubMobile: {
Copy link
Contributor

Choose a reason for hiding this comment

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

This class isn't needed.


return (
<div>
<ListSubheader className={classes.root}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make this <ListSubheader component="div"> and the same to every ListSubheader you add? We have a number of wrong uses of ListSubheader throughout the tree because we like its default style. By default it renders a <li>, li is meant for lists, we don't want to end up having nested <li>. I have fixed some <ListSubheader component="div"> in #2594 but to avoid this in the future I'll file an issue to replace all usage of ListSubheader with a different component while maintaining the same style.

<time dateTime={post.updated}>{`${formatPublishedDate(post.updated)}`}</time>
</a>
{!desktop && (
<>
Copy link
Contributor

Choose a reason for hiding this comment

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

This fragment isn't needed.

</AccordionDetails>
</Accordion>
</>
)}
{desktop && (
Copy link
Contributor

Choose a reason for hiding this comment

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

It'll be nice if y can combine these two expression into something like desktop ? <A/> : <B/>

@@ -15,6 +15,11 @@ const useStyles = makeStyles((theme: Theme) =>
wordWrap: 'break-word',
lineHeight: 'normal',
},
GitHubMobile: {
Copy link
Contributor

Choose a reason for hiding this comment

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

This class isn't needed.


const GitHubInfoMobile = ({ ghUrls }: Props) => {
const classes = useStyles();
const { repos, issues, pullRequests, commits, users } = filterGitHubUrls(ghUrls);
Copy link
Contributor

Choose a reason for hiding this comment

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

let's cache the result of this function call with useMemo so that it doesn't get called every time the Accordion is open.

Suggested change
const { repos, issues, pullRequests, commits, users } = filterGitHubUrls(ghUrls);
const { repos, issues, pullRequests, commits, users } = useMemo(
() => filterGitHubUrls(ghUrls),
[ghUrls]
);

Can you do the same for GithubInfo?

padding: '0 0 0 1rem',
},
},
gitHubIcon: {
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't use a githubIcon anymore right.

@DukeManh
Copy link
Contributor

One area of the inner layout to be improved is the repos list to take up some of the horizontal space. If it looks clustered to you, feel free to design around and add visual separators between them :).

Column Row
Screen Shot 2021-12-16 at 11 33 09 PM Screen Shot 2021-12-16 at 11 33 55 PM

@HyperTHD
Copy link
Contributor

One area of the inner layout to be improved is the repos list to take up some of the horizontal space. If it looks clustered to you, feel free to design around and add visual separators between them :).

Column Row
Screen Shot 2021-12-16 at 11 33 09 PM Screen Shot 2021-12-16 at 11 33 55 PM

I'm definitely leaning more towards the row style, given a suitable max-width ofc. Column view makes it easier to view the list of repos, at the expense of a much longer height and unused width space being used.

@humphd
Copy link
Contributor

humphd commented Dec 18, 2021

Using row vs. column flex with this breakpoint could be the answer, I agree. That looks great.

@humphd humphd added this to the 2.5 Release milestone Jan 13, 2022
@menghif menghif removed their request for review January 15, 2022 15:42
@sirinoks
Copy link
Contributor

We are closing this PR and making our own branch to revert some changes and work on the issue. I new PR will be opened once it is ready.

@sirinoks sirinoks closed this Jan 19, 2022
TueeNguyen pushed a commit to TueeNguyen/telescope that referenced this pull request Jan 23, 2022
- Changed repos display to row, added border bottom for header, added hint icon for accordion
TueeNguyen pushed a commit to TueeNguyen/telescope that referenced this pull request Jan 23, 2022
- Changed repos display to row, added border bottom for header, added hint icon for accordion
TueeNguyen pushed a commit to TueeNguyen/telescope that referenced this pull request Jan 23, 2022
- Changed repos display to row, added border bottom for header, added hint icon for accordion
TueeNguyen pushed a commit to TueeNguyen/telescope that referenced this pull request Jan 28, 2022
- Changed repos display to row, added border bottom for header, added hint icon for accordion
- Fixed clicking on expand icon copies link to blog post
- Added expand icons in the bottom of the github info
- Added function to auto close accordion when scroll pass post
- Added css for mobile device < 375 px width
TueeNguyen added a commit that referenced this pull request Jan 28, 2022
- Initial work from @irenejoeunpark with PR #2491 (#2716)
- Changed repos display to row, added border bottom for header, added hint icon for accordion
- Fixed clicking on expand icon copies link to blog post
- Added expand icons in the bottom of the github info
- Added function to auto close accordion when scroll pass post
- Added css for mobile device < 375 px width

Co-authored-by: Francesco Menghi <53121061+menghif@users.noreply.github.com>
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.

8 participants