We don't persist how many PMs you have exchanged with other users
across reloads, so immediately after a reload, our
pm_recipient_count heuristic for autocomplete isn't very useful.
This change makes it so that we prefer humans to bots when
pm_recipient_count is not yet a factor (i.e. both users may have the
same value of zero).
(imported from commit 5fd8c969631d3437df83dd6e5ff8f7316dc4ef51)
Make our dev setup more similar to prod by using compiled.js,
instead of AJAX-ing templates on the fly and compiling them
with non-node code. This will make our dev environment more
consistent with prod (to avoid surprising bugs), plus it should
be faster (fewer AJAX calls).
This change also means we don't have to keep two copies
of static/third/handlebars/handlebars.js around.
(imported from commit d8d584b9aa13adcdcce7e424033610d77d2df79b)
If a message edit causes a message to become notifiable, we send
a notification to the user, but only if they haven't had any previous
notifications for this message.
(imported from commit cee854de2d42c31a7352a350f79490caf94b613c)
In update_messages() in zulip.js we now set the mentioned flag
on incoming messages, so that they render properly with the
salmon background.
(imported from commit 6df523edbcd567bf8e1fde144f65f35a00548c4f)
After messages are updated, we process the message for alert
word highlighting, just like we do when new messages are
received.
(imported from commit 5538c0f875595df3ec1ac7c4bc45f0fe44c700cc)
Inputs are given a tabindex of -1 in the handlebars templates, this is
added and removed in the show and hide events of the bootstrap collapse.
(imported from commit 2c54c39edc396d3d18330df4583d901690dd71fa)
All of the buttons in the tutorial now have focus to spamming enter will
get to the end.
(imported from commit dc620a28b2c0c3a316a0e91438baf1e284e29e83)
See #2137. When you add a person to a stream on the Streams page,
the autocomplete will now match on the person's full name, not just
their email.
(imported from commit b250ea0dc61d54f7f2f330ef0616935d43234597)
This is the UI piece that finishes the features to let admins
make streams private or public.
(imported from commit 1a193165a6304dc358982e9850a75965fb3a03fd)
We've seen in our error logs browser clients that were constantly
retrying requests to our server after the user logged out in one tab
but didn't close another.
(imported from commit 68dd8d9e618083bc116ae3a96dbcc78fa9301bba)
When we rebuild the user list from scratch, set the unread
counts in the templates to avoid multiple DOM updates.
(imported from commit 2d0c9b0fb99b382332e464ba7c3caad95e05363e)
Features:
* Only shows messages in the narrow
* New messages in the narrow will arrive as they are sent
* Works even for streams you're not subscribed to
* Automatically subscribes you to a stream on send
* Doesn't update your pointer
* All searches etc. automatically have the narrow added
(imported from commit 2e12b76849f6ca0f53dda5985dad477a04f7bbac)
I'd check for bookends, but not daterows. Now, we just check if we can get
a message id out of it, rather than excluding specific types of rows.
(imported from commit 39ebc35e81dcec7fc83b603bf941f816fcd3d38d)
basically this tries to turn scroll-the-world into not-scroll-the-world
This is not very good--maybe Allen has a better idea. The best solution would be to
turn off scroll-the-world. Look for it after the tables->divs change happens.
(imported from commit ae0b6976bca57986f95022f2470bc7117eda7fa3)
Previously, we would slowly accumulate duplicate copies of events that
happened while the user was in the tutorial at a rate of 1 copy per 5
seconds.
(imported from commit 3e3c58aca4b1ba3bfdd1c93f47330a0f4cf4b60f)
We now use window.innerWidth to check for CUSTOMER7's skinny
mode, which empirically seems to be more consistent with
CSS's max-width @media settings.
I tested under FF, Safari, and Chrome.
(imported from commit d440998634633c11b471fe732104be252c979cd4)
It's possible for a message to be considered "long" at one point,
and then if you narrow to it later, it should be considered "short",
because either the screen's wider or taller. This commit makes
sure that we remove the "condensed" flag from short messages,
and it also fixes the "More..." click handler's assumption that
could-be-condensed will always be true for condensed messages.
(imported from commit 77e4a1ad299c09f12e5609a972d5668472bd4a81)
Cache the height of messages to speed up ui.condense_and_collapse()
to make narrows work more quickly. The height of the message
determines whether it is auto-condensed or not. We clear specific
cache entries when messages get edited, and we reset the entire
cache when the window width changes.
(imported from commit 7c12070a3eb3e2e1a2dfeb8d9109f3404a46c032)
Trying to condense messages when they are not yet visible just
leads to wasted effort and wrong results.
This commit makes it so that current_msg_list always points to a
visible list, so the code related to message rendering knows when
to call ui.condense_and_collapse(). For activating narrows, we
now let rendering handle the condense/collapse case.
The home view situation is a little trickier, because we render
new messages in the home view even when we're inside inside of a narrow,
presumably to make it fast to switch into the home view. When
we actually go back to the home view, we need to sweep for messages
that might need to be condensed, since they have been originally
rendered while the home view was not visible.
(imported from commit 4da2d278a4353e9e0c2b98cbf8c9dd03b06cd59b)
Before this change, you could open the Administration page
for a 2nd time, and there would be two copies of each stream.
The simple fix is to remove any existing rows before populating
the table.
(imported from commit 957306d9c6418e59b5b288dad08864547ca63e53)
This is the "Tried to call a Dict method with an undefined key" error
because it tried to look up stream information for `undefined`.
(imported from commit 0187f185f3e424a0c9ea940d9b32f07376ac8952)
There are now 2 cases for narrowing:
1. We narrowed, but only backwards in time (ie no unread were
read). In this case, try to go back to exactly where we were before
narrowing. This behavior is unchanged.
2. We read some unread messages in a narrow. Instead of going back to
where we were before the narrow, go to our first unread message (or
the bottom of the feed, if there are no unread messages). This is new.
This means that after catching up through the sidebar, on returning
home you'll be at the bottom of your feed.
Searching for the first unread message in a message list with 40,000
messages only takes 17ms according to:
function timeit() {
var t0 = new Date().getTime();
_.find(current_msg_list.all(), unread.message_unread);
var t1 = new Date().getTime();
console.log('Find first unread: ' + (t1 - t0) + ' ms');
}
(imported from commit 87c467578a2cced0aa976d8ae2924371b85d2445)
This changes the algorithm slightly for the 2-block case, because
I simplified the logic to just divvy up the space naively based
on the relative size of the blocks.
(imported from commit 9498edd916f65e07fb64d138276691d0d5cc0e55)
This is a functional change. Before this change, the stream
list and user list were allowed to take equal space in the left
sidebar; now, we take the size of each list in deciding which
proportion each block gets.
(imported from commit febedcb0518353825e18a6ebe60d1883b98bc78d)
I don't think share-the-love is turned on for CUSTOMER7 in the
first place, but even if it is, we should hide it when they go
into narrow mode, to make room for streams and users.
(imported from commit 2e80eec0f2ddee06753f48248dca5ac4745db6f1)
Calling $('#foo') is expensive, so if you need it twice, you
should store it in a variable. I did this for stream_filters
and user_presences, and added the expectOne() call for them as
well.
(imported from commit 69e689e28b1248a93ef426a89c14033d2fb36104)
I'd also like to add a database table to actually store the values
that we get out of this and our send message requests for future
inspection, but for now, grepping logs+statsd is good enough.
(imported from commit 99ef179651850217fe6e82c5e928d122ca91101e)
I renamed ui.process_condensing() to ui.condense_and_collapse(),
and, more importantly, it now takes a list of elements, not a single
element, which allows us to do some computations outside the loop.
(imported from commit d5984088030c2a0d4ec8b258c7fcec3e84caf2b1)
This sets us up for the next commit, where we will change
process_condensing to loop over several elements, and we will
not need to recompute height_cutoff every time.
(imported from commit 1cc5b44598b85d1e301bc84492e4dc38f41ec16e)
Without an explicit close, we will continue to get messages on the old
connection, even once we replace the _sockjs property. This leads to
"impossible" situations, such as receiving ACKs after reconnecting.
(imported from commit f8927fdf0551610e5b9d1db29bba00e160e76b6d)
Now that this is no longer a known problem with our product, we want
to hear about it when it happens.
I worry a bit that a 2s fuse may be too aggressive for the case of
customers in Europe, but it might be OK.
(imported from commit d1bd6b85cd8dffab9c0d0fd410de5331736b00af)
We convert sender:me to sender:steve@zulip.com at parsing time,
so users will see the canonicalization in the search bar. Likewise
for pm-with.
(imported from commit aa9951f13d4633cfef85f03e5486d607fdef414f)
R means "I want to send a PM, you can guess the destination"
r means "I want send a stream message, you can guess the destination"
C means "I want to send a PM and specify the destination"
c means "I want to send a stream message and specify the destination"
(imported from commit 4c93cc3029892c21accadd9624da70ee818dec68)
I think we've got plenty of data of user agent strings for when this
warning triggers at this point.
(imported from commit 8bf6601a325b8e35f5127914a447bd522439c531)
If we load a browser window in a narrowed view and then un-narrow
before the home message list has loaded, we end up attempting to
select message ID -1 from home_msg_list even though it is empty,
triggering a traceback.
(imported from commit eb8b686f6e9c1fa518028e5755ac6196781e92d7)
This doesn't actually prevent a user from making the API call into our
servers to actually go and edit a message, so this isn't a bulletproof
solution for realms where messages ABSOLUTELY MUST NOT be edited.
(imported from commit 5bf043a201e2952189b45f93b8c5ca7648f6aee7)
I love press-enter-to-send but find this behavior confusing when
I'm in an edit box -- if we're going to respect it, we should
do so obviously (with a checkbox visible).
This reverts commit 6e3fc6495b7012aa12728a78b8bdd95701bb21e1.
(imported from commit d1ae16110f5504e879e315037c85c211ba3bca9a)
Turn on topic zooming for three realms with users who
requested to see more than five topics (tracked on #1248).
(imported from commit 56c73926a9f3c1006451a3e4a01b7661807908b5)
We need to resize the textarea when it is changed via .val(). By
clearing and resizing the compose box when it is closed, we can
avoid calling autosize_textarea() when the user opens the compose box.
This saves at least 15ms on every compose and might also be a cause
of longer delays.
(imported from commit fe6e092efcd1c4b95a868ee66653448f99af84c0)
R means "I want to send a PM, you can guess the destination"
r means "I want send a stream message, you can guess the destination"
C means "I want to send a PM and specify the destination"
c means "I want to send a stream message and specify the destination"
(imported from commit 755c92aed79ab79089b2e35d2c100582f012736a)
We encountered a strange bug in Chrome on OSX where the initial call
to set scrollTop when the browser window loads did not do anything,
until we first scrolled to some other location on the page. This
patch "fixes" that by automatically scrolling somewhere else before
scrolling to the target place on the page.
(imported from commit 96be6a0016e9e5fd78380613c9587f38406604df)
In the first cut at topic zoom, I was re-rendering the
streams list, but this created glitches with orphaned
list items. The reproducible bug was that unread counts
on unshown streams weren't updating.
In the new approach, I keep the elements more permanent, and
I just hide and show them as needed, either through jQuery
show/hide or permanent CSS selectors.
I got rid of toggle_zoom(), so that we just explicitly zoom
in and zoom out in all situations. In particular, when we
narrow, it's more clear now that only stay zoomed in when
we're narrowing to the same stream as before (including topic
narrows within that stream).
When you zoom in, the number of topics is no longer limited
to 30, since that was kind of arbitrary anyway. (In practice,
the number of topics is usually well under 30, anyway, due to
the way we track them on the client.)
(imported from commit 5b6c143dee9ba9fe557d8cc36335ff28efb4b0de)
This link lets you zoom in to more topics. We only show it if
there are topics that we had to hide to respect the max-5 limit
along with other rules of when you show topics.
This is feature flagged to staging only.
(imported from commit 9915004ec2eb3df7416fe45c0e60cebcd7fecfea)
When your left sidebar is zoomed to show just one stream,
there is a link to to show all streams again.
(imported from commit 92f39b042168c443cbb9f524bf892557ef492551)
If you double-click on a stream that you've narrowed to, it
will either zoom in or zoom out the left sidebar view. Zooming
in shows just that stream; zooming out shows all streams.
This is feature flagged to staging only.
(imported from commit 6fdb3cacd68635f313f2a8a81edf2d6101cce2cb)
This commit doesn't actually add the final UI to zoom/unzoom
topics, because I want to keep those in separate commits, in
case we change how to enable the feature. But this commit
adds a toggle_zoom() function that zooms/unzooms topics.
Zooming is minimally invasive, because we don't really introduce
many extra elements to the UI; instead, we just make the list of
streams be a list of length one (i.e. the active stream). This
gives us a lot of stuff for free, basically, like unread counts, etc.
(imported from commit 814c1361b6210d1591b4174bed1d6e0c98a3f255)
This is a subtle change, to make sure that list items
from stream_filters always go through click handlers, which
ensures, e.g., consistent behavior on opening the compose box.
(imported from commit cd734901def8959c8c8a29c164c7a60730ae0915)
Search suggestions were limiting you to the last 10 topics
in a stream, not the last 10 *matching* topics in a stream.
This was just a bug, where the slice() call was supposed to
come after the filter() call.
(imported from commit 7ad8f8409315d8ca389aa5bb085275a60f6e08c0)
This should make it possible to either open these using middle-click
or copy the links for e.g. putting in a bug tracker ticket.
(imported from commit 0c531453cdd7197f932079c245700948b416a3d5)
`$(message.content)` breaks on /me messages because they are not
wrapped in `<p>` so the message content is interpreted as a selector.
The message text is no longer used, so this line can simply be removed.
(imported from commit ee8d48c1f5fc489cc577cc466f629891ea65d55f)
This seems to only work in Chrome and Safari.
Firefox (at least my version) simply doesn't fire an onclick
event, and our desktop app has its own native code that decides
what to do when a notification is clicked.
(imported from commit 30bacec4726b9e6c022dd2c74f83d37747260dba)
Safari doesn't let you (shift-)tab to buttons, so we have to support
this ourselves in several cases.
(imported from commit 1b8ae28d6950fd9686b442948d71ab300c7328dd)
This is a behavior that basically only administrators can trigger
today, with the exception of the fact that anyone can edit a no-topic
message.
(imported from commit d50eded79ddf3438d87e3dc6a8641fbfb034d50c)
This makes the notification slightly more conservative as we do our
initial roll out. In particular, it avoids cases like being notified
when you are almost at the bottom of your feed for a message in your
narrow.
(imported from commit 9c834b1c344d8c429de92fb3512f32494fc02379)
When you upload a 2nd avatar to Zulip, the URL doesn't actually
change, so even new messages can show the old avatar, if your
browser is caching. We work against the cache by having the
"stamp" argument, which we vary at reload time and also when
we upload the new avatar. The browser still benefits from
cached images as new messages come in.
(imported from commit 84869c8d7f251c9f2498026a5e9e3b2451784879)
UserProfile.show_admin was intended to be a check for users that have
administrative rights in other realms, which we've harmlessly but
erroneously been using to check if they are an admin in their realm.
Use the more straightforward check instead, with a more intuitive
name.
(imported from commit d81050c7dbbb19e59c5e31750be303a4630e1456)
There will be browser errors on staging when this is deployed due to the socket
protocol changing.
(imported from commit f1eda5b5c2ec9c60c23b3ca96277a61debadf5bb)
If you don't call ui.resize_page_components(), then the user
list will have zero height. Now we call it.
(imported from commit ca2e295319550509360e4d2278489f9a328335ff)
This moves the notify-not-in-view notifications into the composebox area.
It also tries to be a bit smarter about what action it links and what it displays.
(imported from commit 1c79bd0d9ef972059a006b17501a09b72e961ee3)
The inactive flag wasn't really supported, and the
activation_toggle_button class was misleading, since
we don't yet toggle in both directions.
(imported from commit 0c8511021dd580c86df4e80092a6dd49e32773f9)
We had people_list-related code left over from before we
started using realm_people_dict.
(imported from commit f77c441269f07db2a8998c2184de81f9d0c053d6)