Skip to content

Fix releases-tab and bugs-tab - #4169

Merged
yakov116 merged 3 commits into
refined-github:mainfrom
cheap-glitch:fix-repo-tabs-features
Mar 30, 2021
Merged

yakov116 merged 3 commits into
refined-github:mainfrom
cheap-glitch:fix-repo-tabs-features

Conversation

@cheap-glitch

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

Copy link
Copy Markdown
Contributor

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
Comment thread source/features/bugs-tab.tsx Outdated

// Update Bugs’ link
new SearchQuery(bugsLink).add('label:bug');
new SearchQuery(bugsTab as HTMLAnchorElement).add('label:bug');

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

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.

5 participants