Skip to content

Split PRs and issues in the top search - #1738

Merged
fregante merged 27 commits into
refined-github:masterfrom
jerone:features/jvw-1635-search-results-filter-2
Feb 13, 2019
Merged

fregante merged 27 commits into
refined-github:masterfrom
jerone:features/jvw-1635-search-results-filter-2

Conversation

@jerone

@jerone jerone commented Jan 20, 2019

Copy link
Copy Markdown
Contributor

Repository search results are currently categorized in 4 types: Code, Commits, Issues and Wikis (if available).
Where issues is a combination of issues and PR. This PR will make another type for all PR's and separate them out of the issues type.

Test

https://github.com/sindresorhus/refined-github/search?q=test+is%3Apr&type=Issues

Screenshot

image

Ref

@sindresorhus

Copy link
Copy Markdown
Member

I think the menu title should be Pull Requests, not PR.

@sindresorhus

Copy link
Copy Markdown
Member

On the PR tab, it says 7 issues in sindresorhus/refined-github, but we should also change that to 7 pull requests in sindresorhus/refined-github

@sindresorhus sindresorhus changed the title Add search results type for PR. Closes #1635 Add repo search results type for Pull Requests Jan 21, 2019
@jerone

jerone commented Jan 21, 2019

Copy link
Copy Markdown
Contributor Author

@bfred-it & @sindresorhus I addressed all feedback; thank you. A lot is changed, so maybe another feedback round...

@sindresorhus

Copy link
Copy Markdown
Member

#1738 (comment) is not fixed.

@jerone

jerone commented Jan 22, 2019

Copy link
Copy Markdown
Contributor Author

@bfred-it & @sindresorhus I addressed all feedback again. Let me know if I need to change anything.

@fregante fregante self-assigned this Jan 23, 2019
- Also apply to global search
- Use native and lightweight count-getter
- Correctly drop existing counters
- Avoid innerHTML
- Use URLSearchParams
- Simplify and shorten code
@fregante

fregante commented Jan 23, 2019 •

Copy link
Copy Markdown
Member

@jerone I made some changes (91ee111 ) but git won't let me push, did you disable the checkbox? (#1665)

@jerone

jerone commented Jan 23, 2019

Copy link
Copy Markdown
Contributor Author

@bfred-it commented on Jan 23, 2019, 12:51 PM GMT+1:

@jerone I made some changes (91ee111 ) but git won't let me push, did you disable the checkbox? (#1665)

Yes, intentionally. I learn so much more from the feedback from the reviewers, then that someone completely rewrites the code that I contributed to this project. I understand that there are some code styling differences (open to any feedback), but there are multiple ways to get to end-goal (if it doesn't contain any bugs).

Anyways, I recognize your contributions and checked the "allow edits from maintainers" again. Feel free to push.

@fregante

fregante commented Jan 24, 2019 •

Copy link
Copy Markdown
Member

Right, but multiple rounds of reviews take longer and are less effective for the reviewer, especially when the whole approach can be modified. Even with our reviews, some pieces fell through so it’s easier to commit directly.

GitHub doesn’t show that maintainers aren’t allowed to push until they try, so I almost opened a new PR to do so.

Also code reviews can only get us so far. Until a reviewer tries to run it and write code they're just shooting in the dark ("try this and that, maybe"). Once the code is written it might as well be committed.

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This feature should probably be renamed into something like split-issue-pr-search-results

@fregante fregante removed their assignment Jan 31, 2019

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is good to go for me. No sure if we should wait for #1750 before merging

@jerone

jerone commented Feb 3, 2019

Copy link
Copy Markdown
Contributor Author

I think we tackled every situation. 👍 :shipit:

} else if (/\btype=Issues\b/.test(location.search) && !/\bis:issue\b/.test(getSearchQuery())) {
title.textContent = title.textContent
.replace(/issue\b/, 'issue or pull request')
.replace(/issues/, 'issues and pull requests');

@fregante fregante Feb 3, 2019 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

'issues and/or pull requests' ...

@fregante fregante Feb 3, 2019 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lol the link was supposed to only show one result, but pasting the link here created a second result. Fixed now

@jerone jerone Feb 3, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh lol, I was actually suggesting an sentence change. That previous link (https://github.com/search?q=alsdka&type=Issues) showed two results, both of them in pull requests. That's why I suggested to reword it to 'issues and/or pull requests', because there were zero (0) issues.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nah I think it’s ok with “and” since the search contains both types. Also easier to read

@fregante

fregante commented Feb 3, 2019

Copy link
Copy Markdown
Member

a

@fregante fregante changed the title Add repo search results type for Pull Requests Split PRs and issues in the top search Feb 13, 2019
@fregante
fregante merged commit abebd9f into refined-github:master Feb 13, 2019
@fregante

Copy link
Copy Markdown
Member

Finally merged! Thanks @jerone 🌝

@jerone
jerone deleted the features/jvw-1635-search-results-filter-2 branch February 13, 2019 09:37
@fregante fregante mentioned this pull request Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants