Commit Graph

4783 Commits

Author SHA1 Message Date
Jitendra Kumar
f96484eed5 style: Center the ⌘ symbol by replacing it with an icon.
This commit updates the keyboard shortcuts UI by replacing
the ⌘ symbol with a more symmetrically aligned icon.

Fixes: #32926
2025-01-24 16:48:26 -08:00
Sahil Batra
52fbca65ce group-settings: Move functions used for group settings.
This commit moves get_realm_user_groups_for_setting and
get_realm_user_groups_for_dropdown_list_widget functions
from user_groups.ts to group_permission_settings.ts.

This change is needed to avoid import cycles in further
commits to add "Permissions" panel for groups.
2025-01-24 14:51:51 -08:00
Sahil Batra
4ae45763b4 settings: Use a common object for all group setting labels. 2025-01-24 14:51:51 -08:00
Sahil Batra
255eee255b events: Pass group in functions called for updating the group.
We now pass group in functions called while handling group update
events, instead of fetching the groups in those function as we
will need the old setting value in future commits.
2025-01-24 14:51:51 -08:00
Sahil Batra
14b7bde954 settings: Extract type for all realm level group settings.
Zod schema and type for realm level group settings is moved
to group_permission_settings.ts as we would define types for
stream and group settings there and the change would also help
in avoiding import cycles in further commits.
2025-01-24 14:51:51 -08:00
Pratik Chanda
f744625e4c tooltip: Add counts in tooltip for views in left sidebar.
Earlier, tooltip in left sidebar views had only the navigation list
title shown inside it.

This commit adds more information to the tooltip by including their
respective counts.

Fixes: zulip#25901.

Co-authored-by: ecxtacy <dc.dhruvchouhan@gmail.com>
2025-01-24 14:16:16 -08:00
Pratik Chanda
6c03d839f7 left_sidebar: Refactor tooltip logic for left sidebar navigation list.
Earlier, left sidebar navigation had two separate tooltip logic to
handle the same tooltip template.

This commit refactors it to use a single tooltip logic for the left
sidebar navigation.
2025-01-24 14:16:16 -08:00
whilstsomebody
733ab5f2f8 reactions: Remove emoji container when reaction count is 0.
While adding a new reaction, we create a new JQuery element
called "message_reaction_container" and append it to the
view to display the emoji.

Previously, when the reaction count became zero for an emoji,
we used to just remove the emoji but not the JQuery element
mentioned above, requiring a reload to remove it. This
inconsistency introduced a bug in the UI. causing unwanted
spaces between emojies as this element used to get accumulated.

This commit resolves the bug by introducing logic to remove
reaction containers with no reactions.

Fixes: #32983
2025-01-24 13:32:35 -08:00
apoorvapendse
6586d9078e copy_and_paste: Paste Excel copied content as image and text.
This ensures that using `^V` pastes the content from excel as
an image.
To get normal text in a formatted manner one can use
`^⇧V`.

The earlier conditions in `is_single_image` caused
the classification to fail in case of Excel pasted
content, which is why we check for the for the XML
namespaces associated with Microsoft in the pasted
HTML.

Fixes #32968.
2025-01-24 11:10:38 -08:00
Aman Agrawal
673281aae8 message_fetch: Extract function to modify narrow before server query. 2025-01-23 16:29:42 -08:00
Tim Abbott
dd430e2b56 scroll_util: Fix typo caught by codespell. 2025-01-23 16:07:52 -08:00
Shubham Padia
2fdb4fe53c stream: Add conditional note to can_add_subscribers_group.
Fixes #33156.
If the stream is set to on the private settings for privacy, we add a
parenthesis text `must be subscribed`.
We had to use JS to change the string since just having a conditional in
the handlebars template would not ensure that the parenthesis text
appears or disappears on changing the value.
2025-01-23 15:57:16 -08:00
Aman Agrawal
3d6baaf450 stream_list: Scroll selected topic into view when zoomed in.
This is useful for keyboard users when use `n` to navigate to the
next topic with zoomed in topic list.
2025-01-23 15:53:16 -08:00
Aman Agrawal
a5e2a7b4e4 topic_list: Fix top selected element not visible on system scroll.
Fixed by accounting for the fixed header in the topic list.
2025-01-23 15:53:16 -08:00
Aman Agrawal
dd33ad11f5 scroll_util: Account for $elem not direct child of scroll container.
When using `position` to get the scroll offset, it uses `offsetParent`
to calculate the offset which is not necessary the scroll container.

To account for this case, we use `offset` to correctly calculate
the position of element relative to the document.
2025-01-23 15:53:09 -08:00
Aman Agrawal
25cb87cdc3 left_sidebar: Fix bottom item not visible in left sidebar.
The last topic is not visible in left sidebar in zoomed_in state.
This is due to height of `views-label-container` not being accounted
for when calculating scrollable height of the topics list.
2025-01-23 15:51:31 -08:00
Sahil Batra
1c07c013ae groups: Do not include "Everyone on internet" group in typeaheads.
There is no reason to show "Everyone on internet" group in
group members, stream subscribers, silent mention and DM
recipient typeaheads since specatators cannot be added to
groups or streams, cannot be involved in DMs and cannot be
mentioned.
2025-01-23 15:41:19 -08:00
Sahil Batra
233b776ea5 stream-settings: Show system groups in subscribers form typeahead.
We now show role-based system groups in the subscribers typeahead
in stream creation and stream edit UI.
2025-01-23 07:53:18 +05:30
Karl Stolley
aecd3dff7d topic_edit: Remove show/hide logic on edit button.
This logic is superfluous, as action buttons are hidden unless
hovered, and when hovered, the `display: none` this sets is
overridden anyway.

Additionally, removing this avoids interference with the flexbox
presenting the action icons, which was causing elements in the
sender line (sender, as well as the timestamp) to visibly shift
out of place when editing the topic, only to see the layout
corrected upon hovering in the action-button area.
2025-01-22 16:18:31 -08:00
Aman Agrawal
753181bee9 message_list_view: Check if the sticky header is not from overlays.
When `message_row`s can be stacked on top of each other if draft
or scheduled messages overlay is open. To avoid selecting
message from them, we filter them out.
2025-01-22 16:10:29 -08:00
Prakhar Pratyush
033c706a03 search: Add support for empty string topic.
This commit adds support to display `realm_empty_topic_display_name`
value (in italics) in the search suggestions & search input pills
for topics having the actual value of empty string.
2025-01-22 16:09:46 -08:00
Prakhar Pratyush
0534bc44f0 user_topics_search: Add support to search for empty string topics.
We show `realm_empty_topic_display_name` for empty string
topics in the SETTINGS/TOPICS table.

This commit makes it possible for users to search for
the `realm_empty_topic_display_name` value to filter out empty
string topics.
2025-01-22 16:09:46 -08:00
Prakhar Pratyush
e63d9f1e89 inbox-search: Add support to search for empty string topics.
We show `realm_empty_topic_display_name` for empty string
topics in the inbox view.

This commit makes it possible for users to search for
the `realm_empty_topic_display_name` value to filter out empty
string topics.
2025-01-22 16:09:46 -08:00
Prakhar Pratyush
8a1b1590ad recent_view_search: Add support to search for empty string topics.
We show `realm_empty_topic_display_name` for empty string topics
in the recent conversations view.

This commit makes it possible for users to search for
the `realm_empty_topic_display_name` value to filter out empty
string topics.
2025-01-22 16:09:46 -08:00
Prakhar Pratyush
3706940df6 compose_closed_ui: Unify translation strings for reply button label.
This commit unifies translation strings for reply button label
to reduce translation effort.

Both the `has_empty_string_topic` and other cases now use a single
"Message <z-recipient-label></z-recipient-label>"`, with dynamic
content passed appropriately.
2025-01-22 15:55:23 -08:00
Prakhar Pratyush
181572021d get_stream_topics: Add support for empty topic name.
This commit is a part of the work to support empty
string as a topic name.

Previously, empty string was not a valid topic name.

Adds `allow_empty_topic_name` boolean parameter to
`GET /users/me/{stream_id}/topics` endpoint to decide
whether the topic names in the fetched `topics` array
can be empty strings.

If False, the topic names in the fetched response will
have the value of `realm_empty_topic_display_name` field
in `POST /register` response replacing "".

Fixes part of #23291.
2025-01-22 15:54:11 -08:00
Shubham Padia
a76042ce39 invite: Any combination of default streams should be subscribe-able.
Fixes #32706.

A user with permission to invite users should be able to subscribe users
to any of the default streams whether they have the permission to do so
or not for each of those default streams or not. This should only happen
in the invite code path, and not the subscribe code path.

This commit also adds the ability to pick and chose default streams if
you do not have the permission to subscribe to any other channels.

Before this, if you did not have the permission to subscribe any other
channels, only the checkbox to subscribe to all the default streams at
once was available to you.

For the stream pill typeahead, we don't show streams that the user
cannot subscribe other users to. For more details, see

   https://chat.zulip.org/#narrow/channel/101-design/topic/can.20subscribe.20other.20users.20permission.20invite
2025-01-22 14:27:06 -08:00
Shubham Padia
3a728aea6f user_profile: Use can_subscribe to show streams in subscribe widget.
We were just checking the realm wide setting before to determine whether
to show the subscribe widget or not. `can_subscribe` of
`get_streams_for_user` had already been using `can_subscribe_others`,
so it was aleady following the new logic to determiner whether a user
can subscribe others to a channel. So there was no change needed there.
We were using the realm wide permsision to determiner whether to show
the widget or not, but now we use the number of subscribe-able
unsubscribed channels to determine whether the widget should be shown
or not.
2025-01-22 14:27:06 -08:00
Shubham Padia
117531a49b stream: Change tooltip message for disabled add subscriber element.
Previously, we only used to have a realm wide setting on whether a user
can add subscribers to a channel. In that case, if the user was not
allowed to add subscribers inspite of having the realm wide permissions,
that would mean it's a private channel that they don't have access to.
After adding the per-channel setting to add subscribers, that is no
longer the case and the tooltip message has been made more generic to
reflect that.
2025-01-22 14:27:06 -08:00
Shubham Padia
328db8d7ce stream_create: Remove redundant code to enable/disable add subscribers.
When creating streams, user creating the stream should always be able to
add subscribers.
https://chat.zulip.org/#narrow/channel/3-backend/topic/Can.20subscribe.20other.20users.20permission/near/2025587
2025-01-22 14:27:06 -08:00
Shubham Padia
1b8115d8e7 compose: Use can_subscribe_others to check permissions. 2025-01-22 14:27:06 -08:00
Shubham Padia
f40db2de28 stream_data: Use can_add_subscribers_group to check permissions. 2025-01-22 14:27:06 -08:00
Shubham Padia
2ccfe36f01 settings_data: Rename user_can_subscribe_other_users.
Rename it to `can_subscribe_others_to_all_streams` to accurately reflect
what it does.
2025-01-22 14:27:06 -08:00
Shubham Padia
a8dd4d8fb9 streams: Add the ability to modify can_add_subcribers_group.
We are just adding the ability to change the value of this setting in
this commit. It is not used for all possible permission checks on the
frontend yet. That will be done in future commits.
2025-01-22 14:27:06 -08:00
Shubham Padia
9402b248a1 state_data: Remove can_subscribe_other_users attribute.
While `can_subscribe_other_users` property will make sense for the
current permissions structure where the ability to add subscribers to
channels is dictated with a realm level setting. In the future, we are
adding a channel level `can_add_subscribers_group`, and having a
property called `can_subscribe_other_users` in state_data will be
confusing since the permission to add subscribers will vary channel to
channel.
We have not removed user.can_subscribe_other_users, that will be better
removed when we add the channel level setting.
See more discussion at
https://chat.zulip.org/#narrow/channel/378-api-design/topic/invite_to_stream_policy.20deprecation/near/2039787
2025-01-22 12:33:58 -08:00
Shubham Padia
3bf87228a2 settings: Use can_add_subscribers_group instead of realm policy.
We are using `can_add_subscribers_group` instead of
`invite_to_stream_policy` to check whether a user can subscribe other
users.
We've removed `invite_to_stream_policy` from the frontend wherever
applicable.
2025-01-22 12:33:58 -08:00
Shubham Padia
34ade0d9a2 realm: Add ability to set can_add_subscribers_group in frontend.
The setting is not used anywhere yet either on the frontend or the
backend, we are just adding the ability to change the value of the realm
setting. We have also removed the ability to set
`invite_to_stream_policy` in this commit while it continues being used
to check permissions.
We have changed the label of the setting from `Who can add users to
channels` to `Who can subcribe users to channels` and label_parens_text
as `in addition to organization administrators` as discussed in
https://chat.zulip.org/#narrow/channel/101-design/topic/Can.20subscribe.20other.20users.20on.20user.20profile/near/2039825
2025-01-22 12:33:58 -08:00
Sourabh Patel
6a5c33788d color_picker: Enable vertical keyboard navigation at channel settings.
At Channel settings overlay, vertical keyboard navigation
on color picker was obstructed by stream_settings_ui.switch_rows.
This commit fixes the issue by using
`color_picker_popover.handle_keyboard` prior to
`stream_settings_ui.switch_rows`
2025-01-22 10:56:28 -08:00
whilstsomebody
14d96bf932 user_profile: Fix incorrect rendering of groups and channels list.
It was found that adding or removing an item from a group
or channel list updated the list correctly initially.
However, when revisiting the group or channel list tab, the
removed item was still present. The item was only removed
after closing and reopening the user profile menu popover.

This commit fixes the bug by correctly fetching the data
and live-updating the list.
Also, we used to re-render the groups and channels list
everytime we opened the groups or channels tab. Now, we
render the list only once when the corresponding tab is
opened for the first time.

Fixes: #33071
2025-01-22 09:29:32 -08:00
Aman Agrawal
b549562a4d sponsorship: Ask user how they plan to use Zulip.
This will help avoid some back-and-forth on sponsorship requests.
2025-01-22 09:22:52 -08:00
Steve Howell
d00934b0ef bug fix: Check offsets when browser doesn't canonicalize.
This is more of a workaround than a bug fix.

Some JS implementations are less "aggressive" about
canonicalizing things like America/Montreal to America/Toronto.

We instead use offset checks.
2025-01-22 09:16:50 -08:00
Saubhagya Patel
a3e322428b settings_ui: Refactor the do_settings_change() function.
Previously, the function reported success after a fixed delay of
500ms. With this change, we calculate the delay dynamically
to account for the time elapsed during the request and report
the success accordingly.
2025-01-21 15:18:05 -08:00
Steve Howell
b84eabae95 navbar bug fix: Restore sideways keyboard navigation.
This fixes #33123, which was a regression due to
7e57477dea
2025-01-21 15:02:22 -08:00
Prakhar Pratyush
5bb53ec091 compose_banner: Show realm_empty_topic_display_name for topic="".
This commit adds support to display `realm_empty_topic_display_name`
value in the compose banners for topics having the actual value
of empty string.

Fixes part of #32996.
2025-01-21 13:22:08 -08:00
Kislay Verma
8379f0cffb topic_link_util: Accept channel name instead of syntax text.
In the function `get_stream_topic_link_syntax`,
we used the typed syntax text to make out
the channel name and then use it to
generate the appropriate link syntax.
We change that to directly accepting the
channel name.

This is in preparation for #31420
2025-01-21 13:21:11 -08:00
Saubhagya Patel
04fa3655ec settings: Replace the Theme select dropdown with the Theme switcher.
This commit includes the following changes:
 - Replace the theme select dropdown in the Preferences
   section of the Personal settings with the theme switcher,
   similar to the one in the personal menu popover.
 - The theme select dropdown in the Default User Settings
   section of the Organization settings also follows the same
   changes.

Fixes: #32111.
2025-01-21 12:01:12 -08:00
Maneesh Shukla
b689ddb2ab move_message: Make propagation mode choices smarter and sticky.
This commit improves the propagation mode choices by making them smarter
and sticky. It remembers the last choice made by the user by storing it
in a map. The new behavior is as follows:

- Overwrites the dropdown selection if the last used option was
 "only one".
2025-01-21 11:57:20 -08:00
Harsh
40519ee9fa compose box: Fix disabled reply button for spectators. 2025-01-21 11:54:54 -08:00
whilstsomebody
ef201f4fed overlay_util: Correctly handle overflow behavior in the application.
As the bug reported in
<https://chat.zulip.org/#narrow/channel/9-issues/topic/A.20little.20right.20shift.20can.20be.20observed.20when.20confirm.20dialog.20ope/near/2026160>
suggests that enabling scroll for an overlay when it is
opened and then disabling it while opening a modal over
it causes a slight shift in the application UI.

We fix this bug by toggling overflow behavior for the
application only when the modal is opened not over an
active overlay. For active overlays, we disable the
overflow for the application when they are opened and
in that case opening a modal over it also has not effect
on the overflow. This prevents any right shift that might
occur due to the visibility of the scrollbar in the application.

Fixes: #32898
2025-01-21 09:00:44 -08:00
Karl Stolley
b4fe3fa37b compose: Allow left arrow to scroll buttons. 2025-01-21 08:57:59 -08:00