Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Conversation

@StanleyGoldman
Copy link
Contributor

@StanleyGoldman StanleyGoldman commented Dec 12, 2016

As requested in #722, functionality to filter pull requests by title or number.

Pull Request Filtering

ObservableCollection<IAccount> Assignees { get; }
IAccount SelectedAssignee { get; set; }
string FilterText { get; set; }
bool IsLoaded { get; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get the feeling IsLoaded should be here.

@shana
Copy link
Contributor

shana commented Dec 12, 2016

This is pretty neat! 😄

@StanleyGoldman
Copy link
Contributor Author

It looks good. Just needs some 🏋️ from @donokuda

@grokys
Copy link
Contributor

grokys commented Dec 13, 2016

This looks great! A few things:

  • While the list is loading, the filter text box is enabled but typing into it does nothing. We probably need to fix this to make filtering etc work too while loading (all the PRs for e.g. aspnet/Mvc take a while to load) but for the moment we should probably disable the textbox while loading like we do with the sort dropdowns
  • I tried to search for a PR by number by typing "Switch submodule links to https #3" but PR 3 was not found - I'd expect that I'd search for PRs by number by using the "#" prefix
  • Should probably put a delay on the search text box binding, as currently typing lags when a project has a lot of PRs (again as in aspnet/Mvc)

@StanleyGoldman
Copy link
Contributor Author

Ah, testing against a repo with a lot of pull requests is something I need to start doing then.

@StanleyGoldman
Copy link
Contributor Author

Updated the gif above.

Let me know if you find the "#" functionality odd..
It wont assume you are performing a pull request number search until and while you follow the "#" with digits. So the initial "#" starts to search for pull requests with "#" in the title.


<ui:FilterTextBox x:Name="filterText"
IsEnabled="{Binding IsLoaded}"
IsEnabled="{Binding IsLoaded, Delay=500}"
Copy link
Contributor

Choose a reason for hiding this comment

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

This delay should be on the Text property, not IsEnabled ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😨

@grokys
Copy link
Contributor

grokys commented Dec 14, 2016

No, I think the "#" works as you've implemented it. I just wonder whether it should be a full string search on the PR number instead of a substring search. For example in aspnet/Mvc if I search "#2" I'm probably looking for PR #2, but instead I get all of the PRs which start with the number 2 (which is a lot in this case!)

@StanleyGoldman
Copy link
Contributor Author

Fixed up

@StanleyGoldman
Copy link
Contributor Author

Yea, I tried it with exact number matching, I can push a branch if you wanna try it out.
It just felt kind of... empty... until you got to the number you were typing, lol.

@grokys
Copy link
Contributor

grokys commented Dec 14, 2016

Hmm yeah, I see what you're saying. One thing I tried (to see if it'd work) was adding a space after the number to see if that forced exact matching - I'm not sure how many people would think to try that though?

@tocsoft
Copy link
Contributor

tocsoft commented Dec 14, 2016

could you not use both searching methods?
order exact matches first then partial matches below?

@grokys
Copy link
Contributor

grokys commented Dec 14, 2016

That's a really good idea @tocsoft !

@StanleyGoldman
Copy link
Contributor Author

I think that's actually a sort not a filter. We would have to land the sorting pull request to see how to integrate the logic.

I'm willing to check it out, but I'm afraid a user wouldn't be able to ascertain what it's doing.

@donokuda
Copy link
Contributor

I'm assuming that if someone is searching for a PR by its number, then they would know exactly which number they're looking for. If that's the case, then I'm not convinced of the value spent trying to refine filtering for PR numbers beyond how it currently works.

I also can't remember the last time when I went "Oh, I need to search for PR #732." Rather, I'm probably going to be searching for keywords like "pull request filtering" instead. That said, I would love to hear your experiences when searching for a specific pull request number is more useful and quicker (perhaps in tandem with an issue tracker 😄)

However, if matching worked on something like branch names (which could be considered out of scope for this pull request), then searching for a number would be more useful when I know a branch is fixing a specific issue (fixes/479-clear-pr-creation-form).

@grokys
Copy link
Contributor

grokys commented Dec 15, 2016

I also can't remember the last time when I went "Oh, I need to search for PR #732." Rather, I'm probably going to be searching for keywords like "pull request filtering" instead.

I do this all the time: for example if someone mentions a PR by number in slack. In addition if I'm looking at a PR on github.com and want to find that PR in Visual Studio I'll likely want to search by number,

@StanleyGoldman
Copy link
Contributor Author

So I think we are agreeing?
Summary: Partial number matching of any kind is misleading and exact number matching is best.

@grokys
Copy link
Contributor

grokys commented Dec 16, 2016

Yeah, I've just tried out the PR with the exact matching, and while I can see your problem with it, I think the behavior is more useful. So personally I think exact number matching is best, though I can't speak for anyone else.

@StanleyGoldman
Copy link
Contributor Author

Agreed. Exact matching is best.

@shana
Copy link
Contributor

shana commented Dec 16, 2016

Let's go with that and see how it goes 😄

@grokys grokys removed this from the Maintainer Workflow: Beta milestone Jan 4, 2017
@grokys grokys changed the base branch from master to release/2.3 February 13, 2017 14:56
@jcansdale
Copy link
Collaborator

This seems to work well. 😄

For consistency, it would be good to use the magnifying glass icon:

image

It looks like standard icons can be accessed via IVsImageService2. See:
https://github.com/madskristensen/ExtensibilityTools/blob/master/src/Misc/Commands/ImageMonikerDialog.xaml.cs

grokys added 2 commits August 29, 2017 11:22
 Conflicts:
	src/GitHub.App/SampleData/PullRequestListViewModelDesigner.cs
	src/GitHub.App/ViewModels/PullRequestListViewModel.cs
	src/GitHub.Exports.Reactive/ViewModels/IPullRequestListViewModel.cs
@grokys grokys changed the base branch from release/2.3 to master September 20, 2017 22:29
 Conflicts:
	src/GitHub.App/ViewModels/PullRequestListViewModel.cs
@grokys
Copy link
Contributor

grokys commented Nov 8, 2017

@jcansdale yes that would be nice, to properly fit in with other VS search boxes I think we need a completely different control (as the one we're using is styled for our dialog which uses a different color scheme etc). This also has the downside that the search box is white on a dark theme. I think that would be another PR tbh...

Instead of displaying our own search box in the PR list, use the built-in search box provided by `ToolWindowPane`.
@grokys
Copy link
Contributor

grokys commented Nov 10, 2017

I've updated the PR to use the built-in VS search functionality, which works around the styling issues. Now looks like this:

image

@grokys grokys mentioned this pull request Nov 13, 2017
@grokys
Copy link
Contributor

grokys commented Nov 13, 2017

Moved to #1312.

@grokys grokys closed this Nov 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants