-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
search: Add search suggestion for "unresolved topics". #31758
base: main
Are you sure you want to change the base?
Conversation
Hello @zulip/server-search members, this pull request was labeled with the "area: search" label, so you may want to check it out! |
Previously, the search suggestion only featured "resolved topics" and filtering for "unresolved topics" was not as intuitive. Users would have to use the negate operator "-" to filter for unresolved topics and it is not possible to edit pills. This change adds "unresolved topics" to the search with support to cancel negations. Fixes: zulip#31725.
Thanks! Can you add a screenshot of what's shown if you type "Unr" into the search box? |
Cool. @evykassirer are you up for reviewing this one? I haven't tested. |
@@ -504,6 +505,7 @@ test("check_is_suggestions", ({override, mock_template}) => { | |||
"-is:alerted", | |||
"-is:unread", | |||
"-is:resolved", | |||
"is:resolved", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this being included in a query that starts with a -
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was an agreement to include it in CZO. Due to the confusion, I'm wondering if we should change course and just remove that from being suggested for -
.
search_string.startsWith("--") | ||
) { | ||
search_string = search_string.slice(1); | ||
s.search_string = s.search_string.slice(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain a bit more why you're keeping two copies of the search string here, and why you're slicing them on different indices? Maybe you can share an example of what would happen here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of -
with the suggestion of -is:resolved
, we would get a suggestion string of --is:resolved
.
One copy of the string is to used to store the string that the typeahead should return. is:resolved
The other copy of the string is used for pattern matching -is:resolved
Heads up @Joelute, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
Previously, the search suggestion only featured "resolved topics" and filtering for "unresolved topics" was not as intuitive. Users would have to use the negate operator "-" to filter for unresolved topics and it is not possible to edit pills.
This change adds "unresolved topics" to the search with support to cancel negations.
Fixes: #31725.
Screenshots and screen captures:
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: