Repository navigation
Add tags-dropdown feature - #1896
Conversation
|
cc @bfred-it @sindresorhus Please have a look. :) |
|
Isn’t this already available in the Code tab? There’s a branch/tag selector |
|
@bfred-it Yes, It's available on the Code tab but I believe when we want to search for the release notes of any particular release or want to download the release assets (e.g. binaries/tar) it will come handy. |
|
Ah right, that one opens the code while this one would open the release directly. I'm just concerned about the size. I'd like to see the native selector added instead, the code is just: <details class="details-reset details-overlay select-menu branch-select-menu">
<summary class="btn btn-sm select-menu-button css-truncate"
data-hotkey="w"
title="Switch branches or tags">
<i>Branch:</i>
<span class="css-truncate-target">master</span>
</summary>
<details-menu class="select-menu-modal position-absolute" style="z-index: 99;" src="/sindresorhus/refined-github/ref-list/master?source_action=disambiguate&source_controller=files" preload>
<include-fragment class="select-menu-loading-overlay anim-pulse">
</include-fragment>
</details-menu>
</details>And once This frees us from any API, adds full search and we're not limited to the last 100 items |
fregante
left a comment
There was a problem hiding this comment.
I'd like to see the suggestion above implemented, but here are some general comments for future code submissions.
|
Yeah, You got it right. I didn't know about this |
|
|
|
Yep, It has. I am also going through the documentation. https://github.com/github/include-fragment-element |
|
@bfred-it A quick question. Adding include-fragment thing will require us to add two npm packages.
Are there any concerns? |
|
On usage of |
|
@notlmn Thanks for your response. I initially thought the same but when I tried, It failed with |
|
@notlmn Don't know what was the issue. This time it worked without those packages installed. 🤔 |
|
@bfred-it I have made the suggested changes. Please take a look. :) |
cc895ac to
9edee8f
Compare
|
@bfred-it I've made the suggested changed. Please take a look. :) |
|
@bfred-it Thank you so much for the in-depth reviews. It helped me a lot to understand some concepts and improve my knowledge. I've pushed the latest changes and I think this should suffice. Please let me know if any more changes are needed on my side. :) |
fregante
left a comment
There was a problem hiding this comment.
A few more changes 😅
I haven't tried the feature at all though, so just reading the code
|
@bfred-it Hopefully this should be it. I've implemented all the suggested changes. Please let me know if any more changes are needed. PS: If anything happens to me, my last wish is to see this PR getting merged. 😂 |
…ined-github into f_add_search_on_releases
|
@sindresorhus First of all, Thank you for your time to carry out a detailed review. I have made the suggested changes. Please have a look. |
|
You seem to have overwritten my changes in f5572b0. |
|
The feature seems to work well. |
|
@hardikmodha Can you mention it in the readme and link to a screenshot of the feature (should be retina, if you don't have retina screen, then 200% zoom). |
@sindresorhus Sorry, It was not intentional. I've added your changes back. It should be good now. I've also updated the readme. Can you please take a look? |
|
@hardikmodha Same questions as #1904 (comment) |
|
@sindresorhus It's a yes from me! :) |
tags-dropdown feature
|
I opened a new issue |
|
@hardikmodha if not too difficult, could you make the content load on demand? For example in the sidebar here, when you click on Projects, the content will start loading. I think this can be achieved with some HTML. Here's the source of the Projects dropdown: <details class="details-reset details-overlay select-menu js-select-menu js-dropdown-details hx_rsm js-load-contents "
data-contents-url="/sindresorhus/refined-github/issues/1896/show_partial?partial=issues%2Fsidebar%2Fprojects_menu_content"
id="projects-select-menu" data-multiple>
<summary class="text-bold discussion-sidebar-heading discussion-sidebar-toggle hx_rsm-trigger" aria-haspopup="menu"
data-hotkey="p">
<svg class="octicon octicon-gear" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true">
<path fill-rule="evenodd"
d="M14 8.77v-1.6l-1.94-.64-.45-1.09.88-1.84-1.13-1.13-1.81.91-1.09-.45-.69-1.92h-1.6l-.63 1.94-1.11.45-1.84-.88-1.13 1.13.91 1.81-.45 1.09L0 7.23v1.59l1.94.64.45 1.09-.88 1.84 1.13 1.13 1.81-.91 1.09.45.69 1.92h1.59l.63-1.94 1.11-.45 1.84.88 1.13-1.13-.92-1.81.47-1.09L14 8.75v.02zM7 11c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z" />
</svg>
Projects
</summary>
<div class="select-menu-modal js-navigation-container position-absolute right-0 hx_rsm-modal"
style="z-index: 99; overflow: visible;">
<div class="select-menu-header">
<span class="select-menu-title">Projects</span>
<button class="hx_rsm-close-button d-none btn-link close-button" type="button"
data-toggle-for="projects-select-menu"><svg aria-label="Close menu" class="octicon octicon-x"
viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img">
<path fill-rule="evenodd"
d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z" />
</svg></button>
</div>
<div class="js-select-menu-deferred-content hx_rsm-content "
data-url="/sindresorhus/refined-github/issues/1896/show_partial?partial=issues%2Fsidebar%2Fprojects_menu_content">
</div>
<div class="select-menu-loading-overlay anim-pulse hx_rsm-loading">
<svg height="32" class="octicon octicon-octoface" viewBox="0 0 16 16" version="1.1" width="32" aria-hidden="true">
<path fill-rule="evenodd"
d="M14.7 5.34c.13-.32.55-1.59-.13-3.31 0 0-1.05-.33-3.44 1.3-1-.28-2.07-.32-3.13-.32s-2.13.04-3.13.32c-2.39-1.64-3.44-1.3-3.44-1.3-.68 1.72-.26 2.99-.13 3.31C.49 6.21 0 7.33 0 8.69 0 13.84 3.33 15 7.98 15S16 13.84 16 8.69c0-1.36-.49-2.48-1.3-3.35zM8 14.02c-3.3 0-5.98-.15-5.98-3.35 0-.76.38-1.48 1.02-2.07 1.07-.98 2.9-.46 4.96-.46 2.07 0 3.88-.52 4.96.46.65.59 1.02 1.3 1.02 2.07 0 3.19-2.68 3.35-5.98 3.35zM5.49 9.01c-.66 0-1.2.8-1.2 1.78s.54 1.79 1.2 1.79c.66 0 1.2-.8 1.2-1.79s-.54-1.78-1.2-1.78zm5.02 0c-.66 0-1.2.79-1.2 1.78s.54 1.79 1.2 1.79c.66 0 1.2-.8 1.2-1.79s-.53-1.78-1.2-1.78z" />
</svg>
</div>
</div>
</details>I think the keys here are those <div class="js-select-menu-deferred-content hx_rsm-content" data-url="/sindresorhus/refined-github/issues/1896/show_partial?partial=issues%2Fsidebar%2Fprojects_menu_content"> |

Note: The feature uses the GitHub API to fetch the releases for the project. If the personal token is available then it uses api v4 (GraphQL) otherwise it uses the api v3 (REST).
Demo: