-
Notifications
You must be signed in to change notification settings - Fork 29k
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
Enrich Git extension's remote source provider API #147613
Conversation
These changes look good to me but I would like @joaomoreno to have a quick look as well. |
But those calls would slow down showing the entire list, right? Is that how the GitHub Repositories does it today?
❤️
Is this displayed as an inline action on the quick open item? |
GitHub Repositories uses the GraphQL API to search for Repository objects, so it can retrieve the fork parent (if any) with a single network request. This information isn't available without a second call through the REST API. Though it's also true that the GraphQL API might be slower, so even if we switched the GitHub extension over to use the GraphQL API, we might slow down the list generation overall.
Yeah, the motivation is that users are already looking at the quickpick and wouldn't notice if we displayed a notification in the bottom right about the incomplete results. From talking with @lszomoru I think we want to avoid introducing this into the API unless we hear a real need for it, and GitHub Repositories has an alternative today (which is to immediately ask for auth as soon as we detect missing SAML--it's a degraded experience compared to now because the user has less context on why they're being asked to reauthenticate, but it's also strange that we would put actions inline in the quickpick). |
* Allow custom title in remote source picker * Include forks in query search results * Support `RemoteSource.detail` * Allow showing quickpicks in `getRemoteSources` * Allow custom placeholder and remote source icons * Add ability to customize placeholder * Register and show recently opened sources * Allow custom remote url labels * Add a separator label for remote sources * Update git-base typings * Make showing recent sources opt in * Add concept of recent remote source to `RemoteSourceProvider` concept * Recent sources should be sorted by timestamp * Pass current query to `getRemoteSources` * Fix applying query
Re: #141295
This pull request expands the remote source provider API from the git-base extension, allowing any extension to provide remote sources with the same richness that is currently available in the Remote Repositories extension. Since we're enriching the API in git-base, I think it also makes sense to rework Remote Repositories to take advantage of this API instead of having its own picker.
The key changes are:
RemoteSourceProvider.getSources()
to display the provider's own secondary quickpick before returning a list ofRemoteSource
s.getSources()
method before generating a list of repositories.getRemoteSources
API command to customize the title and placeholder of the quickpick, in addition to the provider label.getRemoteSources
API command to customize the URL label for a given URL.detail
in addition to thedescription
.detail
.getRemoteSources
API command to align it with the experience in the GitHub Repositories extension.recently opened
items in the top-level picker.getRemoteSources
, so that these do not appear in unexpected locations wheregetRemoteSources
is being used and where the Remote Repositories extension has activated for some reason (e.g. user clicks Open Remote Repositories which activates Remote Repositories, then triggersgetRemoteSources
through some other extension).While adopting some of these API changes in the builtin GitHub extension, I also encountered and fixed #123986 by always including
fork:true
in the search query. I fixed this exact issue in Remote Repositories some time back.Some remaining questions I have:
showMore
method that when clicked initiates reauthentication. @lszomoru I wanted to get your thoughts on adding this to the API since it is pretty specific. An alternative is that GitHub Repositories could just do anauthentication.getSession
withforceNewSession: true
when we get truncated results due to missing SSO.