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
Add releases-dropdown
feature
#6506
Conversation
source/features/tags-dropdown.tsx
Outdated
|
||
void features.add(import.meta.url, { | ||
include: [ | ||
pageDetect.isReleasesOrTags, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then this should use isReleases
? Because the search box only exists there
Also previous tags-dropdown
works on tags page, should this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then this should use isReleases? Because the search box only exists there
Done
Also previous tags-dropdown works on tags page, should this one?
The issue is that the native field SEARCHES the releases notes, which means it does nothing on tags. See https://github.com/python/cpython/releases?q=v3&expanded=true which is empty even if there are plenty "v3" tags
So if we were to add this feature there, we'd have to reinvent the feature to not use datalist
. Not worth it in this PR (or maybe ever)
source/features/tags-dropdown.tsx
Outdated
{latestTags.reverse().map(tag => <option value={tag}/>)} | ||
</datalist>, | ||
); | ||
searchField.setAttribute('list', 'rgh-tags-dropdown'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreal… searchField.list
is read-only 🤷♂️
source/features/tags-dropdown.tsx
Outdated
const field = event.delegateTarget; | ||
const selectedTag = field.value; | ||
if (!('inputType' in event) && latestTags!.includes(selectedTag)) { | ||
location.href = buildRepoURL('releases/tag', selectedTag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As expected, it's broken on unescaped tag names:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! Pretty sure we have the same bug in features like tags-on-commits-list
too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good:
Also cool UI:
Follows:
tags-dropdown
is broken #6257tags-dropdown
feature #6438Super easy, barely an inconvenience. The only issue is that it's technically misusing the
datalist
for navigation (just like mobile websites have done withselect
from 2007 until recently)Test URLs
https://github.com/refined-github/refined-github/releases
Screenshot