-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
left_sidebar: Improve topic search matching. #36966
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
Conversation
|
Thanks! The next step is for this PR to pass tests. |
|
@alya I am working on the file topic_list_data.test.cjs.The test cases are failing as the test were written in accordance to util.filter_by_word_prefix_match. I tried to modify the function filter_topics_by_search_term which in which I am using typeahead.query_matches_string_in_any_order but still test cases are not passing as we were using "," to separate the query but now we are not. How should i proceed? |
7091a57 to
9628bf5
Compare
|
@alya Sorry for the delay — It took me some extra time making sure all test cases pass cleanly along with the improvements. |
Instead of applying a single matching strategy to the raw query,the search logic now categorizes queries by type-single word ,mutiple word or abbreviation improving the accuracy of topic search.
Query words are now separated using spaces instead of commas. Tests have been updated accordingly to reflect this change.
The model (zerver/models/navigation_view.py) defines the "name" property as nullable, while the schema doesn't.
Previously, the /digest developer tool rendered emails using standard CSS classes. This differed from production behavior, where the email system uses the css_inline library to convert these classes into inline styles. This commit updates the digest_page view to use zerver.lib.send_email.get_inliner_instance(). It renders the email content separately before inlining to avoid processing the full page wrapper, which ensures the page title and head elements remain unaffected. Fixes zulip#36800
This currently skips PRs which don't backport cleanly.
Renames `all_messages` function in `MessageListData` to `all_messages_after_mute_filtering` to make it clear that the function returns non-muted messages.
This is required so that the base message can be changed based on different requirements.
If the div in question is occupying the whole row, the tooltip message looks weirdly placed, with the tooltip not centered around the text but instead of the div which can have plenty of empty space. While this problem does not occur on any instances where the tooltip_message is currently, it would be good to change the width of settings-checkbox-wrapper to fit-content so that we don't have the empty space problem. We also remove the fit-content rule enforced via control-label-disabled since it's now redundant.
In organisations with owner_full_content_access set as True, there is no point in letting the individual users toggle `Let administrators export my private data`.
The INTEGRATIONS dict has recently been split into multiple lists.
This check was not necessary. Signed-off-by: apoorvapendse <[email protected]>
This ignores the resolved topic prefix while sorting to match the existing composebox typeahead behavior. Signed-off-by: apoorvapendse <[email protected]>
We search from all the subscribed channels if there is no channel operator. While listing the suggestions, priority is given to topics that are present in the currently narrowed channel. Fixes: zulip#34557. Co-authored-by: Aman Vishwakarma <[email protected]> Signed-off-by: apoorvapendse <[email protected]>
Previously, find_first_unread_anchor used to call get_base_query_for_search unconditionally since we wanted to set need_user_message to True and assumed that since we are just fetching the query, there should be no extra calls to doing that. But if need_user_message is True, we call get_recursive_membership_groups, which is one query. If need_user_message was already set to True, this is a wasteful DB call. So this commit changes find_first_unread_anchor to only rebuild the query in case of need_user_message being false. The ideal thing would be to just have the CTE in the query being returned by get_base_query_for_search. But get_recursive_membership_groups uses a Django CTE that cannot be reused in get_base_query_for_search since it uses SQLAlchemy. We can replicate the logic being done by get_recursive_membership_groups for our case, but it is not worth it to maintain another copy of get_recursive_membership_groups just to save 1 query count.
We moved the channel search out of the scrollable area, so we don't need to account for it.
Since we were trying to make the expanded channel visible instead of just the channel name, this results in the narrowed channel being moved out of view. Fixed by scrolling to the channel name.
We were always scrolling to focus channel even if topic was selected. Fixed by checking if a topic is selected and scrolling to topic in that case.
This commit updates the code in the webapp to use the `can_create_topic_group` setting to validate the `history_public_to_subscribers` setting when creating a new stream or updating a stream's configuration.
The previous implementation was too destructive in a hard to control way, by just allowing CASCADE on foreign keys to delete all related objects, while doing `.delete()` on the `UserProfile`. This caused bugs such as zulip#34803. Instead of doing that, and needing a hacky dance of re-assigning the objects we wanted to preserve to a temporary dummy `UserProfile`, we can avoid `.delete()`-ing the original `UserProfile` at all. Instead, we can simply overwrite the relevant fields, and `.delete()` the specific related objects that we want in a controlled way. Additionally, this allows us to unify the `do_delete_user` and `do_delete_user_preserving_messages` functions to share the same core logic.
We will be introducing additional commits to flag browsers we won't provide support for, but are exactly in the same category as banned browsers like Internet Explorer.
Remove old Twitter quotes from /for/business.
This fixes several code quality issues: - Asking for the peer_data subscriptions for our own user ID isn't a good way to get our own subscriptions, we have non-async functions that get this immediately. - We don't need to fetch subscription objects for the other channels. - More variables/loops than were necessary. - Fixes the confusing string type of the channel_id variable. Only the first issue was a functional one, in that it made the new code conflict with the peer_data changes in zulip#35864 completely unnecessarily.
8b56d6d to
43cef02
Compare
|
Hello @Pritesh-30, it seems like you have referenced #35160 in your pull request description, but you have not referenced them in your commit message description(s). Referencing an issue in a commit message automatically closes the corresponding issue when the commit is merged, which makes the issue tracker easier to manage. Please run An example of a correctly-formatted commit: To learn how to write a great commit message, please refer to our guide. |
I have changed the previously used util.filter_by_word_prefix_match to typeahead.query_matches_string_in_any_order by which now we can search with multiple prefix without any order.
Fixes #35160.
I have only improved the topic search .
How changes were tested:
Manually tested the updated topic search code in my local development environment. Tried multiple multi-word queries in different orders to ensure topics are matched correctly . I have checked that my changes do not affect any other filter logic.
Screenshots and screen captures:
Previously, to search for multi-word topics like
API feature levels rebasingfull words or ordered substrings like "api" or "feature" was required . Now, topic search supports matching shorter substrings in any word and any order. For example:fe leora p l rwill correctly matchAPI feature levels rebasing ideaSelf-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: