We move remove_deactivated_user_from_all_streams
into stream_events.js. There were some minor changes
to rename variables and also to not rely on using
`stream_info`.
This allows several modules to no longer need
to import `narrow` (or, in our current pre-import
world, to not have to use that global).
The broken dependencies are reflected in the node
tests, which should now run slightly faster.
All of our data related to emojis is in emoji.js.
Now typeahead_helper no longer depends on emoji_picker.
Generally we want typeahead_helper to only depend
on data modules to avoid complicated circular
dependencies (or at least mitigate them).
I think it's a known problem that we don't match
on common aliases for our top N emojis, but I don't
attempt to address that here. I just made the
comments reflect the names we use in our
current data structures.
We don't need util.js to be depending on emoji_picker.js.
The function emoji_prefix_sort is only used
in typeahead_helper, so I just moved the implemenation
to there.
This is part of work to break some of our
nastier circular dependencies in preparation
for our es6 migration.
This commit should facilitate loading leaf-like
modules such as people.js before all of the things
that reload.js depends on.
When you unsubscribe a stream by clicking on the
checkmark, we don't want it to disappear right
away, but we also don't need it to stay around
once you start searching for new streams.
Note from Tim: This commit removes some complex code that was just a
workaround for the fact that this widget used to automatically
re-filter immediately after clicking to unsubscribe a user.
Since we've since fixed that original issue, we don't need this.
We add a padded div to our container for the buddy
list to give scrolling the illusion that we've
rendered every list item, while still letting
the browser do the heavy lifting instead of trying
to fake it out too much.
This new div allows us to split out two concerns:
semantic list of items - remains in #user_presences
widget real estate - controlled by new #buddy_list_wrapper
We will use this for progressive rendering. We want to add
padding to the buddy list without messing with the integrity
of the actual HTML '<ul>' list. (One ugly alternative would
have been to add a dummy list item, which be a pitfall for
any code traversing the list.)
Basically, all the code relating to click handlers and similar
things was left alone. We only change js/css related to
scrolling, resizing, and overflow.
This version of progressive scrolling lazily
renders buddy list items, but it doesn't
provide the browser with any notion of upcoming
list items, so as you scroll down and the size
of the rendered list grows, the scrollbar shows
you being too close to the bottom.
This maintains 100% coverage on buddy_list.js.
Earlier, on opening the subs modal, the "Subscribed" tab would be selected
by default when the components.toggle was created for tab switching.
This would change the hash to `#streams/subscribed`, and then extra work had
to be done to change it back to `#streams/all` leading to a longer open times.
With this change, `#streams` and `#streams/subscribed` both take you to
the "Subscribed Tab", and `#streams/all` takes you directly to
the "All Streams" tab.
This renames Realm.show_digest_email field to
digest_emails_enabled, for greater clarity as to what it does
just from seeing the setting name, without having to look it up.
Fixes part of #10042.
We set the keep=false for the narrow_to_row callack so that it is deleted
once the subs modal is opened. Previously, this callback would cause issues
when you then tried to open the All Streams Settings as it would narrow to
the stream row.
In 47aaa73f96, we fixed one issue, which
is that server_events_dispatch.js was calling `update_starred` with
the wrong arguments, but created a new one (toggle_starred wasn't
updated) and missed another (which is that we weren't ever updating
message.starred, and thus if you toggle a message's star-state in one
browser, and then tried to toggle it back in a second, it would feel
like the click didn't work, because it was trying to toggle
e.g. off->on a second time).