Commit Graph

2196 Commits

Author SHA1 Message Date
Tim Abbott 54b10a292c Monkeypatch Django cursor to log query times even when DEBUG=False.
I don't like monkeypatching in general, but this will give us logging
of how much time is being spent in total on database queries on our
staging and prod instances for each of the views we have -- which
should help a lot with debugging performance problems.

The code being patched is identical in Django 1.5, so I don't expect
any issues upgrading in the near future.

I may work on a patch to upstream Django to support this as well.

(imported from commit 08624c7a30f1fd192a972973e0380dd6a131d84e)
2013-02-12 12:01:02 -05:00
Waseem Daher c3cb9a6246 Allow the stream and user lists to scroll with mousewheel.
The previous commit stopped the mousewheel event at .bottom_sidebar,
which means it was never getting to our individual scrolling lists.

(imported from commit 92d32c21bb596d0e14d887ff779a857223d45342)
2013-02-12 11:54:34 -05:00
Waseem Daher 55b05d7bd2 Have the stream list and user list share the sidebar.
This isn't perfect, because if, e.g. the stream list is super short,
it still takes up lots of space that the user list might want to use,
but it's an acceptable first pass solution, in my view.

(imported from commit 669737d769258c089b40ffea4abee3229902e857)
2013-02-12 11:54:34 -05:00
Jessica McKellar 7956f859b2 management: add a remove_users_from_stream command.
(imported from commit 4aeefcc5160a382b13f8bcc2321e76eeea55f4d3)
2013-02-12 11:49:22 -05:00
Jessica McKellar 645e7d58be management: fix add_users_to_streams given do_add_subscriptions output change.
(imported from commit bc03ee0bd601122689e2062b6963780743ac7d27)
2013-02-12 11:49:22 -05:00
Tim Abbott d0953bc8a1 Log time spent doing database queries when DEBUG=True.
When DEBUG=False, Django doesn't log the data at all.  We can and
should add tracking of that at some point, but it requires patching
Django; so for now just log the data when DEBUG=True.

(imported from commit 2b9e6a4c68009733373724f38debe4e77313fdeb)
2013-02-12 11:07:36 -05:00
Tim Abbott c24e05f0e9 Log requestor email address for non-error requests too.
This should make it much easier to debug issues where a particular
user is hosing our API, for example.

(imported from commit cbea49fd1e11805cadf564bd9160d3d6bf7e0eca)
2013-02-12 11:07:36 -05:00
Jeff Arnold f93661e798 Make @**Jeff Arnold** only notify me, not every Jeff
(imported from commit 8e59eceebb4c5af298b0251c126b181cf5899d93)
2013-02-12 10:42:52 -05:00
Leo Franchi 495f7835c8 Make linter happy.
(imported from commit 0c30f2ef176249cd1a06a21946e51a20d6ca7a32)
2013-02-12 10:40:21 -05:00
Jeff Arnold 875e125fb9 Cause @all or @everyone to alert everyone
(imported from commit e2d1cd8b6ea4f2cbae82d052643a5b88e979931c)
2013-02-12 10:27:09 -05:00
Jeff Arnold e2f3a85dbd Clean up the notification code
(imported from commit 5bd811ba40b3f535d474ac53e22fd16816f9bac6)
2013-02-12 10:27:09 -05:00
Leo Franchi b30e277f5a One minute interval for keep-alive pings
(imported from commit f41ffc853c42e75a2e2cb365b73cceac44b7d723)
2013-02-12 10:22:11 -05:00
Waseem Daher 30bed51a65 Style the green 'online now' dot entirely in CSS.
This lets us clean up the HTML a little bit in preparation
for a later change which will cause the stream and people
lists to scroll independently of one another.

Also it feels a bit more fun.

(imported from commit b3b49149d7ec2960fd752fe50b41e55d363c1a98)
2013-02-11 23:15:19 -05:00
Waseem Daher 096e1b7727 Cause clicking on a person's name to start a PM with them.
This is actually a tricky one, because:
* Later, probably if we display an unread count by the person's
  name, the action on clicking them might very well be
  "Narrow to PMs with that person"
* But for now, while we don't have that, everything about
  historical precedent really does strongly suggest that
  clicking that person's name is going to get you a PM with
  that person.

So we implement that. For now anyway.

(imported from commit 4d461fd6edec122d542c4a97e23f2e400c31122e)
2013-02-11 22:36:20 -05:00
Keegan McAllister ca2b48e1ee Prevent scrolling in the stream/user sidebar from moving the message view
(imported from commit b2279b2bac07e29a41b3e5335d2e0d81eb196757)
2013-02-11 20:43:25 -05:00
Zev Benjamin 57b6d6eb50 Make integral easter-egg font-neutral
(imported from commit 2a6c751ab7e872e4b4ddd6bafcb86b0e5d091c1e)
2013-02-11 18:37:34 -05:00
Leo Franchi 674118c104 Add unit tests for active/idle presence
(imported from commit 2685b4ed052b32f347d9d879392b7e87c3e89e1a)
2013-02-11 18:05:57 -05:00
Leo Franchi 83011f7f47 Show a user activity list in the sidebar
(imported from commit 95aaa55c7e4cc39f844518b5308866bedf2cd1c5)
2013-02-11 18:05:57 -05:00
Leo Franchi c348dd3587 Remove get_instance() from SimpleQueueClient
SimpleQueueClient was not thread-safe as the pika method
calls that we are using might disconnect and end up in a bad
state if two threads enqueue messages at the same time.

In order to avoid this, each user of the rabbitmq queue
gets its own instance of a SimpleQueueClient.

(imported from commit 694083b75cd58a60b8de282a8f40eb92a864c5ce)
2013-02-11 18:05:57 -05:00
Leo Franchi 0a0c4bb9a0 [manual] Use rabbitmq for asynchronous presence updating
Note: When deploying, restarting the process-user-activity-commandline script is needed

(imported from commit 63ee795c9c7a7db4a40170cff5636dc1dd0b46a8)
2013-02-11 18:05:57 -05:00
Leo Franchi 31f87481d0 [manual][schema] Add an API for user presence (idle) information
Adds a new db table for storing presences, and an API for setting
an individual user's idleness as well as fetching all idle status
for all users in a realm

(imported from commit 5aad3510d4c90c49470c130d6dfa80f0d36b0057)
2013-02-11 18:05:57 -05:00
Leo Franchi 6f18f4465d Don't add a person more than once to our people_list
The full name may have changed

(imported from commit 44cf37b3f5e17c28f0a6b0a4c75a5c22470a9516)
2013-02-11 17:58:46 -05:00
Keegan McAllister b0bdd7fe0b actions: Flip the popover to the top of the message when near the bottom of the page
From the "reimplementing GUI toolkit behaviors from the early 90's" department.

(imported from commit f3aac2e44c77a858f657233dc032cd52c60843e9)
2013-02-11 17:17:04 -05:00
Keegan McAllister fb3a32f8f0 actions: Open the popover on more specific elements
Now if you click the timestamp, the popover appears near there, rather than in
the middle of the message.

(imported from commit 285a71fddd5b6d9ac86511e5fe41c811d2663342)
2013-02-11 16:59:07 -05:00
Keegan McAllister fe6a9b09ce Also underline timestamp and sender name when a click would open the popover
(imported from commit 4b234e2e1f0025862929906a80188b006c6048b4)
2013-02-11 13:59:19 -05:00
Keegan McAllister 04266fb39d Restore the timestamp tooltip
Now that this isn't the object controlling the actions popover, we can set its
title= back to anything we like.

(imported from commit 36d3ecb23fd22cdc9189537820b944442f7bb5c6)
2013-02-11 13:59:19 -05:00
Keegan McAllister f6cc8d3306 Make right-clicking anywhere on a message open the actions popover
(Except for links.)

(imported from commit 82ce229f3bbc647e9a35d93b063075fa68dbfe93)
2013-02-11 13:59:19 -05:00
Keegan McAllister 7fac4afbe7 Refactor show_actions_popover
(imported from commit 1cb7d7c6c032b0c38adc5b4a4e0752d554f07521)
2013-02-11 13:59:19 -05:00
Keegan McAllister acf61d9c48 actions: Add narrowing to the popover
This addresses another usability problem from #470.

I decided it was too confusing to have menu options for both stream and subject
narrowing, so I went with the latter.

(imported from commit 948fca954a265029ceb27c72ae178015d513785d)
2013-02-11 13:59:19 -05:00
Keegan McAllister 3609f5fdee Add helper narrow.from_popover
(imported from commit 6b20ce7e4eddff03351f5abe8f3f7c080876ea16)
2013-02-11 13:59:18 -05:00
Keegan McAllister 9356c0ca95 Add a link for the actions popover next to the timestamp
Hopefully the text and link-like styling will make it more clear that this
feature exists.

The sender's name is still clickable, but loses the link-like styling since the
popover isn't about the sender.  The space between the sender's name and this
link is now active as well.

We also remove the sender's email address that was previously visible on hover.
It's not hard for the name + email + actions link + timestamp to be too long
for one line.  The email is still present in the popover.

(imported from commit 3a85f199c42102cac0d217543db0a539935e2914)
2013-02-11 13:59:18 -05:00
Keegan McAllister a240ca2a67 Fix indentation in message template
(imported from commit e506bccefdfdc3c015f71f5caa144ce5de2a2bac)
2013-02-11 13:59:18 -05:00
Keegan McAllister 5052460b95 Generalize hover effect for stuff clickable to get the actions popover
Similar to the previous commit.

(imported from commit 4b9558ea204f637467f42995a69b0dbc1e0d8cac)
2013-02-11 13:59:18 -05:00
Keegan McAllister 03cf4199b5 Generalize the message hover effect
We now set a CSS class on the hovered message, which is used to
control email address visibility.

(imported from commit 787e24f71f20aa3a6452e57b94f5ca1a4c8bc32f)
2013-02-11 13:59:18 -05:00
Keegan McAllister 4476f3c083 actions: Clarify reply target
This addresses one of the usability problems from #470.

(imported from commit cb196ab02a82a18a3236ffc5c0c2c7bc87054810)
2013-02-11 13:59:18 -05:00
Keegan McAllister ab8037d828 actions: Move sender information out of the popover title into the body
This makes sense because the actions aren't really about the sender.

(imported from commit cf47939ecc93f4d1113268637e41c0a6daa0f2c2)
2013-02-11 13:59:18 -05:00
Keegan McAllister 16d62fe5de Combine the actions popover with the timeinfo popover
The message timestamp is now always clickable, and the popover contains the
full long-form date and time.  This addresses one problem from usability
testing (see #470).

(imported from commit ad502dff128ad1c934fc0d3faaf5e2931c91c37e)
2013-02-11 13:59:18 -05:00
Keegan McAllister 520d7b1f97 Rename userinfo_popover -> actions_popover
(imported from commit fab5a44af1acaf93640a2f57ffc25b3e97f55d2e)
2013-02-11 13:59:18 -05:00
Jessica McKellar 3a39ac76c4 Add a new /get_members API query.
(imported from commit ced7c74212210a1fcee03c1c402dca9b42483d11)
2013-02-11 13:45:46 -05:00
Zev Benjamin af2d8902c2 Only show the scrollbar for the sidebar on hover
(imported from commit 359443e2ebcbb9a4e440ee8edfe42cb7f2b2e73c)
2013-02-11 11:10:10 -05:00
Luke Faraone 8dbda2cd64 Use full emails rather than just usernames in /activity.
(imported from commit c0397d6429fe85f0bd6e57731dd2132ed1e11b85)
2013-02-11 10:33:16 -05:00
Jessica McKellar 0cbe53b9c7 Autocomplete @notifications to your bolded full name.
This is a stopgap to handle e-mail addresses like me@foo.com.

(imported from commit 804b477214d45f46373b2138d5ff9036644c87da)
2013-02-11 10:03:51 -05:00
Jessica McKellar 53f0b00785 Add a management command to change and log user emails.
(imported from commit 0bf25433a371f7e46ade96019f4a9ceebe395fe5)
2013-02-10 16:45:25 -05:00
Waseem Daher dc02e236df Document our Jenkins integration.
(imported from commit a2711e10eaf5ae4b06de5becf94f9857b535a63b)
2013-02-09 20:54:10 -05:00
Keegan McAllister aa644ab757 Remove direct use of x.attr('zid')
See https://wiki.humbughq.com/Code%20style#x.attrzid-vs.rows.idx
for why this is bad.

(imported from commit b341146704af3bb1b477b12d226096ab72b5e269)
2013-02-09 13:52:16 -05:00
Keegan McAllister 8399426b9c Remove incorrect 'title' argument when creating timeinfo popover
Bootstrap ignored this and instead used the title= attribute, containing the
full timestamp, which seems like what we want.

(imported from commit 8442835d61f89bd0bce75c05e17aabe85e0f417c)
2013-02-08 18:24:16 -05:00
Tim Abbott 000b02c068 Clean up code duplication in add_messages.
The interface is a little messy because so many of the inputs change
-- we need to better organize all these variables under centralized
'zfilt' and 'zhome' headings.

(imported from commit b247e86bf63ea2ea2c0d42ef23e8af0ce288d5dd)
2013-02-08 14:43:21 -05:00
Tim Abbott 2d9a21654b Fix messages being added to the home view out of order.
So here's the reproduction recipe:
(1) Find a narrow that doesn't have any messages since 4 days ago

(2) Directly visit that narrow in your browser (or wait for someone to
do a deploy and thus auto-reload)

(3) Wait until load_old_messages has been called at least once

(4) Un-narrow

(5) Scroll up, and notice that the 400 most recent messages are above
sets of older messages.

The cause is that the code in add_messages assumed that
selected_message_id was within the range of message already in the
home view.  This is true in most cases where add_message is being
called, but it is not true in the case that the user was in a narrowed
view containing only very old messages (And thus selected_message_id
would be older than everything in the home view).

We can fix this by tracking persistent_message_id separately and using
that for the relevant test in add_messages.

(imported from commit f0da2561ba68f729343b260adc398029fae6acf7)
2013-02-08 14:43:13 -05:00
Keegan McAllister 9edb616feb queue: Add logging
(imported from commit db2f15cf5f6a683f03d08a2e8b8ee4547537daf7)
2013-02-08 13:57:22 -05:00
Keegan McAllister 89c544f21f queue: Refactor SimpleQueueClient initialization
In anticipation of subclassing.

(imported from commit 1ebee932aed1b472bf9a8ab6d9bc30519f587c83)
2013-02-08 13:57:22 -05:00