Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

topic_list_typeahead: Show realm_empty_topic_display_name for topic="".

Prakhar Pratyusha6ac4ed6bf7a
diff --git a/web/src/composebox_typeahead.ts b/web/src/composebox_typeahead.ts
index dd96900e329..2ba95c5d63a 100644
--- a/web/src/composebox_typeahead.ts
+++ b/web/src/composebox_typeahead.ts
@@ -1011,8 +1011,14 @@ export function content_highlighter_html(item: TypeaheadSuggestion): string | un
return typeahead_helper.render_typeahead_item({primary: item.language});
case "topic_jump":
return typeahead_helper.render_typeahead_item({primary: item.message});
- case "topic_list":
- return typeahead_helper.render_typeahead_item({primary: item.topic});
+ case "topic_list": {
+ const topic_display_name = util.get_final_topic_display_name(item.topic);
+ const is_empty_string_topic = item.topic === "";
+ return typeahead_helper.render_typeahead_item({
+ primary: topic_display_name,
+ is_empty_string_topic,
+ });
+ }
case "time_jump":
return typeahead_helper.render_typeahead_item({primary: item.message});
default:
diff --git a/web/src/typeahead_helper.ts b/web/src/typeahead_helper.ts
index 4a53b7b6fd5..00e769e8fcc 100644
--- a/web/src/typeahead_helper.ts
+++ b/web/src/typeahead_helper.ts
@@ -104,6 +104,7 @@ export let render_typeahead_item = (args: {
is_user_group?: boolean;
stream?: StreamData;
emoji_code?: string | undefined;
+ is_empty_string_topic?: boolean;
}): string => {
const has_image = args.img_src !== undefined;
const has_status = args.status_emoji_info !== undefined;
diff --git a/web/templates/typeahead_list_item.hbs b/web/templates/typeahead_list_item.hbs
index a3d5c4d23a4..e3b3d48b446 100644
--- a/web/templates/typeahead_list_item.hbs
+++ b/web/templates/typeahead_list_item.hbs
@@ -18,7 +18,7 @@
{{/if}}
{{!-- Separate container to ensure overflowing text remains in this container. --}}
<div class="typeahead-text-container{{#if has_secondary_html}} has_secondary_html{{/if}}">
- <strong class="typeahead-strong-section">
+ <strong class="typeahead-strong-section{{#if is_empty_string_topic}} empty-topic-display{{/if}}">
{{~#if stream~}}
{{~> inline_decorated_stream_name stream=stream ~}}
{{~else~}}