Commit Graph

9237 Commits

Author SHA1 Message Date
Steve Howell f59cca2dcd reactions: Rewrite code to use clean reactions.
Before this commit, the reactions code would
take the `message.reactions` structure from
the server and try to "collapse" all the reactions
for the same users into the same reactions,
but with each reaction having a list of user_ids.
It was a strangely denormalized structure that
was awkward to work with, and it made it really
hard to reason about whether the data was in
the original structure that the server sent or
the modified structure.

Now we use a cleaner, normalized Map to keep
each reaction (i.e. one per emoji), and we
write that to `message.clean_reactions`.

The `clean_reactions` structure is now the
authoritatize source for all reaction-related
operations.  As soon as you try to do anything
with reactions, we build the `clean_reactions`
data on the fly from the server data.

In particular, when we process events, we just
directly manipulate the `clean_reactions` data,
which is much easier to work with, since it's
a Map and doesn't duplicate any data.

This rewrite should avoid some obscure bugs.

I use `r` as shorthand for the clean reaction
structures, so as not to confuse it with
data from the server's message.reactions.

It also avoids some confusion where we use
`reaction` as a var name for the reaction
elements.
2020-03-23 17:30:18 -04:00
Tim Abbott f644f5fc2c css: Change emoji size within text to 20x20px.
We've often gotten the complaint that Zulip's emoji are a bit too big;
this should address the worst consequences of that (line-wrapping
being off with large emoji present) while still making it possible to
easily see what a given emoji is.

The right place to change this is in rendered_markdown.scss, not the
main emoji definition in zulip.scss, as the latter is also used in
places like the emoji picker where a larger size is valuable.

Closes #12731, an older PR that did this with slightly different
parameters (and without a comment).
2020-03-22 15:09:49 -07:00
Siddharth Varshney 5a1b27bf32 css: Merge `.help .sidebar h2` in portico.scss. 2020-03-22 12:48:51 -07:00
Siddharth Varshney 0c8b7161df css: Merge `.help .sidebar h1` in portico.scss. 2020-03-22 12:48:49 -07:00
SiddharthVarshney b9eda45c0b css: Merge `body` in portico.scss. 2020-03-22 12:47:53 -07:00
Siddharth Varshney 962684f189 ui: replace all mute icons from eye/eye-slash with bell/bell-slash.
eye/eye-slash icon is generally used for toggling hiding actions and we are using that same icon for mute action which can be a bit confusing
2020-03-22 12:31:48 -07:00
Steve Howell 9c027e76bb search/hash_util: Parse negated searches properly.
Fixes #14254

You can test this on dev:

    * do "-stream:Verona" in the search bar (the minus
      sign negates the search here)
    * reload the browser

You should see the same search (all streams besides Verona).
2020-03-22 11:29:02 -07:00
Steve Howell 778d457bf7 Avoid blueslip error for empty streams.
We simplify the code for deciding whether
we show a subscribe button or not, and in
doing so avoid a blueslip error where we
were passing `undefined` into `get_sub()`.
2020-03-22 11:29:02 -07:00
shubhamgupta2956 304b538b33 css: Reorder ".support-search-button". 2020-03-22 11:24:44 -07:00
shubhamgupta2956 9823226a49 css: Use SCSS nesting for ".table-striped". 2020-03-22 11:24:44 -07:00
Steve Howell f0c99b42ec Rename people.add_in_realm to people.add().
We had this API:

    people.add_in_realm = full-fledged user
    people.add = not necessarily in realm

Now the API is this:

    people.add = full-fledged user
    people._add_user = internal API for cross-realm bots
        and deactivated users

I think in most of our tests the distinction between
people.add() and people.add_in_realm() was just an
accident of history and didn't reflect any real intention.

And if I had to guess the intention in 99% of the cases,
folks probably thought they were just creating ordinary,
active users in the current realm.

In places where the distinction was obviously important
(because a test failed), I deactivated the user via
`people.deactivate`.

For the 'basics' test in the people test suite, I clean
up the test setup for Isaac.  Before this commit I was
adding him first as a non-realm user then as a full-fledged
user, but this was contrived and confusing, and we
didn't really need it for test coverage purposes.
2020-03-22 10:55:11 -07:00
Steve Howell 25d2e2e122 Rename get_realm_persons() to get_realm_users().
The function's name was misleading, since it includes
any bots in your realm.
2020-03-22 10:55:11 -07:00
Steve Howell 7ac5d0602b minor: Rename function to get_active_humans().
Saying `human_persons` is a bit redundant (although
kind of an artifact of our legacy use of `person`
when we really mean `user`.)
2020-03-22 10:55:11 -07:00
Steve Howell 26daeeb358 minor: Optimize get_active_human_persons().
This is used in a few settings panels.  We
optimize it by avoiding creating an intermediate
list of all users.
2020-03-22 10:55:11 -07:00
Steve Howell 156ff33d22 stream edit: Extract stream_data.potential_subscribers().
We want to move more logic to stream_data to facilitate
testing.

Both before and after this commit, we essentially build a
new list of users for typeahead, but now the new list
excludes subscribed users.  We can do even better than
this in a follow-up commit.
2020-03-22 10:55:11 -07:00
Steve Howell 7088d09094 presence/people: Use people.get_active_human_count().
Before this commit, presence used get_realm_count()
to determine whether a realm was "small" (and thus
should show all human users in the buddy list, even
humans that had not been active in a while).

The `get_realm_count` function--despite a very wrong,
misleading comment--was including bots in its count.

The new function truly counts only active humans
(and no bots).

Because we were overcounting users before this change,
we should technically adjust `BIG_REALM_COUNT` down
by some amount to reflect our original intention there
on the parameter.  I'm leaving it alone for now, though,
since we've improved the performance of the buddy list
over time, and it's probably fine if a few "big" realms
get re-classified as small realms (and show more users)
by virtue of this change.

(Also note that this cutoff value only affects the
"normal" view of the buddy list; both small realms
and large realms will show long-inactive users if you
do searches.)

Fixes #14215
2020-03-22 10:55:11 -07:00
YashRE42 254cc96420 navbar: Extract navbar border into outer div.
This is a prep commit for the new navbar, since the new navbar switches
between a search bar and stream descriptions, it's easier to have the
border defined in an outer div. Due to the way the changesets is
generated, this may seem like a large diff, however, the only change to
navbar.html is to add an opening div with the ".top-navbar-border" class
and a corrseponding closing div to wrap around "#search_box" and
"#search_box_legacy". Apart from this, a few styles have been edited in
zulip.scss and night_mode.scss.
2020-03-20 14:53:43 -07:00
shubhamgupta2956 338bd0e6e2 css: css: Use SCSS nesting for '.zoom-in' in left-sidebar.scss 2020-03-19 16:47:36 -07:00
shubhamgupta2956 7b38d4473c css: Use SCSS nesting for '#add-stream-link' in left-sidebar.scss 2020-03-19 16:47:35 -07:00
shubhamgupta2956 b08e0cf86e css: Use SCSS nesting for '#topics_header' in left-sidebar.scss 2020-03-19 16:47:34 -07:00
shubhamgupta2956 e81ff6bdee css: Use SCSS nesting for '.narrows_panel' in left-sidebar.scss 2020-03-19 16:47:32 -07:00
shubhamgupta2956 d99b0cf7f5 css: Use SCSS nesting for '.hashtag' in left-sidebar.scss 2020-03-19 16:47:28 -07:00
Anders Kaseorg 07bca27fbc styles: Exempt visibility from overlay show transition.
This fixes a failure to give focus to a newly shown overlay.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-03-19 11:23:40 -07:00
Anders Kaseorg 815418d0d7 portico: Typographical nitpicking.
Punctuate marketing headings with a period.  Fix a couple of
title-cased headings to sentense case.  Consistently use curly
apostrophes, curly quotation marks, and Unicode ellipses.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-03-17 16:53:46 -07:00
majordwarf 6da7b390e4 css: Reorder CSS rulesets above media queries. 2020-03-17 12:40:08 -07:00
majordwarf 69422dca9e css: Use SCSS nesting for `.forgot-password-container`. 2020-03-17 12:40:08 -07:00
majordwarf c034287da6 css: Use SCSS nesting in portico-signin.scss for `.split-view`. 2020-03-17 12:40:08 -07:00
majordwarf 87f8061a12 css: Use SCSS nesting for `.static.org-url`. 2020-03-17 12:40:08 -07:00
majordwarf 76999ccaa8 css: Use SCSS nesting for `#registration`. 2020-03-17 12:40:08 -07:00
majordwarf 17f29b3d25 css: Merge `.subdomain` in `portico-signin.scss`. 2020-03-17 12:40:08 -07:00
majordwarf bc1f075d25 css: Reorder `#registration`to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf eb3b5a626a css: Use SCSS nesting for `.split-view` and `.back-to-login`. 2020-03-17 12:40:08 -07:00
majordwarf 18c6cc9929 css: Use SCSS nesting for `.back-to-login-wrapper`. 2020-03-17 12:40:08 -07:00
majordwarf f881ceba3f css: Use SCSS nesting for `.login-social-button`. 2020-03-17 12:40:08 -07:00
majordwarf 62f367f2ff css: Merge `button` style for `.login-social-button`. 2020-03-17 12:40:08 -07:00
majordwarf 4956020f0b css: Use SCSS nesting for `.info-box`. 2020-03-17 12:40:08 -07:00
majordwarf 08edbcad86 css: Use SCSS nesting for `.split-view`. 2020-03-17 12:40:08 -07:00
majordwarf 2b6a618be5 css: Reorder `.split-view` to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf 7067646764 css: Use SCSS nesting for `.portico-page`. 2020-03-17 12:40:08 -07:00
majordwarf 7f05f19c03 css: Reorder `.portico-page` to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf 649399dba8 css: Use SCSS nesting for `#login_form`. 2020-03-17 12:40:08 -07:00
majordwarf a3b395ce94 css: Reorder `#login_form` to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf 5eeef33117 css: Use SCSS nesting for `.register-account`. 2020-03-17 12:40:08 -07:00
majordwarf aeaaf601ea css: Use SCSS nesting for `.register-page-container`. 2020-03-17 12:40:08 -07:00
majordwarf 5dbd3499a9 css: Reorder `.register-page-container` to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf e24fe3b5a6 css: Use SCSS nesting for `.login-page-container`. 2020-03-17 12:40:08 -07:00
majordwarf 37983b0e41 css: Reorder `.login-page-container` to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf 889aeffc83 css: Use SCSS nesting in portico-signin.scss for `.app-main`. 2020-03-17 12:40:08 -07:00
majordwarf 8a556fd2a7 css: Merge `.login-page-header` in portico-signin.scss. 2020-03-17 12:40:08 -07:00
majordwarf 39286fc1cd css: Reorder portico-signin.scss to put `.app-main` next to each other. 2020-03-17 12:40:08 -07:00