Skip to content

Add isProfileRepoList #170

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

Merged
merged 3 commits into from
Jul 9, 2023
Merged

Add isProfileRepoList #170

merged 3 commits into from
Jul 9, 2023

Conversation

fregante
Copy link
Member

@fregante fregante commented Apr 16, 2023

We have these detections:

  • isUserProfileMainTab
  • isUserProfileRepoTab
  • isUserProfileStarsTab
  • isUserProfileFollowersTab
  • isUserProfileFollowingTab

Which nowadays are unnecessarily specific since repository lists are similar in DOM, and will only get more similar (HOPEFULLY):

For the same reason I'm not adding an org-specific detection.

I haven't merged this yet to make sure I choose the right name here. I think *Tab was the wrong choice because:

  • we don't have isRepoSettingsTab but isRepoSettings
  • etc

We can rename those separately, potentially deprecate isUserProfileRepoTab completely.

@fregante fregante changed the title Add isProfileRepos Add isProfileRepoList Apr 16, 2023
@fregante fregante marked this pull request as ready for review April 16, 2023 09:45
@kidonng
Copy link
Member

kidonng commented Apr 16, 2023

Which nowadays are unnecessarily specific since repository lists are similar in DOM, and will only get more similar (HOPEFULLY):

So would you fancy something like this?

const getProfileTab(): 'main' | 'repositories' | 'stars' | ... | undefined

Or is this more suitable to be handled in userspace?

If we are talking about RGH specifically, I think we don't need to care about specific profile tab (i.e. isUserProfile is enough), we need more specific selector to target stuff anyway

@fregante
Copy link
Member Author

fregante commented Apr 16, 2023

That could be useful as a "util" and would be different from a classic detection. Given the rarity, it could be worth it, but we'd lose the automated cross-testing of URLs because that expects true/false.

I think we don't need to care about specific profile tab

I'd be happy to expose your util and deprecate those functions (which we only ever implemented as "just in case" and "doesn't hurt")

@fregante fregante added the enhancement New feature or request label Jul 9, 2023
@fregante fregante merged commit aef4af0 into main Jul 9, 2023
@fregante fregante deleted the isProfileRepos branch July 9, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants