Refined-github: Search issues while a new issue is being typed

Created on 6 Mar 2018  Â·  10Comments  Â·  Source: sindresorhus/refined-github

Exactly like what stackoverflow does when creating a new question:

  • as soon as the title has a few words
  • start a somewhat fuzzy search query in the background
  • display the results in the space above the title of the issue
  • continue updating results while issue is being typed

Maybe limit to 2-5 search requests per minute so as not to eat all the user's rate limiting quota.

Here's a video of someone doing a SO submission.

enhancement help wanted

Most helpful comment

I quickly hacked this together with Primer:

What do you think?

All 10 comments

This would be great and, as much as I'd prefer it as as a separate extension, having the thousands of RGH users on it automatically would prevent a lot of useless issues. 👍

Maybe limit to 2-5 search requests per minute

For that frequency I think we can just show the suggestions when the user is done typing, i.e. blur event.

we can just show the suggestions when the user is done typing

I would add done typing the title

Yes :)

I quickly hacked this together with Primer:

What do you think?

This looks great! Now I'm thinking Should this also appear on issue pages? hell yes that sounds amazing! Great work

@bfred-it @fenollp I've implemented the basic functionality but there are some things I need help with:

Design decisions
  • How many suggestions should be displayed? How should we determine which ones are most relevant?
  • Should we display excerpts when the issue title does not contain any of the title's words?
    And if yes, how do we determine what part and how much of issue is displayed?
  • Should we filter out issues tagged with invalid, spam, et cetera?
  • Should we remove already displayed issues as soon as the user starts typing again?
  • Should only the title be used to search or also the issue body?
Implementation questions
  • How I do I correctly escape a qualifier like is:issue so the API gives me issues that contain it?

WRT design I’m thinking

  • display at most 3-5 results with a link “X more results” to the actual results page
  • if possible this should be using github’s search so that when clicking the link the same results can be found without surprise
    That should answer the design questions. I love your ideas but maybe we can get something basic first then iterate on it with time and experience?

Can’t you double quote that string to escape it? … "is:issue" …?
Thanks for your great work I look forward to it getting merged!

How about matching StackOverflow? https://stackoverflow.com/questions/ask

stackoverflow

It may seem a bit annoying to move the main comment area, but this only happens when the title field loses focus, which means that use probably already clicked/tabbed into the comment box, so they can start typing even if it moved.

How I do I correctly escape a qualifier like is:issue so the API gives me issues that contain it?

"is:issue" works: https://github.com/sindresorhus/refined-github/issues?utf8=%E2%9C%93&q=%22is%3Aissue%22+

I think being that aggressive makes sense only for sites like SO and Quora where having duplicate content across the whole site is a bigger issue. With GitHub you would have quite a bit more false positives as the search is quite permissive and you are not searching all of GitHub, but just a single repo. It would be quite more often that the results are not the same issue compared to SO.

  • Should we display excerpts when the issue title does not contain any of the title's words?
    And if yes, how do we determine what part and how much of issue is displayed?
  • Should we filter out issues tagged with invalid, spam, et cetera?
  • Should we remove already displayed issues as soon as the user starts typing again?

I would answer "no" to all three of the above questions - keep it simple and predictable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mischah picture mischah  Â·  3Comments

hkdobrev picture hkdobrev  Â·  3Comments

hkdobrev picture hkdobrev  Â·  3Comments

sindresorhus picture sindresorhus  Â·  3Comments

juliocanares picture juliocanares  Â·  3Comments