utterance / utterances

:crystal_ball: A lightweight comments widget built on GitHub issues
https://utteranc.es
MIT License
8.68k stars 566 forks source link

Create a new issue when the search didn't find the exact title #496

Open yihui opened 3 years ago

yihui commented 3 years ago

Instead of loading the first result in the fuzzy search, how about creating a new issue with the exact title? Then we would be more certain about which issue corresponds to which page. For example, if the page URL (pathname) is foo/, but the issue with the title foo/ doesn't exist, and two issues with titles hello foo and bye foo exist. In this case, Utterances will map comments to the issue hello foo. I feel it would be better if it creates a new issue with the title foo/ instead.

Basically it boils down to the decision on whether you want to risk loading a wrong issue for comments, or creating a new but unnecessary issue (e.g., hello foo might be the right issue for the page foo/) when an exact match of the title is not found in existing issues. I feel the former is worse than the latter.

yihui commented 3 years ago

A more practical example is that when some pages are under the same hierarchy, and comment issues for lower level pages have been created, but comment issues for higher level pages do not exist yet, then Utterances will load issues that were created for lower level pages when higher level pages are opened. This was the actual motivation of this PR.

For example, I may have two pages, page A /life/index.html and page B /life/cooking/index.html. If people have commented on page B first, page A will use the same Github issue as page B, which is what I'd like to avoid.

If you don't like this change, it will be great if the behavior can be configurable. Thanks!

ericswpark commented 5 months ago

I think this should be the correct behavior. The current implementation always returns whatever the API brings up, which results in unexpected behavior as per #661 if the API returns incorrect results.

yihui commented 5 months ago

@ericswpark I don't feel optimistic about this PR being accepted or Utterances being actively developed anymore. If exact matching is important to you, I suggest you give Giscus a try. It has a data-strict=1 option, which is very clever and useful in my opinion.

ericswpark commented 5 months ago

@yihui yup, thanks for the recommendation. I actually switched to Giscus after posting the comment above. It looks like Utterances is abandoned.