Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yihui
Copy link

@yihui yihui commented Feb 22, 2021

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.

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
Copy link
Author

yihui commented Feb 26, 2021

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
Copy link

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
Copy link
Author

yihui commented Dec 18, 2023

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants