This commit ensures that the focus on the topic list search box is only
triggered when the user clicks on the "SHOW ALL TOPICS" button, and not
when the narrow changes. This prevents unwanted focus behavior when
switching between different narrows/views which interfered with the
focus states of the compose box.
This button was previously found when hovering on the CHANNELS
header, but now that we've removed that header, we show the
button here instead, and always visible.
This gives us more control, for example `show()` was adding
`display: inline-block;` to channels after unhiding them
which was overriding other code (added for channel folders
in future commits) that was trying to hide the channels.
Clicking on the stream row should open the message view
as per "Channel links in the left sidebar go to" setting.
But this happens only when clicking on stream name element
and not on the complete stream row, like clicking on the
privacy icon or towards the left of it, opens the channel
feed always irrespective of the setting. This commit
fixes that.
Updated the code to attach the "New topic" button handler
to "#stream_filters" element instead of "body", as it was
not being executed due to stopPropagation being called in
the click handler for "a" element for stream row.
Attaching the event to "#stream_filters" makes sure that
clicking on "New topic" button calls the handler for it
first and stops event from being propagated to the "a"
element for stream row.
Also moved "New topic" handler to stream_list.ts, as it
would be easy to maintain them if all handlers for the
UI are in the same file.
This also fixes the bug when pressing "Enter" key after
clicking on a stream row did not open the compose box for
replying to the selected message which is the expected
behavior when "Channel links in the left sidebar go to"
setting is set to value other than "List of topics".
Previously, unmuted unread counts for muted channels were still shown
in the left sidebar even when the "Show unread counts for" setting was
set to "No channels".
This commit ensures that unread counts are correctly hidden for muted
channels based on user settings.
This commit adds option in personal settings to allow
navigation of channel links in left sidebar to the top
unread topic in that channel.
In cases of no unread messages in unmuted topics of the channel,
it falls back to the top topic of channel.
Fixes#35066
This follow-up commit replaces the current left sidebar channel list
filter input implementation with the redesigned input component.
Note: This commit removes `clear_search` method from `stream_list.ts`,
since the `.input-button` onclick handler over at `inputs.ts` handles
the clearing of the filter input fields by sending an empty text input
event. This input event triggers the filter update handler of the
module, in this case the `update_streams_for_search` function and
resets the filter list, eliminating the need for a separate per-module
input clearing/resetting workflow.
Fixes part of #34476.
We introduce a different class to be used for left sidebar which
inherits TopicListWidget. More specifically, we allow the
children classes of TopicListWidget to pass their own method to
filter topics. This will later be used by inbox view when showing
channel view in center pane.