We now use window.innerWidth to check for CUSTOMER7's skinny
mode, which empirically seems to be more consistent with
CSS's max-width @media settings.
I tested under FF, Safari, and Chrome.
(imported from commit d440998634633c11b471fe732104be252c979cd4)
It's possible for a message to be considered "long" at one point,
and then if you narrow to it later, it should be considered "short",
because either the screen's wider or taller. This commit makes
sure that we remove the "condensed" flag from short messages,
and it also fixes the "More..." click handler's assumption that
could-be-condensed will always be true for condensed messages.
(imported from commit 77e4a1ad299c09f12e5609a972d5668472bd4a81)
Cache the height of messages to speed up ui.condense_and_collapse()
to make narrows work more quickly. The height of the message
determines whether it is auto-condensed or not. We clear specific
cache entries when messages get edited, and we reset the entire
cache when the window width changes.
(imported from commit 7c12070a3eb3e2e1a2dfeb8d9109f3404a46c032)
Trying to condense messages when they are not yet visible just
leads to wasted effort and wrong results.
This commit makes it so that current_msg_list always points to a
visible list, so the code related to message rendering knows when
to call ui.condense_and_collapse(). For activating narrows, we
now let rendering handle the condense/collapse case.
The home view situation is a little trickier, because we render
new messages in the home view even when we're inside inside of a narrow,
presumably to make it fast to switch into the home view. When
we actually go back to the home view, we need to sweep for messages
that might need to be condensed, since they have been originally
rendered while the home view was not visible.
(imported from commit 4da2d278a4353e9e0c2b98cbf8c9dd03b06cd59b)
This adds coverage on all of our handlebars templates. It renders
each template with representative data and generally performs at
least one sanity check on the DOM that gets created.
Also, the tests output the rendered HTML to .test-js-with-node.html,
which can serve as a way of documenting all of our templates.
(imported from commit 63dd7502457a8199dd35277fc5ab80cd53e2af22)
This caused problems with our tests suite where we were using a logged
in browser session and actually acting as a different user.
(imported from commit 73b8cb39d5d669e682fbacf2f7e574c228885c2f)
We don't use it yet, but the plan is the migrate there and it's better
to just have the filtering in place.
(imported from commit d0e7f40e8a439b8e8751da954e79b5f67226e5a9)
As far as I can tell, we don't actually use this value, but better to
have it be clear.
(imported from commit 3655b87f28b0554ee3db0acb2c0d59543dd093a1)
This replaces the AppleDeviceToken table with a generic
PushDeviceToken with a `kind` field to make it easier to add functionality
like per-device/per-stream settings that share code between Android and
iOS devices.
The schema must continue to work on prod with the old table name, so we
add the new table in parallel and can drop the old table once this code
hits prod and any necessary data is copied.
(imported from commit 0209a7013f2850ac6311f23c3d6f92c65ffd19e3)
This must be run manually on staging after deployment. Once it has been run,
it can be deleted. It only needs to be run on staging, not prod.
(imported from commit 79252c23ba8cda93500a18aa7b02575f406dd379)
This allows us to avoid a circular import when importing models.py
from inside bugdown for the realm-filters-from-database branch.
(imported from commit 7de85b54243132ade6818b080abdc8c5e8ad84f5)