Skip to content

Add repo-header-info feature - #6900

Merged
fregante merged 22 commits into
refined-github:mainfrom
134130:feat/detailed-repo-header
Sep 14, 2023
Merged

fregante merged 22 commits into
refined-github:mainfrom
134130:feat/detailed-repo-header

Conversation

@134130

@134130 134130 commented Sep 10, 2023 •

Copy link
Copy Markdown
Contributor

@134130

134130 commented Sep 10, 2023

Copy link
Copy Markdown
Contributor Author

Renaming this feature is welcome

@fregante fregante changed the title Add detailed-repo-header Add repo-header-info feature Sep 10, 2023
);
}

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

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.

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@134130
134130 force-pushed the feat/detailed-repo-header branch from dc9d892 to 229c9c5 Compare September 10, 2023 12:13
@fregante

fregante commented Sep 11, 2023 •

Copy link
Copy Markdown
Member

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

fregante commented Sep 11, 2023 •

Copy link
Copy Markdown
Member

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

fregante commented Sep 11, 2023 •

Copy link
Copy Markdown
Member

Comment thread source/features/repo-header-info.tsx Outdated
}

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

@fregante fregante Sep 11, 2023 •

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.

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

134130 commented Sep 11, 2023 •

Copy link
Copy Markdown
Contributor Author
  • 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
Copy Markdown
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
Copy Markdown
Member

Example for the fork status:

Screenshot 1 Screenshot 2

With ml-1

@134130

134130 commented Sep 11, 2023

Copy link
Copy Markdown
Contributor Author

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

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

LGTM already

Comment thread source/features/repo-header-info.tsx Resolved
Comment thread source/features/repo-header-info.tsx Resolved
Comment thread source/features/repo-header-info.tsx Outdated
/*
Test URLs

Repository:

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.

Suggested change
Repository:

@fregante

fregante commented Sep 11, 2023 •

Copy link
Copy Markdown
Member

Is this the current size? I like it:

image

@134130

134130 commented Sep 11, 2023 •

Copy link
Copy Markdown
Contributor Author

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

Edit: Yes screenshot is latest image

@fregante

Copy link
Copy Markdown
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?

Comment thread readme.md Outdated
- [](# "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)

@fregante fregante Sep 12, 2023 •

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.

/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
Copy Markdown
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
Copy Markdown
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? 😅

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

Probably easy to implement. No need to update the screenshots

Comment thread source/features/repo-header-info.gql Resolved
Comment thread source/features/repo-header-info.tsx Resolved
@134130

134130 commented Sep 14, 2023

Copy link
Copy Markdown
Contributor Author

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

134130 commented Sep 14, 2023

Copy link
Copy Markdown
Contributor Author

Verified
image

@fregante

Copy link
Copy Markdown
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
@fregante

Copy link
Copy Markdown
Member

🙌

@Teraskull

Copy link
Copy Markdown

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

4 participants