Previously, only spaces were used as word separators when searching
for topics. This meant that searching for "support" would not find a
topic named "topic_support" or "topic/support," which could lead to
unexpected results.
To address this, hyphen (-), underscore (_), colon (:), and slash (/)
have been added as additional word separators for topic filtering in
the left sidebar, as these characters are commonly used as separators
in topic names.
Fixes: #31844
Earlier, in left sidebar, clicking on followed topic icon would narrow
to the topic.
This commit introduces the ability to open topic status menu from
left sidebar from followed topic icon.
Fixes: zulip#28941.
Earlier when a user narrowed to a new topic, there was no highlighted
topic row entry in the left sidebar under the respective stream.
This commit introduces the feature to show highlighted topic in the
left sidebar for a new topic thread. It checks if narrowed topic is
present in the list of topic names to add to it.
It disappears from the left sidebar when unnarrowed and the topic
contains no messages.
Fixes: zulip#22769.
For sorting topics in the left sidebar topics list, the "Followed"
topics are treated the same as "Unmuted" topics.
In a muted stream and not zoomed state:
* followed/unmuted topics at the top.
In an unmuted stream or zoomed state in a muted stream:
* normal recency sorting
The reason is that the "Followed" topics have a tier of interest
above being unmuted, so they shouldn't lie below the "Unmuted" topics
in the list.
This commit adds the follow icon to the right end
(before the three-dot menu icon) of the topic list item
for followed topics.
The icon replaces '@' instead of showing both the '@' and "Follow"
icons in the case of unread mentions, as users don't care if they
are following a topic if they've got unread mentions there.
In a muted stream, the text color of followed topics in the topic list
is set to be similar to that of unmuted topics.
The reason is that the followed topic has a tier of interest above
being unmuted, so it shouldn't stay faded in the topic list.
When all the unread messages in a muted stream are in specifically
muted topics, this ensures that the total unread count for the stream
that the user sees before clicking "more topics" will match the total
unreads number for the stream itself.
This behavior is limited to muted streams, since in a normal / not
muted stream, we don't display a "muted topics only" faded unread
count by the stream's summary line to avoid distracting the user with
it, we match that behavior for the "more topics" line.
We also now display the `@` , again to ensure the stream's summary
line never displays an `@` without some topic row having one.
Add class unmuted_topic to li.bottom_left_row element if topic is
unmuted. Add relevant CSS for .unmuted_topic to display unmuted
topics in regular font.
Fixes part of #24243.
Created a new function choose_topics that loops through the topics
and push filtered topics using should_show_topic function to items
array if not zoomed else just push all topics directly to array.
If stream is muted and not zoomed call the choose_topics function
twice, first with passing unmuted_topics and second time with passing
remaining topics. else, call it only once with topic_names.
Fixes part of #24243
With commit f0d1332ba2, we no longer need to mock `topic_list.js`
in the `topic_list_data` node test. Instead, we can pass a string
directly to that function. The default is an empty string unless
there is a search input. Also, updates the default of the zoom to
be false instead of undefined in the tests.
This commit breaks the cyclic dependency between "topic_list.js"
and "topic_list_data.js".
It achieves this by passing "search_term" generated by the
"get_topic_search_term" function to "topic_list_data.js" directly
through the function call from "topic_list.js".
Incresase the max number of stream topics shown when not zoomed
into the stream for more topics in the left sidebar to be a max
of 8 unread conversations and 12 when there are unreads.
This lets us simplify the long-ish ‘../../static/js’ paths, and will
remove the need for the ‘zrequire’ wrapper.
Signed-off-by: Anders Kaseorg <anders@zulip.com>