Skip to content
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

Launchpad: Search for another PR #3543

Open
axosoft-ramint opened this issue Sep 6, 2024 · 3 comments
Open

Launchpad: Search for another PR #3543

axosoft-ramint opened this issue Sep 6, 2024 · 3 comments
Assignees
Labels
area-launchpad Issues or features related to Launchpad feature New feature or request
Milestone

Comments

@axosoft-ramint
Copy link
Contributor

axosoft-ramint commented Sep 6, 2024

Add ability to search for a PR not in the Launchpad list. UX needs to be talked through.

Normally our algorithm provides the Launchpad with some subset of all PRs. So, the full list of PRs accessible to the user is wider. The current search looks only for PRs selected for the Launchpad and we want user to be able to search among all other available PRs.

The current idea, but needs discussion and may be changed:

  • User can use the text input in the Launchpad quickpick, either in the main Launchpad list/step or through some other/new step, to search for a PR using its url. For example: https://github.com/gitkraken/vscode-gitlens/pull/3500. Or if that fails, we could just do a PR search with the integration using the user's search query.
  • If no item in the existing categorized list matches the search, we check other PRs in the repo (or repos) matching the user's text to see if we can find a matching PR, and show a Focus item (default to "other" category) for it.
  • The user can then open that item and take actions on it like any other Launchpad item.

Notes

  • Should first discuss design/UX with the team. For example: should there instead be a "search for a different PR" button or action item in the Launchpad list? Would that make it more discoverable?
  • Thinking of using integration.getPullRequest for the PR search when the user uses PR url, and integration.searchPullRequests for more general search, but the exact function/query may change depending on final design.
  • Note that if we use integration.getPullRequest or integration.searchPullRequests, they must be implemented for GitLab since Launchpad supports GitLab as well (currently it is only implemented for GitHub). This might be a good opportunity to add this functionality to the shared provider library, but for now we can implement them locally for GitLab as needed.

Specs

  1. If I copy and paste a PR url directly into the input box on the main step, it should search for that PR
  2. Options:
  • When anything is typed in the input box, we can offer a "haven't found what you want? search among everything" item at the end, which when clicked, searches across all PRs the user has access to using the search terms.
  • or Just search and place the result in a new section

Possible UX solutions

"Gradual discovering" of the feature.

General idea is the following:

  1. user searches something
  2. we search inside of the selected subset
  3. and we tell like: "haven't found what you want? search among everything "
Search and show the result in a new section

If so, and the goal here is to allow users to easily find any PR they have access to, then we could insert a new section at the bottom of the Launchpad that returns all matches when someone has an active search, without them needing to select another option.

@axosoft-ramint axosoft-ramint self-assigned this Sep 6, 2024
@axosoft-ramint axosoft-ramint added this to the 16.0 milestone Sep 6, 2024
@axosoft-ramint axosoft-ramint added feature New feature or request area-launchpad Issues or features related to Launchpad labels Sep 6, 2024
sergeibbb added a commit that referenced this issue Sep 17, 2024
sergeibbb added a commit that referenced this issue Sep 17, 2024
@sergeibbb
Copy link
Member

@axosoft-ramint

Question. In the old code I see how the quickpick.value affects that groups are being hidden. But I don't see where does the actual filtering happen. Is it provided by VSCode itself?

@axosoft-ramint
Copy link
Contributor Author

@sergeibbb VSCode indeed internally filters the quickpick items to only those that match your search (though I'm not sure exactly what parts of the quickpick items it uses to match, other than their main label). There is an alwaysShow (I forgot the exact name) property we can toggle on/off for items as a hack to get around this internal filtering, and that's what the old code is using.

@sergeibbb
Copy link
Member

sergeibbb commented Sep 20, 2024

Hi @axosoft-ramint

I have 3 questions for you.


The first is a noob one. What does the returning boolean from the event handler means in a QuickPickStep?

onDidChangeValue?(quickpick: QuickPick<DirectiveQuickPickItem | T>): boolean | Promise<boolean>;

main...draft/3543-pr-search#diff-25ee8b0447aeac38780fa0402ebffabcbbbc8c30024e1a61e681ec5d8e6694bcL555-R609


The next question was discussed on the daily meeting today. So, no need to answer. We also discussed the UX flows that should be used in this task. I'll put it in the description soon.

Another question. Who does sort?
I'm trying to create two sections as on Justin's mockup:
image

I'm adding a header in front of the rest of the items:
image

But it goes below the all items
image


Third. Do I undestand right that this setting to alwaysShow is because the VS Code hides all items that don't match the filter, and by setting alwaysShow <- true we tell VS Code that it should be visible even when it doesn't match?

Specifically, here, where we setup the item that is matches by prNumber: main...draft/3543-pr-search#diff-25ee8b0447aeac38780fa0402ebffabcbbbc8c30024e1a61e681ec5d8e6694bcR597-R598

Yes. I see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-launchpad Issues or features related to Launchpad feature New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants