This will hopefully fix some lagginess when logging in on the Hacker
School realm, especially on Firefox, as the user presence rows are
populated (previously requiring hundreds of template renders).
(imported from commit 67e2d7f91ad62d8d7a2e212ee7c7121bd73f010b)
Fix a minor bug where if you return to the home view with a recipient
filled out, it would be unfaded.
(imported from commit d81d974dcb054c63d8a5dd5afec7b072c99d4e3f)
Previously we had fancy logic to determine where to focus, but immediately
clobbered any focus choice we made and forced the stream selection to be in focus.
We also incorrectly determined what to focus in the case of clicking the new PM
button when in a stream narrow.
(imported from commit 01e2cec8eca068ee1d45d3cfb21607b981d5034e)
Unlike the other cases where we do this sort of offset calculation,
we're working with a message which is not msg_list.selected_id() --
which means that this message might not actually be rendered at all.
Correct for this by just letting then_select_offset stay undefined in
that case.
(imported from commit ebb8a23bf34c52f9495aa88ceca8eb4458d50be1)
When it's not offering any other suggestions, suggesting what
you've typed is unnecessary and confusing and it should just
hide completely instead.
Trac #1476
(imported from commit ff69bb53c661e0a3a193dbddde6e7a4ff8b10031)
This seems to have been somehow introduced in the refactoring to move
the popovers into their own file
(36ad3c61e4d7eb05751f9b886d15edceab656d71).
(imported from commit f5f58844a9c2da4b4433489be1772263f3aba350)
This fix also cleans up the search operators so that @-mentions
and Private messages have a more similar naming convention.
(imported from commit fb1a2119aab5aa9e179c6e321a8d2ef2e90290cf)
This scrolling behavior is driving me crazy on staging.
Reverting until we come up with a better alternative.
This reverts commit 41954fecd9efb43820ed1ccb5210283c17752f51.
(imported from commit 2db602cf51ca734b00ec1bd454c39204468fa024)
This is one case I forgot from the last commit. For example, if the
message actions popover is open, and you open the user sidebar popover,
the message actions popover should close. It now does.
(imported from commit a241634cb1aabf8883cf95ebd5b8ba96f5ed9908)
A cleaner, more general solution would be nice but this fixes at least
the most obvious cases for now.
(imported from commit fc7260e25a4f2172eee74af9c2d9384898947ad3)
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)
Previously the code to save/restore the scroll position when toggling
a stream in/out of the home view would only work if you were currently
not in the home tab -- because you used to only be able to do this
from other pages.
(imported from commit 4002a3980dfd87dabd570abee3ebc63417a78cc5)
Previously, we had some ugly complicated logic through which we
attempted to keep the selected message on screen when prepending
messages, but we didn't actually preserve the scroll position -- the
selected message would jump on the screen. This fixes that, by just
saving/restoring the scroll position of the selected message.
This perhaps makes our model/view split even less clear, but at least
it's correct.
(imported from commit 0a01450bbbcdf1b45c891d0570c9fcfb11769315)
message_list.prepend() now actually only rerenders the new messages
when prepending using the where="top" functionality (previously it
would erroneously just adjust the message database and then wait for
message_list.append() to call _maybe_rerender(), determine that things
are awry, and rerender the whole message list).
(imported from commit c64b7b540a4f5332ad792de0fad9f20750e6db1c)
This has two benefits:
(1) Users can scroll their last message to near the top of the screen,
which decreases how often one needs to scroll down to track current
messages.
(2) It makes scrolling bugs near the bottom of the screen a lot easier
to find, because scrolling down too far isn't blocked by being unable
to scroll messages off the screen.
We should probably later convert this to some formula that varies
dynamically based on the height of the last message.
(imported from commit 41954fecd9efb43820ed1ccb5210283c17752f51)
It turns out that this code tries to place the initial pointer 1/7
from the top; the only reason something reasonable happened
historically is that bottom_whitespace was only 40% of the screen, so
the pointer message ends up landing in the center anyway.
(imported from commit 56d4c2acd018d9a87551c82a43c214c6d80bfb90)