-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Further clean up the topic list filtering typeahead logic. #35485
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
base: main
Are you sure you want to change the base?
Conversation
…d of search_pill. Fixes part of zulip#35284.
This commit adds the `data-syntax` attribute for `get_typeahead_search_term` to determine the appropriate filtering logic , rather than relying on plain text or strings. Additionally, this fix restores the use of the description label instead of the syntax when displaying the pills. Fixes part of zulip#35284.
2f82175
to
a0751b0
Compare
@zulipbot add "buddy review" |
Hey @alya, could you please take a look at it and let me know if the text on the pill now looks good to you? |
Will look into soon. |
@@ -1,4 +1,4 @@ | |||
<div class='pill {{#if deactivated}} deactivated-pill {{/if}}'{{#if user_id}}data-user-id="{{user_id}}"{{/if}}{{#if group_id}}data-user-group-id="{{group_id}}"{{/if}}{{#if stream_id}}data-stream-id="{{stream_id}}"{{/if}} tabindex=0> | |||
<div class='pill {{#if deactivated}} deactivated-pill {{/if}}'{{#if user_id}}data-user-id="{{user_id}}"{{/if}}{{#if group_id}}data-user-group-id="{{group_id}}"{{/if}}{{#if stream_id}}data-stream-id="{{stream_id}}"{{/if}}{{#if data_syntax}}data-syntax="{{data_syntax}}"{{/if}} tabindex=0> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we should be line-wrapping this so each if/else clause for data
fields is on its own line.
@@ -484,8 +484,11 @@ export function get_left_sidebar_topic_search_term(): string { | |||
|
|||
export function get_typeahead_search_term(): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function name should probably be get_typeahead_search_pills_syntax
or something.
This also seems very wrong as code if there's ever multiple pills. I guess that's not possible for now, but it's a code smell for sure.
This PR addresses several improvements related to how pills are implemented and displayed:
search_pill
with a minimal wrapper module (topic_filter_pill.ts
), similar to the approach used inweb/src/integration_branch_pill.ts
.get_typeahead_search_term
to usedata-syntax
attribute instead of relying on text/string matching to determine filtering logic.Fixes part of: #35284.
Screenshots and screen captures:
Self-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: