Commit Graph

6365 Commits

Author SHA1 Message Date
sanchi-t 4b90741f91 can_post_messages_in_stream: Add condition check for archived streams.
Prevents users from sending any message in an archived stream.
2024-10-25 16:06:42 -07:00
sanchi-t f257188ab5 sub_store: Remove unused function `delete_sub`.
Function `delete_sub` was exclusively called by `stream_data.delete_sub`.
With the change in the approach where we no longer remove subscriptions
from `stream_info` and `subs_by_stream_id`, the `delete_sub` function is no
longer needed.
2024-10-25 16:06:42 -07:00
sanchi-t 5ce2b307c4 stream_info: Remove now-unused function `delete`.
Previously, when archiving a stream `delete` function was used to
remove stream from `stream_info`. However, with the current
approach, we don't remove stream instead  we use the `set_false`
function to mark streams as false, making the `delete`
function unnecessary.
2024-10-25 16:06:42 -07:00
sanchi-t a29b6485d6 delete_sub: Do not remove archived stream when deactivated.
Stream is simply marked as `archived: true` instead of removing
the stream from `sub_store` and `stream_info`.

A check in `subscribe_myself` is added before subscribing to a
stream.
2024-10-25 16:06:42 -07:00
sanchi-t fa268877d3 stream: Show `(archived)` at the end of deactivated stream names.
When a stream is deactivated the title area and messages are
re-rendered to update the stream name with `(archived)` suffix.
2024-10-25 16:06:42 -07:00
sanchi-t 616e39c290 stream_data: Make `Subscribe` button not visible for archived streams. 2024-10-25 16:06:42 -07:00
sanchi-t a917215292 get_subs_for_settings: Exclude archived streams from `All Streams` menu.
Don't display stream settings for archived channels.
2024-10-25 16:06:42 -07:00
sanchi-t ca9ac293f3 sub_store: Add `is_archived` field to `Stream` type. 2024-10-25 16:06:42 -07:00
Karl Stolley 40da0e44fb squash: Experiment with less intense modal border colors. 2024-10-25 15:39:13 -07:00
Karl Stolley 2c78efc3c5 settings: Improve layout and appearance of Organization logo area. 2024-10-25 15:39:13 -07:00
Karl Stolley 8c90c9d68d modals: Set new background, border colors. 2024-10-25 15:39:13 -07:00
Karl Stolley cd1f58080b left_sidebar: Put the New DM button to the right of All DMs. 2024-10-25 15:24:20 -07:00
Karl Stolley 9e8d908a37 left_sidebar: Show Direct Messages controls on DM area hover. 2024-10-25 15:24:20 -07:00
Pratik Chanda 34ff1de338 left_sidebar: Hide new topic button on restricted compose permission.
Earlier, in left stream sidebar, new topic button was shown for all
stream rows irrespective of compose permission of the user for
individual streams.

This commit changes the behaviour by hiding the new topic button if
user doesn't have appropriate compose permission for individual
streams.

Fixes: zulip#31800.
2024-10-25 16:32:44 -05:00
Sahil Batra 2109d3d1ab user_group_popover: Remove period after members count. 2024-10-25 08:23:14 -07:00
Shubham Padia 1f0906aef7 groups: Remove list specifying group settings with new API format.
All the groups are now following the new API format, making the list
redundant.
2024-10-24 14:42:21 -07:00
Shubham Padia 9f9d5b2f98 groups: Accept anonymous groups for can_access_all_users_group.
On the frontend, the selection is still a dropdown of system groups but
on the API level, we have started accepting anonymous groups similar to
other settings
We've kept require system groups true for now until we switch to group
picker on the frontend.
2024-10-24 14:42:19 -07:00
Shubham Padia ceb0197c1b groups: Accept anonymous groups for create_multiuse_invite_group.
On the frontend, the selection is still a dropdown of system groups but
on the API level, we have started accepting anonymous groups similar to
other settings.
We've kept require system groups true for now until we switch to group
picker on the frontend.
2024-10-24 14:41:09 -07:00
Karl Stolley 8e85972a03 empty_titles: Set line-height to match font size. 2024-10-24 12:40:43 -07:00
Karl Stolley 5b96769739 right_sidebar: Correct line-height by decoupling .filters class. 2024-10-24 12:39:49 -07:00
sanchi-t aa48a0e3ee css: Refactor theme colors for `input_pill`.
This change moves the light and dark theme colors for
`input_pill` to CSS variables.
2024-10-24 11:09:39 -07:00
sanchi-t 9b5accdb43 css: Refactor theme color for kbd. 2024-10-24 11:09:39 -07:00
Kislay Udbhav Verma 327647f4f8 copy_and_paste: Paste fallback md link if syntax link will be broken.
If we paste a stream-topic URL that can be formatted as per #29302,
we now generate a normal markdown link if the stream topic syntax
could result in a broken link.

Fixes #31904
2024-10-24 11:07:31 -07:00
Sahil Batra b593f6a881 user_group_popover: Fix icon alignment.
This commit fixes alignment of icons for the group members
and subgroups list shown in the popover.
2024-10-24 08:24:14 -07:00
Sahil Batra 7fe927c61b user_group: Show subgroups in popover.
Previously, all members of the group, including members of
recursive groups, were shown in the the popover. Now only
direct members are shown along with the direct subgroups
of the group.

Fixes #32088.
2024-10-24 08:24:14 -07:00
Sahil Batra f6db00bfb5 user_group_popover: Show members count in popover.
This count includes direct members as well as members of
all the recursive subgroups.
2024-10-24 08:24:14 -07:00
Prakhar Pratyush 30ada20ece dialog_widget: Fix stale comment.
The 'settings_user_groups' file which the comment refers
to no longer exists.

This commit updates the comment.
2024-10-24 08:22:08 -07:00
Prakhar Pratyush fd66c08221 onboarding_steps: Fix blueslip error message.
This commit fixes the blueslip error message displayed
when marking an onboarding step as read fails.
2024-10-24 08:22:08 -07:00
Prakhar Pratyush 3e13914f4a attachments_ui: Remove unused 'id' from 'Delete file' dialog widget.
The 'id' field in a dialog widget is used to add custom id to
the container element to modify styles.

We were not using this id anywhere, so this commit removes it.
2024-10-24 08:22:08 -07:00
klarabratteby ab03c74314 user_topic_popover: Convert module to TypeScript. 2024-10-23 15:26:46 -07:00
klarabratteby a601715e37 user_topic_popover: Remove all occurrences of instance.context. 2024-10-23 15:26:46 -07:00
Aditya Chaudhary ac652ffab6
stream_settings: Place the cursor automatically in channel name.
When the user opens channel create settings from left sidebar, now the focus
is set on the channel name input.

The logic was already there, but not properly placed inside the overlay code path.

Fixes #32034.
2024-10-23 15:06:21 -07:00
Aditya Chaudhary c1fc8e6331 channel_feed: Configure click event for channel name.
This commit configures the click event on the channel name so that
when the user is narrowed to a topic within a channel, clicking the
same channel will navigate the user to the general channel feed. This
improves the user experience by allowing easy access to the full
channel feed when a user is focused on a specific topic.

Fixes #32032.
2024-10-23 15:03:39 -07:00
Anders Kaseorg 2671a5c32c stylelint: Enable stylelint-high-performance-animation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Anders Kaseorg f023fa6fc0 styles: Be specific about which properties are transitioned.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Anders Kaseorg 7878b80934 comparison_table: Remove dead CSS for th.sticky.
We do not have a "sticky" class.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Anders Kaseorg f8f511aded footer: Remove unused CSS transition for #footer li.
This doesn’t transition anything.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Anders Kaseorg dfc311ae96 landing_page: Remove CSS transition from .for-education-pricing-model.
If this was doing anything, it was probably just slowing down page
resizes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Anders Kaseorg 75d834dcc3 styles: Remove ineffective animation of display.
It’s not possible to animate or transition the `display` property, at
least until `transition-behavior: allow-discrete` lands in all
browsers.  We already take care of applying `display: none` in a
JavaScript setTimeout (see alert_popup.ts, hide_error in
ui_report.ts).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 14:56:39 -07:00
Aman Agrawal eab9a3e552 message_events: Refresh `is-followed` narrow on topic visibility update.
This adds live update support for `is-followed` narrow. We need
to render the narrow again instead of just adding the relevant
messages from the updated topic since it not easy to determine
which message we need to add based on the selected message of the
user and which messages to ask from the server.
2024-10-23 11:50:25 -07:00
Tim Abbott 29aad5c940 user_groups: Clean up members field comment. 2024-10-23 11:24:02 -07:00
Sahil Batra 9a72d6e72e user_groups: Do not show invalid subgroups in typeahead.
We do not show groups that will break the DAG constraint
on being added to a group as subgroups in the typeahead
shown in the members edit UI.

Fixes #32087.
2024-10-23 11:24:02 -07:00
Karl Stolley 625245af50 left_sidebar: Maintain Channels hover state while showing popover. 2024-10-23 11:01:25 -07:00
Aman Agrawal 70d9d8c09e message_scroll: Remove unnecessary `setTimeout` call.
Since `scroll_finished` is already called post render and we
don't have to wait for anything rendering before calling
`unread_ops.process_visible`, we can just directly call it.
2024-10-23 10:56:11 -07:00
Kislay Udbhav Verma 81c4e45d01 topic_link_util: Use different escape sequence for backticks.
Instead of "&grave;", we use "&#96;" to prevent an lxml parsing bug.
2024-10-22 17:36:59 -07:00
Kislay Udbhav Verma 6956947a73 topic_link_util: Add `&` as a character which can produce broken links.
`&` in topic names like `&copy;` can result in broken stream topic
links. So we generate fallback markdown links for them too.

This is a follow up to #30071.
2024-10-22 17:36:59 -07:00
Sayam Samal f7750a07a2 modals: Fix focus advancement in move topic modal.
Previously, when selecting a new channel in the "move topic" modal using
the keyboard, focus failed to advance to the topic input automatically.
Users had to press the tab key an extra time to move focus to the topic
input, which was not the intended behavior.

This commit modifies the `move_topic_on_update` function in
`web/src/stream_popover.js` to explicitly set focus on the topic input
field after a channel is selected.
2024-10-22 17:34:01 -07:00
evykassirer 8e9c592ce3 search: Only move cursor to end of selection if cursor is there already.
Fixes bug reported here:
https://chat.zulip.org/#narrow/channel/9-issues/topic/Broken.20links.20to.20previous.20messages.3F/near/196462
2024-10-22 16:25:26 -07:00
bedo 5686233699 message_header: Add date on every recipient bar in search_results.
Fixes #31958
2024-10-22 15:24:21 -07:00
Aman Agrawal 3ff6a89fe6 message_scroll: Fix last message not marked as read on `end` keypress.
Since we removed `unread_ops.process_visible` on system initiated
scrolling in #32038, this is important to take care of separately.

Reproducer: Go to a topic with a lot of unread messages and press
`end` key. Last message is not marked as read.
2024-10-22 12:21:45 -07:00
Aman Agrawal 49c2836605 message_scroll: Mark message as read after blue box moves past it.
Fixes #31833

Quoting from the issue:

Some of the reasoning behind that proposal was:

We want the first unread message to be what gets highlighted by the
blue box, since that's what you should read first.
It's bad to eat one unread message when entering a
message feed via N or otherwise.
A consistent algorithm would be that messages get marked as read when
you move the blue box past them ... except that there'd be no way to
mark the last message that way.
Because the bottom being visible marks things as read, it should be
fine to make this change now, even though there wouldn't currently
be a way to use the location of the blue box to mark the last message
in the current view as read.
2024-10-22 12:21:45 -07:00
Varun Singh ee52a7b155 scheduled_messages_overlay_ui: Convert module to TypeScript. 2024-10-22 10:43:58 -07:00
Varun Singh 9aa897b8e2 scheduled_messages_overlay_ui: Return early if msg-id is undefined. 2024-10-22 10:43:58 -07:00
Varun Singh f7f6f8703e scheduled_messages_overlay_ui: Refactor function to not mutate object.
Instead of mutating `message_render_context` object with fields,
we declare the object once depending on msg_type. This is a
prep-commit for migrating the module to TS.
2024-10-22 10:43:58 -07:00
Sahil Batra 5816dda2c9 user_group_create: Support adding subgroups while creating groups. 2024-10-22 10:23:36 -07:00
Sahil Batra 89d0ad1d60 user_group_edit: Add support to update subgroups of existing groups. 2024-10-22 10:23:36 -07:00
Sahil Batra a3b7d956bc user_groups: Allow adding users who are members of subgroups.
This commit updates the code, which checks if user is member of
the group before adding them to the group, to consider only
direct members and now allows members of subgroups to be added
as direct members of the group.
2024-10-22 10:23:36 -07:00
Sahil Batra aa2c7bf1d1 user_group_create_members: Remove buggy code.
Having this code resulted in pills being deleted on
clicking enter in the pill container as this was
needed before ad11561d31, when we cleared the pill
container after adding users to the list of members.
2024-10-22 10:23:36 -07:00
Sahil Batra 330aa25647 user_groups: Remove unused html_selector passed to ListWidget.create.
html_selector is only used when rendering a single item in the list
using insert_rendered_row and render_item, which are not used for
group members list in group creation form.
2024-10-22 10:23:36 -07:00
Sahil Batra 006ac58a4b stream_edit: Fix code being called for wrong subsection.
"update_default_stream_and_stream_privacy_state" function
should be called only when changing or discarding settings
in "Stream permissions" subsections and not when changing
settings in "Advanced configurations" subsection, since
the behavior of stream privacy and default stream options
does not depend on settings in "Advanced configurations".

This also fixes the bug of trying to access "checked"
property on undefined value of $default_stream.find("input"),
since there is no such input in "Advanced configurations"
section.
2024-10-22 10:02:07 -07:00
Maneesh Shukla 81836303d4 settings: Fix email notification permission.
Added `message_content_in_email_notifications` to the
`disabled_notification_settings` object to keep track of the setting.
Also added a tooltip message to display when the checkbox is disabled,
indicating that the setting is controlled by the organization.

Fixes: #27262.
2024-10-22 09:55:40 -07:00
Maneesh Shukla 9771528e28 settings: Rename show_push_notifications_tooltip.
This commits renames the `show_push_notifications_tooltip` object to
`disabled_notification_settings` as mentioned in the
https://github.com/zulip/zulip/pull/27543/files#r1438156860 review.

Fixes part of #27262.
2024-10-22 09:55:40 -07:00
Saubhagya Patel 34de7b7839 settings: Update confirmation modals(invite) to show server errors.
This commit includes the following changes:
 - Errors returned from the server when resending or
   revoking invitations are now shown inside the
   confirmation modal, keeping the modal open.
 - We no longer display errors in place of the Resend
   and Revoke buttons (in case of server errors), as
   they are now handled within the confirmation modal.
 - The "Working..." button text is no longer displayed
   for the Resend and Revoke buttons, which was displayed
   while the request was being processed.
 - The confirmation modals now show a loading spinner,
   while request is being processed.

Fixes part of #31395.
2024-10-22 09:52:09 -07:00
Saubhagya Patel 57f2194a1c settings: Update confirm modals(invite) to show unequal field errors.
This commit includes the following changes:
 - Display errors due to non-matching fields encountered
   during resending or revoking invitations within
   the confirmation modal, keeping the modal open.
 - Each modal is now associated with a specific ID.
 - Modify the error text for the above-mentioned errors.
 - Stop the process of revoking or resending invitations
   if an error due to non-matching fields occurs.

Fixes: #31395.
2024-10-22 09:52:09 -07:00
Vishesh Singh 7e1962dea5 compose: Show bot icon after bot name in recipient picker.
Bot icon shown in the typeahead recipient list which pops up
in the compose box while typing.
On typeahead hover, bot icon takes the color of the font
for better contrast.
2024-10-21 18:09:50 -07:00
Prakhar Pratyush d1be8f9b50 realm_export: Fix '#allow_private_data_export_stats' not live-updated.
Earlier, the count of total users and users who consented in the
'#allow_private_data_export_stats' text were not being live updated.

This commit fixes that behavior.

The counts are now live-updated when:
* a new user joins
* a user is removed
* a user is deactivated
* a user is reactivated
* a user toggles their 'allow_private_data_export' personal setting.

Fixes #31201.
2024-10-21 17:42:52 -07:00
Prakhar Pratyush b8e0e08f01 realm_export: Add 'Export permissions' table.
This commit adds a "Export permissions" table
in the 'Data exports' setting panel.

The table lists the active human users and their
configuration of 'allow_private_data_export' setting.

Fixes part of #31201.
2024-10-21 17:42:52 -07:00
Aman Agrawal a1aa52cff4 message_scroll: Don't mark message read on system animated scroll.
This avoids us marking new messages as read when they arrive without
user activity. Specifically, we don't mark all messages in the narrow
as read when the last message is visible and the scroll was
initiated without user input.
2024-10-21 15:53:28 -07:00
Aman Agrawal 32030a7548 activity: Don't read new messages without user activity.
We have a bug where we can mark messages as read as a result of a
desktop left open with the Zulip window focused. To avoid it,
we only mark new messages as read if there is some user activity.

Note that we scroll to bring new messages into view which can
mark them as read.
2024-10-21 15:53:28 -07:00
Aman Agrawal 72caf5641e activity: Use the defined function to set `new_user_input` value.
This helps us call additional functions when `new_user_input` value
is modified.
2024-10-21 15:53:28 -07:00
Shubham Padia ad11561d31 user_groups: Add users to members preview list without add button.
This makes the behaviour of this screen similar to the create channel
screen where the user does not need to click `Add` button to add users
to members preview. This follows most of the logic from that flow for
soft removal, syncing between members preview list and the input pills,
etc. The current user will have a pill in this case unlike channel
creation since a user can create a group without them in it.
2024-10-21 15:46:11 -07:00
Aman Agrawal 4768294bc0 navbar: Remove `:visited` color effect on button text.
The `:visited` color effect doesn't look good is not intentional.
2024-10-21 15:44:43 -07:00
Alya Abbott 18dc503865 portico: Add buttons to Why Zulip hero bar. 2024-10-21 15:44:43 -07:00
Shubham Padia 97bd0e6f3f user_groups: Fix incorrect nesting for .pill-container.
5980f4a502 moved the
`group_setting_disabled` class from pill container to its parent input
group without changing the nesting for the other css properties
properly. This commit fixes that.
2024-10-21 15:41:30 -07:00
Prakhar Pratyush aa667f8df1 settings_users: Remove the extra 'list_widget.hard_redraw' call.
For ListWidget, 'replace_list_data' makes a call to 'hard_redraw'
by default. There is no need to make a separate call to 'hard_redraw'
when using 'replace_list_data'.

In 'settings_users.js', we were making that separate call.
This commit removes that extra unnecesssary call.
2024-10-21 15:39:44 -07:00
Aman Agrawal 8aca0a7776 narrow_history: Save narrow state after we have scrolled to the msg.
Saving narrow state before we have scrolled to the message results
in view scroll position being different from where the message
is displayed.
2024-10-21 08:54:14 -07:00
Aman Agrawal b895e9dc6f realm_creation: Let user choose their org type. 2024-10-20 18:17:04 -07:00
Aman Agrawal 1cc9947786 message_events: Don't update msg if we don't have it cached locally.
This fixes a bug where we try to rerender the anchor message even
if we don't have it locally cached which results in error.

The bug was introduced in #31942.
2024-10-18 14:46:59 -07:00
Sahil Batra 70b6e46516 stream_create: Do not show banner if the current user is subscribed.
There is no need to show the banner if the user creating the channel
is subscribed to it because user will eventually be narrowed to
channel narrow and seeing the banner flash doesn't look good.
2024-10-18 10:20:32 -07:00
Sahil Batra 77c1204d45 stream_create: Remove banner shown on successful API request.
There was a banner showed on channel creation page on successful
completion of the API request, but we do not need that now since
we anyways move to a different UI, either the settings for the
created channel or to the message view narrowed to the new channel.
2024-10-18 10:20:32 -07:00
evykassirer 7a53db8498 stream_create: Convert module to typescript. 2024-10-17 10:56:59 -07:00
evykassirer b27ce42f6d stream_create: Don't return anything from create_stream.
The return value is not being used anywhere.
2024-10-17 10:56:59 -07:00
Lauryn Menard fa36c7ffde todo-widget: Add TODO for inbound/outbound data schema refactor. 2024-10-17 10:53:26 -07:00
Sahil Batra fde8b2d2e0 stream_creation: Fix subscriber pills being too long.
The CSS for setting min-width was added in 63a7c9061b
to set the width of pill containers used for group
settings, but that also applied to pill containers of
subscribers in stream creation form.

This commit updates the CSS to be applied only for
settings in groups UI.
2024-10-17 10:52:58 -07:00
Karl Stolley 746042915a portico: Align mobile subhead colors with desktop. 2024-10-16 16:20:56 -07:00
Lauryn Menard be3ac06cf4 invite-user-modal: Add validation on custom time input.
Disables the submit button on the invite user modal if the custom
time input value is a negative number or if the number is not an
integer.

Also updates the text for when the invite expires so say that the
custom time value is invalid.
2024-10-16 15:21:40 -07:00
Lauryn Menard 7d5a715ddf settings-input: Move time input check helper to web/src/util.
Moves the helper function for converting a time input into a
number so that it can be reused in both modals and settings
components.
2024-10-16 15:21:40 -07:00
Lauryn Menard 8e3317d15a invite-user-modal: Update invitate expiration text once post render. 2024-10-16 15:21:40 -07:00
Lauryn Menard b8888d2c33 invite-user-modal: Generalize converting custom input into minutes.
Moves custom time input helper to `web/src/util.ts` so that it
can be reused for other modals where users can select a custom
time duration.

Co-authored by: Ujjawal Modi <umodi2003@gmail.com>
2024-10-16 15:21:40 -07:00
Lauryn Menard cc1a3eeec1 invite-user-modal: Internationalize custom time unit options.
Prep for using these values other modals, specifically the
deactivate realm modal.
2024-10-16 15:21:40 -07:00
Vector73 1be0cb1b75 settings: Add `can_move_messages_between_channels_group` realm setting.
Added `can_move_messages_between_channels_group` realm setting to replace
`move_messages_between_streams_policy`.
2024-10-16 14:26:18 -07:00
Shubham Padia 1e85bec9a9 user_groups: Change cursor to not-allowed if cannot leave. 2024-10-16 13:43:03 -07:00
Shubham Padia 4a2f126af9 user_groups: Open group setting typeahead on clicking label.
Fixes #32007.
2024-10-16 13:43:03 -07:00
Shubham Padia 5980f4a502 user_groups: Show not-allowed cursor on labels also.
Fixes part of #32007.
2024-10-16 13:43:03 -07:00
Shubham Padia 8055617900 user_groups: Use group picker for can_mention_group. 2024-10-16 13:43:03 -07:00
Shubham Padia 05a6d7f870 user_groups: Reorder group permission settings.
Fixes part of #32007.
2024-10-16 13:43:03 -07:00
Shubham Padia 5508acfbbd user_groups: Reword tooltip message when user cannot leave group.
Fixes part of #32007.
On the group left sidebar, when a user cannot leave a group, make the
tooltip message same as the leave group button on the right side panel.
2024-10-16 13:43:01 -07:00
Shubham Padia 5c357a7f84 user_groups: Reword tooltip message when user cannot join group.
Fixes part of #32007.
On the group left sidebar, when a user cannot join a group, make the
tooltip message same as the leave group button on the right side panel.
2024-10-16 13:42:47 -07:00
Karl Stolley 9fe5f44b30 left_sidebar: Show DM header hover controls when zoomed in. 2024-10-16 13:41:15 -07:00
Karl Stolley ab1a8367f0 left_sidebar: Add uniform LONG_DELAY class. 2024-10-16 13:41:15 -07:00