-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 set-default-repositories-type-to-sources
on project views
#5949
Fix set-default-repositories-type-to-sources
on project views
#5949
Conversation
Thank you for the PR! Doesn't this break it on every other page where the current selector works? |
I think we need a validation to only use the new selector in this page, it is not breaking anything but is generating console errors in other pages. |
I think it doesn't need a per-page selector. We can fix it by using a different selector that doesn't involve nth-child. |
Actually I think this whole file can be replaced by our selector-observer.ts (not to be confused with the library with we also still use) Instead of having a custom Would you like to give that a try? If not, I will. Example: refined-github/source/features/set-default-repositories-type-to-sources.tsx Lines 14 to 17 in d0491bd
should be something like: observe('.header-nav-current-user ~ a[href$="tab=repositories"]', addSourceTypeToLink) |
Let me check how it works, I'll try with the observer, also I was checking other options, looks like the item we are looking for have this unique mix of clases |
Sure. Once you get it working, you can refer to how it's generally used. For example:
|
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.
Fantastic!
set-default-repositories-type-to-sources
on project views
Linting and testing is slow, post-commits are better in this case. 😜 You wouldn't want to run the whole suite every time you make a single commit |
Thank you for your contribution! |
Thank you indeed! |
Closes #5940
Test URLs
https://github.com/users/janpio/projects/3/views/1
Screenshot
Description
The error was produces by a selector trying to find an item that doesn't exists in the page.
Changes
The method was doing reference to the user's profile dropdown using the
:last-child
selector, looks like later a new item was added turning the user's profile item in the second last item. This PR change the selector to select the profile dropdown again.