Commit Graph

17 Commits

Author SHA1 Message Date
evykassirer b6830ff5df narrow_state: Remove unused search_string function. 2024-09-10 17:51:39 -07:00
evykassirer 825fa6f0e1 narrow_state: Remove narrowed_to_topic function.
This was only being used in one place in compose_closed_ui
to create the label for the closed composebox. But it
only checked if the `channel` and `topic` filters existed,
while `stream_sub` can return `undefined` for a few other
reasons. To ensure that we're catching the undefined sub
while also avoiding duplicate work, it makes sense to just
call `stream_sub()` directly.

Fixes this bug:
https://zulip.sentry.io/issues/5367251929/events/40073ecf007a4a9798e728061a576377/?project=450455688282112
2024-05-24 10:24:16 -07:00
Lauryn Menard 8d102cf12f web-search-suggestions: Update to use channel and channels.
Updates the search suggestions in the web app to use the modern
convention of "channel" and "channels".

Also, updates the "from" search suggestions to use the modern
canonical convention of "sender".

Part of stream to channel rename project.
2024-04-24 17:03:36 -07:00
nimishmedatwal 1594011b67 left_sidebar: Rename All messages to Global Feed.
Fixes part of #27802.
2024-04-17 12:42:21 -07:00
Lauryn Menard 1e7c5b38f8 filter: Use "channel" operator for the Filter class.
Update the Filter class to use "channel" as the canoncial operator
for streams, but keep using "stream" for user-facing text and URLs.

When searching, "channel" does not create any suggestions until
a colon is added and then it shows suggestions with "stream". And
when a search string with channel as an operator is entered, then
it is replaced by "stream" as well.

Part of stream to channel rename project.
2024-04-12 13:44:25 -07:00
Anders Kaseorg 8f07d830f2 narrow_state: Remove unused narrowed_to_search, narrowed_to_starred.
They’re unused as of commit de0db7ad1a
(#28636).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-29 09:37:38 -07:00
Aman Agrawal de0db7ad1a filter: Make excludes_muted_topics a method of the `Filter` class. 2024-02-24 08:31:18 -08:00
Aman Agrawal c20340a5a6 narrow_state: Use `message_lists.current` to return current filter.
It doesn't make sense for us to track a separate current filter when
it should just the be filter of current message list if there is one.

This will reduce possible confusion in the codebase where filter
returned by narrow_state is different from message_lists.current.
2024-02-24 08:31:18 -08:00
Tim Abbott f4ad102d39 narrow_state: Add pm_ids_set helper.
This provides a more easy to work with model of which users, if any,
are involved in the current DM conversation, if any.
2024-02-06 14:44:09 -08:00
Aman Agrawal 272337f0f9 filter: Remove incorrect check for `All messages` view.
All message view has `in-home` filter and is not empty.
If there are no terms provided, we set filter to display
all messages (including muted streams/topics).

We make it mandatory to provide terms to Filter.
2024-01-15 12:26:24 -08:00
evykassirer a87b1d5ad8 filter: Use terms instead of operands.
Operand is a confusing name because this
data structure has an attribute *called*
operand. This commit renames references to
this structure to "term", short for "search
term".
2024-01-02 16:24:53 -08:00
Dinesh cb4957fa26 narrow_state: Add stream_id() function.
Returns `stream_id` if narrowed to stream else `undefined`.

Required for displaying stream typing notifications.
2023-10-10 17:36:55 -07:00
evykassirer c3fe96af52 compose: Use stream id instead of stream name for composebox opts. 2023-08-07 17:08:59 -07:00
evykassirer d9edcba724 narrow_state: Rename stream() to stream_name() which is more accurate. 2023-08-07 17:08:59 -07:00
Tim Abbott 3876171df1 compose: Fix opening compose box when viewing invalid stream.
This likely needs further refactoring to switch to using stream IDs
rather than names in this code path, but this change fixes an
exception that would be throw when opening the compose box while
viewing a narrow to an invalid stream name/ID.
2023-05-16 10:39:33 -07:00
Lauryn Menard 0f7341dd48 narrow: Add frontend support for `dm:` narrow and `/dm/...` URL.
Adds support in the web app for `dm` operator. This will deprecate
the `pm-with` operator, but existing links/URLs are still supported
for backwards-compatilibity.

This commit updates the web app default behaviors to default to
the new narrow/URLs `dm/...` and `/#narrow/dm/...` when navigating
and searching in the app.

There is some general clean up of references to private messages
or PMs to be either direct messages or DMs in these changes.

The general API changelog and documentation updates will be done
in a final commit in the series of commits that adds support for
the various new direct message narrows.
2023-04-25 09:07:08 -07:00
Anders Kaseorg cea1119423 node_tests: Move to web/tests.
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>
2023-02-23 16:04:17 -08:00