utterances icon indicating copy to clipboard operation
utterances copied to clipboard

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

Open yihui opened this issue 4 years ago • 4 comments

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 avatar Feb 22 '21 17:02 yihui

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!

yihui avatar Feb 26 '21 18:02 yihui

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.

ericswpark avatar Dec 11 '23 20:12 ericswpark

@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.

yihui avatar Dec 18 '23 15:12 yihui

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

ericswpark avatar Dec 18 '23 23:12 ericswpark