Repository navigation
Conversation
|
Now it still misses direct links to organization profiles, i.e. But it's not worth it to check every link |
| `a:is([href^="/"], [href^="${location.origin}"])[href$="?tab=repositories"]`, // "Repositories" tab on user profile, only matches relative or same-origin links | ||
| `a:is([href^="/orgs/"], [href^="${location.origin}/orgs/"])[href$="/repositories"]`, // "Repositories" tab on organization profile, only matches relative or same-origin links | ||
| '[aria-label="Organization"] [data-tab-item="org-header-overview-tab"] a', // "Overview" tab on organization profile | ||
| '[aria-label="Organization"] a[data-tab-item="i0overview-tab"]', // "Overview" tab on organization profile (Global navigation update) | ||
| 'a[data-hovercard-type="organization"]', // Organization name on repo header + organization list on user profile |
There was a problem hiding this comment.
We should not depend on any classes/attributes.
Now it still misses direct links to organization profiles, i.e.
https://github.com/refined-github
This feature does not target those links, it should target every:
/*?tab=repositories/orgs/*/repositories/
otherwise we're back to square one (i.e. "some links don't work")
I think the solution is only these 2 selectors (also note the [attr]:is() order)
// User repos
`a[href$="?tab=repositories"]:is([href^="/"], [href^="${location.origin}/"])`,
// Organization repos
`a[href$="/repositories"]:is([href^="/orgs/"], [href^="${location.origin}/orgs/"])`,I don’t think that this will target a lot of invalid links, we'll only want to run something like isUserRepositories/isOrgRepositories to make sure we don't alter the wrong link (if any)
There was a problem hiding this comment.
We should not depend on any classes/attributes.
Did you mean we drop support for these?
This feature does not target those links
Those were mentioned for completeness, I never intended to support them.
also note the
[attr]:is()order
This is following logic order (starts with ^= then ends with $=), but I don't mind either way.
| - User profile: https://github.com/fregante | ||
| - Organization profile: https://github.com/refined-github |
There was a problem hiding this comment.
To avoid confusion: These aren't the only URLs on which the feature runs, it runs everywhere. Instead of "test URLs" we need a list of examples to test, e.g.
| - User profile: https://github.com/fregante | |
| - Organization profile: https://github.com/refined-github | |
| ## Test | |
| - https://github.com/fregante?tab=repositories | |
| - https://github.com/orgs/refined-github/repositories | |
| - The "Your repositories" link in the user dropdown in the header | |
| - The "Repositories" tab in | |
| - https://github.com/fregante | |
| - https://github.com/refined-github |
which would appear as:
Test
- https://github.com/fregante?tab=repositories
- https://github.com/orgs/refined-github/repositories
- The "Your repositories" link in the user dropdown in the header
- The "Repositories" tab in
There was a problem hiding this comment.
I'd also change the name of the feature to something more reasonable because such long features are impossible to mention in commit titles. I'd go for hide-user-forks maybe
set-default-repositories-type-to-sources on more linkshide-user-forks on more links


Resolve #6464
Draft pending "Global navigation update" preview
Test URLs
Screenshot
N/A