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

Add repo-header-info feature #6900

Merged
merged 22 commits into from
Sep 14, 2023

Conversation

134130
Copy link
Contributor

@134130 134130 commented Sep 10, 2023

Description

  • Closes Bring back repo stars on top #6798
  • On original conversation suggested, which is using default details component, is too heavy and ugly.
  • Just showing count of fork and stargazer count

Test URLs

Screenshot

outdated

@134130
Copy link
Contributor Author

134130 commented Sep 10, 2023

Renaming this feature is welcome

@fregante fregante changed the title Add detailed-repo-header Add repo-header-info feature Sep 10, 2023
source/features/detailed-repo-header.gql Outdated Show resolved Hide resolved
);
}

async function addForCompact(button: HTMLButtonElement): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

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

I don’t think we should show this on mobile, there's not enough space especially under 600px

function createStarCounter(stargazerCount: number): HTMLElement {
return (
<div className="starred ml-2">
<StarFillIcon className="starred-button-icon mr-1"/>
Copy link
Member

Choose a reason for hiding this comment

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

I'd probably keep it dimmed so it doesn't attract too much attention. Also because "yellow" means "starred by me" on GitHub, which we're not taking into conservation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need to show "I stared" ?
I'll make it yellow when "I starred" or dimmed when "I not starred"

Copy link
Member

Choose a reason for hiding this comment

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

No let's not include that piece of information

/*
Test URLs

Issues:
Copy link
Member

Choose a reason for hiding this comment

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

We don't need to label each URL if there's nothing special about them. The URLs are multiple only to show that the feature works on these pages, but the pages don't differ in any meaningful way.

@fregante
Copy link
Member

fregante commented Sep 11, 2023

It looks great, but also I think it claims too much attention

Screenshot 2

I like how GitHub is using the lock icon here, it's small and an outline:

Screenshot 8

So I'd match that:

  • smaller icon, outline
  • smaller text, no background
  • ensure it works well on private repos with ci-link (spacing and order)

@fregante
Copy link
Member

fregante commented Sep 11, 2023

Can we also add a fork status? I think that's more important than stars.

Example URL:

This should be really near the lock icon as well. Possible?

@fregante
Copy link
Member

fregante commented Sep 11, 2023

I think these are the related icons, to be used at 12px:

I think they are present in our Octicons version #6878

}

function init(signal: AbortSignal): void {
observe('header .AppHeader-context-full > nav ul', add, {signal});
Copy link
Member

@fregante fregante Sep 11, 2023

Choose a reason for hiding this comment

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

I'd make sure the icon appears before ci-link because ci-link is always delayed while this feature might be cached and instant.

See this page refresh:

after

Also note that this is breaking the font weight of the repo name, which will likely be fixed by the proposed repositioning

@134130
Copy link
Contributor Author

134130 commented Sep 11, 2023

  • I think it works well with private, ci-link (Sorry for bad screenshot; It's private repo)
    image
  • This should be really near the lock icon as well. Possible?

    • I think it looks too stuffy when it appears like private mark
    • image
    • image
    • Of course it can be ml-1 but I suggests ml-2; looks better
    • And It must be grouped with in the Link button. Should it be okay?
      • image
      • image
      • Because the ci-link is outer of the link button, repo-header-info will always appears ahead of ci-link

@fregante
Copy link
Member

Can we also add a fork status?

By "fork status" I meant "is this a fork?" Not "fork count". Sorry for the misunderstanding.

As for the spacing:

  • I think the lock and fork icon can appear near each other, with little spacing
  • The star count should be outside the highlight, in the same place ci-link is

Also the star count text should still be small, like 12px.

Screenshot

You can fork our refined-github/sandbox and do your tests/screenshots there.

@fregante
Copy link
Member

Example for the fork status:

Screenshot 1 Screenshot 2

With ml-1

@134130
Copy link
Contributor Author

134130 commented Sep 11, 2023

It looks not really bad. How do you think?
imageimage

Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

LGTM already

source/features/repo-header-info.tsx Outdated Show resolved Hide resolved
source/features/repo-header-info.tsx Outdated Show resolved Hide resolved
/*
Test URLs

Repository:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Repository:

@fregante
Copy link
Member

fregante commented Sep 11, 2023

Is this the current size? I like it:

image

@134130
Copy link
Contributor Author

134130 commented Sep 11, 2023

😅 Maybe zoomed with Chrome.
I'll check your reviews and update readme image later :D

Edit: Yes screenshot is latest image

@fregante
Copy link
Member

Screenshot 14 Screenshot 10 Screenshot 11 Screenshot 12

@fregante
Copy link
Member

So, uhm, GitHub sometimes will show a fork icon 🤷‍♂️ I don't know when. I provided a demo URL, can you confirm you also see it there natively?

readme.md Outdated
@@ -159,6 +159,7 @@ Thanks for contributing! 🦋🙌
- [](# "unreleased-commits") 🔥 [Tells you whether you're looking at the latest version of a repository, or if there are any unreleased commits.](https://user-images.githubusercontent.com/1402241/234576563-1a0ca255-4c0d-45ae-883d-2b1aa2d7f4c1.png)
- [](# "action-pr-link") 🔥 [Adds a link back to the PR that ran the workflow.](https://github-production-user-asset-6210df.s3.amazonaws.com/50487467/241645264-076a0137-36a2-4fd0-a66e-735ef3b3a563.png)
- [](# "mobile-tabs") [Makes the tabs more compact on mobile so more of them can be seen.](https://user-images.githubusercontent.com/1402241/245446231-28f44b59-0151-4986-8cb9-05b5645592d8.png)
- [](# "repo-header-info") [Shows repository's stargazer count on the header.](https://github.com/refined-github/refined-github/assets/50487467/747b5133-61b8-490e-b961-4e5390ea9482)
Copy link
Member

@fregante fregante Sep 12, 2023

Choose a reason for hiding this comment

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

/assets/ URLs are not accepted by our parser (#6000 (comment)), you'll have to open the link and get its real URL ending with .png (already done in a commit)

Screenshot 13

Copy link
Member

Choose a reason for hiding this comment

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

Also your screenshot was pixelated, make sure this doesn't happen in the future:

@fregante
Copy link
Member

  • Private forks are not allowed on GitHub

Welp, nope, yet another GitHub bug.

Screenshot 1

https://github.com/refined-github/fork is an actual private fork, but GitHub forgot to give it the "lock" icon.

We should do this too, in this feature. Feel like adding it? 😅

Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

Probably easy to implement. No need to update the screenshots

source/features/repo-header-info.gql Show resolved Hide resolved
source/features/repo-header-info.tsx Outdated Show resolved Hide resolved
@134130
Copy link
Contributor Author

134130 commented Sep 14, 2023

Private forks are not allowed on GitHub

AFAIK, Making public repository to private forked repository is not allowed on GitHub. But let alone that, I think showing forked icon on private fork repository is bug of GitHub. GitHub should shows locked icon.

@134130
Copy link
Contributor Author

134130 commented Sep 14, 2023

Verified
image

@fregante
Copy link
Member

showing forked icon on private fork repository is bug of GitHub

Why? It's a forked repo so it deserves a forked icon. That fork was made by:

  1. allowing forks of private repos on this organization
  2. forking a private repo

So they can exist

@fregante fregante merged commit 46a0528 into refined-github:main Sep 14, 2023
9 checks passed
@fregante
Copy link
Member

🙌

@Teraskull
Copy link

It does not show the full star count on hover like the original location. If the count is, for example, 1.1k, on hover it should say the exact amount in an HTML title attribute.

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.

Bring back repo stars on top
3 participants