Skip to content

canUserAdminRepo - Support new UI#240

Merged
fregante merged 6 commits intorefined-github:mainfrom
dnicolson:patch-1
Mar 1, 2026
Merged

canUserAdminRepo - Support new UI#240
fregante merged 6 commits intorefined-github:mainfrom
dnicolson:patch-1

Conversation

@dnicolson
Copy link
Contributor

No description provided.

@fregante fregante changed the title Add additional selector to canUserAdminRepo() canUserAdminRepo - Support view view Feb 28, 2026
@fregante fregante changed the title canUserAdminRepo - Support view view canUserAdminRepo - Support new UI Feb 28, 2026
Copy link
Member

@SunsetTechuila SunsetTechuila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work if the settings entry is in the dropdown menu

@SunsetTechuila
Copy link
Member

SunsetTechuila commented Feb 28, 2026

Note: before the navbar was rewritten in React, users with just write access to the repo didn't have the Settings tab. They now do, but can only view and edit secrets and variables:

image

@fregante
Copy link
Member

Yeah this PR makes sense on its own but probably the whole function should be deprecated instead. In Refined GitHub we now use th API for this purpose.

@dnicolson can you look at other deprecated functions and do the same for this one? You can keep the changes so far.

@SunsetTechuila
Copy link
Member

In Refined GitHub we now use th API for this purpose

canUserAdminRepo is used by clean-repo-tabs, clean-repo-sidebar and show-open-prs-of-forks. All broken right now

@SunsetTechuila
Copy link
Member

SunsetTechuila commented Mar 1, 2026

Maybe we should re-export it with a different name, as it can still be useful. For example, we can use it for refined-github/refined-github#8553 to decide what to fetch: public members or collaborators

@fregante
Copy link
Member

fregante commented Mar 1, 2026

Users seeing that errors see it because they aren't members. Adding this check could hide the error, but nothing else. Also I think external collaborators aren't covered (no settings tab)

@SunsetTechuila
Copy link
Member

SunsetTechuila commented Mar 1, 2026

I'm not sure we understood each other. This is what I'm talking about:

const collaborators = pageDetect.canUserAdminRepo() ? fetchCollaborators() : fetchPublicMemebers();

external collaborators aren't covered (no settings tab)

They are

@fregante
Copy link
Member

fregante commented Mar 1, 2026

If "fetch public member" works, that's ok I guess. It won't cover all collaborators but probably better than nothing. Please open a new PR to deprecate this and rename it.

@fregante fregante merged commit 6da6dd6 into refined-github:main Mar 1, 2026
6 checks passed
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.

3 participants