refined-github icon indicating copy to clipboard operation
refined-github copied to clipboard

`pr-filters` is removing the default filter

Open albertilagan opened this issue 2 months ago • 1 comments

Description

When going to the Pull Requests tab which currently default to is:pr is:open, hitting the Ready for Review filter clears everything out except the draft:false filter which results to the page showing all PRs (merged/closed included)

I assume this is because https://github.com/refined-github/refined-github/pulls which defaults to is:pr is:open does not have the default filter on the url.

https://github.com/user-attachments/assets/37526da3-8803-4e91-a6e5-539bde598ffb

How to replicate the issue + URL

bug in https://github.com/refined-github/refined-github/pulls (which by default is is:pr is:open) it redirects to https://github.com/refined-github/refined-github/pulls?q=+draft%3Afalse

but it works fine on https://github.com/refined-github/refined-github/pulls?q=is%3Aopen+is%3Apr it redirects to https://github.com/refined-github/refined-github/pulls?q=is%3Aopen+is%3Apr+draft%3Afalse properly

Extension version

25.11.22

Browser(s) used

Chrome, Helium

Token ⚠️

  • [x] I set a token in the options page. I understand that some features require a token to work.

albertilagan avatar Dec 05 '25 22:12 albertilagan

Thanks for the report! I can't believe this went unnoticed for several years.

We have a SearchQuery class that's supposed to take care of this but the feature hand-rolls the URL construction instead:

https://github.com/refined-github/refined-github/blob/80c004a03187a59c0f46e94b5dce1905b173c6ef/source/features/pr-filters.tsx#L19-L31

At the very least, the class should be used for query normalization instead, which includes the fix for:

https://github.com/refined-github/refined-github/pulls which defaults to is:pr is:open does not have the default filter on the url.

fregante avatar Dec 06 '25 03:12 fregante