Skip to content

Conversation

@yakov116
Copy link
Member

@yakov116 yakov116 commented Jun 8, 2020

Closes #2927
Get only the last 20

Test https://github.com/sindresorhus/refined-github
1 commit https://github.com/Jin230/Git (Dont ask me how I found that repo 😄 )
image

More than 1 commit
https://github.com/sindresorhus/refined-github
image

More than 20 commits
image

@yakov116
Copy link
Member Author

yakov116 commented Jun 8, 2020

@fregante just double checking were going with v2?

Co-authored-by: Fregante <opensource@bfred.it>
@yakov116
Copy link
Member Author

yakov116 commented Jun 8, 2020

I think we should up it to 34-35 that is one page of commits.

yakov116 and others added 2 commits June 8, 2020 08:52
Co-authored-by: Fregante <opensource@bfred.it>
@fregante fregante changed the title Use api to get latest-tag-button ahead count Improve latest-tag-button’s reliability Jun 8, 2020
@yakov116
Copy link
Member Author

yakov116 commented Jun 8, 2020

I have a few questions:

  1. Do you think we should up it to 34-35 since that is one page of commits. (https://github.com/sindresorhus/refined-github/commits/master)
  2. Should I change the cache key to a string? Since I know you dont like when its __filebasename. It will also take care or the existing cache. (From what I understand it will expire anyways after 2 days)
  3. The current layout is good? (Version 2)
  4. When there are more than 20 commits you want to display 20+? or nothing?

@fregante
Copy link
Member

fregante commented Jun 8, 2020

  • Do you think we should up it to 34-35 since that is one page of commits. (master (commits))

Refer to #2927 (comment)

After all, the point of this information is to know whether we're on the latest commit. Anything above +20 (or missing/incorrect information) isn't particularly useful.

  • Should I change the cache key to a string? Since I know you dont like when its __filebasename. It will also take care or the existing cache. (From what I understand it will expire anyways after 2 days)

Sure.

  • The current layout is good? (Version 2)

👍

4. When there are more than 20 commits you want to display 20+? or nothing?

Refer to #3197 (comment)

This way we get the exact match if it's within the last 10/20/whatever commits, and if not, we don't have to guess, we just display "+".

20.6.4+

@yakov116 yakov116 marked this pull request as ready for review June 8, 2020 21:14
@yakov116
Copy link
Member Author

yakov116 commented Jun 8, 2020

  • Do you think we should up it to 34-35 since that is one page of commits. (master (commits))

Refer to #2927 (comment)

After all, the point of this information is to know whether we're on the latest commit. Anything above +20 (or missing/incorrect information) isn't particularly useful.

I was thinking of any repo that does not do squash and merge 20 is a bit short. (But you can argue that 35 won't help)


Back on topic I Updated first post with pictures

I think the compare link should only show on isRepoRoot WDYT?

@fregante fregante marked this pull request as draft June 9, 2020 09:02
yakov116 and others added 2 commits June 9, 2020 07:25
@yakov116 yakov116 marked this pull request as ready for review June 9, 2020 11:30
Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
Co-authored-by: Fregante <opensource@bfred.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.

Works great!

Comment on lines 121 to 131
if (pageDetect.isRepoRoot()) {
const compareLink = (
<a
className="btn btn-sm btn-outline tooltipped tooltipped-ne"
href={`/${getRepoURL()}/compare/${latestTag}...${defaultBranch}`}
aria-label={`Compare ${latestTag}...${defaultBranch}`}
>
<DiffIcon/>
</a>
);
groupButtons([link, compareLink]);
Copy link
Member

Choose a reason for hiding this comment

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

Can you move this to a new PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

Copy link
Member Author

Choose a reason for hiding this comment

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

Done want me to redo the first post screen shots?

Copy link
Member

Choose a reason for hiding this comment

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

Done want me to redo the first post screen shots?

They're kinda complex to do because I had to add padding around that area to make them "clean"

Also we need to wait for #3205 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok

@fregante fregante merged commit e5c50bd into refined-github:master Jun 10, 2020
@yakov116 yakov116 deleted the latest-tag-from-api branch June 10, 2020 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

latest-tag-button sometimes fails getting the "ahead-by count"

3 participants