zulip/static/js
Steve Howell b3594c984a message scrolling: Fix "Scroll down to view" warning.
We recently added a feature to warn users that they
may need to scroll down to view messages that they
just sent, but it was broken due to various complexities
in the rendering code path.

Now we compute it a bit more rigorously.

It requires us to pass some info about rendering up
and down the stack, which is why it's kind of a long
commit, but the bulk of the logic is in these JS files:

    * message_list_view.js
    * notifications.js

I choose to pass structs around instead of booleans,
because I anticipate we may eventually add more metadata
about rendering to it, plus bools are just kinda brittle.
(The exceptions are that `_maybe_autoscroll`, which
is at the bottom of the stack, just passes back a simple
boolean, and `notify_local_mixes`, also at the bottom
of the stack, just accepts a simple boolean.)

This errs on the side of warning the user, even if the
new message is partially visible.

Fixes #11138
2019-01-07 17:17:55 -08:00
..
billing billing: Remove mix option from frontend. 2019-01-04 23:52:00 +05:30
bundles ui: Extract feedback_widget module. 2019-01-04 10:54:07 -08:00
portico signup: Fix bug in import settings when subdomain is root. 2018-12-29 15:01:09 -08:00
stats analytics: Refactor to support more than one tooltip on same page. 2018-11-28 16:04:35 -08:00
.eslintrc.json
activity.js frontend: Add event handling for user status. 2019-01-02 09:16:31 -08:00
admin.js settings: Add support for customizing the top-left logo. 2018-12-18 12:44:52 -08:00
alert_words.js lint: Add eslint enforcement for comma-spacing. 2018-12-07 12:22:24 -08:00
alert_words_ui.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
archive.js stream_color: Make stream color assignment more efficient. 2018-11-29 13:00:25 -08:00
attachments_ui.js attachments ui: Initialize table sorted by Date uploaded column. 2018-10-02 11:32:45 -07:00
avatar.js settings: Fix width not maximum while uploading user avatar. 2018-10-19 12:36:18 -07:00
blueslip.js Change ui check to ui_report in blueslip. 2018-08-03 15:59:10 -07:00
bot_data.js statis/js/bot_data.js: Add `get_bot_owner_email` function. 2018-11-16 09:52:05 -08:00
buddy_data.js status: Show "(away)" next to yourself if you're away. 2019-01-02 09:27:16 -08:00
buddy_list.js refactor: Split out buddy_list_conf(). 2018-10-16 16:53:47 -07:00
channel.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
click_handlers.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
color_data.js stream_color: Make stream color assignment more efficient. 2018-11-29 13:00:25 -08:00
colorspace.js lint: Add eslint enforcement for comma-spacing. 2018-12-07 12:22:24 -08:00
common.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
components.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
compose.js compose: Add support for using Zoom as the video chat provider. 2019-01-07 10:00:02 -08:00
compose_actions.js Rename util.get_topic -> get_message_topic(). 2018-12-29 11:38:39 -08:00
compose_fade.js compose fade: Use "topic" internally. 2018-12-29 11:40:59 -08:00
compose_pm_pill.js compose pill: Add has_unconverted_data() helper. 2018-10-12 11:20:30 -07:00
compose_state.js subject -> topic: Rename compose fields. 2018-12-09 21:28:45 -08:00
compose_ui.js compose_ui: Create the `compose_ui.replace_syntax` function. 2018-08-26 23:33:24 -07:00
composebox_typeahead.js emoji: Merge datasources for emoji picker and typeahead. 2019-01-05 15:09:04 -08:00
condense.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
confirm_dialog.js settings: Add confirm_dialog module. 2018-10-12 10:37:06 -07:00
copy_and_paste.js lint: Add eslint enforcement for comma-spacing. 2018-12-07 12:22:24 -08:00
csrf.js csrf: Improve API for when no CSRF input is available. 2018-12-16 16:19:23 -08:00
debug.js eslint: Enable `no-extra-parens` rule. 2018-06-11 07:51:24 -04:00
dict.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
drafts.js drafts: Fix bug in finding current element. 2018-12-16 15:46:41 -08:00
echo.js subject -> topic: Sweep "message.subject" in frontend. 2019-01-01 20:49:38 -08:00
emoji.js emoji: Remove now unused `emoji.emojis` data structure. 2019-01-05 15:09:04 -08:00
emoji_picker.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
favicon.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
feature_flags.js Remove feature_flags.mark_read_at_bottom. 2018-07-07 10:19:15 +02:00
feedback_widget.js ui: Render feedback widget client side. 2019-01-04 10:54:10 -08:00
fenced_code.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
fetch_status.js message_fetch: Deduplicate logic for finish_newer_batch. 2018-12-13 08:43:56 -08:00
filter.js subject -> topic: Sweep "message.subject" in frontend. 2019-01-01 20:49:38 -08:00
floating_recipient_bar.js refactor: Rename vars in floating_recipient_bar.js. 2019-01-03 17:33:44 -08:00
gear_menu.js settings: Extract gear_menu.update_org_settings_menu_item(). 2018-12-07 11:40:40 -08:00
hash_util.js subject -> topic: Fix hash_util.js. 2018-12-29 14:34:06 -08:00
hashchange.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
hotkey.js ui: Close feedback widget with escape key. 2019-01-04 10:54:09 -08:00
hotspots.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
info_overlay.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
input_pill.js input pills: Fix modal gets closed when user click on remove-pill-btn. 2018-11-28 16:33:08 -08:00
integration_bot_widget.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
invite.js invite: Replace `invite_as_admin` usage with `invite_as`. 2019-01-05 14:46:38 -08:00
keydown_util.js keydown_util: Ignore alt-arrow and similar things. 2018-12-04 12:24:39 -08:00
lightbox.js thumbnails: Rename data-original to data-src-fullsize. 2018-07-30 13:00:23 -07:00
lightbox_canvas.js lightbox: Make `v` close the lightbox during Pan & Zoom. 2018-07-23 10:36:48 -07:00
list_cursor.js list_cursor: Promote error handling code. 2018-08-24 10:00:04 -07:00
list_render.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
list_util.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
loading.js org settings: Fix a bug where the loading spinner was not visible. 2018-08-08 10:59:23 -07:00
local_message.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
localstorage.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
markdown.js subject -> topic: Sweep "message.subject" in frontend. 2019-01-01 20:49:38 -08:00
message_edit.js lint: Enforce semicolon spacing in eslint. 2019-01-05 15:31:30 -08:00
message_events.js message scrolling: Fix "Scroll down to view" warning. 2019-01-07 17:17:55 -08:00
message_fetch.js Refactor: Split up add_messages api. 2019-01-07 17:17:55 -08:00
message_flags.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
message_list.js message scrolling: Fix "Scroll down to view" warning. 2019-01-07 17:17:55 -08:00
message_list_data.js subject -> topic: Sweep "message.subject" in frontend. 2019-01-01 20:49:38 -08:00
message_list_view.js message scrolling: Fix "Scroll down to view" warning. 2019-01-07 17:17:55 -08:00
message_live_update.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
message_scroll.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
message_store.js subject -> topic: Sweep "message.subject" in frontend. 2019-01-01 20:49:38 -08:00
message_util.js message scrolling: Fix "Scroll down to view" warning. 2019-01-07 17:17:55 -08:00
message_viewport.js message scrolling: Add started_scrolled_up logic. 2019-01-07 17:11:17 -08:00
muting.js page load: Fix two bugs related to muting/unreads. 2018-12-15 13:44:30 -08:00
muting_ui.js ui: Extract feedback_widget module. 2019-01-04 10:54:07 -08:00
narrow.js narrow: Use get_message_topic() helper. 2018-12-29 14:15:43 -08:00
narrow_state.js minor: Change "subject" to "topic" in comments. 2018-12-29 11:38:39 -08:00
navigate.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
night_mode.js ui: Explicity initialize night mode. 2019-01-04 10:54:10 -08:00
notifications.js message scrolling: Fix "Scroll down to view" warning. 2019-01-07 17:17:55 -08:00
overlays.js user settings: Fix active background links when a modal is visible. 2018-12-09 22:32:53 -08:00
padded_widget.js buddy list: Add padding to progressive scrollings. 2018-08-02 16:59:27 -07:00
panels.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
people.js custom profile fields: Markdown rendering for custom profile field values. 2019-01-01 21:06:21 -08:00
pm_conversations.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
pm_list.js refactor: Move pm_with_uri to hash_util. 2018-08-04 09:32:27 -07:00
pointer.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
poll_widget.js widgets: Rename voting_widget to poll_widget. 2018-12-16 19:46:48 -08:00
popovers.js status: Add user menu options to set/revoke away status. 2019-01-02 09:23:20 -08:00
presence.js presence: Use people.is_my_user_id() for check. 2019-01-03 13:49:44 -08:00
reactions.js reactions: Fix minor formatting in log message. 2018-07-10 16:22:52 -04:00
realm_icon.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
realm_logo.js settings: Add support for customizing the top-left logo. 2018-12-18 12:44:52 -08:00
recent_senders.js subject -> topic: Sweep "message.subject" in frontend. 2019-01-01 20:49:38 -08:00
reload.js subject -> topic: Fix subject in opts. 2018-12-16 11:26:18 -08:00
reload_state.js refactor: Extract reload_state module. 2018-08-04 13:55:02 +00:00
reminder.js subject -> topic: Use util.set_message_topic() to set subject. 2019-01-01 20:49:34 -08:00
resize.js lint: Add eslint enforcement for comma-spacing. 2018-12-07 12:22:24 -08:00
rows.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
rtl.js rtl.js: Fix support for supplementary planes of unicode characters (>= U+10000). 2018-08-14 11:39:29 -07:00
schema.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
scroll_bar.js right sidebar: Change media cut-off for where we hide the buddy list. 2018-09-27 07:29:32 -04:00
scroll_util.js scroll_util: Account for element padding in height calculations. 2018-07-27 09:09:52 -07:00
search.js lint: Add eslint enforcement for comma-spacing. 2018-12-07 12:22:24 -08:00
search_pill.js search: Add a basic implementation of search pills. 2018-07-23 11:29:10 -07:00
search_pill_widget.js pills: Use `widget` instead of `my_pill` throughout the app. 2018-07-23 11:29:10 -07:00
search_suggestion.js search: Do not display `All messages` suggestion if bar not empty. 2018-07-23 11:29:10 -07:00
search_util.js Extract search_util.js module. 2018-07-30 11:25:32 -07:00
sent_messages.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
server_events.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
server_events_dispatch.js emoji: Merge datasources for emoji picker and typeahead. 2019-01-05 15:09:04 -08:00
settings.js settings: Eliminate admin_sections module. 2018-12-17 10:13:20 -08:00
settings_account.js custom profile fields: Markdown rendering for custom profile field values. 2019-01-01 21:06:21 -08:00
settings_bots.js settings: Update organization permission strings to reflect guests. 2018-10-30 10:48:06 -07:00
settings_display.js emoji: Fix caching for text emojiset. 2018-09-21 18:34:12 -07:00
settings_emoji.js emoji: Remove `display_url` from the context of `admin_emoji_list`. 2018-08-14 12:07:56 -07:00
settings_invites.js settings: Fix casper tests on invitations page. 2019-01-05 15:08:37 -08:00
settings_linkifiers.js settings: Rename "settings_filters" to "settings_linkifiers". 2018-12-17 12:28:55 -08:00
settings_muting.js muting: Add stream_id to markup for mute settings. 2018-12-14 16:05:35 -08:00
settings_notifications.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
settings_org.js compose: Add support for using Zoom as the video chat provider. 2019-01-07 10:00:02 -08:00
settings_panel_menu.js settings: Eliminate admin_sections module. 2018-12-17 10:13:20 -08:00
settings_profile_fields.js settings: Call maybe_disable_widgets() in set_up() methods. 2018-12-17 10:13:18 -08:00
settings_sections.js settings: Rename "settings_filters" to "settings_linkifiers". 2018-12-17 12:28:55 -08:00
settings_streams.js settings: Call maybe_disable_widgets() in set_up() methods. 2018-12-17 10:13:18 -08:00
settings_toggle.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_ui.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_user_groups.js lint: Add eslint enforcement for comma-spacing. 2018-12-07 12:22:24 -08:00
settings_users.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
setup.js js: Extract csrf.js and include in common bundle. 2018-12-16 16:18:42 -08:00
socket.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
starred_messages.js display settings: Implement UI for starred_message_counts. 2018-08-21 13:42:23 -07:00
stream_color.js Extract color_data.js. 2018-11-28 14:51:51 -08:00
stream_create.js Clean up code to open "Create stream" panel. 2018-12-02 18:40:00 -08:00
stream_data.js subscriptions: Add tooltip, only subscribers can add user in private stream. 2019-01-05 16:21:41 -08:00
stream_edit.js subscriptions: Add tooltip, only subscribers can add user in private stream. 2019-01-05 16:21:41 -08:00
stream_events.js stream_color: Make stream color assignment more efficient. 2018-11-29 13:00:25 -08:00
stream_list.js Use stream_id for by_stream__uri(). 2018-12-14 16:05:40 -08:00
stream_muting.js Refactor: Split up add_messages api. 2019-01-07 17:17:55 -08:00
stream_popover.js Use stream_id for mark-topic-read handler. 2018-12-14 16:05:40 -08:00
stream_sort.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
submessage.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
subs.js subscriptions: Hide add-subs html element if user is guest user. 2019-01-05 16:24:39 -08:00
tab_bar.js tab_bar: Make explicit call of narrow change handle function. 2018-11-29 12:36:00 -08:00
templates.js settings: Warn if server is unable to deliver mobile push notifications. 2018-10-31 13:18:17 -07:00
tictactoe_widget.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
timerender.js timerender.js: Remove use of legacy font awesome base class 'icon-vector'. 2018-10-15 19:22:57 +05:30
todo_widget.js todo lists: Make lists sharable. 2018-12-17 07:40:27 -08:00
top_left_corner.js PM sidebar: Expand PM sidebar for huddles. 2018-10-22 12:22:26 -07:00
topic_data.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
topic_generator.js muting: Use stream_id for internal data structures. 2018-12-14 15:58:35 -08:00
topic_list.js topic list: Remove unnecessary markup. 2018-12-14 16:05:40 -08:00
topic_zoom.js Have ESC zoom out topics if you're zoomed in. 2018-10-24 16:54:35 -07:00
translations.js i18n: Fix reference error for localstorage. 2018-05-30 23:28:21 +05:30
transmit.js subject -> topic: Sweep "message.subject" in frontend. 2019-01-01 20:49:38 -08:00
tutorial.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
typeahead_helper.js typeahead: Rename `codepoint` to `emoji_code`. 2019-01-05 15:09:04 -08:00
typing.js typing indicators: Use user ids internally. 2018-10-14 09:38:32 -07:00
typing_data.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
typing_events.js typing_events: Make explicit call of narrow change handle function. 2018-11-29 12:36:00 -08:00
typing_status.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
ui.js ui: Explicity initialize night mode. 2019-01-04 10:54:10 -08:00
ui_init.js ui: Explicity initialize night mode. 2019-01-04 10:54:10 -08:00
ui_report.js ui_report: Add support for passing "". 2018-12-18 12:33:42 -08:00
ui_util.js compose: Fix recent autocomplete regression. 2018-12-22 08:07:23 -08:00
unread.js subject -> topic: Sweep "message.subject" in frontend. 2019-01-01 20:49:38 -08:00
unread_ops.js eslint: Add key-spacing linter rule. 2018-12-18 10:41:06 -08:00
unread_ui.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
upload.js upload: Use a placeholder when uploading. 2018-08-26 23:33:24 -07:00
upload_widget.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
user_events.js settings: Add guest avatar marker to account settings. 2018-12-30 11:07:00 -08:00
user_groups.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
user_pill.js compose pill: Add has_unconverted_data() helper. 2018-10-12 11:20:30 -07:00
user_search.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
user_status.js frontend: Add basic user_status module. 2019-01-02 09:16:31 -08:00
util.js subject -> topic: Make get_event_topic() more flexible. 2019-01-01 20:52:10 -08:00
widgetize.js widgets: Rename voting_widget to poll_widget. 2018-12-16 19:46:48 -08:00
zcommand.js slash commands: Add undo for /day and /night. 2019-01-04 10:54:10 -08:00
zform.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
zulip.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00