topic list: Kill off "no more topics".

If you clicked for no more topics and then the server didn't find any,
we once had code that would say "No more topics" in light gray at the
bottom of the topic list.

The feature appears to have been broken by some detail in the
`self.dom` refactoring.  More importantly, it's not clear it's useful
as opposed to clutter.

Since we added the `stream.first_message_id` feature, it's now very
rare for the `more topics` option to appear when there aren't in fact
older topics that could be fetched.  In cases where there are not, the
UI is still clear about what's happening -- it shows a loading
indicator and then displays a list of topics that doesn't have
anything new.

So we're removing this feature; we can re-add it without too much
difficulty if user feedback in the future suggests it would be useful
after all.
This commit is contained in:
Steve Howell 2020-01-17 21:30:40 +00:00 committed by Tim Abbott
parent 613b8ade20
commit 1eab59d1b5
3 changed files with 2 additions and 59 deletions

View File

@ -283,15 +283,7 @@ exports.widget = function (parent_elem, my_stream_id) {
spinner.show();
};
self.show_no_more_topics = function () {
const elem = self.dom.find('.no-more-topics-found');
elem.show();
self.no_more_topics = true;
};
self.build = function (active_topic, no_more_topics) {
self.no_more_topics = false; // for now
self.build = function (active_topic) {
if (active_topic) {
active_topic = active_topic.toLowerCase();
}
@ -300,14 +292,6 @@ exports.widget = function (parent_elem, my_stream_id) {
self.dom = self.build_list();
parent_elem.append(self.dom);
// We often rebuild an entire topic list, and the
// caller will pass us in no_more_topics as true
// if we were showing "No more topics found" from
// the initial zooming.
if (no_more_topics) {
self.show_no_more_topics();
}
};
return self;
@ -334,31 +318,12 @@ exports.get_stream_li = function () {
return stream_li;
};
exports.need_to_show_no_more_topics = function (stream_id) {
// This function is important, and the use case here is kind of
// subtle. We do complete redraws of the topic list when new
// messages come in, and we don't want to overwrite the
// "no more topics" error message.
if (!zoomed) {
return false;
}
if (!active_widgets.has(stream_id)) {
return false;
}
const widget = active_widgets.get(stream_id);
return widget.no_more_topics;
};
exports.rebuild = function (stream_li, stream_id) {
const active_topic = narrow_state.topic();
const no_more_topics = exports.need_to_show_no_more_topics(stream_id);
exports.remove_expanded_topics();
const widget = exports.widget(stream_li, stream_id);
widget.build(active_topic, no_more_topics);
widget.build(active_topic);
active_widgets.set(stream_id, widget);
};
@ -376,8 +341,6 @@ exports.zoom_in = function () {
const active_widget = active_widgets.get(stream_id);
const before_count = active_widget.num_items();
function on_success() {
if (!active_widgets.has(stream_id)) {
blueslip.warn('User re-narrowed before topic history was returned.');
@ -396,12 +359,6 @@ exports.zoom_in = function () {
const widget = active_widgets.get(stream_id);
exports.rebuild(widget.get_parent(), stream_id);
const after_count = widget.num_items();
if (after_count === before_count) {
widget.show_no_more_topics();
}
}
ui.get_scroll_element($('#stream-filters-container')).scrollTop(0);

View File

@ -527,17 +527,6 @@ li.expanded_private_message a {
margin-left: 6px;
}
.no-more-topics-found {
opacity: 0.7;
font-style: italic;
margin: 2px 0px 0px 6px;
font-size: 0.9em;
}
.no-more-topics-found {
display: none;
}
.zoom-in .show-more-topics {
display: none;
}

View File

@ -9,6 +9,3 @@
<li class="searching-for-more-topics">
<img src="/static/images/loading-ellipsis.svg" alt="" />
</li>
<li class="no-more-topics-found">
{{t "No more topics." }}
</li>