Commit Graph

27 Commits

Author SHA1 Message Date
amcdowell226
124a32e819 compose: Save messages as drafts when window loses focus.
Add a check for window blur and save any in-progress
messages as drafts. This will help prevent unnecessary
message loss for the user by creating drafts for them more
whenever they switch away from their Zulip tab.

Tested on my local Ubuntu development with a demo
organization and some of the premade profiles.

Fixes #35262.
2025-08-05 15:28:13 -07:00
Vector73
71342169ff stream_settings: Update organization default dropdown labels.
Updates labels for organization default options in "topics policy"
and "message retention policy" channel settings.

Fixes #35212.
2025-07-11 12:31:03 -07:00
Karl Stolley
e19b815eaf compose: Rename functions to reflect attention level. 2025-06-20 15:54:59 -07:00
Karl Stolley
966c8451df compose: Add functions to mute/unmute recipient row. 2025-06-19 17:21:20 -07:00
Vector73
6094bbe8a5 stream_settings: Add new topics_policy setting.
Added `topics_policy` channel setting to configure sending
messages in the empty topic.

Fixes #33549.
2025-06-17 17:05:58 -07:00
Vector73
62c67eae8e settings: Add a new topics_policy realm setting.
Added a new realm setting, `topics_policy` and deprecated
`mandatory_topics` setting as it now replaced by `topics_policy`.

Fixes part of #33549.
2025-06-17 17:05:58 -07:00
Tim Abbott
bbeede1e52 people: Optimize is_person_active.
Calling settings_data.user_can_access_all_other_users on every call to
this function could be expensive when using this function in loops
over every user in the organization.

After the previous commit, those calls are still somewhat expensive
for guest users.
2025-06-06 10:53:03 -07:00
Aditya Kumar Kasaudhan
a5632a9356 drafts: Refactor draft deletion to support bulk operations.
This commit updates the draft deletion functionality to handle
multiple draft IDs at once, reducing localStorage writes.
2025-06-05 15:34:11 -07:00
Evy Kassirer
efda73536f compose: Prefer using recipient_ids over recipient_emails. 2025-05-16 10:51:29 -07:00
Anders Kaseorg
61c04078cc server_events: Extract interface for compose, transmit to new module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-12 11:07:12 -07:00
Evy Kassirer
cbc4dfb086 compose: Fix broken logic in 'finish' test.
It doesn't make sense that there would be no compose pill user ids
if there were compose pill emails, and there needs to be permission
to send a direct message or the message won't successfully send.

This was working before because `user_ids_string` ended up empty
in `validate_private_message`, which incorrectly returned true
for `check_dm_permissions_and_get_error_string`.
2025-05-07 09:32:02 -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
Karl Stolley
a3a43c2f8b compose: Handle fading with general chat.
This commit also attempts to fix a bug, present in main, where a
draft restored directly to the compose box loses its original topic
upon switching to other topic narrows.

Co-authored-by: Prakhar Pratyush <prakhar@zulip.com>
2025-02-26 13:59:03 -08:00
Karl Stolley
cae48d3faa compose: Rename placeholder update function for clarity. 2025-02-26 13:59:02 -08:00
Apoorva Pendse
8496a40564 compose_banner: Assign banner priority.
Assigns priority to banner errors as
mentioned in #32115.
2025-02-23 23:11:18 -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
Steve Howell
0a6a37fcff node tests: Extract compose_helpers lib.
For now compose_helpers only includes FakeComposeBox.
I don't love either of the names, but some of the alternatives
that I thought of have their own tradeoffs.

The compose_helpers module will soon have other
helper classes or functions in it, possibly including
the mock_banners helper from lib/compose_banner.

I don't want to step on mock_banners yet, because
I have two possible plans for improving that code,
and I haven't decided what's best yet, so for now
I don't want to step on it or move it, so I am
just leaving that alone for now.

Gotta start somewhere.
2025-01-09 15:08:17 -08:00
Steve Howell
d0730131a2 compose tests: Create stubs for height and css.
This is a bit of an emergency fix to fix the build, but
it is probably close to what we want.

Any test that cares about the height of the compose box
can probably override this behavior.  Likewise for any
css calls.
2025-01-07 16:34:31 -08:00
Steve Howell
b5d0858632 compose tests: Encapsulate zjquery interactions. 2025-01-07 13:16:35 -08:00
Steve Howell
31bdbd0f67 compose tests: Rename "foobarfoobar". 2025-01-07 13:16:35 -08:00
Steve Howell
9da5b8e7be compose tests: Remove unnecessary zjquery setup.
There is no point creating all this fake DOM if are
not gonna validate anything about it.
2025-01-07 13:16:35 -08:00
Steve Howell
586eb46ef1 compose: Rename enter_with_preview_open.
The old function name sounded like you were entering
preview mode when, in fact, hitting the enter key
in some cases **exits** you from preview mode.

This was particularly confusing to read in the tests.
2025-01-07 13:16:35 -08:00
Sahil Batra
bbf43a2866 stream-settings: Use new "can_send_message_group" setting. 2025-01-07 12:17:36 -08:00
opmkumar
5eb51e2df6 message_edit: Add message length limit indicator in edit message UI.
Adds a message length limit indicator similar to the one in the compose box.
The tooltip message for the disabled save button now appears dynamically
based on whether the message exceeds the length limit or the editing time
has expired.

Fixes #25271.
2024-12-04 11:44:51 -08:00
opmkumar
88727862b4 compose: Refactor functions for handling max length limits.
Refactors `check_overflow_text` and `validate_message_length` functions.
This commit ensures that there won't be any change in the existing UI
of the compose box with the refactoring of the above functions.
2024-12-04 11:44:51 -08:00
Anders Kaseorg
687f1b1651 tests: Rename the Node tests to *.cjs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00