Commit Graph

1701 Commits

Author SHA1 Message Date
Saubhagya Patel
d3c20f0b25 notifications: Render emoji in desktop notifications.
In desktop notifications, we no longer display an emoji's status
code. Instead, we show the corresponding Unicode emoji to
render it properly in desktop notifications. For custom
emojis, we continue to display their name.

Fixes #30598.

Co-authored-by: Tanmay Kumar <tnmdotkr@gmail.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-02-23 10:57:09 -08:00
Maneesh Shukla
b7ce31135d deactivated_user: Correctly display deactivated users in the right sidebar.
Fixes: #30797.
2025-02-21 18:01:26 -08:00
Shubham Padia
3132bdb20f composebox: Streams without content access shouldn't be in typeahead.
Other places where we use get_unsorted_subs do not require content
access.
See https://chat.zulip.org/#narrow/channel/101-design/topic/dropdown.20for.20metadata.20access.20stream/near/2096230
2025-02-21 15:36:07 -08:00
Shubham Padia
5d7a78f721 stream_data: Users with content access should be able to preview.
Before this, not all users with content access were able to see the
preview button.
2025-02-21 15:36:07 -08:00
Prakhar Pratyush
eed056a591 topic_list_data: Add support to filter empty string topic.
We show `realm_empty_topic_display_name` for empty string topics
in the left sidebar.

This commit makes it possible for users to search for
the `realm_empty_topic_display_name` value to filter out empty
string topics.
2025-02-21 14:13:22 -08:00
Prakhar Pratyush
c777fede07 compose_state: Remove empty_topic_placeholder function.
This commit removes `empty_topic_placeholder` function as
it is no longer used.
2025-02-20 10:09:41 -08:00
Sahil Batra
434a145e31 typeahead: Handle matching for "role:members" system group.
The name displayed for "role:members" group is
"Everyone, except guests" and "role:members" group should
be shown in the typeahead when searching for "Members" as
well, i.e. while matching the query in the input "Members"
and "Everyone, except guests" both should be considered as
display names for "role:members" group.
2025-02-19 17:02:51 -08:00
Sahil Batra
ff05fd558c groups: Change display names of everyone and members system groups.
"role:members" group name is displayed as "Everyone except guests"
in the UI and "role:everyone" group name is displayed as
"Everyone including guests".
2025-02-19 17:02:51 -08:00
Maneesh Shukla
a98135649f deactivated_user: Show deactivated status for deactivated users.
Fixes: #26833.
2025-02-18 22:20:05 -08:00
Anders Kaseorg
949e5004cb codespell: Fix typos caught by codespell.
“Brunch” wasn’t a typo, but, whatever.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-18 22:04:43 -08:00
Anders Kaseorg
4e04eed745 typos: Fix typos caught by typos and mwic.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-18 19:44:02 -08:00
Shubham Padia
89ea21f7f0 stream_data: Use user_has_permission_for_group_setting.
Before this, we were using `is_user_in_setting_group` which does not do
the extra checks around a guest user's permissions (and in future, some
other checks).
We introduced `initialize_and_override_current_user` in stream_data test
to make it easier to set current_user.user_id.
2025-02-18 12:49:05 -08:00
Maneesh Shukla
dc95699862 code_playground: Add custom playground options in the default_options list.
We can configure a custom playground for any language, including ones
which we don't have in our typeahead suggestions. One might then want to
make that language the default for code blocks, which is now possible
with this commit.

Fixes: #33282.
2025-02-16 17:22:47 -08:00
Sahil Batra
0d1d805ee5 settings_data: Check server setting in user_can_summarize_topics. 2025-02-14 11:52:28 -08:00
Vector73
7440444a90 saved_snippets: Move initialization directly to ui_init.ts.
Defer saved snippets dropdown creation until the compose box
is opened for better performance.

Fixes #31831.
2025-02-14 11:51:40 -08:00
roanster007
f3fbf314e2 echo: Update channel-topic link to permalink upon new message arrival.
This commit updates the traditional url of a channel-topic narrow
to topic permalink upon arrival of new message in the narrow, by
using the `with` operator on it.

The requirement for this change arises when we navigate to an
empty topic. Since it has no messages yet, we fallback to the
traditional channel-topic links. However, when a new message
arrives to this empty topic, we want the url to live update to
a permalink of the narrow.

This is done as an effort to make sure channel-topic narrows
always contain `with` term.
2025-02-13 12:40:37 -08:00
Vector73
2ef9695ef0 settings: Migrate wildcard_mention_policy to group-based permission.
Added new group-based permission setting
`can_mention_many_users_group` to replace `wildcard_mention_policy`.
2025-02-12 23:21:33 -08:00
roanster007
41f30e1052 topics: Change topic links of left sidebar to use new permalinks.
This commit updates the topic links obtained from clicking
the topics in the left sidebar, recent view and inbox, and
those obtained from "Copy link to topic" to use the new
topic permalinks.

Fixes part of #21505.
2025-02-12 16:21:03 -08:00
opmkumar
2a15da47d9 message_edit: Show typing indicator for message editing.
This commit adds typing indicators for message editing in stream
as well as in dm, if the send typing notification
for corresponding is enabled.

Based on earlier work in #28585.

Co-authored-by: Rohan Gudimetla <rohan.gudimetla07@gmail.com>

Fixes #25719.
2025-02-12 15:08:56 -08:00
Prakhar Pratyush
1aa048df35 channel_email: Make sender configurable when generating channel email.
Earlier, it was not possible to configure the user that the forwarded
email will be sent by.

This commit updates the 'Generate channel email address' modal to
make sender configurable when generating channel email.

Fixes #31566.
2025-02-12 15:08:32 -08:00
Prakhar Pratyush
1acf309d57 stream_data: Fix 'can_access_stream_email' function.
'can_access_stream_email' function determines who can
generate email to send message in a channel.

Earlier, the function was not considering channel post policy.
So, a user which doesn't have permission to post in
a channel as per channel post policy could generate channel email.

This commit makes sure to not show the "Generate email address"
button in such cases.

We show the button only if the current user or any of the bots
they control has the permission to post in the channel.

Fixes part of #31566.
2025-02-12 15:08:32 -08:00
Prakhar Pratyush
a94cc47879 bot_data: Remove the stale 'get_editable' function. 2025-02-12 15:08:32 -08:00
Sahil Batra
4ca28bb850 settings: Add setting to control permission for topic summarization. 2025-02-12 12:05:04 -08:00
Karl Stolley
be5c81286c rendered_markdown: Offset ordered lists by start and count.
Fixes #33424
2025-02-12 10:32:26 -08:00
Prakhar Pratyush
8a14018442 drafts: Show empty string as topic when realm_mandatory_topics=true.
Earlier, we were displaying `realm_empty_topic_display_name` as the
topic name when topic="".

This was not the expected behavior when `realm_mandatory_topics=true`.

This commit updates the logic to show empty string in such cases.
2025-02-12 09:37:51 -08:00
Shubham Padia
d82f595e51 stream: Disable permissions that require content access.
Disable privacy settings and can_add_subscriber_group when an admin does
not have content access to the channel.
We are going to add `can_subscriber_group` in the future which will also
require content access to change and that's why we have used
`stream_group_permission_settings_requiring_content_access` to keep the
list of such group settings.
We only show the warning banner now if the user cannot edit any of the
channel properties. For more details, see
https://chat.zulip.org/#narrow/channel/101-design/topic/Warning.20for.20settings.20that.20cannot.20be.20changed.2E
2025-02-11 15:09:16 -08:00
Shubham Padia
f94608677f stream_data: Use can administer channel for can_unsubscribe_others.
Previously, we were just checking whether a user was realm admin for
`can_unsubscribe_others`, now we also check whether they are a channel
admin for the said channel.
2025-02-11 15:09:16 -08:00
Shubham Padia
c97495c7ae stream_data: Use has_content_access for can_subscribe_others. 2025-02-11 15:09:16 -08:00
Shubham Padia
b786e70b89 stream_data: Add content/metadata access argument to change permission.
We are making this change with default set as true, since that is the
behaviour other functions are expecting. We are not making any behaviour
changes in this commit on where metadata access should be check or where
content access should be checked for this function's usage. That will be
done commit by commit for different functions using
`can_change_permissions`.
Accepting `require_content_access` makes it a bit hard to read at other
places where the argument is passed as just true or false without
knowing what the argument is for, but it was just a choice when writing
the code. We will refactor this current function into two functions in
the upcoming commits and solve that problem.
We've also removed `can_edit_description` from `stream_data` but we have
kept around `can_change_name_description` in `stream_settings_data`.
Since `can_edit_description` was just used at once place, it didn't make
much sense to keep it around, but we kep around
`can_change_name_description` since we've already done the work to have
fine tuned permissions for that setting and we don't want to undo that
work.
2025-02-11 15:09:16 -08:00
Shubham Padia
f5bcaacfc3 stream_data: Add has_content_access function.
This function will be used to check whether a user has access to a
channel's content in future commits.
2025-02-11 15:09:16 -08:00
Shubham Padia
03bfa7752d stream_data: Use has_metadata_access for can_view_subscribers.
We are using `has_metadata_access` one by one in different functions in
stream_data where possible. This commit does not represent the
exhaustive use of `has_metadata_access`.

We have kept around the `can_view_subscribers` function even though it
is the same as `has_metadata_access` right now. Since we've already done
the work of using `can_view_subscribers` at appropriate places, it would
be good to keep that work around in case that function's underlying
implementation changes in the future.
2025-02-11 15:09:16 -08:00
Shubham Padia
29a1a01325 stream_data: Add has_metadata_access function.
This function will be used in upcoming commits to determine whether a
user has access to a channel metadata or not. This function does not
give access to channel's content.
2025-02-11 15:09:16 -08:00
roanster007
ca2394495e search: Exclude with operator terms from search terms.
This commit excludes terms containing the `with` operator
from the search terms, since `with` operator is not a search
operator.
2025-02-07 13:03:52 -08:00
Vector73
cb6f0fd63c realm: Add setting to notify user on DMing guest.
Added `enable_guest_user_dm_warning` setting to decide whether
clients should show a warning when a user is composing to a guest
user in the organization.

Fixes #30078.

Co-authored-by: adnan-td <generaladnan139@gmail.com>
2025-02-06 12:15:41 -08:00
Maneesh Shukla
205cfc0f85 change_password_modal: Hide the dialog spinner when action fails.
This commit also add the comma(,) and exclamation mark(!) to the
error messages wherever they were missing.

This commit modify the settings_change_error function to show the error
inside the modal, instead of the settings panel behind it.
2025-02-06 09:40:57 -08:00
Tim Abbott
68c3e86ffa stream_data: Fix parsing of slugs for inaccessible channels.
Previously, if we had syntax in a URL slug that looked like a channel
ID, but we couldn't find the channel (say, beacuse it's a link to a
channel we're not subscribed to), parse_narrow would fail to parse it,
resulting in incorrect error handling.

This could break rendering of topic links that we want to process via
rendered_markdown.ts. I've confirmed that the web app's logic for
processing message_view.show does not require its caller to check the
channel ID is accessible.

The updated logic matches what we do in the mobile apps.
2025-02-05 14:01:11 -08:00
Pratik Chanda
ef2f8c0796 recent_conversations: Show unread @-mention indicator for DMs.
Earlier, in recent conversation, only streams had unread @-mention
indicators and DMs in recent conversation lacked them.

This commit introduces unread @-mention indicators for DM rows in recent
conversations using `unread_mention_dms` which stores `user_ids_string`
mapped to `message_id`s having mention.

Fixes: zulip#28849.
2025-02-05 13:27:57 -08:00
Pratik Chanda
d3f4d0dfa2 left_sidebar: Show unread @-mention indicators for DMs in left sidebar.
Earlier, in left sidebar, only streams had unread @-mention indicators
in individual streams and topics. DMs lacked unread @-mention
indicators.

This commit introduces unread @-mention indicators for DM rows in left
sidebar using `unread_mention_dms` which stores `user_ids_string` mapped
to `message_id`s having mention.

Fixes part of zulip#28849.
2025-02-05 13:27:57 -08:00
Pratik Chanda
2a26f34983 hotkey: Focus visible input filter field on query streams hotkey.
Earlier, if pm_list or stream_list was zoomed in and hitting `q`
hotkey would seemingly do nothing but in the background would add
highlighted class to `stream_row` and toggle stream-list-filter.

This commit fixes this behaviour by bringing focus to currently
visible input filter field.
2025-02-05 13:23:15 -08:00
Pratik Chanda
c071d952e1 left_sidebar: Refactor display left sidebar for stream list filter.
This commit refactors show left sidebar display logic when initiating
stream search to sidebar_ui.
2025-02-05 13:23:15 -08:00
apoorvapendse
ac8614caf8 copy_and_paste: Fix regression caused by quoting math.
We now do a more precise check to decide whether
to perform the span conversion for intermediate
text nodes.

Fixes: https://chat.zulip.org/#narrow/channel/9-issues/topic/HTML.20paragraphs.20misconverted.20by.20copy.20and.20paste.
2025-02-04 16:10:49 -08:00
Sahil Batra
fbbd36b306 group-settings: Live update permissions panel.
This commit adds code to live update permissions panel when
a group gains permission.
2025-02-04 16:08:58 -08:00
Tim Abbott
42bc59b802 hash_util: Parse with operators for copy/paste. 2025-02-02 11:46:05 -08:00
opmkumar
6789c9d648 search: Add "x" button to the filter of uploaded files table.
Creates a new `filter_text_input.hbs` file to enhance reusability of the
filter component.
The set_up_event_handlers function of `list_widget.ts` has been
modified to listen to the click event of the `.clear-filter` selector.
Additionally, the CSS for the input filter has been updated.

Referenced PR #19578.

Co-authored-by: Nikhil <59444243+nikhilmaske-2001@users.noreply.github.com>

Fixes #32599.
2025-02-01 18:51:36 -08:00
Prakhar Pratyush
0788942a68 message_link: Add support for empty string topic in syntax.
This commit adds support for empty string as a valid topic name
in syntax for linking to channel messages.

The server stores it after empty string is replaced with
`realm_empty_topic_display_name` and wrapped with an <em> tag.

The web client parses the rendered_content and updates
the topic_name part in the HTML with topic_name in user's language
+ wraps it in a <span> tag with 'empty-topic-display' css class.
2025-01-31 14:23:15 -08:00
Prakhar Pratyush
53dc5198c6 copy_and_paste: Fix missing empty string topic in message_link syntax.
Earlier, pasting a message_link for a message in empty string topic in
the compose area resulted in #**channel_name@100** syntax instead of the
correct #**channel_name>@100** syntax.

This commit fixes that bug.
2025-01-31 14:23:15 -08:00
Prakhar Pratyush
e08bf15682 stream_topic_link: Add support for empty string topic in syntax.
This commit adds support for empty string as a valid topic name
in syntax for linking to topics.

The server stores it after empty string is replaced with
`realm_empty_topic_display_name` and wrapped with an <em> tag.

The web client parses the rendered_content and updates
the topic_name part in the HTML with topic_name in user's language
+ wraps it in a <span> tag with 'empty-topic-display' css class.
2025-01-31 14:23:15 -08:00
Prakhar Pratyush
3759525807 markdown: Use handlebar to construct HTML that requires escaping.
This commit updates 'handleStreamTopic' & 'handleStreamTopicMessage'
to use handlebar templates for the rendering.

We avoid using JS template literals for constructing complex HTML
that requires escaping.
2025-01-31 14:23:15 -08:00
Vector73
469bc4f442 page_params: Remove bot_types field to reduce database queries.
Removed `bot_types` field from page_params to reduce extra db queries
on page load and allowed bot types for the user are determined locally
instead.
2025-01-30 11:37:35 -08:00
Vector73
d48164ce1e settings: Add two new realm settings to restrict bot creation.
Added `can_create_bots_group` setting which controls who can
create any type of bots in the organization.

Added `can_create_write_only_bots_group` setting which controls
who can create incoming webhooks in the organization in additon
to those who are in `can_create_bots_group`.
2025-01-30 11:37:33 -08:00