For spectators, the chunk of page_params that originates from
do_events_register isn’t assigned until ui_init.js. That means the
TypeScript type of page_params is mostly a lie during module load
time: reading a parameter too early silently results in undefined
rather than the declared type, with unpredictable results later on.
We want to make such an early read into an immediate runtime error,
for both users and spectators consistently, and pave the way for
runtime validation of the page_params type. As a second step, split
out the subset of fields that pertain to the entire realm.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
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.
In order to eliminate the usage of `::after` pseudo-element for
rendering the empty list message, this commit introduces a new function
for displaying the empty user list message on the right sidebar.
Since we only have tippy popovers now, functions calling
not_hide_tippy_instances have been removed.
Also, all of emoji_picker, stream_popover, user_card etc popovers
are tippy popovers so calling hideAll is enough to hide them all.
We should search for what the user asked us to search for.
CZO conversation:
https://chat.zulip.org/#narrow/stream/101-design/topic/search.20buddy.20list.20for.20self/near/1630454
This commit also stops the user from being at the top of
the search list, so that the search list is fully
alphabetical (though still sorted by online status).
We switch to not having the user at the top of the list
only when there's search text in the search bar, otherwise
there'd be a visual jump that would happen just by opening
the search bar. There's almost always visual change when
entering text into the search input field, so that seems
like the time to change the sorting.
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>