Skip to content

Add isProfileRepoList - #170

Merged
fregante merged 3 commits into
mainfrom
isProfileRepos
Jul 9, 2023
Merged

fregante merged 3 commits into
mainfrom
isProfileRepos

Conversation

@fregante

@fregante fregante commented Apr 16, 2023 •

Copy link
Copy Markdown
Member

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

kidonng commented Apr 16, 2023 •

Copy link
Copy Markdown
Member

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

fregante commented Apr 16, 2023 •

Copy link
Copy Markdown
Member Author

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