diff --git a/web/src/left_sidebar_navigation_area.ts b/web/src/left_sidebar_navigation_area.ts index 99863eeddd..c784b9fcf6 100644 --- a/web/src/left_sidebar_navigation_area.ts +++ b/web/src/left_sidebar_navigation_area.ts @@ -130,6 +130,12 @@ export function handle_narrow_activated(filter: Filter): void { function toggle_condensed_navigation_area(): void { const $views_label_container = $("#views-label-container"); const $views_label_icon = $("#toggle-top-left-navigation-area-icon"); + + if (page_params.is_spectator) { + // We don't support collapsing VIEWS for spectators, so exit early. + return; + } + if ($views_label_container.hasClass("showing-expanded-navigation")) { // Toggle into the condensed state $views_label_container.addClass("showing-condensed-navigation"); diff --git a/web/src/sidebar_ui.ts b/web/src/sidebar_ui.ts index 1dbda94899..dc9bdc0099 100644 --- a/web/src/sidebar_ui.ts +++ b/web/src/sidebar_ui.ts @@ -219,6 +219,7 @@ export function initialize_left_sidebar(): void { is_recent_view_home_view: user_settings.web_home_view === settings_config.web_home_view_values.recent_topics.code, hide_unread_counts: settings_data.should_mask_unread_count(false), + is_spectator: page_params.is_spectator, }); $("#left-sidebar-container").html(rendered_sidebar); diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css index 405f6a3270..a18c5e61bf 100644 --- a/web/styles/left_sidebar.css +++ b/web/styles/left_sidebar.css @@ -812,6 +812,11 @@ li.top_left_scheduled_messages { } } + /* Remove the cursor: pointer property of Views label for the spectators. */ + &.remove-pointer-for-spectator { + cursor: default; + } + #toggle-top-left-navigation-area-icon { grid-area: starting-anchor-element; } diff --git a/web/templates/left_sidebar.hbs b/web/templates/left_sidebar.hbs index 0c3db48bae..bb57174e68 100644 --- a/web/templates/left_sidebar.hbs +++ b/web/templates/left_sidebar.hbs @@ -1,7 +1,7 @@