Commit Graph

48990 Commits

Author SHA1 Message Date
Aman Agrawal eb1c3bc293 recent_topics: Check if at last row before moving down.
This looks a regression from some of the recent additions to
recent topics.
2022-10-19 14:52:54 -07:00
Aman Agrawal 198f31fbea recent_topics_ui: Use topics_widget to get number of current rows.
I think this should be more reliable and faster.
2022-10-19 14:52:54 -07:00
Anders Kaseorg 89e4233b68 timeout: Correct thread id type passed to PyThreadState_SetAsyncExc.
This type changed in Python 3.7:
https://github.com/python/cpython/pull/781

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-10-19 14:49:24 -07:00
Aman Agrawal ed2ea4c8cc integrations: Increase font size of logo disclaimer.
Increased font size from 11px to 13px. This text was unreadable
on mobile as per Google report at 11px font size.
2022-10-19 12:03:16 -07:00
Sahil Batra b8a70c71f0 popovers: Rename "Move message" option to "Move messages".
This commit renames "Move message" option to "Move messages"
to make it more clear that the user can move multiple messages.
2022-10-19 12:02:22 -07:00
Sahil Batra cde4377789 message_edit: Allow editing "no topic" message from modal in all cases.
Previously, we allowed editing topic of "no topic" message, when other
conditions were not met, only from recipient bar but it is allowed
irrespective of other condtions. This commit fixes it to show the
"Move message" option and icon for "no topic" messages irrespective
of other conditions.
2022-10-19 12:02:22 -07:00
Sahil Batra 2451002e3b popovers: Use can_move_message function.
We can now directly use `can_move_message` function instead
of checking topic and stream edit permission. This helps us
in avoid duplication of code.
2022-10-19 12:02:22 -07:00
Sahil Batra ad3fe2c0db keyboard_shortcuts: Fix description for "e" shortcut.
This commit updates the description for "e" shortcut so
that it at least fits in one line in english.

Fixes #23112.
2022-10-19 12:02:22 -07:00
Sahil Batra 693a36d680 popovers: Add "(e)" shortcut to "View message source" option. 2022-10-19 12:02:22 -07:00
Sahil Batra eed728fb59 hotkey: Use "m" hotkey for moving messages.
Fixes #23113.
2022-10-19 12:02:22 -07:00
Sahil Batra 10668b080e message_edit: Remove NO_LONGER from editability_types.
Previously, NO_LONGER type was just used to display
the text in the bottom-right of message edit form
which we have removed now, so we can remove `NO_LONGER`
type now.
2022-10-19 12:02:22 -07:00
rixant 3c238c7b19 portico: Change deafult width of dropdowns to fit-content.
We seem to override this setting for most of the dropdowns, so this
common CSS only applies to the smaller dropdown shown to logged-in
users, where it was weirdly wide.
2022-10-19 11:59:34 -07:00
David Rosa 84ce917e9f help: Add "Edit a custom profile field" section.
Adds a section on editing to the Custom profile fields help article.

Fixes part of #23170.
2022-10-19 11:58:00 -07:00
David Rosa 64c31b7cb9 help: Rename "Add custom profile fields" -> "Custom profile fields".
Renames the help article on custom profile fields to reflect that
its content is not just about adding fields.

Adds a redirect from the old URL to the new URL and updates internal
links, linking to #add-a-custom-profile-field where appropriate.

Fixes #23170.
2022-10-19 11:58:00 -07:00
Aman Agrawal eec294b257 css: Fix color of filter buttons being changed on hover for spectators.
We don't want the color to change at all on hover since these buttons are
disabled. This only needed a fix for the dark theme.
2022-10-19 06:42:11 -07:00
Alya Abbott abccc483f4 help center: Clean up documentation on sending messages.
- Consolidate /help/starting-a-new-private-thread and /help/private-messages.
- Tweak the wording on compose-and-send-message.md.
- Use compose-and-send-message.md where appropriate (and not otherwise).
2022-10-18 22:20:45 -07:00
David Rosa c0f534ff79 help: Fix "Reply mentioning user" documentation.
Corrects "Reply mentioning user" option which is available in the
user menu if accessed from a message.

Documents "Copy mention syntax" option which is available from the
right sidebar.

Fixes: #23202.
2022-10-18 22:18:47 -07:00
Aman Agrawal 169f777b36 use_info_popover: Fix long words overflowing out of container.
The text will now break at the overflowing points. A hyphen maybe
inserted but is dependent on language and browser support.
2022-10-18 22:13:04 -07:00
Aman Agrawal a29009b4d9 realm_user_settings: Fix user status with emoji preview.
Fixed to reflect how user status with emoji will be displayed
in the right sidebar.
2022-10-18 22:13:04 -07:00
Aman Agrawal 5a5ec5518c right_sidebar: Fix full name overflowing its container.
User's name with status emoji was overflowing its container,
resulting in overflown text to not be converted into ellipsis
and pushing status emoji out of visible area.
2022-10-18 22:13:04 -07:00
Mateusz Mandera f6f7e4c53f migrations: Remove bugged Recipients in 0419. 2022-10-18 20:50:10 -07:00
Aman Agrawal 8883b64388 recent_topics: Handle page up/down manually.
Fixes #23078.

Instead of relying on browser, we handle the page up/down keys
to ensure we take care of some rows being hidden due to compose
box and table header.
2022-10-18 17:34:42 -07:00
Joseph Ho 551c6899be
compose: Stop selecting compose box content after topic change.
Previously, the on_topic_change handler for the compose system would
focus the compose box after a topic change, and also select all content in 
the compose box. Selecting that content makes sense if we think the user's
intent is likely to be deleting that content; but there's no clear reason we
should expect that intent, and it's not particularly consistent with our drafts
model to risk accidentally losing partially composed message content this way.

After some discussion, we've concluded that in both cases reaching this code path
(either the previous topic being "" or the compose box content being entry), it'd
be better to skip the `.select()`.

Fixes #23146.
2022-10-18 17:20:52 -07:00
Lauryn Menard 8089910dcb narrow: Update browser title when in a narrow search view.
Sets a default value of "Search results" for complicated narrow search
views and updates logic to use `filter.get_title` as a helper to
generate better titles for some common search views.

Does not update the existing behavior for narrow searches that have
"pm-with" or "group-pm-with" operators.

Note as of this change, the default search title and titles generated
from `filter.get_title` will be translated into the user's preferred
language.

Fixes #22952.
2022-10-18 17:13:51 -07:00
Lauryn Menard 857324a164 filter: Return 'undefined' title for narrows with search operator.
Updates `filter.get_title` to return 'undefined' for any narrow
with a search operator. Previously it would return a title if
the search operator was paired with a common narrow, but those
results were not being used when building the message view
header and will not be used for setting the browser title.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard 099acc3c60 narrow: Split out logic for `group-pm-with` in `update_narrow_title`.
Fixes a subtle bug in the browswer title that occured if the user
input a keyword or another vaild search operator before `pm-with`
or `group-pm-with`.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard 107fdc8955 narrow: Translate browser title for default views.
Translates browser titles for "All messages" and "Recent topics"
views.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard f3e118f241 filter: Add stream name that was searched for to unknown stream title.
When the narrow/search for a stream is undefined because either the
stream does not exist or the user is not subscribed to the private
stream, format the title that's used in the message view header to
include the stream name that was searched for.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard 5f42425982 filter: Update default title for `streams:public` narrow.
Updates default title for `streams:public` narrow to be
"Messages in all public streams".

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard c1b430d602 filter: Add titles for messages with alerts and unread messages.
In `filter.get_title`, add cases for the two missing "is" operators,
"alerted" and "unread".

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Aman Agrawal abec99fe0c tippy: Check if reaction still exists in DOM before showing tooltip.
This avoids an error being triggered if `instance.reference` gets
remvoed from the DOM and `rows.get_message_id` is called on it in
`onShow` later.

This is an untested bug fix since I was not able to reproduce
this on live server or locally.
2022-10-18 16:04:55 -07:00
Aman Agrawal 59e7741055 recent_topics: Fix typo.
This was an unintentional change in #20890, which resulted in
reply to topics not working.
2022-10-18 12:26:20 -07:00
David Rosa d9dd272a78 help: Update documentation on bots.
Adds new tab to `zerver/lib/markdown/tabbed_sections.py` to document
managing bots from both personal settings and organization settings.

Documents adding bots from the organization settings Bots panel.

Separates instructions for deactivating and reactivating a bot from
both personal settings and organization settings.

Fixes a few formatting issues such as missing bold formatting and
heading level.

Fixes: #23066.
2022-10-18 10:16:42 -07:00
Rixant Rokaha 24f344dc40 settings_ui: Change org profile icon to same as custom profile fields. 2022-10-18 08:25:13 -07:00
rixant c15e202155 settings_ui: Change icons in organization settings sidebar. 2022-10-18 08:25:13 -07:00
David Rosa a94b13cfb0 help: Fix "Click on the ellipsis" formatting and use of macros.
Adds bold formatting to **ellipsis** for consistency and replaces
duplicate instructions with the appropriate macro across help
center docs.
2022-10-18 08:23:59 -07:00
David Rosa 7af9d43d6a help: Update documentation for "Mute this user" and "Manage this user".
This documents how to access the options from the three-dot menu in a
user's profile summary.

Refactors and updates the steps for muting a user into a single set of
instructions. Updates instructions for the "Manage this user" option.

Fixes #23204.
2022-10-18 08:23:59 -07:00
David Rosa fc85f88529 help: Add macros to document access to three-dot menu in profile summary.
Fixes part of #23204.
2022-10-18 08:23:59 -07:00
Alex Vandiver 0fc8c6c16f message_fetch: Switch to exponential backoff with jitter. 2022-10-18 08:20:22 -07:00
Alex Vandiver 3bb13a1f58 message_fetch: Switch to using show_error, which is equivalent. 2022-10-18 08:20:22 -07:00
Alex Vandiver 2d406aa9d0 message_fetch: Improve retry logic for matches_narrow re-checks.
Previously, we retried all failed requests to
`/json/messages/matches_narrow` forever, with a fixed 5s retry.  This
meant infinite retries even on 4xx responses, for instance on invalid
narrows -- and _each_ new message would add another infinite every-5s
retry.

Skip retries on 400 responses, and put an upper limit on the number of
retries.  At the same time, change the retries to be
exponential-backoff with full jitter, to be more responsive in the
event of a one-off failure, and more forgiving in response to a longer
outage.

Failures that exhaust the 5 attempts are silent to the user -- since
this is likely an uncommon edge case (requiring Tornado to be serving
events to the client, Django to be unresponsive, and the client to be
narrowed to a filter it cannot apply locally), and the failure mode is
not bad (it will simply fail to live-update with new matching
messages).

Fixes: #20165.
2022-10-18 08:20:22 -07:00
madrix01 550a32bb20 recent_topics: Add Private message to recent_topics.
This commit adds private messages to the Recent topics view, to make
it an all-encompassing overview of recent activity visible to the user.

We add a filter "Include PM" to toggle whether PMs should be shown in
recent topics.

Fixes #19449.
2022-10-17 15:02:01 -07:00
Lauryn Menard a3f6220fe4 analytics: Add summary statistic for guest users in realm.
Adds the count of users with the role of guest to the stats view
`page_params` via a database query. This information is then added
to the summary statistics section of the analytics page after being
formatted by `stats.js`.

Creates Bassanio as a guest user in the database for the analytics
realm.

Fixes #20162.
2022-10-17 11:53:59 -07:00
Florian Pritz f37ac80384 import_realm: Speed up first_message_id calculation.
On my data (about 10 million messages in 1600 streams) this used to take
about 40 hours, while the improved statement completes in roughly 30
seconds.

The old solution had postgres go through the entire table until the
first match for each stream. Thus, the time spent scanning the table
got longer and longer for each stream because postgres always started at
the beginning (and somehow it did not use any indices) and had to skip
over all rows until it found the first message from the stream that is
was looking for each time.

This new statement just performans a bulk operation, scanning the table
only once and then inserts the results directly into the destination
table.

Slightly more verbose inforation about this change can be found in:
https://chat.zulip.org/#narrow/stream/31-production-help/topic/Import.20Rocketchat.20data/near/1408867

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2022-10-17 11:43:21 -07:00
David Rosa ebd4181ae0 help: Update message menu documentation.
Updates all help center documentation according to the latest changes to
the three-dot message menu and the UI for moving and editing messages.

Fixes #23217.
2022-10-17 11:37:03 -07:00
Zixuan James Li 46329a2710 test_classes: Create a dedicate helper for query count check.
This adds a helper based on testing patterns of using the "queries_captured"
context manager with "assert_length" to check the number of queries
executed for preventing performance regression.

It explains the rationale of checking the query count through an
"AssertionError" and prints the queries captured as assert_length does,
but with a format optimized for displaying the queries in a more
readable manner.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-17 11:32:52 -07:00
Zixuan James Li 9117db8887 test_helpers: Tighten type annotation for queries_captured.
This adds CapturedQueryDict to provide a more accurate type annotation
for the return value of queries_captured. We also replace "Generator"
with "Iterator" because the latter two type parameters were unused.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-10-17 11:32:52 -07:00
Aman Agrawal a351d34462 portico_signin: Fix signup text overflowing to icon in Russian.
This is not the right fix for this, but a temporary adjustment
to make it look good with minimal impact on other languages and
other pages.

Right fix would require changing the structure of the button, which
was not easy to do and make it look similar to how it looks now.
2022-10-17 11:09:16 -07:00
Aman Agrawal e14e62c24c templates: Remove unused `no-slide` class. 2022-10-17 11:08:16 -07:00
Sahil Batra cebf43903c settings: Fix height of left sidebar for short screens.
It was not possible to scroll to the bottom of the list on
narrow-width when only single column was displayed on the
settings overlay. This commit fixes the height of the sidebar
and set to "100% - height of header - height of tab-container"
which fixes the scroll behavior.

This is not a issue for two-column overlay where height is set
to "100% - height of header" (the tab-container is already
inside the header).

This duplicates some CSS to avoid using "!important". While doing
this duplication, we remove "margin: 0" and "display: block" since
these are already set as default values.

Fixes #22876.
2022-10-16 19:16:53 -07:00