display_settings: Allow user to set default_view.

TextField is used to allow users to set long stream + topic narrow
names in the urls.

We currently restrict users to only set "all_messages" and
"recent_topics" as narrows.

This commit achieves 3 things:
* Removes recent topics as the default view which loads when
  hash is empty.
* Loads default_view when hash is empty.
* Loads default_view on pressing escape key when it is unhandled by
  other present UI elements.

NOTE: After this commit loading zulip with an empty hash will
automatically set hash to default_view.  Ideally, we'd just display
the default view without a hash, but that involves extra complexity.

One exception is when user is trying to load an overlay directly,
i.e. zulip is loaded with an overlay hash. In this case,
we render recent topics is background irrespective of default_view.

We consider this last detail to be a bug not important enough to block
adding this setting.
This commit is contained in:
Aman Agrawal
2021-03-10 12:56:10 +00:00
committed by Tim Abbott
parent 709fbe5c0a
commit e587c029f6
25 changed files with 160 additions and 13 deletions

View File

@@ -53,6 +53,7 @@ class HomeTest(ZulipTestCase):
"debug_mode",
"default_language",
"default_language_name",
"default_view",
"delivery_email",
"demote_inactive_streams",
"dense_mode",