Change default Pull Request filter #51751
Replies: 43 comments 2 replies
|
Very keen on this |
|
Would be really nice, especially when working in a mono repo with lots of Pull Requests and issues |
|
Hiding drafts is for instance something I'd like to switch on: |
|
I think it's an essential quality-of-life feature. You should be able to specify a default search query in "Pull requests". |
|
Yes, please. Really need the ability to set default filters. |
|
Would love this! |
|
Yes, would love this! |
|
https://github.com/rbeauchemin/github-filter |
|
Default would be great, and having custom presets in the drop-down would also be nice. I currently work around this with browser bookmarks. |
|
Would be nice, as being able to hide draft PRs by default would be handy. |
|
I was looking for this functionality and came across this thread, I decided to create a very simple tampermonkey script to apply my preferred filters to |
|
100% support this change in functionality! |
|
As someone who reviews a lot of PRs and has very particular label filtering setup, this would be great! |
|
I liked @blakethomp's band-aid fix, but didn't work for me for some URLs and depending on the source of the anchor tag, how the I use mine as an Arc Boost, but there's no reason it wouldn't also work as a ViolentMonkey/TamperMoney script. You can adjust the new query to your liking. const DEFAULT_FILTERS = ["is:pr", "is:open", "draft:false"];
const updateAnchor = (element) => {
const href = element.getAttribute("href")
if (!href || !href.startsWith("/")) return
const url = new URL(href, window.location.origin)
if (!url.pathname.endsWith("/pulls")) return
const query = url.searchParams.get("q")?.split(" ")
if (!query) {
url.searchParams.set("q", DEFAULT_FILTERS.join(" "))
element.setAttribute("href", url.href)
return
}
if (!query.includes("is:open") || query.includes("draft:false")) return
query.push("draft:false")
url.searchParams.set("q", query.join(" "))
element.setAttribute('href', url.href)
}
const updateAll = () => {
const elements = document.querySelectorAll('a[href]')
for (const element of elements) updateAnchor(element)
}
const observe = (mutations) => {
for (const mutation of mutations) {
switch (mutation.type) {
case "childList":
for (const node of mutation.addedNodes) {
if (node.nodeType !== Node.ELEMENT_NODE) continue
if (node.tagName === 'A') updateAnchor(node)
for (const anchor of node.querySelectorAll('a[href]')) updateAnchor(anchor)
}
break;
case "attributes":
if (mutation.attributeName !== "href") break
updateAnchor(mutation.target)
break
default:
}
}
}
const observer = new MutationObserver(observe)
observer.observe(document.documentElement, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ['href']
})
document.addEventListener("DOMContentLoaded", updateAll) |
|
It would be nice to be able to set default PRs filter to a |
|
+1, it would be a helpful! |
|
+1, i would set the default to |
|
Almost 3 years, but still very helpful |
|
+1, please, this would be huge! |
|
shocked this isn't a thing yet, +1 |
|
In this multi-agent, multi-worktree world we live in now, it would be wonderful to support this. That or create some sort of "hidden draft" state. I want to be able to create WIP PRs, and I want to not contribute to repo noise. |
|
Big +1 ! |
|
+1 |
|
+1 |
|
+1 |
|
Github not adding features that are actually usefull since.... will 2023 or longer is most cases! |
|
+1 |
|
|
+1 |
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Product Feedback
Body
I'd like to be able to change the default filter of Pull Requests page.
Default is "is:pr is:open " and although I can change the filter, each time I refresh the page it gets back to the default.
Thanks
All reactions