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

Don't clutter the global search bar in the global Pull Requests page #1253

Closed
nacimgoura opened this issue Apr 11, 2018 · 12 comments · Fixed by #1933
Closed

Don't clutter the global search bar in the global Pull Requests page #1253

nacimgoura opened this issue Apr 11, 2018 · 12 comments · Fixed by #1933
Labels
bug help wanted small Issues that new contributors can pick up

Comments

@nacimgoura
Copy link

nacimgoura commented Apr 11, 2018

Issuehunt badges

Hello, I think I encountered a bug. When I click on the "pull request" button on the navbar, the filters get into both input of the page instead of just being in the filter input.

image

bfred-it earned $40.00 by resolving this issue!

@lukaszklis
Copy link
Contributor

Seems to be caused by https://github.com/sindresorhus/refined-github/blob/7f23ff66be7a3f713fd5f06977b36427130c49d5/source/features/sort-issues-by-update-time.js#L29-L30, I believe it should be fixed by limiting the scope of the selectors to target repository-related ”Pull requests” and ”Issues” links.

@sindresorhus sindresorhus changed the title filter in navbar search with pull requests Filter in navbar search with pull requests Apr 11, 2018
@fregante
Copy link
Member

I think that’s a consequence of the update time sorting. Not much it can be done about it

@yakov116
Copy link
Member

@bfred-it can we clear the field after loading the page?

@fregante
Copy link
Member

That would disable the sorting on the searches

@yakov116
Copy link
Member

@bfred-it I thought the sorting was for when we load the page. When I search not always is it needed to be by last updated.

Can we make an x or a clear field button?

@fregante
Copy link
Member

fregante commented Apr 12, 2018

The sorting ideally should be consistent across the site, truly a new default.

We could however fixing this issue in two ways:

  • clearing out the header search, because that’s global, duplicate and-who-cares 👈
  • clearing the fields BUT applying the sorting when the search form is submitted. This would be nice because the sorting would be applied invisibly. However we can’t clear out the fields randomly because the user might have typed something in. RGH would have to understand which queries by the user and leave them untouched.

@fregante fregante changed the title Filter in navbar search with pull requests Don't clutter the global search bar in the global Pull Requests page Dec 9, 2018
@fregante fregante added the small Issues that new contributors can pick up label Feb 21, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $40.00 to this issue.


@janat08
Copy link
Contributor

janat08 commented Apr 14, 2019

I did this by narrowing down selectors to links. the sorting still works.

janat08 added a commit to janat08/refined-github that referenced this issue Apr 14, 2019
I did this by narrowing down selectors to links. the sorting still works.

fixes refined-github#1253
it's strongly emphasised that the bug should be fixed, with the suggestion that the whole behaviour of feature could be refined in what it manifests.
janat08 added a commit to janat08/refined-github that referenced this issue Apr 15, 2019
I did this by narrowing down selectors to links. the sorting still works.

fixes refined-github#1253
it's strongly emphasised that the bug should be fixed, with the suggestion that the whole behaviour of feature could be refined in what it manifests.
s
@IssueHuntBot
Copy link

@sindresorhus has rewarded $36.00 to @bfred-it. See it on IssueHunt

  • 💰 Total deposit: $40.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $4.00

@janat08
Copy link
Contributor

janat08 commented Apr 18, 2019

So the thing is that my solution actually worked, instead of applying bandaid on it. Obviously, the reason why some random text gets applied to input with selector for href is not because the selector is bad (since href doesn't exist on input you see), but because you must clear the input after the fact and get a bounty out of it in lieu of first solution.

@fregante
Copy link
Member

fregante commented Apr 19, 2019

So the thing is that my solution actually worked

I'm not sure of where you get that from, I tried and it didn't — because it changed nothing. The feature your PR modified, does not affect the input field directly, in fact you can disable RGH and:

  1. Visit /pulls
  2. Type "hello" in the right-side search field
  3. Press Enter
  4. You'll see "Hello" in the global search bar, the same "issue"

This is because GitHub applies the q parameter to both fields on the page, even if they point to two different search results.

The reason why our feature (the one you modified) makes the query appear in the global search field (while the regular "Created" and "Assigned" tabs don't) is that we effectively modify the query (and GitHub doesn't hide it from the global field like it does for its own tabs)

@janat08
Copy link
Contributor

janat08 commented Apr 19, 2019

right, I didn't read issue description to begin with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted small Issues that new contributors can pick up
6 participants