Skip to content

Conversation

@Pritesh-30
Copy link
Collaborator

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 rebasing full 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 le or a p l r will correctly match API feature levels rebasing idea
  • Users no longer need to type full prefixes or the exact order of words
  • If prefix of any one word is rong than it will not match
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.

@alya alya added the not ready Needs work to be ready for maintainer review. label Dec 9, 2025
@alya
Copy link
Contributor

alya commented Dec 9, 2025

Thanks! The next step is for this PR to pass tests.

@Pritesh-30
Copy link
Collaborator Author

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

@alya
Copy link
Contributor

alya commented Dec 11, 2025

@Pritesh-30
Copy link
Collaborator Author

@alya Sorry for the delay — It took me some extra time making sure all test cases pass cleanly along with the improvements.
I’ve refined the topic search logic to better handle multiple prefixes and different query patterns while keeping existing behaviour and all tests are now passing.
It's now ready for review . Looking forward to your feedback.

Pritesh-30 and others added 16 commits December 14, 2025 11:38
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.
apoorvapendse and others added 23 commits December 14, 2025 11:38
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.
@Pritesh-30 Pritesh-30 force-pushed the topic-search-improvement branch from 8b56d6d to 43cef02 Compare December 14, 2025 11:39
@zulipbot zulipbot added size: XL and removed size: M labels Dec 14, 2025
@zulipbot
Copy link
Member

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 git commit --amend in your command line client to amend your commit message description with Fixes #35160..

An example of a correctly-formatted commit:

commit fabd5e450374c8dde65ec35f02140383940fe146
Author: zulipbot
Date:   Sat Mar 18 13:42:40 2017 -0700

    pull requests: Check PR commits reference when issue is referenced.

    Fixes #51.

To learn how to write a great commit message, please refer to our guide.

@Pritesh-30 Pritesh-30 closed this Dec 14, 2025
@Pritesh-30 Pritesh-30 deleted the topic-search-improvement branch December 14, 2025 11:45
@Pritesh-30
Copy link
Collaborator Author

@alya Sorry, I was trying to clean the commit history for review but accidently merged new commits from main branch and rebased and pushed it. so i am closing this PR and creating a new one.Sorry for the inconvinience. #37065

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

Labels

area: left sidebar (filters) not ready Needs work to be ready for maintainer review. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow start-of-word matches in left sidebar filters