For the settings UI, we now wait until a user goes to a particular
settings section before calling the appropriate function to set
up the section (which usually involves setting up click handlers
and populating initial data).
We had never-enabled code to allow users to set default
streams for their bots (for event registration, default sending, etc.).
This commit removes the code.
In this commit we fix the issue of scrollbar occasionally scrolling
down too far when we click more topics option. Upon scrolling to top
the scroll gets reset everything returns to normal. This sometimes
leads to big blank space upon clicking more topics. This has been
fixed by reseting the scroll upon narrowing.
Fixes: #4440.
In this we fix the positioning of the loading spinner on the home page
when its loaded for the first time. First time here does not mean first
time use but means first time of a new session.
Prevent switching of stream rows on pressing arrow key when focussed
on the 'Create stream' section (this would cancel the curren stream
creation flow).
We've had this kind of hacky setting called message_view_only for
a long time in the hotkeys code, and it originally helped optimize
the code a bit. It wasn't well maintained, and people started
adding non-message-view behavior to the arrow keys without flipping
that flag to false. This change finally flips the flag to false,
which simplifies some of our logic.
We now explicitly return true from process_hotkey() when we
handle up/down/backspace for the drafts modal. Also, we no longer
call preventDefault() from drafts.draft_handle_events(), since the
caller does that, and we no longer return `true`, since we were
never inspecting the return value anyway.
The up/down arrows now navigate the left pane of the settings menu.
The code here was originally implemented as part of our settings
redesign, but the code was added in a place that became unreachable
after we fixed a bug with home_tab_obscured(). This commit
resurrects the code and places the guts of it in settings.js. It
is possible that we want to clean this code up eventually to deal
better with hidden blocks.
The code here used to live in hotkey.js. Its complicated calling
protocol made it difficult to unit test. We are also trying to
slim down hotkey.js.
Our arrow navigation for things like `#stream_filters` has always
been kind of awkward, since it's difficult to get the focus to
their list items. This commit does nothing to fix that yet.
The subscriber data is currently pulled from the web needlessly
when it exists in memory. This processes data returned from
the `stream_data.get_sub_by_id(n).subscribers` and the
`people.get_person_from_user_id(n).email` methods to build the
same list of subscribers that is sent from the server.
Fixes: #4314.
On filling out the name and description for new stream,
and changing the tab (e.g. by clicking on a stream on the left),
then come back to 'Create streams', it should restore stream name
similar to the stream description.
Fix#4311.
The web app doesn't need any presence data for its first ping to
the server, because it already has up-to-date presence info in
page_params. So now we can tell the server not to send us a big
payload that we were already ignoring.
For small-ish realms (<= 250 users), we ensure that the presence
info includes all realm users the front end knows about, even in
cases where the server sends down a slimmed version of presence
data. We make the users "offline" by default, of course.
This commit sets us up to optimize larger realms without concerns
of breaking small realms. Small realms may want to continue to
show all users, even users who may have been offline several weeks,
since it doesn't clutter their API as much as it would for big
realms.
Most of this code was simply moved from activity.js with some
minor renaming of functions like set_presence_info -> set_info.
Some functions were slightly nontrivial extractions:
is_not_offline:
came from activity.huddle_fraction_present
get_status/get_mobile:
simple getters
set_user_status:
partial extraction from activity.set_user_status
last_active_date:
pulled out of admin.js code
We also fixed activity.filter_and_sort to take user_ids.
* Change the classes and ids of different widgets and modals
and make suitable changes in `admin.js`.
* Remove any other occurrences of `alias` or `realm_alias`
from admin.js.
This fixes an issue with the menu going below the bottom of screen
with non-tiny windows, and it was rare that anyone benefitted from the
extra suggestions.
Fixes: #4133.
This moves the implementations of error/report/message from
ui.js to ui_report.js. They had been shimmed before, so calling
modules still use the same names to call the functions, but we
no longer need the shims.
Previously drafts called compose.snapshot_message which would then
get the message object from compose.create_message_object. This method often
checked for the validity of stream/user recipients which would often cause tracebacks.
The new method in drafts.snapshot message just gets the data from the fields and
stores them in the draft model without any additional checking.
This commit adds the backend support for a new style of tutorial which
allows for highlighting of multiple areas of the page with hotspots that
disappear when clicked by the user.
* 'd' in message view opens drafts.
This also adds hotkeys within the drafts UI:
* Up/down arrow keys navigate the drafts.
* Pressing enter edits the selected draft.
* Pressing backspace deletes the selected draft.
Some variable names tweaked by tabbott.
Zulip's logic for garbage-collecting data structures before reloading
was a fix for a Chrome memory leak that lasted across reloads a few
years ago. That memory leak is probably now fixed, and thus logic is
causing lots of JavaScript tracebacks that are probably not useful.
So, let's try removing this cleanup logic (everything but the
still-useful deletion of the event queue).
We no longer let the left arrow put you into the message edit
UI for a message where you can only edit topics, since that is
just confusing to most users.
This change also improves error handling a bit, and it removes
an unnecessary call to rows.id().
Finally, it moves some logic out of message_list.js, so that we
don't have a circular dependency for this codepath.
Fixes#4259
If we get reactions for deactivated users, or otherwise missing
users, we only issue a blueslip warning now. The function
get_message_reactions() was indirectly causing blueslip errors
before this fix, but we can downgrade to warnings now that this
function has better unit tests around it.
We eventually want to track deactivated users on the client.
Fixes#4289