right sidebar: Remove "GROUP PMs" section.

We remove the "GROUP PMs" section that used
to be in the lower right sidebar.

Most of this is straightforward code removal.

A couple quick notes:

    - The message fetching code now just
      calls `huddle_data.process_loaded_messages`,
      which we still need for search suggestions.
      We removed `activity.process_loaded_messages`.

    - The `huddle_data.process_loaded_messages`
      function no longer needs to return `need_resize`.

    - In `resize.js` we now just calculate
      `res.buddy_list_wrapper_max_height` directly
      from `usable_height`.
This commit is contained in:
Steve Howell 2020-05-26 11:58:18 +00:00 committed by Tim Abbott
parent 9f5725d265
commit 43e5b2d28b
16 changed files with 26 additions and 356 deletions

View File

@ -132,9 +132,6 @@ people.add_active_user(zoe);
people.add_active_user(me); people.add_active_user(me);
people.initialize_current_user(me.user_id); people.initialize_current_user(me.user_id);
const real_update_huddles = activity.update_huddles;
activity.update_huddles = () => {};
const presence_info = new Map(); const presence_info = new Map();
presence_info.set(alice.user_id, { status: 'inactive' }); presence_info.set(alice.user_id, { status: 'inactive' });
presence_info.set(fred.user_id, { status: 'active' }); presence_info.set(fred.user_id, { status: 'active' });
@ -176,7 +173,8 @@ run_test('sort_users', () => {
]); ]);
}); });
run_test('process_loaded_messages', () => { run_test('huddle_data.process_loaded_messages', () => {
// TODO: move this to a module for just testing `huddle_data`
const huddle1 = 'jill@zulip.com,norbert@zulip.com'; const huddle1 = 'jill@zulip.com,norbert@zulip.com';
const timestamp1 = 1382479029; // older const timestamp1 = 1382479029; // older
@ -211,56 +209,13 @@ run_test('process_loaded_messages', () => {
}, },
]; ];
activity.process_loaded_messages(messages); huddle_data.process_loaded_messages(messages);
const user_ids_string1 = people.emails_strings_to_user_ids_string(huddle1); const user_ids_string1 = people.emails_strings_to_user_ids_string(huddle1);
const user_ids_string2 = people.emails_strings_to_user_ids_string(huddle2); const user_ids_string2 = people.emails_strings_to_user_ids_string(huddle2);
assert.deepEqual(huddle_data.get_huddles(), [user_ids_string2, user_ids_string1]); assert.deepEqual(huddle_data.get_huddles(), [user_ids_string2, user_ids_string1]);
}); });
run_test('full_huddle_name', () => {
function full_name(emails_string) {
const user_ids_string = people.emails_strings_to_user_ids_string(emails_string);
return activity.full_huddle_name(user_ids_string);
}
assert.equal(
full_name('alice@zulip.com,jill@zulip.com'),
'Alice Smith, Jill Hill');
assert.equal(
full_name('alice@zulip.com,fred@zulip.com,jill@zulip.com'),
'Alice Smith, Fred Flintstone, Jill Hill');
});
run_test('short_huddle_name', () => {
function short_name(emails_string) {
const user_ids_string = people.emails_strings_to_user_ids_string(emails_string);
return activity.short_huddle_name(user_ids_string);
}
assert.equal(
short_name('alice@zulip.com'),
'Alice Smith');
assert.equal(
short_name('alice@zulip.com,jill@zulip.com'),
'Alice Smith, Jill Hill');
assert.equal(
short_name('alice@zulip.com,fred@zulip.com,jill@zulip.com'),
'Alice Smith, Fred Flintstone, Jill Hill');
assert.equal(
short_name('alice@zulip.com,fred@zulip.com,jill@zulip.com,mark@zulip.com'),
'Alice Smith, Fred Flintstone, Jill Hill, + 1 other');
assert.equal(
short_name('alice@zulip.com,fred@zulip.com,jill@zulip.com,mark@zulip.com,norbert@zulip.com'),
'Alice Smith, Fred Flintstone, Jill Hill, + 2 others');
});
presence.presence_info = new Map(); presence.presence_info = new Map();
presence.presence_info.set(alice.user_id, { status: activity.IDLE }); presence.presence_info.set(alice.user_id, { status: activity.IDLE });
presence.presence_info.set(fred.user_id, { status: activity.ACTIVE }); presence.presence_info.set(fred.user_id, { status: activity.ACTIVE });
@ -354,31 +309,6 @@ run_test('PM_update_dom_counts', () => {
assert.equal(value.text(), ''); assert.equal(value.text(), '');
}); });
run_test('group_update_dom_counts', () => {
const value = $.create('alice-fred-value');
const count = $.create('alice-fred-count');
const pm_key = alice.user_id.toString() + "," + fred.user_id.toString();
const li_selector = "li.group-pms-sidebar-entry[data-user-ids='" + pm_key + "']";
const li = $(li_selector);
count.set_find_results('.value', value);
li.set_find_results('.count', count);
count.set_parent(li);
const counts = new Map();
counts.set(pm_key, 5);
li.addClass('group-pms-sidebar-entry');
activity.update_dom_with_unread_counts({pm_count: counts});
assert(li.hasClass('group-with-count'));
assert.equal(value.text(), "5");
counts.set(pm_key, 0);
activity.update_dom_with_unread_counts({pm_count: counts});
assert(!li.hasClass('group-with-count'));
assert.equal(value.text(), '');
});
run_test('handlers', () => { run_test('handlers', () => {
// This is kind of weak coverage; we are mostly making sure that // This is kind of weak coverage; we are mostly making sure that
// keys and clicks got mapped to functions that don't crash. // keys and clicks got mapped to functions that don't crash.
@ -652,8 +582,6 @@ run_test('realm_presence_disabled', () => {
activity.redraw_user(); activity.redraw_user();
activity.build_user_sidebar(); activity.build_user_sidebar();
real_update_huddles();
}); });
run_test('clear_search', () => { run_test('clear_search', () => {
@ -706,34 +634,11 @@ run_test('searching', () => {
assert.equal(activity.searching(), false); assert.equal(activity.searching(), false);
}); });
run_test('update_huddles_and_redraw', () => {
const value = $.create('alice-fred-value');
const count = $.create('alice-fred-count');
const pm_key = alice.user_id.toString() + "," + fred.user_id.toString();
const li_selector = "li.group-pms-sidebar-entry[data-user-ids='" + pm_key + "']";
const li = $(li_selector);
count.set_find_results('.value', value);
li.set_find_results('.count', count);
count.set_parent(li);
const real_get_huddles = huddle_data.get_huddles;
huddle_data.get_huddles = () => ['1,2'];
activity.update_huddles = real_update_huddles;
activity.redraw();
assert.equal($('#group-pm-list').hasClass('show'), false);
page_params.realm_presence_disabled = false;
activity.redraw();
assert.equal($('#group-pm-list').hasClass('show'), true);
huddle_data.get_huddles = () => [];
activity.redraw();
assert.equal($('#group-pm-list').hasClass('show'), false);
huddle_data.get_huddles = real_get_huddles;
activity.update_huddles = function () {};
});
reset_setup(); reset_setup();
run_test('update_presence_info', () => { run_test('update_presence_info', () => {
page_params.realm_presence_disabled = false;
const server_time = 500; const server_time = 500;
const info = { const info = {
website: { website: {

View File

@ -416,7 +416,7 @@ run_test('insert_message', () => {
assert.equal(message_store.get(new_message.id), undefined); assert.equal(message_store.get(new_message.id), undefined);
helper.redirect('activity', 'process_loaded_messages'); helper.redirect('huddle_data', 'process_loaded_messages');
helper.redirect('message_util', 'add_new_messages'); helper.redirect('message_util', 'add_new_messages');
helper.redirect('notifications', 'received_messages'); helper.redirect('notifications', 'received_messages');
helper.redirect('resize', 'resize_page_components'); helper.redirect('resize', 'resize_page_components');
@ -433,9 +433,9 @@ run_test('insert_message', () => {
// the code invokes various objects when a new message // the code invokes various objects when a new message
// comes in: // comes in:
assert.deepEqual(helper.events, [ assert.deepEqual(helper.events, [
'huddle_data.process_loaded_messages',
'message_util.add_new_messages', 'message_util.add_new_messages',
'message_util.add_new_messages', 'message_util.add_new_messages',
'activity.process_loaded_messages',
'unread_ui.update_unread_counts', 'unread_ui.update_unread_counts',
'resize.resize_page_components', 'resize.resize_page_components',
'unread_ops.process_visible', 'unread_ops.process_visible',

View File

@ -1,6 +1,3 @@
const render_group_pms = require('../templates/group_pms.hbs');
const huddle_data = require("./huddle_data");
/* /*
Helpers for detecting user activity and managing user idle states Helpers for detecting user activity and managing user idle states
*/ */
@ -42,43 +39,18 @@ function update_pm_count_in_dom(count_span, value_span, count) {
value_span.text(count); value_span.text(count);
} }
function update_group_count_in_dom(count_span, value_span, count) {
const li = count_span.parent();
if (count === 0) {
count_span.hide();
li.removeClass("group-with-count");
value_span.text('');
return;
}
count_span.show();
li.addClass("group-with-count");
value_span.text(count);
}
function get_pm_list_item(user_id) { function get_pm_list_item(user_id) {
return buddy_list.find_li({ return buddy_list.find_li({
key: user_id, key: user_id,
}); });
} }
function get_group_list_item(user_ids_string) {
return $("li.group-pms-sidebar-entry[data-user-ids='" + user_ids_string + "']");
}
function set_pm_count(user_ids_string, count) { function set_pm_count(user_ids_string, count) {
const count_span = get_pm_list_item(user_ids_string).find('.count'); const count_span = get_pm_list_item(user_ids_string).find('.count');
const value_span = count_span.find('.value'); const value_span = count_span.find('.value');
update_pm_count_in_dom(count_span, value_span, count); update_pm_count_in_dom(count_span, value_span, count);
} }
function set_group_count(user_ids_string, count) {
const count_span = get_group_list_item(user_ids_string).find('.count');
const value_span = count_span.find('.value');
update_group_count_in_dom(count_span, value_span, count);
}
exports.update_dom_with_unread_counts = function (counts) { exports.update_dom_with_unread_counts = function (counts) {
// counts is just a data object that gets calculated elsewhere // counts is just a data object that gets calculated elsewhere
// Our job is to update some DOM elements. // Our job is to update some DOM elements.
@ -88,59 +60,10 @@ exports.update_dom_with_unread_counts = function (counts) {
const is_pm = !user_ids_string.includes(','); const is_pm = !user_ids_string.includes(',');
if (is_pm) { if (is_pm) {
set_pm_count(user_ids_string, count); set_pm_count(user_ids_string, count);
} else {
set_group_count(user_ids_string, count);
} }
} }
}; };
exports.process_loaded_messages = function (messages) {
const need_resize = huddle_data.process_loaded_messages(messages);
exports.update_huddles();
if (need_resize) {
resize.resize_page_components(); // big hammer
}
};
function huddle_split(huddle) {
return huddle.split(',').map(s => parseInt(s, 10));
}
exports.full_huddle_name = function (huddle) {
const user_ids = huddle_split(huddle);
const names = user_ids.map(user_id => {
const person = people.get_by_user_id(user_id);
return person.full_name;
});
return names.join(', ');
};
exports.short_huddle_name = function (huddle) {
const user_ids = huddle_split(huddle);
const num_to_show = 3;
let names = user_ids.map(user_id => {
const person = people.get_by_user_id(user_id);
return person.full_name;
});
names = _.sortBy(names, function (name) { return name.toLowerCase(); });
names = names.slice(0, num_to_show);
const others = user_ids.length - num_to_show;
if (others === 1) {
names.push("+ 1 other");
} else if (others >= 2) {
names.push("+ " + others + " others");
}
return names.join(', ');
};
function mark_client_idle() { function mark_client_idle() {
// When we become idle, we don't immediately send anything to the // When we become idle, we don't immediately send anything to the
// server; instead, we wait for our next periodic update, since // server; instead, we wait for our next periodic update, since
@ -186,8 +109,6 @@ exports.build_user_sidebar = function () {
}); });
finish(); finish();
resize.resize_page_components();
return user_ids; // for testing return user_ids; // for testing
}; };
@ -201,45 +122,6 @@ function do_update_users_for_search() {
const update_users_for_search = _.throttle(do_update_users_for_search, 50); const update_users_for_search = _.throttle(do_update_users_for_search, 50);
function show_huddles() {
$('#group-pm-list').addClass("show");
}
function hide_huddles() {
$('#group-pm-list').removeClass("show");
}
exports.update_huddles = function () {
if (page_params.realm_presence_disabled) {
return;
}
const huddles = huddle_data.get_huddles().slice(0, 10);
if (huddles.length === 0) {
hide_huddles();
return;
}
const group_pms = huddles.map(huddle => ({
user_ids_string: huddle,
name: exports.full_huddle_name(huddle),
href: hash_util.huddle_with_uri(huddle),
fraction_present: buddy_data.huddle_fraction_present(huddle),
short_name: exports.short_huddle_name(huddle),
}));
const html = render_group_pms({group_pms: group_pms});
ui.get_content_element($('#group-pms')).html(html);
for (const user_ids_string of huddles) {
const count = unread.num_unread_for_person(user_ids_string);
set_group_count(user_ids_string, count);
}
show_huddles();
};
exports.compute_active_status = function () { exports.compute_active_status = function () {
// The overall algorithm intent for the `status` field is to send // The overall algorithm intent for the `status` field is to send
// `ACTIVE` (aka green circle) if we know the user is at their // `ACTIVE` (aka green circle) if we know the user is at their
@ -333,7 +215,6 @@ exports.initialize = function () {
exports.set_cursor_and_filter(); exports.set_cursor_and_filter();
exports.build_user_sidebar(); exports.build_user_sidebar();
exports.update_huddles();
buddy_list.start_scroll_handler(); buddy_list.start_scroll_handler();
@ -351,7 +232,6 @@ exports.initialize = function () {
exports.update_presence_info = function (user_id, info, server_time) { exports.update_presence_info = function (user_id, info, server_time) {
presence.update_info_from_event(user_id, info, server_time); presence.update_info_from_event(user_id, info, server_time);
exports.redraw_user(user_id); exports.redraw_user(user_id);
exports.update_huddles();
pm_list.update_private_messages(); pm_list.update_private_messages();
}; };
@ -370,7 +250,6 @@ exports.on_revoke_away = function (user_id) {
exports.redraw = function () { exports.redraw = function () {
exports.build_user_sidebar(); exports.build_user_sidebar();
exports.user_cursor.redraw(); exports.user_cursor.redraw();
exports.update_huddles();
pm_list.update_private_messages(); pm_list.update_private_messages();
}; };

View File

@ -413,16 +413,6 @@ exports.initialize = function () {
$(".tooltip").remove(); $(".tooltip").remove();
}); });
$('#group-pms').expectOne().on('click', '.selectable_sidebar_block', function (e) {
const user_ids_string = $(e.target).parents('li').attr('data-user-ids');
const emails = people.user_ids_string_to_emails_string(user_ids_string);
narrow.by('pm-with', emails, {trigger: 'sidebar'});
e.preventDefault();
e.stopPropagation();
popovers.hide_all();
$(".tooltip").remove();
});
function do_render_buddy_list_tooltip(elem, title_data) { function do_render_buddy_list_tooltip(elem, title_data) {
elem.tooltip({ elem.tooltip({
template: render_buddy_list_tooltip(), template: render_buddy_list_tooltip(),
@ -454,7 +444,7 @@ exports.initialize = function () {
}); });
// PM LIST TOOLTIPS // PM LIST TOOLTIPS
$("body").on('mouseenter', '#pm_user_status, #group_pms_right_sidebar', function (e) { $("body").on('mouseenter', '#pm_user_status', function (e) {
$(".tooltip").remove(); $(".tooltip").remove();
e.stopPropagation(); e.stopPropagation();
const elem = $(e.currentTarget); const elem = $(e.currentTarget);
@ -466,7 +456,7 @@ exports.initialize = function () {
do_render_buddy_list_tooltip(elem, title_data); do_render_buddy_list_tooltip(elem, title_data);
}); });
$("body").on('mouseleave', '#pm_user_status, #group_pms_right_sidebar', function (e) { $("body").on('mouseleave', '#pm_user_status', function (e) {
e.stopPropagation(); e.stopPropagation();
$(e.currentTarget).tooltip('destroy'); $(e.currentTarget).tooltip('destroy');
}); });
@ -496,7 +486,7 @@ exports.initialize = function () {
// MISC // MISC
(function () { (function () {
const sel = ["#group-pm-list", "#stream_filters", "#global_filters", "#user_presences"].join(", "); const sel = ["#stream_filters", "#global_filters", "#user_presences"].join(", ");
$(sel).on("click", "a", function () { $(sel).on("click", "a", function () {
this.blur(); this.blur();

View File

@ -1,8 +1,6 @@
const huddle_timestamps = new Map(); const huddle_timestamps = new Map();
exports.process_loaded_messages = function (messages) { exports.process_loaded_messages = function (messages) {
let need_resize = false;
for (const message of messages) { for (const message of messages) {
const huddle_string = people.huddle_string(message); const huddle_string = people.huddle_string(message);
@ -11,12 +9,9 @@ exports.process_loaded_messages = function (messages) {
if (!old_timestamp || old_timestamp < message.timestamp) { if (!old_timestamp || old_timestamp < message.timestamp) {
huddle_timestamps.set(huddle_string, message.timestamp); huddle_timestamps.set(huddle_string, message.timestamp);
need_resize = true;
} }
} }
} }
return need_resize;
}; };
exports.get_huddles = function () { exports.get_huddles = function () {

View File

@ -1,4 +1,4 @@
const list_selectors = ["#group-pm-list", "#stream_filters", "#global_filters", "#user_presences"]; const list_selectors = ["#stream_filters", "#global_filters", "#user_presences"];
exports.inside_list = function (e) { exports.inside_list = function (e) {
const $target = $(e.target); const $target = $(e.target);

View File

@ -1,4 +1,6 @@
const util = require("./util"); const util = require("./util");
const huddle_data = require("./huddle_data");
function maybe_add_narrowed_messages(messages, msg_list) { function maybe_add_narrowed_messages(messages, msg_list) {
const ids = []; const ids = [];
@ -58,6 +60,7 @@ exports.insert_new_messages = function insert_new_messages(messages, sent_by_thi
messages = messages.map(message_store.add_message_metadata); messages = messages.map(message_store.add_message_metadata);
unread.process_loaded_messages(messages); unread.process_loaded_messages(messages);
huddle_data.process_loaded_messages(messages);
// message_list.all is a data-only list that we use to populate // message_list.all is a data-only list that we use to populate
// other lists, so we always update this // other lists, so we always update this
@ -90,8 +93,6 @@ exports.insert_new_messages = function insert_new_messages(messages, sent_by_thi
notifications.notify_local_mixes(messages, need_user_to_scroll); notifications.notify_local_mixes(messages, need_user_to_scroll);
} }
activity.process_loaded_messages(messages);
unread_ui.update_unread_counts(); unread_ui.update_unread_counts();
resize.resize_page_components(); resize.resize_page_components();

View File

@ -1,3 +1,5 @@
const huddle_data = require("./huddle_data");
const consts = { const consts = {
backfill_idle_time: 10 * 1000, backfill_idle_time: 10 * 1000,
error_retry_time: 5000, error_retry_time: 5000,
@ -46,7 +48,7 @@ function process_result(data, opts) {
message_util.add_old_messages(messages, opts.msg_list); message_util.add_old_messages(messages, opts.msg_list);
} }
activity.process_loaded_messages(messages); huddle_data.process_loaded_messages(messages);
stream_list.update_streams_sidebar(); stream_list.update_streams_sidebar();
pm_list.update_private_messages(); pm_list.update_private_messages();
recent_topics.process_messages(messages); recent_topics.process_messages(messages);

View File

@ -27,25 +27,6 @@ function size_blocks(blocks, usable_height) {
} }
} }
function set_user_list_heights(res, usable_height, buddy_list_wrapper, group_pms) {
// Calculate these heights:
// res.buddy_list_wrapper_max_height
// res.group_pms_max_height
const blocks = [
{
real_height: ui.get_scroll_element(buddy_list_wrapper).prop('scrollHeight'),
},
{
real_height: ui.get_scroll_element(group_pms).prop('scrollHeight'),
},
];
size_blocks(blocks, usable_height);
res.buddy_list_wrapper_max_height = blocks[0].max_height;
res.group_pms_max_height = blocks[1].max_height;
}
function get_new_heights() { function get_new_heights() {
const res = {}; const res = {};
const viewport_height = message_viewport.height(); const viewport_height = message_viewport.height();
@ -67,8 +48,6 @@ function get_new_heights() {
res.stream_filters_max_height = Math.max(80, res.stream_filters_max_height); res.stream_filters_max_height = Math.max(80, res.stream_filters_max_height);
// RIGHT SIDEBAR // RIGHT SIDEBAR
const buddy_list_wrapper = $('#buddy_list_wrapper').expectOne();
const group_pms = $('#group-pms').expectOne();
// Calculate our top offset, which should typically be 50px, // Calculate our top offset, which should typically be 50px,
// even though we sometimes split that as 40px of margin // even though we sometimes split that as 40px of margin
@ -92,20 +71,9 @@ function get_new_heights() {
- $("#userlist-header").safeOuterHeight(true) - $("#userlist-header").safeOuterHeight(true)
- $("#user_search_section").safeOuterHeight(true) - $("#user_search_section").safeOuterHeight(true)
- invite_user_link_height - invite_user_link_height
- parseInt(group_pms.css("marginTop"), 10)
- parseInt(group_pms.css("marginBottom"), 10)
- $("#group-pm-header").safeOuterHeight(true)
- $("#sidebar-keyboard-shortcuts").safeOuterHeight(true); - $("#sidebar-keyboard-shortcuts").safeOuterHeight(true);
// set these res.buddy_list_wrapper_max_height = Math.max(80, usable_height);
// res.buddy_list_wrapper_max_height
// res.group_pms_max_height
set_user_list_heights(
res,
usable_height,
buddy_list_wrapper,
group_pms
);
return res; return res;
} }
@ -154,7 +122,6 @@ function left_userlist_get_new_heights() {
res.stream_filters_max_height = blocks[0].max_height; res.stream_filters_max_height = blocks[0].max_height;
res.buddy_list_wrapper_max_height = blocks[1].max_height; res.buddy_list_wrapper_max_height = blocks[1].max_height;
res.group_pms_max_height = 0;
return res; return res;
} }
@ -246,8 +213,6 @@ exports.resize_sidebars = function () {
const h = narrow_window ? left_userlist_get_new_heights() : get_new_heights(); const h = narrow_window ? left_userlist_get_new_heights() : get_new_heights();
$("#buddy_list_wrapper").css('max-height', h.buddy_list_wrapper_max_height); $("#buddy_list_wrapper").css('max-height', h.buddy_list_wrapper_max_height);
$("#group-pms").css('max-height', h.group_pms_max_height);
$("#stream-filters-container").css('max-height', h.stream_filters_max_height); $("#stream-filters-container").css('max-height', h.stream_filters_max_height);
return h; return h;

View File

@ -292,7 +292,6 @@ exports.initialize_kitchen_sink_stuff = function () {
if (page_params.realm_presence_disabled) { if (page_params.realm_presence_disabled) {
$("#user-list").hide(); $("#user-list").hide();
$("#group-pm-list").hide();
} }
}; };

View File

@ -9,12 +9,7 @@ $left_col_size: 19px;
$topic_indent: calc($far_left_gutter_size + $left_col_size + 4px); $topic_indent: calc($far_left_gutter_size + $left_col_size + 4px);
#left-sidebar { #left-sidebar {
#group-pm-list { #user-list {
display: none;
}
#user-list,
#group-pm-list {
padding-left: 10px; padding-left: 10px;
} }
} }

View File

@ -375,7 +375,6 @@ on a dark background, and don't change the dark labels dark either. */
.top_left_row:hover, .top_left_row:hover,
.bottom_left_row:hover, .bottom_left_row:hover,
#stream_filters li.highlighted_stream, #stream_filters li.highlighted_stream,
#group-pms li:hover,
#user_presences li:hover, #user_presences li:hover,
#user_presences li.highlighted_user { #user_presences li.highlighted_user {
background-color: hsla(136, 25%, 73%, 0.2); background-color: hsla(136, 25%, 73%, 0.2);

View File

@ -6,21 +6,18 @@
text-decoration: none; text-decoration: none;
} }
#group-pms li:hover,
#user_presences li:hover, #user_presences li:hover,
#user_presences li.highlighted_user { #user_presences li.highlighted_user {
background-color: hsl(93, 19%, 88%); background-color: hsl(93, 19%, 88%);
} }
#buddy_list_wrapper, #buddy_list_wrapper {
#group-pms {
position: relative; position: relative;
margin-left: 0; margin-left: 0;
overflow: auto; overflow: auto;
} }
#user_presences, #user_presences {
#group-pms {
list-style-position: inside; /* Draw the bullets inside our box */ list-style-position: inside; /* Draw the bullets inside our box */
} }
@ -63,8 +60,7 @@
} }
} }
#user_presences li, #user_presences li {
#group-pms li {
list-style-type: none; list-style-type: none;
border-radius: 4px; border-radius: 4px;
@ -72,13 +68,7 @@
padding-right: 15px; padding-right: 15px;
} }
#group-pm-title { #user_presences .user_circle {
margin: 10px 0px 0px 0px;
display: inline-block;
}
#user_presences .user_circle,
#group-pms .user_circle_fraction {
width: 8px; width: 8px;
height: 8px; height: 8px;
margin-top: 0px; margin-top: 0px;
@ -88,8 +78,7 @@
display: block; display: block;
} }
#user_presences a, #user_presences a {
#group-pms a {
color: inherit; color: inherit;
margin-left: 0px; margin-left: 0px;
} }
@ -100,12 +89,6 @@
margin-left: 5px; margin-left: 5px;
} }
.group-pms-sidebar-entry .selectable_sidebar_block {
display: flex;
width: 100%;
}
.group-pm-link,
.user-presence-link, .user-presence-link,
.user_sidebar_entry .selectable_sidebar_block { .user_sidebar_entry .selectable_sidebar_block {
overflow: hidden; overflow: hidden;
@ -126,24 +109,17 @@
opacity: 0.5; opacity: 0.5;
} }
.group-pm-link {
width: calc(100% - 60px);
display: inline-block;
}
.selectable_sidebar_block { .selectable_sidebar_block {
cursor: pointer; cursor: pointer;
} }
.group-pms-sidebar-entry,
.user_sidebar_entry { .user_sidebar_entry {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
} }
.user_sidebar_entry .count, .user_sidebar_entry .count {
.group-pms-sidebar-entry .count {
float: right; float: right;
padding: 0 4px; padding: 0 4px;
background-color: hsl(105, 2%, 50%); background-color: hsl(105, 2%, 50%);
@ -164,10 +140,6 @@
display: none; display: none;
} }
.group-pms-sidebar-entry .count {
margin-right: 16px;
}
.user_sidebar_entry.user-with-count .count { .user_sidebar_entry.user-with-count .count {
display: block; display: block;
} }
@ -193,16 +165,7 @@
padding-bottom: 9px; padding-bottom: 9px;
} }
#group-pm-list { #userlist-header {
display: none;
}
#group-pm-list.show {
display: block;
}
#userlist-header,
#group-pm-header {
margin-right: 10px; margin-right: 10px;
} }

View File

@ -1,14 +0,0 @@
{{! User Presence rows }}
{{#each group_pms}}
<li data-user-ids="{{user_ids_string}}" class="group-pms-sidebar-entry narrow-filter">
<div class="selectable_sidebar_block" id="group_pms_right_sidebar" data-user-ids-string="{{user_ids_string}}" data-is-group="true">
{{#if fraction_present}}
<span class="user_circle_fraction" style="background:hsla(106, 74%, 44%, {{fraction_present}});"></span>
{{else}}
<span class="user_circle_fraction" style="background:none; border-color:hsl(0, 0%, 50%);"></span>
{{/if}}
<a href="{{href}}" data-name="{{name}}" class="group-pm-link">{{short_name}}</a>
<span class="count"><span class="value"></span></span>
</div>
</li>
{{/each}}

View File

@ -16,13 +16,6 @@
<div id="buddy_list_wrapper_padding"></div> <div id="buddy_list_wrapper_padding"></div>
</div> </div>
</div> </div>
<div id="group-pm-list">
<div id="group-pm-header">
<h4 class='sidebar-title' id='group-pm-title'>{{ _('GROUP PMs') }}</h4>
</div>
<ul id="group-pms" class="filters scrolling_list" data-simplebar>
</ul>
</div>
{% if show_invites %} {% if show_invites %}
<a id="invite-user-link" href="#invite"><i class="fa fa-plus-circle" aria-hidden="true"></i>{{ _('Invite more users') }}</a> <a id="invite-user-link" href="#invite"><i class="fa fa-plus-circle" aria-hidden="true"></i>{{ _('Invite more users') }}</a>
{% endif %} {% endif %}

View File

@ -626,8 +626,6 @@ html_rules: List["Rule"] = whitespace_rules + prose_style_rules + [
'templates/zerver/app/markdown_help.html', 'templates/zerver/app/markdown_help.html',
# 5xx page doesn't have external CSS # 5xx page doesn't have external CSS
'static/html/5xx.html', 'static/html/5xx.html',
# Group PMs color is dynamically calculated
'static/templates/group_pms.hbs',
# exclude_pattern above handles color, but have other issues: # exclude_pattern above handles color, but have other issues:
'static/templates/draft.hbs', 'static/templates/draft.hbs',