Skip to content

Feat/autocomplete users - #1643

Draft
mubarak-mustopha wants to merge 4 commits into
zulip:mainfrom
mubarak-mustopha:feat/autocomplete_users
Draft

Feat/autocomplete users#1643
mubarak-mustopha wants to merge 4 commits into
zulip:mainfrom
mubarak-mustopha:feat/autocomplete_users

Conversation

@mubarak-mustopha

@mubarak-mustopha mubarak-mustopha commented May 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do, and why?

This PR fixes #1526.
What I added

  • It improves the autocomplete feature by prioritizing users in the current topic when using replying to a message.
  • It adds a new method get_user_ids_in_topic_narrow to Model

What's already included

  • Prioritizing users in the current stream: WriteBox._setup_common_stream_compose() sets the value of WriteBox.recipient_user_ids to the users in the current stream
  • Prioritizing real users over bot: Model._update_users_data_from_initial_data() orders user data by status which prioritizes humans over bots.
  • Prioritizing users which have recent DMs next

External discussion & connections

  • Discussed in #zulip-terminal in topic
  • Fully fixes #
  • Partially fixes issue #
  • Builds upon previous unmerged work in PR #
  • Is a follow-up to work in PR #
  • Requires merge of PR #
  • Merge will enable work on #

How did you test this?

  • Manually - Behavioral changes
  • Manually - Visual changes
  • Adapting existing automated tests
  • Adding automated tests for new behavior (or missing tests)
  • Existing automated tests should already cover this (only a refactor of tested code)

Self-review checklist for each commit

  • It is a minimal coherent idea
  • It has a commit summary following the documented style (title & body)
  • It has a commit summary describing the motivation and reasoning for the change
  • It individually passes linting and tests
  • It contains test additions for any new behavior
  • It flows clearly from a previous branch commit, and/or prepares for the next commit

Visual changes

Before

autocomplete_unfixed.webm
After

autocomplete_partial_fix.webm

@zulipbot zulipbot added the size: XL [Automatic label added by zulipbot] label May 3, 2026
This retrieves the sender ids of the messages in that topic excluding id
of the current user.
This sorts private_msg_ids by timestamp and retrives the
display_recipient_ids of the associated Message objects.
@mubarak-mustopha
mubarak-mustopha force-pushed the feat/autocomplete_users branch 2 times, most recently from a8ba347 to 88b211c Compare May 10, 2026 14:57
Fixes zulip#1526.
Prioritize users with recent DMs after users in current topic then
stream.
@mubarak-mustopha
mubarak-mustopha force-pushed the feat/autocomplete_users branch from 88b211c to 785d04b Compare May 10, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XL [Automatic label added by zulipbot]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review & improve ordering of autocomplete (users/mentions)

2 participants