Commit Graph

14329 Commits

Author SHA1 Message Date
evykassirer 6ef5736bfe drafts: Rename undefined draft topics to empty string.
This fixes an error state that came out of #22094.
The code causing the error was fixed in #23238 but some
drafts still have undefined topics which has some strange
side effects. One day we'll have typescript help catch
this kind of thing!

More details on CZO: https://chat.zulip.org/#narrow/stream/9-issues/topic/live.20update.20issue.20with.20drafts/near/1457913
2022-11-02 16:36:36 -07:00
evykassirer 919f08d80f drafts: Catch and log error caused by drafts with undefined topics.
This is a bandaid fix to an error that came out of #22094.
The error was fixed in #23238 but some drafts still have
undefined topics which is raising this error.

More details on CZO: https://chat.zulip.org/#narrow/stream/9-issues/topic/live.20update.20issue.20with.20drafts/near/1457913
2022-11-02 16:20:40 -07:00
Imran 1fadb7cbd9
stream_settings: Link to stream description help center article.
This lets us provide a hook to where we've written some advice both on
what makes a good stream description, and also what Markdown formatting
is supported there.

Fixes #23376.
2022-11-02 16:19:53 -07:00
Rohitt Vashishtha 1db901cded keydown_util: Check Enter events properly for IME edge cases.
We now check whether an IME is currently composing and do not
process any such key==="Enter" events as the Enter/Return key.

Fixes #22062.
2022-11-02 15:42:42 -07:00
Rohitt Vashishtha 56970ee117 message_edit: Refactor message edit keydown handler.
This commit modifies handle_message_row_edit_keydown to use
keydown_util.is_enter_event(). This is a precursor to fixing #22062.
2022-11-02 15:05:33 -07:00
Rohitt Vashishtha 836f0fed10 message_edit: Refactor topic edit keydown handler.
This commit modifies handle_inline_topic_edit_keydown to use
keydown_util.is_enter_event(). This is a precursor to fixing #22062.
2022-11-02 15:05:33 -07:00
Rohitt Vashishtha d4379f9528 keydown_util: Extract all 'Enter' events to one place.
This is a prep commit to fix #22062.
2022-11-02 15:05:33 -07:00
Chris Bobbe b52e83281b shared: Bump version to 0.0.16 2022-11-02 13:59:05 -07:00
Mateusz Mandera 6e336ef6f6 delete_topic: Use the same timeout pattern as /mark_all_as_read.
We don't want to use the nginx 502 timeout as an API pattern. In
/mark_all_as_read we've already figured out how we want to handle this
instead.
2022-11-02 16:50:06 -04:00
Lauryn Menard 66da42bbae popovers: Do not show option to mark unread for unsubscribed streams.
In the message actions popover menu, adds an additional check for
whether the mark as unread option should be displayed based on if
the message is a stream message and if the user is subscribed to
the message's stream.
2022-11-02 13:39:20 -07:00
Tim Abbott a1aba2869b settings_org: Fix exception processing stream type events.
The previous check looked at whether the settings overlay as a whole
was open, not whether the specific panel we're going to update was
rendered.

The other code paths calling from server_events_dispatch into this
module already correctly check meta.loaded.
2022-11-02 11:43:07 -07:00
Ganesh Pawar 3a9730b7c6 gear_menu: Change sponsored plan name. 2022-11-02 09:55:23 -07:00
Tim Abbott 3ea1311f56 unread: Downgrade unread race logging to not an error.
We added this logging statement in
8d33a62eca, and we now have the data to
suggest this will happen in normal operation.

I left this as a blueslip.log, since it may be useful to see in the
leadup to another exception.
2022-11-01 22:47:52 -07:00
Aman Agrawal 8dd3579885 unread: Use `unread_topic_counter` to get message details.
The message we are trying to remove from unread mentions might not
have been fetched locally.

Fortunately, the `unread_topic_counter` data structure is designed to
support exactly this kind of lookup.
2022-11-01 22:41:07 -07:00
Aman Agrawal 2e480b0b09 unread: Move some functions.
Moved these functions to be able to access `unread_topic_counter`
inside them.
2022-11-01 22:32:07 -07:00
Greg Price 8810203a4c shared: Prescribe atomic push when bumping version.
This way, if the maintainer isn't able to update `main`,
the push doesn't add the shared-VERSION tag either.
That avoids ending up with a tag that potentially doesn't
get included in the history of the main branch.

The Git docs warn that servers might or might not support this
feature, but GitHub does -- indeed they boasted about it when it
first came out, in Git 2.4 back in 2015:
  https://github.blog/2015-04-30-git-2-4-atomic-pushes-push-to-deploy-and-more/
2022-11-01 22:25:37 -07:00
Chris Bobbe 167b891d4e shared: Fix typeahead.js.flow to add Emoji['reaction_type'].
The emoji matcher uses this property in is_unicode_emoji.

It doesn't quite make sense to be talking about "reaction types"
here -- we might use this for a message-reactions UI, but we might
just as reasonably use it for emoji UI in message composing. Ah,
well: I guess that's just a bit of messiness that we can deal with.
2022-11-01 17:46:47 -07:00
Chris Bobbe 72303bc0b0 shared: Bump version to 0.0.15 2022-11-01 10:19:34 -07:00
Lauryn Menard 7b88d6d8f8 help-menu: Update tip at the bottom of search operators tab.
Updates the tip at the bottom of the search operators tab to only
state that operators can be combined as needed.

Fixes #22866.
2022-11-01 08:40:33 -07:00
Aman Agrawal 6042e91fe8 left_sidebar: Hide sub to more streams in topics list view (zoom-in). 2022-11-01 08:24:24 -07:00
Aman Agrawal 7e8ebe3aa5 recent: Fix alignment of unread mention icon. 2022-11-01 08:24:24 -07:00
Lauryn Menard af00fd05b2 narrow-banner: Check user exists with "group-pm-with" empty narrow.
When "group-pm-with" is the first operator and setting an empty
narrow banner, check that the operand matches a user and set the
title based on whether the user exists or not.
2022-11-01 08:23:43 -07:00
Lauryn Menard a2e4005279 narrow: Return default search title for "group-pm-with" operator.
Because "group-pm-with" is not a common search operator, instead of
setting a specialized title in the browser and tab, just use the
default title, "Search results".
2022-11-01 08:23:43 -07:00
Lauryn Menard 656f2c6f5f images: Move operating system screenshots to app-screenshots directory.
Moves the three images of the web-app on different operating
systems (Mac, Ubuntu and Windows) to the same directory as
the two mobile-app screenshots, `/static/images/app-screenshots/`.
All five images are referenced in `static/js/landing-page.js`.
2022-10-31 14:36:54 -07:00
Lauryn Menard 0c947985bd tests: Update tests to use example profile picture.
So that we can stop using Tim's photo for tests, adds an open
license profile picture to use instead.

Updates tests that used `tim.png` to use the new example profile
picture, which is located in `static/images/test-images/avatars/`.
2022-10-31 14:36:54 -07:00
Lauryn Menard 1eda42f509 images: Create `/authentication_backends` directory for icons.
Creates `static/images/authentication_backends` directory for icons
of backend authentication methods, which are used on the log-in page.

And updates the example documentation in the API `/server_settings`
endpoint.
2022-10-31 14:36:54 -07:00
Aman Agrawal 784966b3bd css: Visual fixes to message feed notice.
Fixes #23273

Removed height restriction to allow the box to grow when text wraps
to the next line.

Aligned wrapped lines to the text in the first line instead of the
icon.
2022-10-31 14:33:50 -07:00
Aman Agrawal 42ff193e29 recent: Fix alignment of unread count in PM rows.
The alignment was off in both narrow and wide screens. Added
an invisible mute icon to PM rows to keep the unread counts aligned
with topic rows.
2022-10-31 14:21:24 -07:00
Aman Agrawal d6c68ac82c css: Increase opacity of sidebar titles in dark theme.
0.5 opacity felt too light; it made these appear similar in color to
muted streams, not as the intended grey text.  This opacity reduction
is only applied in dark theme to sidebar titles.
2022-10-31 14:17:40 -07:00
Greg Price 28c97dd4f1 typeahead [nfc]: Dedupe query_matches_person logic a bit.
I think this makes the flow a bit clearer: we always search
`.full_name`, and if emails are real then we also search the email.
2022-10-31 10:28:03 -07:00
Greg Price 728555522b typeahead [nfc]: Use people.get_visible_email abstraction.
Best to centralize this logic -- makes the intention clearer at the
use site, and also puts us in better position to make changes to it in
the future.
2022-10-31 10:28:03 -07:00
Greg Price c746d5669f typeahead [nfc]: Dissolve `query_matches_source_attrs`.
This makes each of the call sites more straightforward and
transparent.  In `query_matches_person` it also opens up further
simplifications, which we'll make next.

Since we're now exporting `query_matches_string` from this
shared module, we write its type in the `.js.flow` file.
2022-10-31 10:28:03 -07:00
Greg Price 7400165031 typeahead [nfc]: Push toLowerCase down into query_matches_string.
This prepares us to dissolve query_matches_source_attrs in favor
of making its call sites simpler and more transparent.
2022-10-31 10:28:03 -07:00
Aman Agrawal 925fa4ca50 left_sidebar: Make topics list header sticky.
Fixes #22911

`Back to streams`, stream name and filter topics are all sticky
now and their color changes based on which filter is active and
the currently applied theme.
2022-10-28 17:43:33 -07:00
Lauryn Menard 8ccd416e3b filter: Combine stream narrow cases in `filter.get_title`. 2022-10-28 17:41:47 -07:00
Lauryn Menard 0901ccdb47 filter: Show pm_with title with near narrow links.
Updates the `filter.get_title` logic to return the list of users
for narrows that include the pm_with and near operators. That way
the browser/tab title remains the same for these views.
2022-10-28 17:41:47 -07:00
Mateusz Mandera a410f6b241 do_mark_all_as_read: Split up the work into batches.
Fixes #15403.
2022-10-27 16:59:54 -07:00
aparna-bhatt 5189826f27 css: Improve the dialog_widget loading spinner visuals.
Previously, when you clicked the confirmation button in a
dialog_widget, we'd display a loading spinner on top of an ugly grey
button background.

Remove the ugly grey background color, while making sure the loading
spinner inside the button looks good and doesn't resize the button.

Fixes: #22002
2022-10-27 16:29:22 -07:00
Zixuan James Li 6f4047c679 unread: Extract old_unreads_missing.
This avoids post-initialization access to page_params inside unread.js.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-27 14:59:16 -07:00
Zixuan James Li 79b8219797 unread: Pop unread_msgs from page_params for initialization.
This change is made so that we are not accessing the global page_params
directly. Note that we also rename unread_msgs to params to match other
modules that follow this pattern.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-27 13:03:54 -07:00
Zixuan James Li b9f7edb58a unread: Stop accessing page_param.unread_msgs after init.
This adds a get_unread_message_count helper that returns the size of
unread_messages and replaces the usage of page_param.unread_msgs.count
elsewhere in the codebase.

Fixes #23334.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-27 13:03:54 -07:00
Tim Abbott d47f29c2d6 reactions: Implement display_emoji_reaction_users setting.
This setting provides a more ergonomic experience when viewing a
message where only a small number of emoji reactions are present; you
no longer need to hover over the reaction to see who reacted, which is
often quite important to understanding what it means.

We added this setting (visible in the development environment only,
and implemented on mobile) a few months ago; so to complete this
feature, we just need to add the frontend rendering/live update logic
and publish it.

As documented in the code comments, the current rule is "messages with
3 or fewer reactions" for which messages will display the names of the
users reacting.

The previous set_reaction_count API made sense when the display of a
given reaction was a pure function of its data. However, we will soon
be making it a function of the total number of reactions on the
message.

Thus, view functions to update reaction display now need to call a
shared update_vote_text_on_message function in all code paths, even
code paths like "add the first vote for a reaction" and "remove the
sole vote of a reaction" which previously did not need to call
set_reaction_count.

Fixes #20890.
2022-10-27 12:41:51 -07:00
Tim Abbott 98c478d994 reactions: Pass full message objects to view functions.
This is not the cleanest API, but it will be necessary in the next
commit in order to update the message's rendering of other emoji.
2022-10-27 12:41:51 -07:00
Tim Abbott 02b670fa66 reactions: Use clean_reaction_object API for view functions.
This substantially reduces the complexity of parameter passing in the
reactions rendering code path.
2022-10-27 12:41:51 -07:00
Tim Abbott b346e492c8 reactions: Reorder make_clean_reaction. 2022-10-27 12:41:51 -07:00
Tim Abbott 545a31e0b1 reactions: Delete stale message.reactions after cleaning.
Also update some comments explaining the core data model and approach
for set_clean_reactions.
2022-10-27 12:41:51 -07:00
Tim Abbott 5bd074bb36 reactions: Use a better variable name for clean_reactions objects.
We may want to rename clean_reactions to something else, but the name
`r` is pretty confusing for an object that isn't a single reaction,
but instead an object detailing all the reactions on a message.
2022-10-27 12:41:51 -07:00
Raghav Luthra a8fc195402 reactions: Change color of reaction counter from blue to black.
The blue font color on the vote_text beside the reactions in
light mode made it seem like a link which it's not, so it has
been changed to regular font color.

We preserve the blue font color on hover, matching the add-reaction
button.
2022-10-27 12:41:51 -07:00
Raghav Luthra 477a1b5789 reactions: Refactor CSS to prepare for longer vote_text.
This fixes a bug where in narrow windows, long vote_text could extend
beyond the body of the reaction's allocated area.

It also provides a matching right margin around the count/name inside
the reaction pill, which looks better when we have strings inside them.
2022-10-27 12:41:51 -07:00
Raghav Luthra 1b75151a97 settings: Fix display_emoji_reaction_users org setting save/discard.
Follow-up to commit 22a5d008c1.

The new display setting introduced in above commit was not registered
properly and enabling/disabling it from Organization settings > Default
user settings did not display a "Save/Discard" widget. This has been
fixed by modifying the `settings_org.get_subsection_property_elements`
function.
2022-10-27 12:41:51 -07:00