Commit Graph

28 Commits

Author SHA1 Message Date
Sahil Batra
6292b03b33 overlays: Handle restoring messages in inaccessible streams.
On trying to restore a draft or a scheduled message in a
stream that is no longer accessible, compose box is opened
without selecting any stream with dropdown open.

Previously, it raised an AssertionError.
2025-08-11 12:55:50 -07:00
Tim Abbott
941a91bc6c Revert "compose_actions: Clean up unnecessary rewire."
This reverts commit 56faf6b22a.

I need to merge another PR that wasn't updated.
2025-08-11 12:55:50 -07:00
Kislay Verma
56faf6b22a compose_actions: Clean up unnecessary rewire.
We organically create a user group so that the
pertinent code paths are accessed.

Fixes part of #32326.
2025-08-11 11:57:49 -07:00
Kislay Verma
c134cc398f tests: Add library function to create user groups.
This is done to ensure the objects exactly match
the schema/types during tests.

Fixes part of #32326.
2025-08-11 11:57:49 -07:00
Kislay Verma
e4b0af5536 compose_actions: Improve tests by using lib functions.
We use the `make_stream` and `make_user` functions to
make the objects type-correct.

Fixes part of #32326.
2025-08-11 11:57:49 -07:00
Maneesh Shukla
0eea85446b tooltips: Group tooltips for a smooth transition.
This commit introduces the use of createSingleton from the Tippy.js
library to group the tooltips of compose box formatting buttons. The
main benefit is that the hover delay only applies when you move the
cursor into the group for the first time — after that, tooltips show up
instantly as you move between buttons. It makes the whole experience
feel a lot smoother.

We store the singleton instance in a variable to avoid creating multiple
instances unnecessarily. Before initializing a new singleton, we destroy
the previous one to prevent memory leaks and ensure correct behavior.

Previously, each formatting button had its own independent tooltip with
separate delays, which made the experience feel sluggish and disjointed
when hovering across buttons.

Now, by sharing a delay timer across the grouped tooltips, the
transition feels more natural.

Fixes: #24825.

Co-authored-by: Sayam Samal <sayam@zulip.com>
2025-07-10 17:20:41 -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
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
Evy Kassirer
38bf407c9a compose_actions: Migrate start() to use pm recipient ids. 2025-05-16 10:51:29 -07:00
Evy Kassirer
464b7f4540 compose_state: Rename private_message_recipient to clarify it stores emails.
This will add clarity as we move towards using ids more and emails
less.
2025-05-16 10:51:29 -07:00
Evy Kassirer
497ba6bd25 compose_action: Move missed PM recipient into compose_defaults. 2025-05-08 09:35:53 -07:00
Evy Kassirer
1ade634728 compose_actions: Reset start_called in tests. 2025-05-08 09:35:53 -07:00
Evy Kassirer
b210456e35 compose_actions: Fix on_narrow tests to pass opts correctly. 2025-05-07 09:31:19 -07:00
Karl Stolley
1c55004cda decorated_channels: Rename partial as 'decorated_channel'. 2025-04-22 11:26:12 -07:00
Aman Agrawal
01c5197dd9 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.
2025-03-25 11:28:43 -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
Prakhar Pratyush
087abb4314 composebox: Show 'Enter a topic (skip for general chat)' placeholder.
Use a more instructive placeholder instead of "Topic" when
topic is not mandatory in a realm.

Updated placeholder:
'Enter a topic (skip for general chat)'.
2025-02-26 14:03:24 -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
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
e856294da6 compose: Open the compose box with channel picker.
This commit changes the code in such a way that the
"Start new conversation" button open the compose box with the channel
picker open, as we do when no channels is selected.

Fixes #28410.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>
2024-12-16 10:50:12 -08:00
Emil Grehn
f9b95bd4f3 message_quoting: Add a "Forward message" option below "Quote message".
Forward message starts a new message with the quoted context
(message or selection).
The compose box opens with then channel picker open and no topic.

Also added documentation about this feature in the help center.

Fixes part 2 of #31953
2024-12-04 22:25:14 -08:00
Emil Grehn
8e9d581746 message_quoting: Rename 'quote_and_reply' to 'quote_message'.
To be consistent with the new naming in the app
'quote_reply' was also renamed to 'quote_message'

Fixes part of #31953
2024-12-04 22:25:14 -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