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

fixed autocomplete for new topics is case-sensitive #13508

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

katisari
Copy link
Collaborator

#12725

Testing Plan:
Previously: When creating the same topic that already exists, the compose drop down menu will show two options:
"TOPIC", "topic"
when user tries to create a topic called "TOPIC" when "topic" name already exists in the database.

With the new changes to fix the issue, I tested by:

  1. Created a new topic "topic" in my local repository in stream "test".
  2. Tried to create new topic "TOPIC" in my local repository in stream "test".
  3. Now, when user types "TOPIC", he/she only sees one option because I made the feature case-insensitive.

Solution Details:
My solution to the issue was comparing strings of the user input topic box with the topics in topic list by converting them to all to lowercase versions. Javascript's indexOf() is case sensitive, so I manually create a lambda function to manually traverse through the topic list to make the composebox typeahead case-insensitive.

This is an important feature to have because if there are two options for the same topic name, it creates confusion for the user. The user might think they he/she is creating a new topic, but in reality, his/her message will be added on to an existing topic if the topic names are the same (since the back-end is case-insensitive).

Screen Shot 2019-12-10 at 5 14 42 PM

@katisari
Copy link
Collaborator Author

Feel free to leave a comment of the changes.

@vaibhavrajsingh2001
Copy link
Collaborator

@katisari try having a single commit that includes all changes.

@zulipbot
Copy link
Member

Heads up @katisari, we just merged some commits that conflict with the changes your 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/master 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.

None yet

3 participants