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

Fix releases-tab and bugs-tab #4169

Merged
merged 3 commits into from
Mar 30, 2021
Merged

Fix releases-tab and bugs-tab #4169

merged 3 commits into from
Mar 30, 2021

Conversation

cheap-glitch
Copy link
Member

@cheap-glitch cheap-glitch commented Mar 29, 2021

Test URLs

Any repo page

Screenshot

n/a

GitHub changed the layout of the navbar, now it's no longer a list but instead a simple collection of anchor elements. The anchors act both as links and as tabs, so they bear all the meta attributes directly.

@cheap-glitch cheap-glitch changed the title Fix releases-tab and bugs-tabs Fix releases-tab and bugs-tab Mar 29, 2021
@@ -87,7 +86,7 @@ async function init(): Promise<void | false> {
bugsCounter.title = '';

// Update Bugs’ link
new SearchQuery(bugsLink).add('label:bug');
new SearchQuery(bugsTab as HTMLAnchorElement).add('label:bug');
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 drop this type cast once you change the issuesTab selector to a.UnderlineNav-item[data-hotkey="g i"] (i.e. including the tag name a)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought so too, but unfortunately it seems that cloneNode loses the element type: microsoft/TypeScript#283

Copy link
Member

Choose a reason for hiding this comment

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

Seems like the workaround added in #2670 doesn't work in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

No it does actually, I just forgot the return value of elementReady() needed to be coerced. My bad.

Copy link
Member

Choose a reason for hiding this comment

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

There’s an issue open on the element-ready repo to implement the selector parser for types, if anyone is interested. Relatively easy PR for that

@cheap-glitch cheap-glitch marked this pull request as ready for review March 29, 2021 19:26
@yakov116 yakov116 merged commit 8f319ab into refined-github:main Mar 30, 2021
@cheap-glitch cheap-glitch deleted the fix-repo-tabs-features branch March 30, 2021 07:06
@JourneyOver
Copy link

Looks like it's back to being a list once again xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants