Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve clean-repo-sidebar - #3974

Merged
fregante merged 22 commits into
refined-github:mainfrom
cheap-glitch:improve-clean-repo-sidebar
Feb 22, 2021
Merged

fregante merged 22 commits into
refined-github:mainfrom
cheap-glitch:improve-clean-repo-sidebar

Conversation

@cheap-glitch

@cheap-glitch cheap-glitch commented Feb 14, 2021

Copy link
Copy Markdown
Contributor
  1. LINKED ISSUES: Closes Further clean-repo-sidebar #3972

  2. TEST URLS:

  1. SCREENSHOTS:
Description, releases & no packages
Before After
Packages
Before After
No releases
Before After
Empty meta
Before After
Readme demo screenshot

clean-repo-sidebar

This PR:

  • Hides the "About" and "Languages" headers
  • Aligns the top of the "About" section with the main page content
  • Moves the latest release link to the "About" section and hides the "Releases" section → Hides everything in the "Releases" section except the latest tag/release and merge "About" with "Releases"
  • Hides the whole "Releases" section if there's no releases
  • Hides the whole "About" section if it's completely empty (no description, no license, no releases) (Improve clean-repo-sidebar #3974 (comment))
  • Fixes the alignment of the icons for the meta links (license, repo age & latest tag/release) (Improve clean-repo-sidebar #3974 (comment))

TODO:

  • Test against repos with tags instead of releases
  • Fix "conflict" with repo-age
  • Test in Chromium
  • Fix tag spacing
  • Fix top alignment

@cheap-glitch
cheap-glitch marked this pull request as draft February 14, 2021 15:48
@yakov116

Copy link
Copy Markdown
Member

Thanks for all your the prs!

  • Fix "conflict" with repo-age

Would running repo-age after clean-repo-sidebar help?

@cheap-glitch

This comment has been minimized.

@fregante

Copy link
Copy Markdown
Member

As we discussed in the previous PR, we can never hide the whole about section because we have repo-age. If people disable it, tough luck.

Also since you’re moving the entire release link instead of just hiding parts of it, I’d suggest testing repos that have tags but not releases. I think they also appear there, just differently.

@fregante

Copy link
Copy Markdown
Member

Love the screenshots, thanks!

Comment thread source/features/clean-repo-sidebar.tsx Outdated
Comment thread source/features/clean-repo-sidebar.tsx Outdated
@cheap-glitch
cheap-glitch marked this pull request as ready for review February 15, 2021 14:00
@cheap-glitch

Copy link
Copy Markdown
Contributor Author

It works for repos with tags instead of releases, but the vertical alignment is a bit wonky:

image

Is it worth fixing this? I don't remember seeing a lot of repos with this config.

@fregante

Copy link
Copy Markdown
Member

The spacing on repo-age seems excessive too, especially compared to the url just above it

@cheap-glitch

Copy link
Copy Markdown
Contributor Author

The spacing on repo-age seems excessive too

It matches the one of the license link, which is absent here. So fixing this would also mean changing the spacing of the license link too.

@fregante

Copy link
Copy Markdown
Member

Let's just update the tag’s spacing if it exists. Probably something like select(tag icon)?.classList.add(whatever margin class the others use)

@fregante

fregante commented Feb 16, 2021

Copy link
Copy Markdown
Member

The icon spacing incongruence also applies to releases:

Screen Shot 2

And this link is still here:

Screen Shot 1


Also, I used the classes instead of rgh-clean-releases because they're exact and defined by GitHub, this way we don't have to keep magic numbers in our CSS.

@cheap-glitch

cheap-glitch commented Feb 16, 2021

Copy link
Copy Markdown
Contributor Author

The icon spacing incongruence also applies to releases

Actually in this case the spacing is correct, but the text of the first two links has some whitespace at the beginning. If we remove it, the alignment becomes correct:
image

And this link is still here

Should also we hide the "Learn more about GitHub sponsors" link?

@fregante

Copy link
Copy Markdown
Member

Should also we hide the "Learn more about GitHub sponsors" link?

I thought about it but the link is unique and it’s not an obvious feature.

@fregante

fregante commented Feb 17, 2021

Copy link
Copy Markdown
Member

https://github.com/broofa/npmgraph

Screen Shot 1

This is misaligned as well, I'm not sure if there's a clean way other than finding that and removing .mt-3. Ideally this should be handled automatically via CSS (e.g. add negative margin on top of the whole about section). I'm not sure if there are negative classes, like mt--3, worth a look in their stylesheet.

If you prefer not fixing all of these issues, we can merge this as is and I'll open a new issue.

@fregante

fregante commented Feb 17, 2021

Copy link
Copy Markdown
Member

the text of the first two links has some whitespace at the beginning. If we remove it

Ugh 😰 I think we don't have a choice. The release widget uses flex so we can't add a space there, it's just ignored. I guess the alternative is to:

  • remove the space from repo-age in our JSX
  • have repo-age remove the license space, so they're consistent between themselves, regardless of this feature.

@cheap-glitch

cheap-glitch commented Feb 17, 2021

Copy link
Copy Markdown
Contributor Author

remove the space from repo-age in our JSX
have repo-age remove the license space, so they're consistent between themselves, regardless of this feature.

Should this be in a separate PR?

@fregante

fregante commented Feb 17, 2021

Copy link
Copy Markdown
Member

Should this be in a separate PR?

Up to you:

If you prefer not fixing all of these issues, we can merge this as is and I'll open a new issue.

Those fixes are only necessary due to this feature anyway, so it's ok if they're part of the same PR

@cheap-glitch

Copy link
Copy Markdown
Contributor Author

Should also we hide the "Learn more about GitHub sponsors" link?

I thought about it but the link is unique

It's also in the little modal box that pops up when you click the "Sponsor" button in the repo header.

@fregante

Copy link
Copy Markdown
Member

Unfortunately if there are no releases there's a blank space:

Screen Shot

Source: https://github.com/justinfrankel/licecap

Without RG:

Screen Shot 1

I think this is because we only hide the Release title via CSS but not the whole section?

Generally I think that the new CSS-only rules are a little brittle so we should probably just use some JS to ensure we're selecting the right elements and using the right logic.

As always, we can merge as is and open a new issue. Still up to you

@cheap-glitch

Copy link
Copy Markdown
Contributor Author

All problems should be fixed now. I tested every link in Firefox & Chromium, with and without repo-age enabled.

In the end I had to rely on an ugly margin-top: -16px to fix the top alignment, because there's just too many different cases to fix with JS (especially when putting repo-age in the mix).

Should we also hide the "Learn more about GitHub sponsors" link?

I thought about it but the link is unique

It's also in the little modal box that pops up when you click the "Sponsor" button in the repo header.

@fregante can I get your definitive opinion on this before I redo the screenshots?

@fregante

fregante commented Feb 22, 2021

Copy link
Copy Markdown
Member

@fregante can I get your definitive opinion on this before I redo the screenshots?

Let's leave it as is for now

In the end I had to rely on an ugly margin-top: -16px to fix the top alignment

Yeah that's ok for now, better than having to cover every single situation

All problems should be fixed now. I tested every link in Firefox & Chromium, with and without repo-age enabled.

Thanks for being so thorough! It's a feature with many moving parts

I redo the screenshots?

I'd say they're fine. No need to be super-exact, we just need to show what the feature does approximately.

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be good to go

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe a couple of small changes

Comment thread source/features/clean-repo-sidebar.tsx Outdated
Comment thread source/features/clean-repo-sidebar.tsx Outdated
@fregante
fregante merged commit 236472c into refined-github:main Feb 22, 2021
@cheap-glitch
cheap-glitch deleted the improve-clean-repo-sidebar branch February 22, 2021 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Further clean-repo-sidebar

3 participants