Commit Graph

1601 Commits

Author SHA1 Message Date
Aman Agrawal
5458a2ca2f message_list: Fix just_unsubscribed for empty views.
This fixes a bug where wrong bookend is shown in empty views in
the next commit.

(cherry picked from commit afbc6f2510)
2025-03-27 21:53:31 -07:00
Lauryn Menard
44fdbe5f04 compose-closed-ui: Refactor get_recipient_label.
Refactors get_recipient_label so that it's a bit clearer what the
recipient_information parameter is for and what we do when that
parameter is undefined.

In doing so, we no longer treat the constructed objects, that are
passed as the recipient_information parameter, and actual Message
objects, that we get from the current message list view, as the
same thing.

(cherry picked from commit 7d3b77e490)
2025-03-27 16:53:35 -07:00
Lauryn Menard
1345944688 compose-closed-ui: Rename update_reply_recipient_label.
Renames update_reply_recipient_label to
update_recipient_text_for_reply_button.

This better matches the function that sets the default text for
the closed compose box button: set_standard_text_for_reply_button.

(cherry picked from commit 94fe5fc173)
2025-03-27 16:53:35 -07:00
Aman Agrawal
2dd46fe522 compose_validate: Make validate single source for error messages.
Instead of relying on different functions to get error messages,
we use `validate` to get the error message for the current compose
state.

This fixes a bug where compose tooltip was not defined when
compose state was not valid.

(cherry picked from commit 01c5197dd9)
2025-03-27 16:53:35 -07:00
Aman Agrawal
b047bf4d44 compose: Remove old style compose send disable.
We now use `disabled-message-send-controls` class to control
the disabled status of send button. So, this is not required.

(cherry picked from commit ad0b616bbd)
2025-03-27 16:53:35 -07:00
Aman Agrawal
f12d72d711 stream_list_sort: Fix user setting for demote inactive stream ignored.
We were not using `filter_out_inactives` and `pin_to_top` when
sorting stream in the left sidebar.

These were incorrectly removed in
1aee0ef98b.

Restored the original function and the places where it was used
to bring back original functionality.

(cherry picked from commit 67ff430e45)
2025-03-26 10:55:07 -07:00
Aman Agrawal
30e52c90e5 stream_list_sort: Remove unused function.
This function was introduced in c1b5021d84
but was never used.

(cherry picked from commit 87864992a8)
2025-03-26 10:55:07 -07:00
Prakhar Pratyush
e95ee707a6 compose: Update topic input box when mandatory_topics setting changes.
Earlier, when `realm_mandatory_topics` setting was getting toggled,
the topic input box in composebox was not being live-updated to
align with the correspondning setting's UX.

This commit fixes that bug by making sure that placeholder and
other UI elements are updated accordingly.
2025-03-20 10:32:31 -07:00
Prakhar Pratyush
f8bedf3e3a compose_validate: Fix topic required error message not shown.
Earlier, with `realm_mandatory_topics=true` the topic required
error message was shown only when topic="".

The error message was missing for other topic names which are
also considered empty:
* "(no topic)"
* realm_empty_topic_display_name

This commit fixes the bug to show the error message for the
other two topic names too.
2025-03-18 11:18:37 -07:00
Prakhar Pratyush
0642c7a264 util: Fix is_topic_name_considered_empty function.
Earlier, the `is_topic_name_considered_empty` function
used to return true only if the topic_name is either:
* ""
* "(no topic)"
* `realm_empty_topic_display_name` value

The third condition is not precisely correct. This commit
replaces it with the displayed topic name for `""` topic.

The displayed topic name is not always the same as
`realm_empty_topic_display_name` value.
2025-03-18 11:18:37 -07:00
Tim Abbott
a6c5ddf102 compose_validate: Fix buggy separated handling of empty compose box.
When I adjusted 4fbf91c135 to no longer
do a full re-validation on every character typed, that unmasked bugs
in how the compose_setup handler code and compose_validate split
responsibility for validating 0-length messages.

The user-facing result was the send button not enabling properly when
starting to type.

Fix this by moving the 0-length message validation into
compose_validate, where we already handle issues of too-long messages,
sharing the same basic logic for determining when to do a full
validate() call.

A benefit of this reworking is now all of the logic for handling the
`invalid` class is in one place in validate, rather than split with
the compose_setup module.
2025-03-17 14:15:12 -07:00
Tim Abbott
4602a22057 compose: Remove unnecessary mocks in node tests.
These became unnecessary in my final bug fix to
4fbf91c135.
2025-03-17 11:48:44 -07:00
Aman Agrawal
4fbf91c135 compose: Fix buggy tooltip on validation.
Compose send tooltip was not correctly displayed when the compose
box was in an invalid state.

We significanlty improve the logic for displaying the tooltip here
to provide a more robust experience to the user.
2025-03-17 11:35:56 -07:00
Sahil Batra
526b46828c stream-settings: Show archive button to channel admins.
Previously, stream archive button was only shown to realm admins.
Now button is shown to all the users who can administer the
channel.

Fixes part of #33379.
2025-03-17 11:02:55 -07:00
Anders Kaseorg
dd71087b5f dropdown_widget: Convert TypeScript enum to union.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-17 08:43:19 -07:00
sanchi-t
43932cd6aa stream_edit: Update channel row in settings when channel is archived. 2025-03-14 11:29:51 -07:00
Sahil Batra
48aaeee6dd stream-settings: Refactor filter dropdown related code.
Variable for storing the dropdown widget is now
declared in stream_settings_components and this
commit also adds some helper functions to get
and set the filter value.

This is a preparatory commit to avoid import
cycles in further commits for fixing live
update when channels are archived.
2025-03-14 11:29:51 -07:00
Sahil Batra
c50e8fa406 stream-settings: Move functions to update stream privacy choices.
This is a preparatory refactor to avoid import cycles in future
commits for fixing live update behavior when archiving channels.
2025-03-14 11:29:51 -07:00
Sahil Batra
0c6ed6559a stream-settings: Refactor code to not store filter value in variable.
There is no need to store the archived status filter value in a
variable, instead value can just be derived by calling "value"
function on DropdownWidget.

This is a preparatory refactor for further commits which will fix
live-update behavior when archiving channels.
2025-03-14 11:29:51 -07:00
Aman Agrawal
a393d9d495 user_group: Use double user icon instead of tripe user icon. 2025-03-14 11:07:33 -07:00
Kartikay5849
136be83502 mentions: Warn on non-silent group mentions with unsubscribed members.
Add a warning banner when a user mentions a group (non-silent) where none
of the members are subscribed to the current stream. The banner informs
the user that the mention won't notify anyone.

Fixes #33545.
2025-03-13 15:55:30 -07:00
evykassirer
08ed639763 filter: Validate and parse sender:me when turning into a pill.
Fixes #31315.

We want to parse sender:me with the email when turning it into
a pill, but not before then so that "Sent by me" is still the
search string in the suggestions.
2025-03-13 13:54:14 -07:00
Vector73
b31024be47 saved_snippets: Add support for editing saved snippets.
Fixes #33708.
2025-03-13 10:58:36 -07:00
afeefuddin
6f196c7ec9 composebox_typeahead: Show CrossRealmBots in the typeahead list.
Fixes: #30817
Co-authored-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-03-12 23:11:53 -07:00
roanster007
2c548d4856 settings: Allow "resolve topic" permissions to be managed independently.
This commit separates the "resolve topic" permissions from the
topic editing permissions, through the introduction of setting -
"can_resolve_topics_group" which user group whose members
can resolve topics.

Fixes #21811
2025-03-12 19:32:35 -07:00
opmkumar
4f462970e4 search: Add is-muted search operator.
Add the `is:muted` search operator.
`-is:muted` is an alias for the `in:home` operator.

Co-authored-by: Kenneth <Kenneth012004@outlook.com>

Fixes #16943
2025-03-11 23:18:07 -07:00
opmkumar
4becea3993 search: Fix -in:home muting logic.
Previously, mentions from muted channels were incorrectly excluded when
narrowing down to `-in:home`. Additionally, messages from all muted
topics were missing in the results.
This commit solves the above listed issues.

The relevant legacy logic being removed dates to when we didn't
support unmuting or following topics.
2025-03-11 23:18:07 -07:00
Lauryn Menard
0f5246400b message-edit: Use last_moved_timestamp for edited/moved indicators.
Use both the last_moved_timestamp and last_edit_timestamp to show
edited and moved indicators/tooltips in the message list view of
the web app, instead of parsing the message edit history array.

We still maintain and build the message edit history array as it's
used for calculating the narrow terms when there is a near operator
and a message has been moved to a different channel or topic.

Updates the tooltip for message edit indicators to include both
the moved and edited time if a message has been both moved and
edited.
2025-03-11 16:42:28 -07:00
whilstsomebody
41ec9a3904 stream_settings_data: Exclude archived streams in channel pickers.
These cannot be used for notifications channels, so they are both
distracting, and picking one of them would show an error.
2025-03-11 14:28:44 -07:00
Maneesh Shukla
e3a1ad7a3c settings: Prevent redundant requests by modifying event handler.
Previously, all buttons within .subsection-changes-save were targeted,
potentially leading to multiple requests while a request was in
progress. This change ensures that the triggering element is properly
handled by preventing the default form submission action.
2025-03-11 12:45:57 -07:00
opmkumar
86eb69a68b hash: Fix logic for handling web public narrows.
Previously, `is_spectator_compatible` in `hash_parser.ts` ignored all
operators and operands beyond the first pair in a narrow.
This was fixed by iterating through each operator-operand pair individually.
2025-03-11 12:43:02 -07:00
Quan Nguyen
b4bb708c14 recent_conversations: Improve sorting behavior.
Refine sorting algorithm of recent conversation list so that
it works like spreadsheet sorting, with previous sorting orders
remembered.

Fixes #33289.
2025-03-11 10:48:31 -07:00
apoorvapendse
66ca78dbd3 compose_paste: Add test to verify pasting from Mac terminal.
For context, #33569 appears to have been fixed
unintentionally by #33691.

This just adds a test to verify the expected
behavior when it comes to pasting from the
Mac terminal as described by the reproduction
steps in #33569.

We might still end up with some edge case in
the future, that might not work as expected.

CZO: https://chat.zulip.org/#narrow/channel/9-issues/topic/.F0.9F.93.82.20surprising.20line.20breaks.20when.20copy-pasting.20.2333569/near/2119422

Co-authored-by: Kislay Verma <kislayuv27@gmail.com>
2025-03-11 09:48:35 -07:00
Apoorva Pendse
54fd02b173 compose_tooltip: Remove delay for invalid messages.
Does what 714def080f
was trying to do without the side effects.
Fixes: 714def080f
2025-03-11 09:41:22 -07:00
apoorvapendse
ef863258c2 compose_paste: Remove title formatting more carefully.
We now start to consider text nodes
with valid content to determine
whether we should remove the styling.

Fixes: #31218.
2025-03-10 17:01:13 -07:00
Sahil Batra
e2d9d069e0 settings: Remove dense_mode setting. 2025-03-10 16:07:37 -07:00
Sahil Batra
6f6059da73 personal_menu: Support changing information density settings.
This commit adds UI in personal popover menu for user to change
font-size and line-height.

Fixes part of #33186.
2025-03-10 16:07:37 -07:00
Harsh
b7a943b8cb left_sidebar: Hide menu option for home view if all messages are read.
This commit hides sidebar menu option button instead of showing
it with "Mark all messages as read" option, for home view when
there are no unread messages.
2025-03-10 13:08:39 -07:00
Sayam Samal
3275fcc96e popup_banners: Redesign connection banner to use new banner component.
This commit serves as the base commit for redesigning the alert banners
by migrating them to use the new banner component. We use a new name
to refer to these banners — "Popup banners", which is more descriptive
about their behavior.

The Popup banners are appended to the container in a stacking order,
i.e., the most recent popup banner appears on the top and the oldest one
is sent to the bottom of the stack. These banners also inherit the
animations from the alert banners for visual appeal.

This commit also fixes the bug where clicking on the "Try now" button
in the popup banner resulting from an error in the `/json/messages`
endpoint resulted in call to restart_get_events in server_events.js
instead of load_messages in message_fetch.ts.

Fixes #31282.
2025-03-10 11:21:11 -07:00
Vector73
c049259d07 user: Remove is_billing_admin user property.
Removed `is_billing_admin` user property as it is no longer used since
billing permissions are now determined by `can_manage_billing_group`
realm setting.
2025-03-10 09:36:30 -07:00
Vector73
158fd58cde settings: Add "can_manage_billing_group" realm setting.
Added "can_manage_billing_group" realm group permission setting
to control who can manage billing and plans in the organization.

Fixes #32745.
2025-03-10 09:36:30 -07:00
Niloth P
6ba3bdc05d filter: Add may_contain_multiple_conversations.
Preparatory commit for #31292.
2025-03-08 17:38:49 -08:00
sanchi-t
423ee27a23 stream_privacy: Add archive icon for archived channels.
Archived channels are now displayed with an archived
icon.
2025-03-07 18:08:41 -08:00
sanchi-t
1aef79078c stream_settings: Display archived channels.
By default, archived channels will be hidden.
2025-03-07 18:08:41 -08:00
sanchi-t
f9babb37a2 delete_sub: Do not remove stream from subscriptions when archived. 2025-03-07 18:08:41 -08:00
sanchi-t
874e7bacf9 popover_menus_data: Hide actions user can't take for archived channels.
Hide actions users cannot perform for messages and topics within
archived channels.
2025-03-07 18:08:41 -08:00
Lauryn Menard
3143662830 narrow-state: Use stream_id in cases where only stream ID is needed.
Updates calls to narrow_state.stream_sub that do not use the
StreamSubscription data, but rather just need a valid stream ID.
2025-03-06 17:47:59 -08:00
Lauryn Menard
51bb8eff59 narrow-state: Add only_valid_id boolean param to stream_id function.
Updates narrow_state.stream_id to have a boolean parameter, that
defaults to false. When true, the function will return an ID or
undefined based on the stream data that we have. When false, the
function will return the operand of the channel narrow term when
it's a valid number or undefined if it's not.

Replaces all uses of narrow_state.stream_sub()?.stream_id to
instead use the updated stream_id function with only_valid_id set
to true.
2025-03-06 17:47:57 -08:00
Tim Abbott
8cbd5e3612 buddy_data: Fix inconsistent subscriber status test.
The `subscribed` state elsewhere in this test has the current user
subscribed, so they should be there in peer_data.
2025-03-06 17:44:36 -08:00
Lauryn Menard
61fa5ccbf1 narrow-state: Return undefined for a channel ID that would be NaN.
When the channel operand would return NaN for the ID value, we now
return undefined, so that there is only one invalid value being
returned by narrow_state.stream_id.
2025-03-06 17:42:50 -08:00