Commit Graph

28 Commits

Author SHA1 Message Date
Prakhar Pratyush
8a14018442 drafts: Show empty string as topic when realm_mandatory_topics=true.
Earlier, we were displaying `realm_empty_topic_display_name` as the
topic name when topic="".

This was not the expected behavior when `realm_mandatory_topics=true`.

This commit updates the logic to show empty string in such cases.
2025-02-12 09:37:51 -08:00
Prakhar Pratyush
e3ce4c5766 drafts_table: Show realm_empty_topic_display_name for topic="".
This commit adds support to display `realm_empty_topic_display_name`
value in the drafts table for topics having the actual value of
empty string.
2025-01-10 14:32:55 -08:00
aditya.chaudhary1558@gmail.com
08c8e40afa drafts: Remove feature for discarding drafts after 30 days.
This commit helps in removal of all the code and documentation
related to 30-day auto removal of draft that are saved.

Fixes #32176.
2024-12-17 11:54:10 -08:00
evykassirer
7bd4016254 message_events: Convert module to typescript. 2024-12-10 10:52:01 -08:00
Anders Kaseorg
fcba1f03c4 drafts_overlay_ui: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-30 18:41:42 -08:00
Anders Kaseorg
ec3177c834 web: Add explicit extensions to imports.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Anders Kaseorg
52e59a9605 web: Add setters for rewired variables.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Pratik Chanda
64a9f83473 compose_box: Fix order of group pm recipient pills on focus.
Earlier when compose box was opened or narrowed to pm, the recipient
pills were sorted according to user email strings instead of their
full names which was inconsistent with compose box placeholder text,
recipient row and message header.

This commit fixes the behaviour by introducing a `sort_email`
function to sort emails according to their full names and display
sorted pills.

Fixes: zulip#27375.

Co-authored-by: richardshaju <richardshaju66@gmail.com>
2024-08-27 13:21:16 -07:00
evykassirer
d9f25d01a1 web: Use util.the for accessing element of single-item lists. 2024-08-20 09:48:15 -07:00
Aman Agrawal
eca1a66fe8 drafts: Show saved time in UTC format in a tooltip. 2024-07-01 15:13:21 -07:00
Anders Kaseorg
7d4d4017b3 eslint: Fix unicorn/prefer-array-find.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-26 20:13:26 -07:00
Anders Kaseorg
804c3706ff tsconfig: Enable noUncheckedIndexedAccess.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 16:29:23 -07:00
Anders Kaseorg
7303851fd5 drafts: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg
9b711cda20 tippy: Use namespace import for tippy.js.
Names like “delegate”, “Instance”, “Placement”, “Props”, and
“ReferenceElement” are much too generic to make sense as named
imports.

The downside is that we now need to write tippy.default(…) instead of
tippy(…) (because ES module namespace objects cannot be callable), but
that cost is worthwhile.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:45:46 -07:00
Anders Kaseorg
507eb4913c tsconfig: Enable exactOptionalPropertyTypes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-16 08:58:20 -07:00
Anders Kaseorg
49e1c919c3 drafts: Convert .data("draft-id") to a module variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-07 12:57:14 -07:00
Anders Kaseorg
467e5a4361 drafts: Fix implicit use of any.
Attempting to convert .data("draft-id") to .attr mysteriously breaks
draft saving, so I’ll leave that for future work.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-06 16:12:27 -07:00
Tim Abbott
7beea02660 compose_state: Reuse has_savable_message_content. 2024-04-20 13:29:22 -07:00
evykassirer
2c2dfa4c3d draft: Only auto-restore drafts edited since adding the feature. 2024-04-20 13:27:25 -07:00
evykassirer
160b78a7e9 drafts: Don't restore drafts being actively sent or scheduled. 2024-04-20 13:27:25 -07:00
evykassirer
14d83458c8 drafts: Separate initialize function into data and UI pieces.
This will let us initialize the data before the UI is ready
to be initialized. We'll need to do this in an upcoming commit
where we clear a flag on page load before the reload code
initializes.
2024-04-20 13:27:25 -07:00
evykassirer
3ef4e80dff compose: Add button to save draft and start a new message. 2024-04-20 13:27:24 -07:00
Riken Shah
d48de6da08 compose: Restore the last draft when compose box is opened.
Now when the user opens a narrow that has a draft saved for
that particular conversation, the draft will automatically
be restored in the compose box. This will make it easy to
return to a draft after clicking away, and also will make
it less confusing when people close the compose box by
accident. Note that this only restores the draft when
there is a full recipient specified (stream and topic,
or at least one PM recipient).

Fixes part of #18555.
Fixes #11218 and #17396.
2024-04-20 12:31:51 -07:00
evykassirer
cb3f22c30e drafts: Delete a draft if it is cleared from the compose box.
We used to keep the draft, assuming that clearing the composebox
was an accident. Now we want to delete the draft, in preparation
for auto-restoring drafts when opening the composebox for narrows
with drafts associated with them. If a user opens the composebox
and sees a draft they don't want anymore, clearing the box is a
way we expect them to try to delete it.
2024-04-20 12:31:51 -07:00
N-Shar-ma
f4d58f1ba6 compose: Show counter inside Drafts button for the current recipient.
Now we show the number of drafts that are addressed to the current
recipient selected in the compose box, if any, in the Drafts button
within parentheses (whether it is next to the Send button, or in the
Send options popover), and explain that it is the number of drafts for
this conversation in the tooltip.

Fixes: #28696.
2024-03-13 16:53:45 -07:00
N-Shar-ma
6ec04c2469 drafts: Refactor function to have a default value for its 1 parameter.
For function `filter_drafts_by_compose_box_and_recipient` since the set
of drafts to filter from is almost definitely going to always be all
drafts, we make the required drafts parameter optional with the default
value of all drafts.

This is a prep commit for the next commit which will use this function.
2024-03-13 16:53:45 -07:00
Anders Kaseorg
aaa6f16538 web: Use Zod z.discriminatedUnion more.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-02 15:39:04 -05:00
evykassirer
c60cc07605 drafts: Convert module to typescript. 2024-03-01 15:49:53 -08:00