floating_recipient_bar: Replace with sticky header.

This commit is contained in:
Aman Agrawal
2022-12-19 08:16:05 +00:00
committed by Tim Abbott
parent 00be770d38
commit 4dfe3d36e0
18 changed files with 161 additions and 485 deletions

View File

@@ -18,7 +18,6 @@ import * as message_util from "./message_util";
import * as message_view_header from "./message_view_header";
import * as narrow from "./narrow";
import * as narrow_state from "./narrow_state";
import * as navbar_alerts from "./navbar_alerts";
import * as navigate from "./navigate";
import {page_params} from "./page_params";
import * as people from "./people";
@@ -45,7 +44,6 @@ import * as user_status from "./user_status";
import * as user_topics from "./user_topics";
let topics_widget;
let message_list_displayed_before;
// Sets the number of avatars to display.
// Rest of the avatars, if present, are displayed as {+x}
const MAX_AVATAR = 4;
@@ -854,7 +852,6 @@ export function show() {
$("#message_feed_container").hide();
$("#recent_topics_view").show();
set_visible(true);
$("#message_view_header_underpadding").hide();
$(".header").css("padding-bottom", "0px");
unread_ui.hide_mark_as_read_turned_off_banner();
@@ -888,7 +885,6 @@ export function hide() {
$focused_element.trigger("blur");
}
$("#message_view_header_underpadding").show();
$("#message_feed_container").show();
$("#recent_topics_view").hide();
set_visible(false);
@@ -901,17 +897,6 @@ export function hide() {
// before it completely re-rerenders.
message_view_header.render_title_area();
if (!message_list_displayed_before) {
// Hack: If the app is loaded directly to recent topics, then we
// need to arrange to call navbar_alerts.resize_app when we first
// visit a message list. This is a workaround for bugs where the
// floating recipient bar will be invisible (as well as other
// alignment issues) when they are initially rendered in the
// background because recent topics is displayed.
message_list_displayed_before = true;
navbar_alerts.resize_app();
}
// This makes sure user lands on the selected message
// and not always at the top of the narrow.
navigate.plan_scroll_to_selected();