Skip to content

Only disable latest-tag-button when actually on the latest tag - #5365

Merged
kidonng merged 2 commits into
mainfrom
improve-latest-tag-button
Feb 13, 2022
Merged

kidonng merged 2 commits into
mainfrom
improve-latest-tag-button

Conversation

@kidonng

@kidonng kidonng commented Feb 2, 2022 •

Copy link
Copy Markdown
Member

Bug introduced in e7f0d3e (#3199), it only checks if the default branch is not ahead of the latest tag, but doesn't check if you are actually on the default branch.

Also changed the text from "release" to "tag". "Release" is a GitHub term and what we are really working with is Git tags.

Test URLs

https://github.com/refined-github/refined-github/tree/22.1.18

Screenshot

Before After

...if current branch is default branch
@fregante

fregante commented Feb 3, 2022 •

Copy link
Copy Markdown
Member

Showing “you’re on the latest release” on the default branch is intentional because the feature was introduced to make you aware you’re potentially looking at a pre-release version of the documentation — hence the term “release” rather than the more specific “tag”.

Showing “you’re on the latest release” when on a different tag yeah, that’s a bug 😃

@cheap-glitch cheap-glitch changed the title Only disable latest-tag-button when you actually on the latest tag Only disable latest-tag-button when actually on the latest tag Feb 3, 2022
@kidonng

kidonng commented Feb 3, 2022

Copy link
Copy Markdown
Member Author

hence the term “release” rather than the more specific “tag”.

But we should be accurate here. It's called latest-tag-button for a reason.

People should be aware of the relationship of tag and release and if they do they will get what the tip is conveying

@fregante

fregante commented Feb 3, 2022 •

Copy link
Copy Markdown
Member

“You’re on the latest version”

It's called latest-tag-button for a reason.

Uhm. It's called that way because it links to the latest tag. The name is accurate. We're talking about the tooltip and state of the button, which mentions where "you're on", not where you're going.

@kidonng
kidonng merged commit 98b63b6 into main Feb 13, 2022
@kidonng
kidonng deleted the improve-latest-tag-button branch February 13, 2022 10:02
@fregante

Copy link
Copy Markdown
Member

Screen Shot

Even after clearing the cache

@kidonng

kidonng commented Feb 22, 2022

Copy link
Copy Markdown
Member Author

I just noticed getCurrentCommittish returns a empty string on repo home and it probably shouldn't.

We can create an exception for it in this feature, but ideally I would like to see getCurrentCommittish can infer the current commitish from the DOM (but that also means it will become async 🥲).

@fregante

fregante commented Feb 22, 2022 •

Copy link
Copy Markdown
Member

I don't remember our decisions around it but I think that it doesn't need to be async. @yakov116 might have some ideas on why this is happening.

Is this bug due to this PR?

@yakov116

Copy link
Copy Markdown
Member

We need getCurrentCommittish not to depend on the DOM since we have features the depend on it before the DOM loaded and those functions cannot become async.

The issue is that getCurrentCommittish depends on the title. However isRepoHome does not have a title, so the only way is through the DOM. (Or getDefaultBranch since that is the branch you are on)

@fregante

Copy link
Copy Markdown
Member

Right, if this hasn't just changed behavior, I think the current situation is fine. In features that run on the repo home we just need to use getDefaultBranch.

I also saw the mention in #5222 (comment)

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.

3 participants