Commit Graph

63435 Commits

Author SHA1 Message Date
Anders Kaseorg
8f173b0fdf styles: Replace deprecated word-break: break-word with overflow-wrap.
Addresses a new declaration-property-value-keyword-no-deprecated
Stylelint rule.

https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#break-word
https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-29 15:04:09 -08:00
Anders Kaseorg
997d77f0dd styles: Convert Sass-style variables to CSS custom properties.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-29 15:04:09 -08:00
Apoorva Pendse
ed0f5bd6ed message: Remove failure message for disabled read receipts.
This removes the "Failed to load read receipts." prefix
in the read receipt overlay in case of organizations
that have disabled their read receipts.

Fixes: https://chat.zulip.org/#narrow/channel/9-issues/topic/Why.20the.20failure.20message.20on.20disabled.20read.20receipts.2E
2025-01-29 15:02:14 -08:00
Pratik Chanda
2bd88254a1 tooltip: Fix unread count for home view tooltip includes muted messages.
Earlier, unread_count in home view tooltip was set to total unread
messages while we normally exclude muted messages from unread_count.

This commit changes this by setting it to `home_unread_messages`.
2025-01-29 15:01:15 -08:00
Lauryn Menard
ee8cb9c926 reload: Check server_settings before initiating a reload.
In order to avoid races with the user's device connecting to a
network after unsuspending, we ping the server settings endpoint
for a success response before initiating the reload of the app.

Fixes #33118.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-01-29 15:00:23 -08:00
Lauryn Menard
078ce89380 util: Extract helper function for backoff of retries on error response.
Extracts message_fetch and get_events algorithms for calculating the
exponential backoff into a shared helper function.

These match the algorithm that were designed for the Python API, except
that we use a ratio of 2 rather than sqrt(2) in the message_fetch code
path.
2025-01-29 15:00:23 -08:00
Lauryn Menard
79224b0149 puppeteer-navigation: Use more specific view selector.
Updates the selector for the channel narrow and combined feed
in this puppeteer test to be more specific than the message feed
container, which is what the check for the direct message view
already does in this test.
2025-01-29 15:00:23 -08:00
Lauryn Menard
7b95441bfe help: Update add a custom emoji instructions for modal form. 2025-01-29 14:56:51 -08:00
Alex Vandiver
4dfb285b5b message_summary: Reorganize settings and secrets.
This allows arbitrary litellm-supported backends.
2025-01-29 14:55:35 -08:00
Alex Vandiver
69524b48b5 message_summary: Switch to orjson. 2025-01-29 14:55:35 -08:00
Alex Vandiver
816dde5b9a message_summary: Factor out into the actions package. 2025-01-29 14:55:35 -08:00
Aman Agrawal
b9483e3f5f move_topic_to_stream_widget: Show dropdown below stream button. 2025-01-29 14:54:24 -08:00
Shubham Padia
48405b704e user_group: User user object instead of email to add creator pill. 2025-01-29 12:36:10 -08:00
Shubham Padia
41c68fad2c stream: Allow non-admins to create channel without subscribing to it.
Fixes #33125.
We now add a creator pill on the channel create screen. For the rule to
not allow non admins to create a channel without subscribing to it, the
rule was most probably introduced to prevent creating a private channel
that you can't access and creating a public channel and then not being
able to find it. Those concerns aren't valid anymore with the new group
permissions system and UX changes respectively.
See
https://chat.zulip.org/#narrow/channel/101-design/topic/Rework.20UX.20for.20adding.20everyone.20to.20a.20channel.20or.20group.20.2333127/near/2064926
for more details.
2025-01-29 12:36:10 -08:00
Shubham Padia
274fdc5908 input_pill: Add disabled flag to make a pill disabled.
A disabled pill cannot be removed. It will not have the `x` sign inside
it's pill. Pressing backspace on the pill will not remove it. But it
will still be possible to shift focus on the disabled pill using the
backspace button.

We decided to keep disabled not as a property of `item` and instead of
the pill via `InputPill`. This means that a pill is disabled and not an
item. Also, since the item types vary so much between user, user group,
channel and other pills, adding disabled to `InputPill<ItemType>` makes
it much more simpler to add this capability to wherever needed one by
one.

We also need to pass this property to `generate_pill_html` so the
respective functions can respect that property and render the pill
accordingly.

While this feature is not in use at the immediate moment, we've kept it
around since it is likely to be useful in the future.
2025-01-29 12:36:10 -08:00
Karl Stolley
861917d2c5 left_sidebar: Allow condensed nav icons to scale. 2025-01-29 10:15:55 -08:00
Karl Stolley
ab58a2c656 left_sidebar: Allow masked unreads to scale. 2025-01-29 10:15:55 -08:00
Karl Stolley
d71161dc83 left_sidebar: Remove out-specified font-size selector.
The comment here is also no longer true, as of the 2024 sidebar
redesign (all vdots take the same size).
2025-01-29 10:15:55 -08:00
Karl Stolley
938fcfb698 left_sidebar: Remove unused class selector block. 2025-01-29 10:15:55 -08:00
Alya Abbott
50ff629ac5 help: Update permissions docs for group-based permissions. 2025-01-28 18:37:21 -08:00
whilstsomebody
09214c91b6 stream_popover: Disable confirm move button for empty topic name.
When mandatory topic is true, empty topic name  is not allowed.
For more information, see
<https://chat.zulip.org/#narrow/channel/9-issues/topic/Confirm.20move.20button.20stays.20enable.20when.20topic.20input.20is.200.2E/near/1989468>
2025-01-28 18:18:29 -08:00
sanchi-t
9921b116e8 css: Refactor theme colors for settings.
This change moves the light and dark theme colors for
`settings` to CSS variables.
2025-01-28 17:55:00 -08:00
Aditya
22c300439f polls: Fix transition issue for "Add" and "New" option in dark theme.
Resolved a transition issue in the polls UI when switching between dark and light modes. This fixes visual inconsistencies and ensures smoother transitions, improving the overall user experience.

Fixes #30628.
2025-01-28 17:54:16 -08:00
ritwik-69
20fef7576d compose: Fix placeholder disappearance bug.
This commit resolves an issue where the placeholder in the
composing message to the recipient text box would disappear
unexpectedly.

Fixes: #32912
2025-01-28 17:53:10 -08:00
Aditya Kumar Kasaudhan
bd1bf5a851 compose: Fix Cmd + Return to send messages in preview mode on Mac.
Previously, Cmd + Return did not send messages in preview mode when
configured by the user.

This commit fixes the logic to allow sending messages in preview
mode with Cmd + Return as per user configuration.

Fixes: #32960.
2025-01-28 17:51:08 -08:00
Alex Vandiver
af4fa75b66 puppet: Upgrade version of aws tool. 2025-01-28 17:43:08 -08:00
Maneesh Shukla
faa8b0d4a5 user_groups: Allow adding a user to groups via user profile.
Fixes: #32488.
2025-01-28 15:19:21 -08:00
Maneesh Shukla
e33fe6779b user_group: Rename invite_user_group_picker_pill.ts to user_group_picker_pill.ts.
Fixes part of #32488.
2025-01-28 15:13:19 -08:00
Maneesh Shukla
3ce9c558b2 user_groups: Add search input to the user group.
Fixes part of #32488.
2025-01-28 15:13:19 -08:00
Maneesh Shukla
18e5ede3c3 user_groups: Change the data-empty value.
Fixes part of #32488.
2025-01-28 15:13:19 -08:00
evykassirer
39319cee34 message_header: Specify font-size and line height on content div.
This is helpful for info density, because `em` values change
depending on the font-size of the HTML element, and we want to
be able to reference `em` sizes for the placement of the message
header container when it's sticky.

This commit should have no functional changes because
`message-header-contents` is the only child of `message_header`
and doesn't itself use font size or line height.

This commit also changes the line height to unitless
https://chat.zulip.org/#narrow/channel/6-frontend/topic/navbar.20sticky.20header.20with.20em/near/2054561
2025-01-28 14:50:43 -08:00
Prakhar Pratyush
ab123d3160 attachments: Restrict users access to attachment without message access.
This commit adds hardening such that if the invariant "no usermessage
row corresponding to a message exists if the user loses access to the
message" is violated due to some bug, user can't access the attachment
if they are not subscribed.
2025-01-28 13:59:08 -08:00
Prakhar Pratyush
621eb1f610 prior_mention_user_ids: Exclude user who no longer has message access.
This commit updates the 'get_mentions_for_message_updates' function to
use the generic 'event_recipient_ids_for_action_on_messages' function
to determine users having access to the message and perform an
intersection with the mentioned users to filter out the users who
no longer can access the message.

It helps to add hardening such that if the invariant "no usermessage
row corresponding to a message exists if the user loses access to the
message" is violated due to some bug, it has minimal user impact.
2025-01-28 13:59:08 -08:00
Prakhar Pratyush
ce6b5cf068 message_edit: Fix recipient of event due to 'do_update_embedded_data'.
This commit updates the 'do_update_embedded_data' function to use
the generic 'event_recipient_ids_for_action_on_messages' function
while deciding the event's recipients.

It helps to add hardening such that if the invariant "no usermessage
row corresponding to a message exists if the user loses access to the
message" is violated due to some bug, it has minimal user impact.
2025-01-28 13:59:08 -08:00
Karl Stolley
0d28323b1a left_sidebar: Match icon font-size to action heading.
Fixes: #32969
2025-01-28 13:54:32 -08:00
Karl Stolley
4efa8f77b0 left_sidebar: Correct centering of browse-channels SVG. 2025-01-28 13:54:32 -08:00
Aman Agrawal
548afc2f1a topic_summary: Add button to generate narrow summary.
This remains only enabled in the development environment.
2025-01-28 13:13:20 -08:00
Mateusz Mandera
685e49d34d zilencer: Improve "hostname already exists" error in registration.
Users most likely to run into this will be the ones who are moving to a
new server, but keeping their original domain and thus just need to
transfer the registration.
2025-01-28 11:10:50 -08:00
Mateusz Mandera
4e22a79e6a zilencer: Add flow for a server to reclaim its registration.
If the server controls the registration's hostname, it can reclaim its
registration credentials. This is useful, because self-hosted admins
frequently lose the credentials when moving their Zulip server to a
different machine / deployment method.

The flow is the following:
1. The host sends a POST request to
   /api/v1/remotes/server/register/takeover.
2. The bouncer responds with a signed token.
3. The host prepares to serve this token at /api/v1/zulip-services/verify and
   sends a POST to /remotes/server/register/verify_challenge endpoint of
   the bouncer.
4. Upon receiving the POST request, the bouncer GETS
   https://{hostname}/api/v1/zulip-services/verify, verifies the secret and
   responds to the original POST with the registration credentials.
5. The host can now save these credentials to it zulip-secrets.conf file
   and thus regains its push notifications registration.

Includes a global rate limit on the usage of the /verify_challenge
endpoint, as it causes us to make outgoing requests.
2025-01-28 11:10:50 -08:00
bedo
a8625df748 test_markdown: Add test for mentioning groups with a common sub-group. 2025-01-28 10:29:40 -08:00
Tim Abbott
73f0ca91f2 test_markdown: Reduce object generation in a loop. 2025-01-28 10:29:40 -08:00
bedo
f9f6e6d7e6 mention: Optimize query when mentioning several groups.
Fixes: #32934

context:
Fetching all users who are members (directly or via sub-groups)
of groups mentioned in one message.

Reduce O(n) queries, where n is the number
of mentioned groups, to a constant of 1 query.

Extend "get_recursive_subgroups_for_groups" functionality to
"get_root_id_annotated_recursive_subgroups_for_groups"
which is the same but keeps track of each group root_id and
annotates it to each group.

Then in init_user_group_data(), we only fetch
each group's root_id along with
active direct members.
2025-01-28 10:29:40 -08:00
Sahil Batra
3581d5feb8 node-tests: Add tests for functions used to check group permissions.
This commit add node tests for functions used to check permissions
a group has for rendering "Permissions" panel.
2025-01-28 10:06:31 -08:00
Sahil Batra
bae14944ad group_permission_settings: Refactor get_assigned_permission_object.
- Function now returns early if can_edit_settings is false since
we do not want details if the group has direct permission or not.
- Added function to get the tooltip text if group has permission
due to being subgroup of a group that has permission.
- Added comments for some explaination around different blocks.
2025-01-28 10:06:31 -08:00
Sahil Batra
143b4d30d3 user_groups: Fix group_has_permission function.
When setting was set to a single group, group_has_permission
did not return true if group was subgroup of the setting group.
2025-01-28 10:06:31 -08:00
Sahil Batra
47f7b59aab group-settings: Fix updating owner editable settings.
We now disable the checkbox for admins in group permissions
panel for settings that only owners can edit.
2025-01-28 10:06:31 -08:00
Sahil Batra
7aa4ba0afc settings_config: Rename group_setting_labels.
This commit renames group_setting_labels to all_group_setting_labels
since it contains labels for all realm, stream and group level group
permission settings and we use group_setting_labels variable to pass
labels for one type of settings to templates.
2025-01-28 10:06:31 -08:00
Sahil Batra
444312b22c types: Rename GroupSettingName to GroupGroupSettingName.
This commit renames GroupSettingName type to GroupGroupSettingName
making it consistent with similar RealmGroupSettingName and
StreamGroupSettingName types.

Also, renamed group_setting_name_schema similarly.
2025-01-28 10:06:31 -08:00
Sahil Batra
17650ae6ab settings: Fix updating email notification batching period setting.
There was a bug when updating email notification batching period
setting to a custom value not present in dropdown because
"email_notifications_batching_period_minutes" is just a name
used for input elements and we do not use it to store the setting
value as it is just stored in seconds.
2025-01-28 09:40:36 -08:00
Mateusz Mandera
0caf815e36 do_activate_mirror_dummy_user: Assert user_profile is a mirror dummy.
If this is called on a user without is_mirror_dummy=True, that seems
certain to be a bug. Therefore, an assert is preferable in order to
catch this, rather than returning early with noop like some other
function such as do_deactivate_user.
2025-01-28 09:38:56 -08:00