Skip to content

Improve latest-tag-button’s reliability - #3199

Merged
fregante merged 19 commits into
refined-github:masterfrom
yakov116:latest-tag-from-api
Jun 10, 2020
Merged

fregante merged 19 commits into
refined-github:masterfrom
yakov116:latest-tag-from-api

Conversation

@yakov116

@yakov116 yakov116 commented Jun 8, 2020 •

Copy link
Copy Markdown
Member

Comment thread source/features/latest-tag-button.tsx Resolved
Comment thread source/features/latest-tag-button.tsx Resolved
Comment thread source/features/latest-tag-button.tsx Resolved
Comment thread source/features/latest-tag-button.tsx Resolved
Comment thread source/features/latest-tag-button.tsx Resolved
Comment thread source/features/latest-tag-button.tsx Resolved
@yakov116

yakov116 commented Jun 8, 2020

Copy link
Copy Markdown
Member Author

@fregante just double checking were going with v2?

@yakov116

yakov116 commented Jun 8, 2020

Copy link
Copy Markdown
Member Author

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

Comment thread source/features/latest-tag-button.tsx Resolved
@fregante fregante changed the title Use api to get latest-tag-button ahead count Improve latest-tag-button’s reliability Jun 8, 2020
@yakov116

yakov116 commented Jun 8, 2020 •

Copy link
Copy Markdown
Member Author

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

fregante commented Jun 8, 2020 •

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

yakov116 commented Jun 8, 2020 •

Copy link
Copy Markdown
Member Author
  • 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
Comment thread source/features/latest-tag-button.tsx Resolved
@yakov116
yakov116 marked this pull request as ready for review June 9, 2020 11:30
Comment thread source/features/latest-tag-button.tsx Resolved
Co-authored-by: Flo Edelmann <[email protected]>
Comment thread source/features/latest-tag-button.tsx Resolved

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

Works great!

Comment thread source/features/latest-tag-button.tsx Resolved
Comment thread source/features/latest-tag-button.tsx Resolved
Comment thread source/features/latest-tag-button.tsx Resolved
Comment thread source/features/latest-tag-button.tsx Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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