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

search: Add search suggestion for "unresolved topics". #31758

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

Conversation

Joelute
Copy link
Collaborator

@Joelute Joelute commented Sep 26, 2024

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:
image
image
{CBF9BE32-65DC-40A4-A565-05610AB0E863}

Self-review checklist
  • Self-reviewed the changes for clarity and maintainability
    (variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

  • Explains differences from previous plans (e.g., issue description).
  • Highlights technical choices and bugs encountered.
  • Calls out remaining decisions and concerns.
  • Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

  • Each commit is a coherent idea.
  • Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

  • Visual appearance of the changes.
  • Responsiveness and internationalization.
  • Strings and tooltips.
  • End-to-end functionality of buttons, interactions and flows.
  • Corner cases, error conditions, and easily imagined bugs.

@zulipbot
Copy link
Member

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.
@alya
Copy link
Contributor

alya commented Sep 26, 2024

Thanks! Can you add a screenshot of what's shown if you type "Unr" into the search box?

@alya
Copy link
Contributor

alya commented Sep 27, 2024

Cool. @evykassirer are you up for reviewing this one? I haven't tested.

@alya alya added the maintainer review PR is ready for review by Zulip maintainers. label Sep 27, 2024
@kennethnrk
Copy link
Collaborator

image

This behaviour is wrong.
You should change the search suggestions filtering logic to only display "Unresolved topics" in the case of "-is:resolved"

@@ -504,6 +505,7 @@ test("check_is_suggestions", ({override, mock_template}) => {
"-is:alerted",
"-is:unread",
"-is:resolved",
"is:resolved",
Copy link
Collaborator

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 -?

Copy link
Collaborator Author

@Joelute Joelute Oct 15, 2024

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);
Copy link
Collaborator

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.

Copy link
Collaborator Author

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

@zulipbot
Copy link
Member

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 upstream/main branch and resolve your pull request's merge conflicts accordingly.

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

Successfully merging this pull request may close these issues.

Make it easier to search for unresolved topics
5 participants