Commit Graph

1521 Commits

Author SHA1 Message Date
Steve Howell 3f1b3af002 Add "Mentioning messages" to the upper left sidebar.
Treat "mentioned" messages like "starred" messages for narrowing.

Lots of ugly copy/paste here.  There might be opportunity for
some cleanup in places.

(imported from commit e7629890d42643c0000e1cc85422b2a0690f2cc4)
2013-05-30 14:45:01 -04:00
Keegan McAllister 371d0dbaa0 Identify app.js source map using a special comment
If we're going to minify third party code, the size heuristic may not hold
anymore.

(imported from commit 78ada1fee1446e78b3b1ad299ee3e975d1cd9002)
2013-05-30 13:51:46 -04:00
Tim Abbott 1cf2d993a6 Fix un-narrowing while the home view messages are still loading.
The bug we experienced here was that if you loaded the page in a
narrowed view, and then un-narrowed before the first block of messages
for the home view arrived via load_old_messages, then
narrow.deactivate() would re-select ID -1 in home_msg_list.  This ends
up calling recenter_view() on the message, which in turn tries to
access the message with message id -1, which fails.

We do sometimes re-select a message ID in order to recenter the view
properly when we prepend messages to a message list, so we can't make
this always a nop; instead we add a check for id -1 in the
message_selected.zephyr event handler.

(imported from commit 66f84a586e59d99aaf0e4ba2cda9fe597b033145)
2013-05-30 10:29:04 -04:00
Steve Howell b34fc4d78f Fix intermittent bug w/page downs at bottom of feed.
There was an off-by-one error in how we determine when
the message list was scrolled all the way to the bottom,
and this undermined our handlers for page down and scrolling
to get the pointer all the way to the bottom.

(imported from commit f80d11582b40726246e69c817a502b311081c730)
2013-05-29 18:42:38 -04:00
Steve Howell fc2c5eb70a Revert "Experimental navigation: t and b keys"
This reverts commit 13fb245f86ab84b1d2faea9d2a1f2145cd4aa907.

(Waseem wanted to hold off on adding more hot keys.)

(imported from commit 97c25ffa01fd7058fc90a278887d85b7d82a268a)
2013-05-29 18:10:43 -04:00
Jessica McKellar 80b13bdb73 Fix incorrect space character in several e-mail prompts.
(imported from commit 41bdbce2225a5eb5ab4057467d599d1341fcd9a5)
2013-05-29 15:23:26 -04:00
acrefoot c58ac9cc0c Re-focus on the compose box after a send
Re-focuses on the compose box after a send, but only if
the compose-box was opened by responding to the message
at the cursor (by hitting "r", enter, or clicking on the message)

(imported from commit 8e7560c8ea31397b57b2bc3e2e7d9dd996226a6f)
2013-05-29 13:07:45 -04:00
Steve Howell b3cb196452 Stabilize pointer after reply-to clicks..
The reply-to autoscroll was using a flag that was redundant
to suppress_scroll_pointer_update and then updating it prematurely,
which caused the pointer to move when you clicked on a message to
reply to it.  Now the pointer goes to the message you replied to.

(imported from commit e2f49fd6bd0da9a3f4b58c0eb08192ef0ee9abf0)
2013-05-29 10:11:39 -04:00
Tim Abbott ab093e7d9a message_edit: Fix traceback saving message edits.
Now that we sometimes call message_edit.end() twice, we need to check
if we've already cleaned it up.

(imported from commit 4e0efa14ba78df0a86b2ae97b99fa1be6197df88)
2013-05-29 10:11:08 -04:00
Steve Howell 975b984aee Slow down pointer adjustments at the bottom of the messages.
The main point of this fix is to move some more scroll-related code
into viewport.js, but it also fixes a bug where the size of #main_div
was not accurately representing the full height of the message list.
Making the calculation more accurate narrows the window where we
do pointer adjustements on mousewheel moves.

(imported from commit 5d821f459284c4dbd5ff8056001e54caf4355f1d)
2013-05-28 17:23:22 -04:00
Tim Abbott 968ef85ff8 Display the blank for new bots below existing bots.
(imported from commit 813fbf969d0fef508db1dc4acd02c1fc98f427fb)
2013-05-28 16:41:31 -04:00
Steve Howell b045d4e503 Uncover replied-to message by proper amount after clicking.
Fix min-height before doing the calculation of how much a
replied-to message is being covered by the compose box.  This
change also removes an outdated call to slideDown.

(imported from commit e5a3f35bbacff16dffae62c9e9f6bbc7978a13c1)
2013-05-28 13:45:43 -04:00
Jessica McKellar c50e05bc68 Focus on the correct textbox when you initiate a compose when narrowed.
The logic for this already existed, but start() was getting called
twice, once from compose.set_mode and once from the click handler, and
the result was the focus always being in the stream input box.

(imported from commit 9a832a118856b5705524975a4412b7e6e547ef5c)
2013-05-28 12:49:54 -04:00
Jessica McKellar 1ac44f0356 Expand the compose box in the correct mode when narrowed to PMs.
(imported from commit 68e4bb3091b855dafda8df3ca10737abb5d2f337)
2013-05-28 12:49:53 -04:00
Jessica McKellar c1a067857b Make clicking on a presence list name narrow you to those PMs.
This parallels clicking on a stream name, which narrows you to that
stream. This also gives you a discoverable way to narrow to PMs with a
particular person.

(imported from commit 6c706f0643f6a8ec20ac38360153227ec2f645ae)
2013-05-28 12:48:40 -04:00
Steve Howell 11430a58b7 Experimental navigation: t and b keys
This sets up the keys t and b to anchor your pointer to the top
and bottom of the viewport.  It empowers keyboard users who
are otherwise at the mercy of Barnowl recentering, but of
course it doesn't affect users who don't want to opt in.

(imported from commit 13fb245f86ab84b1d2faea9d2a1f2145cd4aa907)
2013-05-28 10:33:54 -04:00
Steve Howell 9cedca4dc5 Don't stop the autoscrolls for reply-to. Refactored.
The functional change here is that our code to stop
autoscrolling on certain events, particularly mousemove,
now only runs during system initiated autoscroll events.
If the user had been replying to a message, then the feature
to stop autoscroll was too aggressive.

This patch also starts to put more scrolling-related code
into viewport.js, which will hopefully prevent some code
duplication and give us a single place to control things like
stopping animated scrolls.

(imported from commit e7d5946b0ac7fcfda2eff1d0e2b58a78b44ecc1a)
2013-05-28 10:25:06 -04:00
Leo Franchi 10501c08cc Remove client-side mention calculation as it's done server-side via message flags
(imported from commit 603aa8aef69d486a8acda953ec72cdeeb7476dd7)
2013-05-24 21:23:58 -04:00
Leo Franchi b548538a98 [manual] Send UserMessage flags in get_events updates
This commit must be deployed in a separate step from the previous [manual]
commit

(imported from commit c6f00e217062790fce8380f61f82ea8824fb3722)
2013-05-24 21:23:58 -04:00
Zev Benjamin a74590ea12 Remove mixpanel wrapper
We can use mixpanel.disable, instead.

(imported from commit 1da1513de2f9e19b0c3149bb412030feba960f87)
2013-05-24 21:23:57 -04:00
Tim Abbott 8479b4f0cd [schema] Record and display whether a message was edited.
We also record the historical edits to the message in this JSON format:

 [{"prev_content": "new test message 14", "timestamp": 1369157249},
  {"prev_content": "new test message 13", "timestamp": 1369157118}]

but we don't actually do anything with the information as of yet.

(imported from commit 2d5ca449b87b33ad035ab0e076a22e150c8e7267)
2013-05-24 21:23:55 -04:00
Leo Franchi de8f43fec1 Add all unknown people to people_dict, even if they have only been PMed with
(imported from commit 01ca442127d5289a2cdfa5e9630aa928bea0b6eb)
2013-05-23 10:39:47 -04:00
Leo Franchi 98d8095391 Don't require people_dict to contain everyone you PM with
(imported from commit 003a5bf601366986c0f65d0e945d8e390ad581cd)
2013-05-23 10:15:58 -04:00
Leo Franchi 3be1acebaa Use canonicalized names when processing unread counts
(imported from commit 9a4a1d48221f10489a9dcf3ab2532b73b0c26e4e)
2013-05-23 09:56:43 -04:00
Leo Franchi c12fd08050 Use same canonicalization for stream names when calculating recent subjects
(imported from commit d934f67cb469728162b8ae48b5fc63805bf18d8f)
2013-05-23 09:56:43 -04:00
Allen Rabinovich f69762e612 Modify message box layout and spacing.
* Modify the narrow icon in FontAwesome to make it better align to the pixel grid and display well on Windows+Chrome.
   * Move the message controls to the right
   * Hide the message info icon until the message is hovered / selected
   * Switch the star to a gray version
   * Increase the size of the gravatar
   * Adjust the spacing
   * Add the right-side message pointer
   * Fix private message background colors and mention colors
   * Modify star count test to account for new stars
   * Bug fixes for stream subscription messages and other miscellanea.

(imported from commit 3d3d9de7e03f3658c5c78b492051b2b7f795487d)
2013-05-22 21:55:15 -04:00
Steve Howell 7cdbb0e6b0 Make auto-scrolling less aggressive.
This goes back to only scrolling by the size of the new
message, and it avoids scrolling in certain use cases.

(imported from commit f9e6380b779bb21283ba889715712b6b51633838)
2013-05-22 18:22:09 -04:00
Leo Franchi 3b7ddd72cf Don't throw an exception if we get an undefined stream
(imported from commit b6bbaf1fa14bec5fc43016f81e15caa32a9fb948)
2013-05-22 18:12:49 -04:00
Zev Benjamin 991630c031 Record basic versions of the operators used in narrows for metrics
(imported from commit 5c7cb3a62ebf0b2c1f0d8e9cae8d845cde9baf56)
2013-05-22 16:20:48 -04:00
Zev Benjamin 2ab5c7dd76 Fix race involving mixpanel load order
Previously, we were referencing the mixpanel objects only once, at
page load time, which meant that there was a race between metrics.js
loading and mixpanel completely loading.  Mixpanel starts with stub
methods and then replaces them once it fully loads, asynchronously.
If metrics.js ran before mixpanel loaded, we'd end up wrapping the
stub methods instead of the real versions.  Adding a layer of
indirection ensures that we always get the right method.

(imported from commit 6a8cfbf249168443956895b7a7e29bf7bb4222aa)
2013-05-22 16:20:48 -04:00
Tim Abbott a34d640eb3 Rename message_edit.cancel to message_edit.end.
(imported from commit 5c720100afbf1e86c09eb2567f465c42353f95ec)
2013-05-22 13:04:37 -04:00
Tim Abbott e68c6bb1da Fix race where message editing might be cancelled after rerendering.
(imported from commit 989f1eace526d351cdbd9e15de594964de09a770)
2013-05-22 13:04:32 -04:00
Tim Abbott d0df3d9b37 Revert "Fix that you have to save an edited message twice to complete the edit."
This reverts commit 87226d857845c6f16cb3bc0d6ab5bb748aca5987.

This meant that if for some reason there's a server error or network
failure trying to send in your edit, your changes are silently lost.

(imported from commit 2b5d19716fef1565b061a2b6c7cecc54f183b6f3)
2013-05-22 13:04:32 -04:00
Tim Abbott 67f84b06f7 Add support for changing colors in the stream popovers.
(imported from commit 30593148500a78c36baec87af5868d8c5a173d96)
2013-05-22 12:10:16 -04:00
Waseem Daher 6656869a92 signup: Rotate through cute placeholder names.
(imported from commit 59c1523d35cd80e904a173fefc614da2543b391d)
2013-05-22 11:32:18 -04:00
Zev Benjamin b565b2adc9 Add a bunch of debugging support for mixpanel
Currently, some browsers don't seem to be sending metrics information
to mixpanel.  This commit will make said browsers noisy, but should
help debug what's going on.

(imported from commit c5050f66d985eb76e38117b2668594fedfc10702)
2013-05-22 10:43:57 -04:00
Zev Benjamin 10dbfd0985 Record narrow metrics
(imported from commit d312115d384dd1f33e05dcd1b3f1dadc86e3fdf3)
2013-05-21 17:56:49 -04:00
Zev Benjamin d35c8f0c81 Track what user action triggered a narrow
(imported from commit 2b110dc27334e4b823810bfef13c3d10d36b3886)
2013-05-21 17:56:49 -04:00
Zev Benjamin d1ac16ee3f Record compose metrics
(imported from commit 194a7d36650cf3e1e52f0dad3f453942179de122)
2013-05-21 17:56:49 -04:00
Zev Benjamin c60a500a8f Track what user action triggered a compose
(imported from commit 3e23dd1f7e9e3a742b0c3b9e1b0eeb85cfa4c736)
2013-05-21 17:56:49 -04:00
Zev Benjamin a4bda36ab4 Add a wrapper to mixpanel so that we can selectively enable metrics collection
(imported from commit 1d72f2e98c4c756a8a988d08731282e4195b8e1a)
2013-05-21 17:56:49 -04:00
Steve Howell 5e64b9e90b Fix screen geometry for the tab bar.
Use tab_bar_underpadding to find out the top of viewport
that we can view.  Also, eliminate effective_page_size().

(imported from commit 0e2d777790552e77d635989e496f3446cefccb1e)
2013-05-21 14:45:38 -04:00
Jessica McKellar 8609c59781 Only show edit subject hint on messages you sent.
(imported from commit 613a023bf22b07f879864690142e9d5e0a56f0ef)
2013-05-21 14:19:56 -04:00
Jessica McKellar f4b99c8177 Fix that you have to save an edited message twice to complete the edit.
(imported from commit 87226d857845c6f16cb3bc0d6ab5bb748aca5987)
2013-05-21 11:04:56 -04:00
Jessica McKellar a6a3110bfb Encourage users to edit placeholder subjects with an edit icon.
(imported from commit 0bfe67876b237ea2fb4f523b23b9cdbbd9a4027a)
2013-05-21 11:04:56 -04:00
Jessica McKellar a3b6758315 Give a placeholder subject when users don't supply one.
(imported from commit ac6f0f7029c6a96c4c20562b02bee656436c70b2)
2013-05-21 11:04:54 -04:00
Steve Howell 33dd01885a Fix autoscroll to use ui.message_viewport_info().
This will make it automatically work if we add new tab
bar like things.  The current version of ui.message_viewport_info()
is slightly broken; that's a separate fix.

(imported from commit fa1906b738433223831250e3191dfd8e87d67daf)
2013-05-20 23:55:03 -04:00
Steve Howell 8738f330c5 Fix lint error in unread.js.
(imported from commit 2b6736dfbd03cb8de93ab9e38f471430bdcf6d61)
2013-05-20 23:42:22 -04:00
Steve Howell 62d6360a48 Extracted model code out to unread.js.
Most of the model logic pertaining to unread counts had been in
zephyr.js, along with a couple global variables.  Now the code
is encapsulated in unread.js.  It was a pretty straightforward
extraction with some minor method name changes.  Also, a small
bit of the logic had also been in stream_list.js.

Conflicts:
	tools/jslint/check-all.js

(imported from commit f0abdd48f26ab20c5beaef203479eb5a70dacfff)
2013-05-20 23:42:11 -04:00
Steve Howell c587a18646 Animate "Private messages" when new private messages come in.
Set the background behind "Private messages" to green whenever
a user's unread count goes up for private messages.  Remove
the background after 3s.  Advanced browsers will fade the
green in and out over 6s (3s up, 3s down).

(imported from commit 80ed9661d9eec1d697f3259854037d7e145615cd)
2013-05-20 23:41:40 -04:00