Instead of current_user.user_id we use page_params.is_spectator
field to check the spectator cases as it makes it more clear
to the reader about what is the condition checking.
Fixes#17933, #27517
Instead of `recent_view_table`, we make `html` as our scroll container.
This fixes an important bug for us where filters sometimes disappear
due to them scrolling under navbar which is unexpected. Since we are
now using separate containers to display rows and
filter (while includes table headers), where filters use sticky
positioning, this bug will be fixed.
Uptil now, the `query_matches_string_in_order` function would respect
the order of words in the query string when matching a source string.
This meant that for query "two one", the source string "one two three"
would not be matched.
For more flexibility, a new function, `query_matches_string_in_any_order`,
has been added., which returns true if each word in the query string matches
the prefix of a distinct word in the source string, else it returns false.
The algorithm for computing this is quadratic in terms of the source word
count so can be a little expensive, but it is only currently used for
searching topics in Recent Conversations, where the strings' length is
limited by the max stream / topic name length allowed, so this should be
performant enough for this use case.
We want to name types/views that are not Stream or Direct related to be
"non-specific". The previously used term "non-stream" could be confusing
since it would literally mean any type/view which is not a stream type/
view, which would encapsulate the Direct type/view also.
Thus, we finally use the following terms to describe the type of
conversation:
1. Stream type (Streams or Topics)
2. Direct type (A)
3. Non specific type (Inbox, Recent conversation, All messages)
Some files already were using `noop` in place of `() => {}`.
It's both clearer what it means and is easier to type.
This updates all test files to fully use `noop`, and
adds a shared import from the test lib file.
This commit removes the 'development' guard and makes
the UI changes related to the 'Follow Topics' project visible
outside the development environment.
Cleans up the older UI elements related to mute and unmute topics.
It did the same thing as handle_narrow_activated when passed the
home_msg_list filter.
We still leave a renamed version for use by the inbox/recent views.
It did the same thing as handle_narrow_activated when passed the
home_msg_list filter.
We still leave a renamed version for use by the inbox/recent views.
Earlier, followed topics in muted streams were not listed in
the 'Recent conversations' table when 'Include muted' filter is
unchecked.
They should be listed as we currently list unmuted topics.
The "test_filter_all" includes tests for muted and not muted topics,
but the 'is_spectator' field is set to 'true'.
Logically, it is incorrect because a topic can't have a
visibility policy set in spectator view.
This commit fixes the incorrect behavior and adds a separate test
for the case 'is_spectator=true'.
The issue was introduced in d0a697f.
narrow is a term that is intended to only apply to a message feed
view; it comes from "narrowing the set of messages you're looking
at from the All messages" so switching it to something different
makes sense.