Commit Graph

3090 Commits

Author SHA1 Message Date
Aman Agrawal 9b49909d3e compose_actions: Fix incorrect condition.
This was introduced in #28767 with the intention to skip scrolling
the selected message.

So, the actual bug that the PR fixed would have been just fixed
by opening the compose box early.

(cherry picked from commit aa76919ddb)
2024-02-16 12:28:16 -08:00
Tim Abbott c9eb942105 narrow: Clarify some confusing details.
The update_selection function name was rather misleading, since that
function call is in fact what renders the message list object for the
view.

Also add comments about a few subtle/confusing details that I noticed
while debugging this code path today.

(cherry picked from commit 61ff8f2bef)
2024-02-16 12:28:16 -08:00
Tim Abbott 8b8ab7fb9c narrow: Open compose box before rendering main message feed.
As discussed in the new comments, we had a bug where the
system-initiated animated scroll that happens when the compose box
opens as a result of narrowing would race with the internal
rerendering that occurs when the message_fetch request asking the
server for additional data returns.

The correct fix for this is just to open the compose box, if we're
going to do so, before setting the user's scroll position in the
narrowing/rendering process.

This ends up being a UI improvement (in that the compose box is
available for typing a bit earlier) as well as avoiding both the risk
of this race as well as the bad UX of adjusting the user's scroll
position multiple times as part of entering the view.

This does not address an as-yet-unknown bug wherein the animated
scroll that occurs when opening the compose box, when racing with a
background rerender, results in a bogus ending scroll position, though
it's easy to see how that might occur given that rerendering does
clear the DOM briefly.

(cherry picked from commit 4e2a282a1b)
2024-02-16 12:28:16 -08:00
Anders Kaseorg 6e09c01772 typeahead: Remove insecure default highlighter implementation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 16:46:02 -08:00
Anders Kaseorg bc5d4b565a settings_playgrounds: Fix HTML injection in language typeahead.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 16:46:02 -08:00
Sahil Batra 0ebe623b42 group_settings: Empty right panel based on the url hash.
This commit adds code to empty the right panel if hash is
changed to "#groups/your" or "#groups/all".

(cherry picked from commit fc8e6d2aa8)
2024-01-24 16:38:46 -08:00
Sahil Batra 8549e9b648 groups_settings: Fix browser back button for groups overlay.
There is no problem in behavior of browser back button if we open
the group settings overlay using "#groups/your", "#groups/all" or
"#groups/new" url hash, but someone can directly go to a link with
"#groups" and in this case we want to fix the browser back button.

This commit replaces "#groups" entry with "#groups/your" which is the
default section opened, such that pressing back when on "#groups/your"
does not go to "#groups", which will then a form a cycle and instead
go back actually.

(cherry picked from commit c6be850fb9)
2024-01-24 16:38:46 -08:00
Sahil Batra 9a04f5b0c4 gear_menu: Open group settings overlay with "#groups/your" hash.
This commit fixes the bug in browser back button behavior when
opening the groups overlay from gear menu. The bug was caused
due to browser history containing both "#groups" and "#groups/your"
entries, which essentially resulted in a "#groups/your" -> "#groups"
-> "#groups/your" cycle and thus nothing happend on clicking
browser back button.

The case for a user manually typing "#groups" url would be handled
in next commit.

(cherry picked from commit eced3d9d6a)
2024-01-24 16:38:46 -08:00
Sahil Batra c8fe3d941c groups_settings: Make "Cancel" button work in group creation form.
(cherry picked from commit 3549164827)
2024-01-24 16:38:46 -08:00
Tim Abbott ddc88d2a45 compose: Simplify convert_mentions_to_silent_in_direct_messages.
The behavior to replace existing message content was leftover code
from a previous version of the mechanism, and not intended.

(cherry picked from commit 85ee5255bc)
2024-01-22 18:19:09 -08:00
Tim Abbott e332f4f4f2 compose: Don't convert bot mentions to silent mentions.
This fixes an unintended consequence of the silent mention conversion
logic added in 4d1ade1f88, where bots
that looked for personal mentions would not process mentions in 1:1
DMs.

(cherry picked from commit 60afdc45eb)
2024-01-22 18:19:09 -08:00
N-Shar-ma dfb4fc4261 compose: Revamp and improve test suite for compose formatting buttons.
Earlier, the tests for compose formatting were verbose, hard to read as
well as extend, and overly granular, without even having the ability to
test the final text selection or the cursor position.

Now, new test helpers, `init_textarea_state` and `get_textarea_state`,
have been added, enabling the tests to be more concise and readable,
while also being more powerful. A representative string alone now
describes the textarea state (the text and the selection / cursor),
making each test case as easy as defining the initial state as a string
and comparing the expected state post formatting with another string.

These new tests helped surface a couple bugs which have been fixed in
preceding commits.

(cherry picked from commit 179e9374b4)
2024-01-22 18:19:09 -08:00
N-Shar-ma c4d567c792 compose: Fix bug where toggling off link formatting left extra spaces.
In cases where either the description or the URL, or both were empty,
there would be an unneeded space, originally intended to space out the
description and URL, lingering even when the description and/or URL was
missing. The resulting highlight would also be off at times.

Now we only add in a space if both the description and URL are present,
and the highlight too is as intended.

(cherry picked from commit a5889bc3af)
2024-01-22 18:19:09 -08:00
N-Shar-ma b1fcbfd89a compose: Fix bug where spoiler would not always start on a new line.
Earlier, when a selection not starting at the beginning of a line was
formatted as a spoiler, the spoiler would not start on a new line, and
so would not be rendered as a spoiler. The `Header` highlighting too
was off by one character.

Now, the spoiler starts on a new line, and the `Header` highlighting
works as expected too.

(cherry picked from commit c46375f6fc)
2024-01-22 18:19:09 -08:00
sayyedarib 7a474e4cbf status_emoji_selector: Replace fa-smile with custom zulip-smile-icon.
Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
(cherry picked from commit ff4d4dd31b)
2024-01-22 18:19:09 -08:00
sayyedarib 8b00c9a9dd user_status: Fix alignment of select-emoji icon of user-status modal.
use flex display justify-content for vertical alignment
instead of using offsets like "top". for horizontal
alignment of smiley-icon use text-align center.

Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
(cherry picked from commit c1b8e45216)
2024-01-22 18:19:09 -08:00
Mateusz Mandera a96c821651 desktop_app: Close popover when clicking on "Plan management".
(cherry picked from commit e916ae754a)
2024-01-18 15:58:02 -08:00
Mateusz Mandera ba50faced4 remote_billing: Fix /self-hosted-billing/ handling for desktop app.
When you click "Plan management", the desktop app opens
/self-hosted-billing/ in your browser immediately. So that works badly
if you're already logged into another account in the browser, since that
session will be used and it may be for a different user account than in
the desktop app, causing unintended behavior.

The solution is to replace the on click behavior for "Plan management"
in the desktop app case, to instead make a request to a new endpoint
/json/self-hosted-billing, which provides the billing access url in a
json response. The desktop app takes that URL and window.open()s it (in
the browser). And so a remote billing session for the intended user will
be obtained.
2024-01-15 21:32:00 -08:00
afeefuddin 5841813ac4 portico-header: Dropped find accounts link for smaller windows.
Fixes #27477

(cherry picked from commit 76d79701a2)
2024-01-15 12:02:53 -08:00
Anders Kaseorg ea862aa29f notification_settings: Open push notification docs link in new tab.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit f93fbd34c7)
2024-01-15 12:02:53 -08:00
Vector73 e2cb2da864 settings: Fix setting label click functionality.
This commit fixes "Automatically follow topics where I'm mentioned"
setting label click functionality so that the setting is toggled
on clicking the label .

(cherry picked from commit 1c286a6835)
2024-01-15 12:02:53 -08:00
Anders Kaseorg bb7b9af676 user_status: Fix parsing of partial user_status events.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit dd3a8ce3b5)
2024-01-15 12:02:53 -08:00
Sahil Batra e67c0d19c5 user_pill: Add support to not allow adding inaccessible users manually.
We previously allowed adding pills for inaccessible user by typing
the email manually. This commit updates it to handle inaccessible
users like we handle invalid emails.

(cherry picked from commit 9197a2c3e2)
2024-01-05 10:32:54 -05:00
Sahil Batra f9eea995fd input_pill: Define a type for pill_config object.
(cherry picked from commit ede88191a8)
2024-01-05 10:32:54 -05:00
Alya Abbott 3decf380d7 settings: Update description text in Settings > Topics panel.
(cherry picked from commit 2732da2bb2)
2024-01-05 10:32:54 -05:00
N-Shar-ma 6b0ad1a7f5 compose: Clear stream id when prompting user for stream selection.
Now we clear the stream id from the compose state on opening the stream
selection dropdown when no stream is specified.

This fixes the bug where the compose box placeholder text would refer to
the previously selected stream, even when the open stream dropdown had
no stream selected.

(cherry picked from commit 48d0d49fde)
2024-01-05 10:32:54 -05:00
Joydeep Bhattacharjee ba39529100 css: Fix the color of alert word in dark theme.
This was incorrectly not declared as a theme-dependant color.

Fixes #28407.

(cherry picked from commit e3744627ac)
2024-01-05 10:32:54 -05:00
Sahil Batra 4c01110c88 settings: Fix discard button in groups UI in dark theme.
(cherry picked from commit 8f795e22e8)
2024-01-05 10:32:54 -05:00
Sahil Batra 660edba4dd user_groups: Do not remove the user group row if user can join again.
We now do not remove the user group row immediately from "Your groups"
panel when user is removed from the group, if the user can join that
group again by themselves. This makes the behavior similar to what
we have for streams.

(cherry picked from commit 377df9e4db)
2024-01-05 10:32:54 -05:00
Sahil Batra f799190bea settings: Show push notifications tooltip on stream specific row.
This commit fixes the bug about not showing the tooltip about push
notifications not being enabled on the server on checkbox in stream
specific notification row.

(cherry picked from commit 415fb2014b)
2024-01-05 10:32:54 -05:00
Sahil Batra 4e549e684f settings: Do not show tooltip if push notifications are enabled.
We previously showed tooltips about push notifictions not being
enabled on server on the checkboxes in "Notification triggers"
section incorrectly when server had push notifications enabled.

This bug was present as realm_push_notifications_enabled was
not passed to the template correctly. This commit fixes it by
instead using "is_disabled" in the "if" condition as we only
expect it to be true when push notifications are not enabled
on server.

(cherry picked from commit 99f29983a1)
2024-01-05 10:32:54 -05:00
Anders Kaseorg 776a0eeae8 models: Extract zerver.models.streams.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-05 10:32:54 -05:00
Anders Kaseorg ee85ac5433 models: Extract zerver.models.users.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-05 10:32:54 -05:00
Anders Kaseorg f78d8e13c1 models: Rename zerver/models.py to zerver/models/__init__.py.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-05 10:32:54 -05:00
Anders Kaseorg 64a87c311d echo: Update build_display_recipient comment.
Commit c6b3d0212d (#12959) moved the
code it refers to.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-05 10:32:54 -05:00
Karl Stolley e44ba3b1f1 portico: Add new self-hosted plans.
Co-authored-by: Alya Abbott <alya@zulip.com>
2023-12-15 11:03:42 -08:00
Karl Stolley 92de3d11d2 portico: Add self-hosted plans comparison table.
Co-authored-by: Vlad Korobov <vlad.korobov@zulip.com>
Co-authored-by: Alya Abbott <alya@zulip.com>
2023-12-15 11:03:42 -08:00
Karl Stolley 5d7010c8a0 billing: Update copy, modal for self-hosted downgrades and trials. 2023-12-15 11:03:42 -08:00
Aman Agrawal 8fb126505c sponsorship: Show different discount text for self hosted orgs. 2023-12-15 11:03:42 -08:00
Aman Agrawal 3aed22dcd0 gear_menu_popover: Enable `Plan management` in production. 2023-12-15 11:03:42 -08:00
evykassirer 1f7b3d7a2d stream edit toggler: Update `select_tab` when changing hash."
This fixes a bug in #26717 where the hash would flash to #personal
before #subscribers. Sometimes `setup_toggler` is called after
the hash change, and it needs to know which tab to show.

Ideally in the future we'd clean up this code so that the hash
changing function isn't called multiple times.
2023-12-15 08:47:45 -08:00
Evy Kassirer 6e902defba
node tests: Use noop helper function pattern in test files.
Some files already were using `noop` in place of `() => {}`.
It's both clearer what it means and is easier to type.
This updates all test files to fully use `noop`, and
adds a shared import from the test lib file.
2023-12-14 14:51:33 -08:00
Sahil Batra 94f0837b9c settings: Restrict length of realm Jitsi url custom input.
We have a restriction of 200 characters for jitsi_server_url
realm setting custom input element.

Fixes part of #27355.
2023-12-14 12:11:59 -08:00
Tim Abbott 1757b88760 billing: Offer release announcement subscriptions.
Also avoid prompting for full name time more than once.
Adds TOS version field to Remote server user.

Co-authored-by: Karl Stolley <karl@zulip.com>
Co-authored-by: Aman Agrawal <amanagr@zulip.com>
2023-12-14 10:51:16 -08:00
Anders Kaseorg a13e42f18a docs: Add missing spaces around code spans.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-14 00:05:44 -08:00
Sayam Samal c61b353b4b gear_menu_popover: Update the rocket icon used for plan and pricing.
Fixes #28163.
2023-12-13 07:59:13 -08:00
Sahil Batra 27d236fb52 popover: Fix user popover and profile for bot with inaccessible users.
We incorrectly passed bot owner ID to get_bot_owner_user instead of
the bot object.
2023-12-13 00:45:20 -08:00
Sayam Samal 7f26905fe0 compose_actions: Hide compose box when navigating to inbox/recent view.
Currently, given that the compose box is already open, it stays open
when the user navigates to the inbox/recent view, even when there is
no modifications to the message or recipients.

This commit adds conditions to close the compose box when navigating
to the inbox/recent view, except when we can reasonably infer that it
was the intended action.
2023-12-12 22:56:53 -08:00
Aman Agrawal 63f4fc51de server_deactivate: Show error message for server on active plan. 2023-12-12 21:00:42 -08:00
Aman Agrawal da74b9ade7 billing: Apply common styles to billing pages. 2023-12-12 17:31:41 -08:00