Commit Graph

143 Commits

Author SHA1 Message Date
Tim Abbott 54c32992fd Fix hitting down-arrow at bottom of message list.
Previously the viewport.scrollTop() command that we ran in this case
would actually scroll far off the bottom of the site; it only did
something that looked reasonable because bottom_whitespace was small
and thus the scroll was truncated.

This version scrolls to 10% of the viewport away from the top.  We may
need to tweak that to instead be a fixed number of pixels or something.

(imported from commit 0176bf6e3662dfa24887f41b110b429bd8054cb0)
2013-07-08 17:32:18 -04:00
Jeff Arnold 8f58647ff6 Don't let up/down close a compose unless the compose content is focused.
Fixes #1447.

(imported from commit 73603050680c526be3764dbaaa8ed747b76ead56)
2013-07-05 15:00:08 -04:00
Waseem Daher 51f9ace595 Revert "Chevron icon on each message now causes a dropdown menu; hover on message for info"
This reverts commit f8fbf70c8502370a78159e24f3cf9589fb9d384f, since
we're waiting on some Firefox and no-hover fixes.

(imported from commit 6b13f5bb9d907303ab311afd7da584bc06538c91)
2013-07-03 17:44:35 -04:00
Kevin Mehall 0f6bdafea3 Mark all messages in view as read when you hit the bottom.
Trac #1428

(imported from commit f40d890091528969ae4e4db80adb019cbce60fef)
2013-07-03 17:10:15 -04:00
acrefoot bea702dd17 Chevron icon on each message now causes a dropdown menu; hover on message for info
As does the hotkey "i". It's somewhat less appropriate because it's all actions,
but it's where our "info" menu used to be, and we can workshop a better one. "a"
feels weird to me, but maybe it's just me.

You can also hover on the .message_content to see a popover with extra message details

This is for Trac #1334.

(imported from commit f8fbf70c8502370a78159e24f3cf9589fb9d384f)
2013-06-28 12:24:03 -04:00
Tim Abbott 6cc45b89b1 Revert "Hide pointer until a hotkey is used"
This reverts commit fec64815c879f9704847795cc163e2b517b4190d.

We've decided this experiment didn't work out.

(imported from commit 04f38e15c8ef19fbaa022a06bbcca3b0c67ec5ad)
2013-06-20 18:02:18 -04:00
Tim Abbott c87e12ad41 Revert "Tweak hotkey behavior when pointer isn't shown."
This reverts commit 74fb298c711e61ae98c210d0ed11c875ce6ba591.

We've decided this experiment didn't work out.

(imported from commit 8acd3a030b692f9397155a20a9f89e63ed6a6cf7)
2013-06-20 18:02:18 -04:00
Kevin Mehall b1b4c1a625 Update fade on every change to recipient fields. Trac #1261.
(imported from commit 2b966765bef3e7e4d8cd2ee6ad55a05ba1f23ab2)
2013-06-18 10:06:58 -04:00
Kevin Mehall b06c2f7ccf Tweak hotkey behavior when pointer isn't shown.
Disable the hotkeys that act on the current message, except Enter
immediately shows the cursor without moving it.

(imported from commit 74fb298c711e61ae98c210d0ed11c875ce6ba591)
2013-06-14 13:50:03 -04:00
Kevin Mehall 6cb7baf598 Hide pointer until a hotkey is used
(imported from commit fec64815c879f9704847795cc163e2b517b4190d)
2013-06-14 13:47:07 -04:00
Steve Howell c2ab6428b8 Handle shifted hotkeys better.
Treat shift-space like page-up.  Let the browser handle
shift-page-up, shift-escape, and similar keystrokes.

(imported from commit 31d5c5eb1dd4af7228c5e7794fb4cffc4bd8e88b)
2013-06-11 11:49:53 -04:00
Steve Howell 19adec9d2c Make hotkey.js less error prone to modify.
I extracted get_event_name(), which should help isolate
the problem of identifying keys from the specific mechanics of
dispatching actions for given keystroke events.

(imported from commit 058c0749016dc17cce554788e10ccb32438e9dfe)
2013-06-11 11:49:53 -04:00
Leo Franchi 76c9e27a76 Disable composebox experiments on prod
(imported from commit a553320e7d775978ee31af0f8920cbfeb705f5cb)
2013-06-11 11:41:34 -04:00
acrefoot 10d63dff9a stop emails regarding bad hotkey parsing
Why are our tests so incomplete?

(imported from commit 8d94a95f514edeb6ddb74774224fee062af3b5df)
2013-06-10 15:34:11 -04:00
acrefoot b3be518b5a Fix previous hotkey fix
re-enable 'j' and 'k' hotkeys.

(imported from commit 61a9025c4b0560f9f6ce4e9699e191c40106fcde)
2013-06-10 15:19:11 -04:00
acrefoot b27bb3fc33 Check e.which on hotkey events for charCode != 0
"(" and "↓" share the same e.which, but only "(" has a non-zero
charCode. This commit will start checking for non-zero charCodes
for directional keys.

(imported from commit bcb8c3c5ef2c13708fd04cca5f4d8b0f65beaa84)
2013-06-10 12:39:39 -04:00
acrefoot da361b9208 jbarnold composebox UI experiment
1) When you send a message, restore the focus to the composebox, targeted at the same recipient
2) If the composebox is completely empty and you press up or down, have that close the composebox and take the appropriate action
3) If you started the compose via a reply option (r, enter, click), don't refocus the composebox if the cursor has changed.

(imported from commit 84545e49d06959eb62e7fd2b22e1387383df6d1d)
2013-06-07 17:39:31 -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
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 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
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
Zev Benjamin d35c8f0c81 Track what user action triggered a narrow
(imported from commit 2b110dc27334e4b823810bfef13c3d10d36b3886)
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
Steve Howell 898a69f42a Fix Pagination when user hits PgUp/PgDn/Space. (ticket 1237)
This commit takes control of keyboard-based pagination away
from the browser, so that we can use the effective viewport
size as the amount to page, as well as keeping a little bit
of overlap from page to page.  There had been issues with
pagination for a while, but the introduction of the always-open
composebox particularly aggravated the situation.

(imported from commit 45b9b7d5a6b322230c9d55e1be0b763dbce06e2e)
2013-05-10 15:36:24 -04:00
Leo Franchi 9362731e4d Mark messages behind pointer as read when moving pointer
(imported from commit 7e1d3d7124aec239a8fdd24da4aab682a41ff435)
2013-05-03 11:14:47 -04:00
Leo Franchi d0b8a2fd21 Mark messages as read when using the End key
(imported from commit b2495cb27b1362d037e786db7f108540f2ce655b)
2013-05-01 17:26:19 -04:00
Jessica McKellar 69753f228c hotkeys: fix assumptions that message lists are non-empty.
This fixes user-visible browser errors caused by trying to use the id
of messages in an empty message list.

One error could be triggered by trying to go to the end of your feed
with the End key during a reload.

Another could be triggered by trying to narrow to a stream or subject
using hotkeys while in an empty narrow.

(imported from commit a0e5456fd3b475aecac6eddd7104772baaf3aeb8)
2013-04-10 16:36:11 -04:00
Tim Abbott 3a93c8cc90 Fix pointer jumps on unnarrowing after certain scroll events.
This appears to have been caused by our code for preventing the
viewport from being recentered if you move the pointer away from the
edge of the viewport from a position near the edge, which was being
run even when it was not triggered by a scroll event.

(imported from commit 0a4b3dcca75a6e5dbf1beb77a5249bd6a9c61341)
2013-04-03 13:38:41 -04:00
Tim Abbott 11ad134f7b Fix directional hotkey calculations for Home and End keys.
The old directional hotkey calculation system was fragile, and because
of this, didn't scroll when you used the home/end keys.

(imported from commit dca4786de13a4ed2864600dadbf4b1a5ba848074)
2013-04-03 13:37:23 -04:00
Leo Franchi 2f09492e71 Don't scroll to a message if there are no messages loaded
(imported from commit 8b881713595f60b3a989cb2c6875444e80c736d4)
2013-04-03 11:33:20 -04:00
Jessica McKellar ce66bdec5b Remove unused hotkeys.in_scroll_caused_by_keypress.
(imported from commit 65223a036e72489a41130a83e4537d0ccb80b90c)
2013-03-28 17:08:25 -04:00
Jessica McKellar 3df47f2025 Do not try to recenter if you were already moving in the right direction.
Before this commit, if you try to arrow around when the selected
message is outside the pointer threshold for recentering, you get a
big jump, even if you are arrowing towards the center of the viewport.

(imported from commit 5c15d5ccccdf027a8bfa8b79bf519fccbfa971d8)
2013-03-28 17:08:25 -04:00
Tim Abbott 61ee8b1921 Unfade messages after you manually edit the recipient.
It's pretty confusing if this doesn't change.  In some other world we
could update the fade, but since we're currently only fading on reply,
I think it would be weird to update the fade when you're picking a new
recipient.

(imported from commit 8f77419d443d578068b57f847354ac6da7632ee2)
2013-03-13 11:12:25 -04:00
Waseem Daher 0e1b019f0a Allow Esc to blur the searchbox input.
This is a fix in response to an issue reported by Nelson.

(imported from commit 3db9e3a91d4e848408f19645e20382414a87b115)
2013-03-11 11:49:47 -04:00
Waseem Daher f941a58ec1 Suppress enter-replies if a button or link has focus.
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)
2013-03-06 18:10:20 -05:00
Zev Benjamin 182eb86db7 Only render a small portion of the message list at a time
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)
2013-03-05 12:48:32 -05:00
Luke Faraone d88107567a Remove "find in page" functionality.
This was a source of user confusion and didn't provide that much value.

(imported from commit fbe9405d8bc4cb6661baa7fe7583eab5ed73d886)
2013-03-04 10:59:41 -05:00
Zev Benjamin 4c9e3a167e Move message selection to an event-based system
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)
2013-02-21 13:29:17 -05:00
Zev Benjamin 9e9b4c8541 Make MessageList.selected_id an accessor method
(imported from commit 144d12ba8be2de02900ef06c3413f660144de8bf)
2013-02-21 13:29:17 -05:00
Zev Benjamin e9b915c2b9 Remove global selected_message_id and persistent_message_id variables
Each message list now has a selected message id.

(imported from commit 041abc54ea42c636c30e39df4a2e838bb830e1aa)
2013-02-21 13:29:17 -05:00
Keegan McAllister 00445c843e Restore the cursor position when shift-tabbing back from send button to content
Fixes #806.

(imported from commit ccdab39b52f3aee387be17f13c91ecfabee2b214)
2013-02-19 11:25:03 -05:00
Jessica McKellar 2852692de5 Hide floating recipient bar on mousewheel scroll but not keypress.
That way it is visible more consistently when arrowing through
messages (arrowing causes scroll events).

(imported from commit ba629b907e4e593032a61a10b04f00e592fe8427)
2013-02-18 21:17:29 -05:00
Zev Benjamin bcd0bb80e1 Remove narrow.target() and pass the target explicitly
This fixes #861

(imported from commit 244deaae84db2e8c7c5ce3f9b9b25cc33bdd234d)
2013-02-13 10:56:10 -05:00
Keegan McAllister 520d7b1f97 Rename userinfo_popover -> actions_popover
(imported from commit fab5a44af1acaf93640a2f57ffc25b3e97f55d2e)
2013-02-11 13:59:18 -05:00
Waseem Daher 8f434fb63e Have 'c' and 'C' behave identically to their buttons.
Prior to this commit, if you have the composebox open, pressing 'c' or
'C' clears its contents. This change makes it work more analogously to
pressing the 'New stream message'/'New private message' buttons.

(imported from commit 3de5bf83754d8ab86b1967ce2ba15f5846090667)
2013-02-04 11:46:17 -05:00
Jeff Arnold 030fbbccad Autocomplete @names in the compose box
(imported from commit a6df85d4dbeaecaceaa4ed76d1adff4a000392c5)
2013-01-14 13:27:20 -05:00
Jeff Arnold 3c8b30d043 Revert "Autocomplete @names in the compose box"
This reverts commit d60d1693e77bdd045a1bd20491c6d6efed918b39.

(imported from commit 796036e146eaf917b74dc0bac01e92aa6a682d16)
2013-01-11 13:49:23 -05:00
Jeff Arnold 09a6dc6c42 Autocomplete @names in the compose box
(imported from commit d60d1693e77bdd045a1bd20491c6d6efed918b39)
2013-01-11 13:00:34 -05:00
Keegan McAllister 6dea25fd9f Add narrow.by for syntactic convenience
(imported from commit 51300b93a078d54e5111e6bb16ecd9ecbcc295d2)
2013-01-08 12:18:31 -05:00
Keegan McAllister ddf75b64f7 Un-narrow whenever we clear the search box
(imported from commit 15533579bfbae1644cc76b33348c3cd21a829713)
2013-01-08 12:18:30 -05:00