When narrowing, we use the selected id in the home view as the anchor,
and if the user is new and hasn't selected any messages yet (or moved
the pointer since first using humbug), their home view selected message
will be -1. Rather than failing to get_old_messages for any narrows starting
from that point, return all matching messages.
(imported from commit 72cfe392d9ac01ed41abc8eadf0f47240e374665)
The new system, called blueslip, makes errors fatal when in debug
mode and only output a message when running in production. In the
future, it could also send user errors back to us automatically.
(imported from commit 1232607c0311e885c8b5a5e8a45ffb28822426e0)
This should substantially improve the repeat-rendering time for pages
with large numbers of tweets since we don't need to go all the way to
twitter.com, which can take like a second, to render tweets properly.
To deploy this commit properly, one needs to run
./manage.py createcachetable third_party_api_results
(imported from commit 01b528e61f9dde2ee718bdec0490088907b6017e)
The jQuery .data() documentation says: "Every attempt is made to
convert the string to a JavaScript value (this includes booleans,
numbers, objects, arrays, and null) otherwise it is left as a
string. To retrieve the value's attribute as a string without any
attempt to convert it, use the attr() method."
(imported from commit f47c1cbb94cb5a98ea9842b00f45c35cd21873f9)
This should hopefully cause the page not to scroll around when we load
a giant block of emoji, because now the size of the emoji is known
before it finishes loading.
(imported from commit f566437edd725f6084c6a10c6230fd36e8d12346)
Our mobile apps (which don't support in_home_view filtering) will move
the pointer to a message that isn't actually in the home view, so we
need to accept that sort of input for now (and maybe in general --
even if we fix our mobile apps, third-party clients may screw this up
too).
(imported from commit ce837e972f0581abd1df44fdb2dd5270dfb9afde)
This commit adds a dependency on python-twitter,
whose upstream is at https://github.com/bear/python-twitter,
and which for now needs to manually be installed on our
servers from the Debian package in sid.
(imported from commit 80cd9f4f59a6f0de6b75ac95e412c69e2a2e2490)
This should make their size totally known to the DOM,
which should prevent jumpiness when they load.
(imported from commit 564d920014f5bc52c217adf54c2f5bab6ba625e0)
We now clean up the stream subscription in more places, but some
historical tutorial streams are still around and if an error or page
reload happens during the tutorial it'll stick around.
(imported from commit 8cf0ebda26bf752c1a23296a4ba85d194bbb3004)
This uses the unauthed v1 of the Twitter API, which is going to go
away soon, but it's fine as an interim measure.
(imported from commit 709a250271321f5479854a363875c9da43e6382d)
For people who aren't on the @humbughq.com realm the tutorial bot showed
up in the create new stream modal but attempting to invite them failed.
This was most often noticed with the tutorial bot.
In the future we should figure out a really good cross-realm story, but
in the near-term we need to probably exclude other people outside your
realm rather than special-casing @humbughq.com.
This closes trac #1059.
(imported from commit df704df0c8ae84b23d9491ce6ab77300831cdd20)
We now add the my_fullname class to the entry for you in the sidebar so
that we can automatically update this element when changing your name.
This closes trac #979.
(imported from commit f1473d6bb6f18810311d42c85d4b57aab9966498)
We also grey out the box to prevent the user from clicking twice.
This closes trac #1030.
(imported from commit eec810e3fbc5b7c9350c2d91e448fb27d4c856f8)
This code also has the side effect of making it no longer possible to
click to the right of a name to start composing a message to them.
Fixes#931
(imported from commit 80e995ccc8ead18b80a39181c47cc94d6063f0f6)
Previously, if a narrowed view started out with no message selected,
one would never be selected unless you clicked on it.
(imported from commit 11c6a1a8d046ec33a3dbea4067c40896be137485)
The message list data structure never had the rendered_idx values
initiatized except via _maybe_rerender (called when a message is
selected). For the narrowed message list for streams with no messages
yet, we didn't select a message (as there was none to select); the end
result is that msg_list.append() will never rerender because it tries
to subtract undefined from undefined and gets NaN in its test for
whether it needs to rerender.
So fix this by initializing _min_rendered_idx and _max_rendered_idx to
valid values for the empty message list (the closed interval from 0 to -1).
(imported from commit 6afecb1569185a842a3a9108cedba7e88f8befad)
I find that I never use it, and I don't totally like our
experience in the app to be different from our users'.
Admittedly, this is a small way in which that's the case :)
Finally, since we do usability studies in @humbughq.com,
the link appears there too, and I'd like it not to.
(imported from commit 1225c4ae79de52fa98b21ce00a6542df76b667ea)
Use less technical subjects, and make them good examples of actual
topics you'd want to discuss (previous examples like 'jQuery' might
leave people wondering "jQuery is a technology, not a topic, why is
that a subject?")
(imported from commit 23b74fe145ed2d325daa94a46e63c42c005b1459)
Prior to this change, any stream message sent by internal_send_message
could only be in the realm of the sender.
This was a problem most notably for... the tutorial bot, with the
hilarious consequence that the tutorial worked fine in humbughq.com,
but failed to start anywhere else.
(imported from commit 33a904a28e3a57e1a2cf9172c2e2a75b50967a50)
Require POST method for /accounts/logout. This has the side effect of
automatically enabling Django's CSRF protection.
(imported from commit 44b1b6ebaadc1c03006e21ae54ac768e31234801)
The typeaheads take some time to open and changing focus on keydown
sometimes prevents them from doing so before the focus is changed.
(imported from commit a8153704e60f3d6c34af55a3de5bd43071a15baf)
This is in response to the following bug report by Evan Broder:
FYI, it looks like if I accidentally tab to the "Formatting" link and
hit enter, it erases the message (and replaces it with a reply to
whatever the selected message is, I think?)
This is subtle and here's why: Suppose you have the focus on a
stream name in your left sidebar. j and k will still move your
cursor up and down, but Enter won't reply -- it'll just trigger
the link on the sidebar! So you keep pressing enter over and
over again. Until you click somewhere or press r.
Net-net though, I think it's a change worth making, because
it's good for keyboard accessibility.
(imported from commit b65bcc0abbc751718bb03d418c03961b9ed9e42b)
I.e. if you sent a stream message, Tutorial bot will reply to that
stream, and if you sent a PM, Tutorial bot will reply with a PM.
(imported from commit 05b7d1848f6eb1f70dcd5fb365fba9daee52a5dd)
This simplifies a bunch of fragile resizing logic in our code,
and also addresses the Chrome Canary bug where clicking in the
searchbox causes the navbar to get huge.
This fixes Trac #764 and Trac #1039
(imported from commit fc8c3995109de384b71dfba2b986a8500ff7f08d)
With this change,
pkill -SIGUSR1 -f runtornado
will dump the stack and SIGUSR2 will enable an interactive debugging
session.
This fixes#613 for Tornado which was the original motive for that
ticket; I'm not sure whether we want to do this for our Django
processes as well, but it would be easy to do so if we did.
(imported from commit a7de7c6070f4bf0404bed6f434e6a6b291d66a26)
I figure it's worth giving people time to read the message and click
the "Report error link" before we redirect the page away; 60 seconds
is still short enough that if the person wasn't at their computer,
it'll still fix itself.
(imported from commit 577193cf8dca0a646933741a50769378ddd824bb)
The new message list system can rerender the message list on scroll,
but did not properly re-highlight any messages which were highlighted
at the time the scrolling was initiated due to an open compose box,
this time due to a bug where the meaning of "this" changes when we
moved the rendering code into the message list library.
(imported from commit 26d9716811b56a6f89ae22e68038ad560dcfee64)
The new message list system can rerender the message list on scroll,
but did not properly re-fade any messages which were faded at the
time the scrolling was initiated due to an open compose box.
(imported from commit 4bc7c172e8bb55acfaacc5e5460eb6a2ef9aebe2)
Now when the font increases, so will the size of the emoji. (1.4em
seems to be 20px at our default settings, so this doesn't change the
size of the emoji for any of our existing people).
(imported from commit edb0b590f00bfbad0355a41b1f995335cf0e9e07)
Otherwise we're by default testing the phone size layout, which
probably isn't what we want the default test setup to be.
(imported from commit a76b2d51c18824b0a5f6342cce848aca87dda15a)
Previously we did the equivalent of a $('.message_comp').child('input'),
which does not search beyond the first level.
In addition, using a comma in a selector is essentially an AND, which
means the narrow search only applied to elements of the 'input' class.
So when debugging we saw a bunch of elements being selected and that hid
the bug for a bit.
Now we do a .find instead which will ensure we blur the correct
elements.
This closes trac #1045.
(imported from commit f44383ee9fc93406d031589ef914f5a003334ea7)
This now adds you to a special `tutorial-username` when you begin,
we send tutorial messages there, and we remove you from it when
you're done.
(imported from commit a93a90b9347a4f72536e96331ddfd1d47727ce71)
But only allow them to send to tutorial-<<your username>>.
The idea being that this helps reduce potential abuse from this JSON
call. (Because otherwise, anyone could call into this endpoint and
have the tutorial bot send random messages to random peoples's
streams.)
(imported from commit 471d4348d7ad43858b5df240e4f1dceba006aab6)
This cuts about 6 seconds off of the test startup time on my laptop.
The other startup costs are about 1 second for the server to come up
and about half a second for casperjs to begin executing tests.
generate-fixtures now takes a '--force' option that can be use to
force a regeneration of the test database.
(imported from commit 1f473507502f0edf159b2638abb392d9357eb46f)
Prior to this commit, at 800px, e.g., the Google button
is smushed into the login form.
(imported from commit 422d1b677439460785f6b31ea2fe2c819e23e259)
Previously, we blurred all input/text boxes, including e.g. the search
box. This probably won't impact normal operation, but this can be a
problem for our automated frontend tests which tend to have different
timing than real life.
(imported from commit ea84312bea2aae99d51b48cede0746e7a5b6e76e)
Previously, using e.g. the search box would be problematic because the
compose box closing event might fire, blurring the search box, in the
middle of whatever you were doing.
(imported from commit cc045f5a6a7b7fbf72848da14b6fcd3df39cab05)
We had a bug where if the selected message had the same subject as the
target message, but a different stream, narrowing by subject would
narrow to that subject plus the selected message's stream rather than
the target message's stream.
(imported from commit 4b196342318a06d8aeea46bf05e3d7416ecb6c5b)
Previously if you narrowed to
"pm-with:wdaher@humbughq.com,jbarnold@humbughq.com", you'd always get
no results because our filter was comparing your query against
message.reply_to, which is sorted in alphabetical order.
(imported from commit 40dc78640f3b010f11312176cfcf3c331fdf3337)
The most expensive part of adding the display time to messages is
calling time.toLocaleDateString() and time.toLocaleTimeString().
Most of the time, this information never gets seen, so we now delay
calculating it until just before the user would see it. This cuts
the time to render a chunk of messages from >1s to ~200ms.
(imported from commit 6167e7a8e1c3b4ca77471fa346292be4ffa67ec8)
Adding the display times to messages is very expensive (> 1s for 400
messages in Chrome on my machine). This commit doesn't directly
address that issue, but does mitigate its affects on scrolling speed
when rendering the next chunk of the message list. After this
commit, rendering a portion of the message list for the second time
only takes ~300ms.
(imported from commit b22badb5dcce69be297f6403b1cb40950e46376e)
Long-term we probably want to pick the render window size and
re-render threshold based on the user's window height instead of
arbitrarily.
When we re-render we probably also want to ensure that the newly
selected message appears in the same location as it would have
before the re-render.
(imported from commit f044b7f2200822e8e6e8dba7108d087a69016134)
One of Matt Goldstein's comments is that we often make you look
like you're not at your computer, even when you are, just because
you haven't checked Humbug for a while.
While it's important to have this be accurate, right now I think
we err on the side of showing you as not present. So I increased
some of the timeouts in an attempt to fix that.
(imported from commit 9fd8f432e6684ec1b33d1d932f37caa99c627959)
This might need to change after we merge zev's message list branch, but
it fixes the bug and performs well and isn't a lot of code.
And it has the nice property that it'll only fade messages within the
neighbors range, so there's no need to update the unfading code to
support this.
(imported from commit c562d7335bc5635c960321e1451e4ba0f4452ee9)
I don't actually have this problem, but Jessica et al tell me that the
tutorial bot's messages sometimes arrive too late for them and it
interferes with the test suite's ability to run correctly.
I add a delay which should hopefully reduce the occurrence
of this issue.
(imported from commit 0f41610ada7dd49d71f0deef034e014164357197)
Even though they look like images, they're not -- you need to
append ?dl=1 to get the image version.
(imported from commit 2a05e7c58f475c908687110d9191f8709425c660)
It's not quite what the CUSTOMER4 person wanted, but
I think it scratches the itch.
This fixes Trac #1023
(imported from commit 9186499c8f6bacb230a2d1ed6d5ca7ffa7416ac3)
To be fully responsive, we can basically never specify the width of
our container in a fixed number of pixels; otherwise we'll run into
the situation where there's an inordinate amount of wasted space on
our left and right.
So everything needs to change from, e.g. row to row-fluid,
and that has a whole cascading series of changes that that implies.
(imported from commit 7e2771d916f429548c65c0a00fc4c11397054656)
Previously we defaulted to current_msg_list.selected_id, which was
fine if you were narrowing from the home view, but if you navigated to
a narrow with no messages in it and then clicked something in the left
panel or used the search bar, it wouldn't work.
Fixes trac: #870.
(imported from commit 5ee480d8d2b1fb300fccbe75e04135d977a1fc07)
The first change might somewhat address users asking "does it matter
which one I click on?" by not being specific that one should click on
_this message_.
The latter I think addresses a small confusion I've seen where people
try try to hit tab before starting a reply.
(imported from commit 708acdf4d4c80713795b96b1a59d681a88604670)
This is the fix for https://trac.humbughq.com/ticket/958 (Narrowing
moves the pointer) proposed by jhurwitz. Currently on master,
narrowing can cause you to end up wildly out of place.
This branch is not a perfect fix -- you do end up with the pointer on
the expected message after the narrow, but that message is centered on
the screen; better would be for that message to not move at all.
(imported from commit b89e4e2c896add20eceb609db46c46dc025fdce2)
If this is not the case, then you can't actually click the
"Press Enter to send" checkbox in the composebox (or anything
in the space occupied by where the popup will go).
This actually is not a perfect solution because that area still
remains unclickable for anything else. (In particular, for example,
scroll a message's "Info" link and then try to click on it -- you
can't! The click is captured by the #notifications-area div.)
http://www.vinylfox.com/forwarding-mouse-events-through-layers/
proposes an alternative more general way of dealing with this,
but it seems like a real pain.
This fixes Trac #1017.
(imported from commit 9cfde1cfff63ab32ae7d129980c47567e221eac3)
This import strips other icons we aren't using from the CSS definitions and
fonts.
Licensed under MIT.
(imported from commit 02cc2681a1cf44107444b6fe70420afca6950ae2)
This code adds a dependency on python-django-auth-openid, installable as
django-openid-auth from PyPI.
On prod, one needs to run a syncdb in order to create the required
tables. A database *migration* is not required, as these are new tables
only.
(imported from commit c902a0df8d589d93743b27e480154a04402b2c41)
In Safari only, if you narrow to something and scroll all the way back
up to the top and then unnarrow, your position actually remains all
the way at the top!
We explicitly call a "scroll_to_selected" as the final step of
deactivating a narrow, which brings this message into view.
This doesn't seem to be an issue on Chrome and Firefox, but I'm not
quite sure why; something about the sequence of events.
(imported from commit fc73640351be03c02eb2f3c8a23de3327723f002)
After c1d98239 the function works in CasperJS as well.
Reverts some of 90f4d6ac3ddb387e74051b9af2c230698fa94479.
(imported from commit 3579df33930bb34dc081908b84900905eee6d270)
By splitting up all_msg_list and home_msg_list, we can properly add/remove
streams from the home view without having to jump through hoops.
(imported from commit 92767197759f7519197dfc58be951b60fa823fbb)
If we have removed a stream from the home view, and our pointer
that we load from the server refers to a message that is no longer
visible, we don't want to error out but rather select the nearest
message to our previously selected one.
(imported from commit d212f1fba7b06836d1d916b43042991625b6f41e)
Messages are now selected on a MessageList, which triggers a
message_selected event that other parts of the code can listen for.
(imported from commit 1da9e4121425c0ac4461b41b7aea169072e1512b)
Previously we would select the first message in the block. Now, we
only do that if a message that is selected will not be in the
resulting narrowed view. If the selected message will be in the
narrowed view, we select that message once narrowed.
(imported from commit 4da5a3a0b597b58c2e028f1b29ac20ae3808a4d1)
I kind of expect this to work, and hopefully this'll help with
people getting stuck on the "Settings" page in the tutorial.
(imported from commit 1159d884dcd331bcfb74864a0176fa293e8c3714)
Most of them are just typos or funny punctuation, but this also adds
the word "above" after "You and Humbug Tutorial Bot" since otherwise
the user might try to click the text in the message body and be
confused.
(imported from commit dccaf4acd24db713acab261440f0a9d03860e0f4)
Right now the MIT realm has pretty bad UI lag with 1,200 messages loaded. We
need to fix the root problem, but this commit at least makes reloading the page
a satisfactory remedy.
(imported from commit 93d47710891cfc4db9fa00beaa5ccd10113aa1c3)
Here I have a sketchy but functional framework for dealing with
all of the async stuff that a tutorial requires, and an early
draft of what such a tutorial might look like.
I could probably go and remove the first-run message, but I'll
keep it around for now in the unlikely event that something I
haven't anticipated goes wrong in starting up the tutorial.
(imported from commit de9779a66a1b3fe790082decb324c90ec180b39b)