The function show_actions_popover() actually toggles the
message action menu open and closed. I renamed the method
to toggle_actions_popover(), and I check to make sure the
menu is open before trying to focus its first item.
(imported from commit b2c32b6c4e0be6066cd1d41463457b7e991df0ec)
Every time we re-render the huddles section, we need to
update the unread count. We do this is in very similar
fashion to how we update individual users.
(imported from commit 2419365bc602ddaebc609090e119c0dcfad35bb7)
This fixes a mild regression in 6bd2a0315ff56a20027074d65ccaa094bd35e63f,
which fixed a bigger bug. That change added the event parameter to
add_alert_word(); this change updates one of the callers to now
supply it.
(imported from commit c6375abb8bd22d12c538cd7439462aae4665ee38)
Show up to 10 of your recent group PM conversations in the right
sidebar. Clicking on the links narrows to the huddle and opens the
compose box for the huddle. The green circles have opacity
proportional to the number of users present in the huddle.
This is feature flagged to staging only.
Some of this code was written by Allen before commits were squashed.
Known issue: unread counts disappear on certain refresh events.
(imported from commit 3b44665150ba20594d8b0295cb30df03601c1d52)
Add a method that lets us know what percentage of a huddle is
present. (We can use this later to set the opacity of huddles
in the UI.)
(imported from commit 8a2383951807d7bfbf9d730a8980d977cf23b379)
This should substantially mitigate the get_updates failures that we've
been seeing, since users will experience a 2s-slow send, not a 0-60
second slow send.
We should revert this once we resolve the root problem.
(imported from commit b665d0dfe674e1113bdd62cef50e3d9c52758e4c)
The global in question was `event`, set to:
MouseEvent {dataTransfer: null,
toElement: button.btn btn-mini add-alert-word,
fromElement: null, y: 442, x: 763…}
in Chrome. This does seem to be the correct event.
In Chrome, this global variable existed, so the code path didn't error
out. In Firefox, the global variable didn't exist, causing adding
alert words to fail.
(imported from commit 6bd2a0315ff56a20027074d65ccaa094bd35e63f)
This will hopefully help with the send dialog being stuck on
"sending" as well as allowing us to not show errors to the user on
reconnect.
(imported from commit 31ee889853f348e486863073dc130cdfb4e1338d)
Clients can only have one connection at a time, anyway, so we can
just keep track of a client id, instead. This makes reconnections
easier.
It's a little funny to use queue ids for the client id, but we know
they should exist by the time the client is connecting and they are
guaranteed to already be unique and authenticatable. We will also
eventually be integrating the event system and the socket code closer
anyway.
(imported from commit 1f60e06fb16d31d6c121deafd493fb304d19a6c2)
This is unnecessary without summarization and has a performance
impact on scrolling.
This reverts commit 6270a33ff0fe98fc901b687ca533ef0ea127d052.
(imported from commit ac328a9fe344adfaf1cc1822cd58bc9178ae1a33)
This reverts commit c10d9c1a0d23891acce88bf8d79866c08cb75681.
This reverts commit 9259a246946cd968a8725c38ff5ef2d4b4793717.
(imported from commit 50e9e0136c2487cc63d75ae2b78df0c70a1b0be1)
For messages that you sent yourself, it is more likely that you
will want to edit the message than reply to yourself, collapse
your own message, etc. from the info menu, so we make it the first
option. This should make it easier for keyboard users to edit
messages.
(imported from commit 94c5036a4ae85ed091c95eae2545e78887a09598)
This is the amount of time between when it is sent, and when it is
rendered into the user's home view.
(imported from commit 468c28e77ba16c7256c359e90ab5aacf9d497585)
Activity.js now has the capability to track huddles that
come through in loaded messages and return them in reverse
chronological order by their most recent message. Right
now this only connected to a unit test, not any production
code.
(imported from commit 59957086fa2e454e5711472df091f178217aed2b)
This can be squashed with the prior commit, which inlined this
MIT check into update_users() while trying to avoid other
complications. After inlining the code, it's clear that we
don't need to call the sort_users() line of code for MIT users,
so I moved the MIT guard condition up.
(imported from commit fa5b52e14964ad595b34d40ce6c8450ea93726c5)
Since ui.set_presence_list is only called from activity.js, I am
inlining the code into activity.update_users(). This also allows
us to move ui.presence_descriptions into activity.js, which
is the right home for presence-related things.
(imported from commit 0ff239275c544a86c14d517bc386d06726b81cd9)
The user_info var was mapping users to presence information, and
presence_info is a better name for it. This change is partly tactical,
as it sets us up to inline ui.set_presence_list, which receives
user_list as presence_list and then has a completely different
variable called user_info.
By doing this pre-factoring, the next commit becomes just a pure
code move without more moving parts of renaming variables.
(imported from commit 4b015d19886b43d24905124eb37cd9dd317aa87b)
Narrow.activate was called without an options object in one
obscure location. I'm not sure how it's actually triggered,
since all searches seem to go through the typeahead path with
the "Search for x" option, but someone managed to do it.
(imported from commit 5e0e1bbe7570e5f6a654949547dc164e01125efa)
It's somewhat buggy, and has thus been annoying our internal users, so
better to disable it until we can fix the bugs.
(imported from commit f981791d32d321b0cfe06b4a337e26ab48832bb3)
This should help with determining the prevalence of slow sends as
experienced by users.
(imported from commit f00797679315c928af3c87ad8fdf0112f1dfa900)
Perhaps we should be checking based on an ID rather than the actual
text, but this fixes the proximal issue.
(imported from commit b125415c3a8356255b64c8e22733532491ea0065)
I switched narrow.by_subject and narrow.by_recipient to use the all_msg_list
instead of current_msg_list, since we wanted to be able to narrow to messages
specifically not in the current_msg_list. However, in searches which revealed
old messages outside the range of all_msg_list (which only has a single contiguous range),
this broke narrowing.
Let's use msg_metadata_cache instead.
(imported from commit 427f717484b4ae83d9bb4cc6e51ce17177d037fe)
Displays a notification above the composebox in cases where the message
is not visible (further down), or where it's outside the current narrow or search.
It also offers a link to the appropriate narrow when it makes sense, and offers
timetravel when appropriate. There is currently a bug with timetravel (and you can
see this when using the popover menu) that makes "narrow to messages around this time"
not work for muted messages.
This resolves Trac #1518.
(imported from commit 391ca0b9c07d91496f6585a4fd8e15723d1170e2)
Looking at the historical data, fewer than 50% of active users have
completed the checklist, which means that it is just persistent
clutter. We also have other better ways of encouraging people to send
traffic and get the apps now.
This commit removes both the frontend UI and backend work but leaves
the db row for now for the historical data.
(imported from commit e8f5780be37bbc75f794fb118e4dd41d8811f2bf)
Nobody uses it, and it causes confusion. (How is it different from 'Home'?)
For now, leave in the ability to get to the narrow, although we may
ultimately want to do away with it as well.
(imported from commit 35b3f27e39c4de3391bc5571b32f7242a29f4cfa)
We were using Gravatar for user avatars, but now users can
upload their avatars directly to Zulip, and we will store
their avatar for them. This removes the old Gravatar-related
interface and polling code.
This commit does not attempt to update the avatars in
messages that have already been loaded, either for the user
making the change or other users.
(imported from commit 301dc48f96f83de0136c93de57055638c79e0961)
The "Your Account" and "Notifications" boxes on the Settings
page each had their own border and their own "Save changes"
button, but they were within the same form and sending to the
same back end point.
This commit creates a separate form and endpoint for each
of the two boxes.
(imported from commit 04d4d16938f20749a18d2c6887da3ed3cf21ef74)
Previously, if the user held down the enter button while the socket
was disconnected, the client would try to connect in a very tight
loop. Now we throttle reconnection attempts to 1 per second.
(imported from commit 7b18260b992d5a34f3ea7925cf72b383f84bbabd)
If the user has a flaky connection, we might be in the backoff state
of attempting a reconnect. But when the user regains connectivity
and tries to send, we want to send the message as soon as possible.
(imported from commit 3c5c8e9c3104ff7923258f73c9ab700548518d16)
All local_server JS stuff should ideally be controlled from
feature-flags so it's easy to see at a glance what's been done.
(imported from commit 45b1cdae382679d3fa3b5f02f67e8ab749a89a51)
We leave the HTML in because it's harmless. (We could do a more
thorough expunge, but I don't see the point).
(imported from commit d3d68b0b2df96a9f3de73903b043c18bc6f77563)
The Streams page should only show active public realms, even though
a user might have info about a "retired" stream in their browser.
I regressed this in 69b83d769 for "retired" streams. A retired
stream is a stream that no longer has subscribers. The bug
scenario here was that you could create a stream, regret it,
unsubscribe yourself, and then the stream never went away from
the Streams page.
This diff tries to be a little more explicit about building the
list of streams for the Streams page. Basically you have two
sources:
* Get only the subscribed streams from the internal
data structures.
* Get the unsubscribed streams by calling the back end
for all public streams, and subtract out the subscribed
streams.
I tested the following scenarios:
normal stream with me: in Streams
normal stream without me: in Streams
my invite-only: in Streams
their invite-only with me: in Streams
their invite-only without me: not in Streams
retired stream: not in Streams (but message colors are good)
See the email "custom query to get public stream names" for some
related discussion.
(imported from commit bc9224e68797b26b795399941117faa9d6858b39)
I want to make subscribed_streams() external, but it conflicts with
a legacy name in the same module (stream_data.js), so I have to rename
it in the same commit. The new name conforms better to the current
naming convention, which generally has functions returning objects
use "sub" in the name.
(imported from commit 9f1ed60772c649359a413257e0998857eab3603f)
Trac #1734
This is implemented by bouncing uploaded file links through a view
that checks authentication and redirects to an expiring S3 URL.
This makes file uploads return a domain-relative URI. The client converts
this to an absolute URI when it's in the composebox, then back to relative
when it's submitted to the server.
We need the relative URI because the same message may be viewed across
{staging,www,zephyr}.zulip.com, which have different cookies.
(imported from commit 33acb2abaa3002325f389d5198fb20ee1b30f5fa)
When we add starring of historical messages, they'll get added to the
home view (since we don't filter them out), which isn't a big deal --
but we don't want to make an inaccurate claim that the user subscribed
to this stream and then unsubscribed.
This should most properly be handled by filtering server-side, but at
the moment our lack of an index on UserMessage.flags makes that
impractical from a performance perspective.
(imported from commit 00751a5f9fc20e9da5c09914c11d1579f9e7398e)
There seems to be some sort of bug involving PhantomJS and XHR
streaming messages. When successive pages are loaded that use XHR
streaming, PhantomJS seems to think the second one never finishes
loading and therefore hangs.
(imported from commit db93b4cab816f1fdc3f3f543c9394b1cba8abedb)
Because our authentication system reads cookies from the initial
connection attempt, several SockJS transports can't be used.
(imported from commit 34b9571225d39072985b8223fb12c43c7235841f)
We want to deprecate reload_subscriptions(), which was kind
of a big hammer to use when only a single stream is being
renamed. Now we call stream_list.rename_stream() to update
the sidebar.
(imported from commit a77d09c0433d9b605b7baa7d7c61183bc8c37ba9)
For a large domain like HS, we were pulling back about 100k of
text with subscriber emails when we opened the Streams page.
This was unnecessary, as the subscribers aren't shown until
you expand the stream, and there's already an AJAX call.
(imported from commit 69b83d769030d87318acefc364ac6ff3a2ec3605)
Use the new count_full_messages_between instead of subtraction in
message_list_view.append. By finding a count higher than it should be
when summarized messages are present, it didn't add new messages until
the pointer moved under certain conditions.
(imported from commit c10d9c1a0d23891acce88bf8d79866c08cb75681)
Currently, code blocks end up with scrollbars annoyingly frequently --
even with a maximum width window, you can't fit a standard 80
character terminal worth without needing a scrollbar. This change
causes our code block text to be the same size as normal text and
inline code blocks.
(imported from commit c2fc7e008cc514e90387f8f0db2b49e357cf4f62)
Summary blocks can contain hundreds of messages. When the rendering window
code didn't take this into account, it would lead to all kinds of
unpleasant behavior when you scroll.
Trac #1888
Unfortunately, this replaces a subtraction with a function that iterates
through all the messages.
(imported from commit 9259a246946cd968a8725c38ff5ef2d4b4793717)
* Disable for search-like narrows (whitelist stream and home instead of
blacklisting topics and PMs)
* Use home view summarization flag for All Messages
(imported from commit 48bd10ae5da7c7564c2efe86a40078f1a7e96e20)
Don't warn when @-mentioning a bot on a public stream that it does
not appear to be subscribed to. It may be receiving those messages
anyway.
(imported from commit 4a00694942a721897a01736f48033c71048e0b16)
This doesn't address the more complicated case of someone @-mentioning
you on a muted topic, which consensus is you do want to get
information for, but we need to develop some infrastructure to present
that case to users clearly.
(imported from commit a4bc1e89c108fa8ba6eccc0a198eabf2231326ab)
Add the option "Narrow to just this message" to the chevron
menu. This has two use cases:
* It's an easy way to get a sharable URL for the message.
* It reduces distractions.
For now it is feature flagged to just customer12.invalid and staging.
See #1880.
(imported from commit 897d247176f9024ff825ccd3b338236569eed5ab)
Allow users to open Zulip windows in new tabs with command-click
from the left sidebar narrowing links and recipient bar
narrowing links.
(imported from commit d60c038c7bf1efccd461f5284d513b9cbfbdaebf)
If the user has text in the compose box, don't close or
change the compose box when they narrow.
(imported from commit f9b400f6bac37cb313f1fd87aadb3ba1d3a035ef)
For the two cases where narrowing should open the compose box,
we now put that logic inside of narrow.js.
(imported from commit 570e22e90c2f6d422ba71cce400c075f0b8adf51)
Handle closing the compose box inside of narrow.js, to
ensure consistent behavior for all the narrowing UI options.
(imported from commit f17a687491eb2361c73032cd974cedb2a0a2dd85)
The main user-facing feature here is that users can open narrows
in new tabs or windows. Internally, it makes the HTML more semantic.
One consequence of making these elements into actual anchor tags
is that clicking on them no longer triggers this logic to
close the compose box when you click outside of it:
// Unfocus our compose area if we click out of it. Don't let exits out
// of modals or selecting text (for copy+paste) trigger cancelling.
if (compose.composing() && !$(e.target).is("a") &&
($(e.target).closest(".modal").length === 0) &&
window.getSelection().toString() === "") {
compose.cancel();
}
Instead of patching the above code, I elected to just call
compose.cancel() explicitly in the click handlers for the links
themselves.
We are gonna try to clean up the compose-box behavior globally soon.
(imported from commit c9a01916f1714fe3dd495d25c78cd5e5532105ef)
I added comments to the section of the template that generates
recipient bars for stream/topic messages.
(imported from commit a7ea9353dc5db20db3410b9566f5e0d670eff31f)