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.
This commit is contained in:
Lauryn Menard
2023-04-11 21:04:33 +02:00
committed by Tim Abbott
parent d379020726
commit 0f7341dd48
36 changed files with 520 additions and 415 deletions

View File

@@ -147,7 +147,7 @@ function scroll_all_private_into_view() {
export function handle_narrow_activated(filter) {
const active_filter = filter;
const is_all_private_message_view = _.isEqual(active_filter.sorted_term_types(), ["is-dm"]);
const narrow_to_private_messages_section = active_filter.operands("pm-with").length !== 0;
const narrow_to_private_messages_section = active_filter.operands("dm").length !== 0;
if (is_all_private_message_view) {
// In theory, this should get expanded when we scroll to the