From 92bcfe9f42df112e8732167f09ce843ecbf56a47 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Wed, 23 Apr 2025 11:40:30 +0530 Subject: [PATCH] message_view_header: Allow showing HTML as navbar title. This will be used show channel icon in title in the text "All topics in # channel". --- web/src/filter.ts | 6 ++++-- web/src/message_view_header.ts | 3 ++- web/templates/navbar_icon_and_title.hbs | 5 +++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web/src/filter.ts b/web/src/filter.ts index 80a921f87b..c6ba52c515 100644 --- a/web/src/filter.ts +++ b/web/src/filter.ts @@ -23,7 +23,8 @@ import * as user_topics from "./user_topics.ts"; import * as util from "./util.ts"; type IconData = { - title: string; + title?: string | undefined; + html_title?: string | undefined; is_spectator: boolean; } & ( | { @@ -1317,7 +1318,8 @@ export class Filter { } add_icon_data(context: { - title: string; + title?: string; + html_title?: string; description?: string | undefined; link?: string | undefined; is_spectator: boolean; diff --git a/web/src/message_view_header.ts b/web/src/message_view_header.ts index 1cf488abd5..3efb10bc69 100644 --- a/web/src/message_view_header.ts +++ b/web/src/message_view_header.ts @@ -18,7 +18,8 @@ import * as stream_data from "./stream_data.ts"; import type {StreamSubscription} from "./sub_store.ts"; type MessageViewHeaderContext = { - title: string; + title?: string | undefined; + html_title?: string | undefined; description?: string; link?: string; is_spectator?: boolean; diff --git a/web/templates/navbar_icon_and_title.hbs b/web/templates/navbar_icon_and_title.hbs index 3f1ba27085..632c2d709c 100644 --- a/web/templates/navbar_icon_and_title.hbs +++ b/web/templates/navbar_icon_and_title.hbs @@ -3,7 +3,12 @@ {{else if icon}} {{/if}} +{{#if title}} {{title}} +{{/if}} +{{#if html_title}} +{{{html_title}}} +{{/if}} {{#if stream}} {{#if stream.is_archived}}