Commit Graph

51199 Commits

Author SHA1 Message Date
SameepAher 9e4b5b2bed css: Fix text overflow bug for pill values.
This commit fixes the text overflow bug for pill values by adding a
maximum width of 100% for the pill along with the ellipsis property on
text overflow.

Fixes: #21807.
2023-04-24 16:04:03 -07:00
Joelute a840cd88ab click_handlers: Allow messages being edited/viewed to be clicked.
If a user is editing a message or viewing the message source, they'll notice that clicking on the messsage doesn't move the blue box to it while the keyboard works just fine. We want to allow the message to be selected while not triggering the reply function.
2023-04-24 16:02:34 -07:00
Joelute e2c4033d75 help: Add instructions for `do not mark messages as read`.
As a follow up to #24309, we want to add a new tab with desktop/web
instructionsto the "Configure whether messages are automatically marked as
read" section.The paragraph has also been tweaked to accommodate the new
feature.
2023-04-24 15:58:59 -07:00
Hardik Dharmani 7a14f12031 recipient_row: Correct hotkey for mute icon tooltip. 2023-04-24 15:56:16 -07:00
Tim Abbott 28f86057d6 lint: Fix TypeScript linter error in localstorage.ts.
This was introduced because the PR converting this file to TypeScript
predated this linter rule being enabled.
2023-04-24 13:24:08 -07:00
Tim Abbott 5e8e7af066 i18n: Fix encoding of stream bookends.
Fix an issue with how 3e6f34780a
passed the stream name to the template around translation tags.
2023-04-24 12:19:06 -07:00
AcKindle3 fd84651a16 Localstorage: Use `zod` to parse type `FormData`.
Local storage is an untyped interface external to the frontend code
itself. The `data` field after `JSON.parse`'d from `raw_data` can be
further validated using `zod`'s schema `formDataSchema`.

The test case `server_upgrade_alert hide_duration_expired` in
`navbar_alerts.test.js` has a bug at `start_time`, which is fixed in
this commit. `start_time` is a mock value of `Date.now()` used in
`localstorage.ts`, which will concatenate with a number `expires`.
So `start_time` was supposed to be an integer value. Before fix, `new
Date(1620327447050)` returns a `Date` object which is wrongly
concatenated with `expires`.

Fixes #24997.
2023-04-24 11:59:02 -07:00
AcKindle3 70b8eb3423 TS migration: Convert `localstorage.js` to `localstorage.ts`.
Added function parameter types, return type, and types of local
varaibles. Added a `null` check for `raw_data` before `JSON.parse`.
Created a type `FormData` and an export type `LocalStorage` to
imporve conciseness and clearity.

Type `LocalStorage` is exported because it might be used in other
files based on an observation that many files have imported `localstorage`.
2023-04-24 11:59:02 -07:00
Akarsh Jain 3e6f34780a bookend: Add stream icons to subscribed/unsubscribed divider line.
Fixes: #23685.
2023-04-24 11:53:16 -07:00
palashb01 047bffe257 compose_box: Convert dynamic closed compose box tooltips to tippyjs.
This commit converts the dynamic closed_compose_box
tooltip to template-based tippy.js tooltips. The functions in
the compose_closed_ui.js file are refactored to dynamically change
the 'data-tooltip-template-id' attribute according to the situation.

The title parameter is removed from the functions in
compose_closed_ui.js so that we can change the tooltip within the
caller functions themselves, according to the situation. Since there
is no way to match the title in existing functions with different
languages to change the tooltip attribute dynamically, it is better
to change the tooltip attribute within the caller function according
to the situation, rather than passing the title as a parameter.

In the case of the reply button, we disable it when direct messages
are not allowed. However, tippy.js tooltips do not appear in the
case of disabled elements, so we have to use the container element
around it to show the tooltip. This approach is used in the case of
the reply button, where the span element wraps the button.

We used to have two titles for the reply button: one is the usual
'Reply to selected message', and the other is for the disabled state.
However, in the case of recent conversations, it makes more sense
to have a new tooltip title: 'Reply to selected conversation'.

To ensure that the tooltip content changes dynamically, it is
required to destroy the tooltip instance and then reinitialize it
every time.

Fixes: #25096
2023-04-24 11:45:56 -07:00
palashb01 aa23b9deaf compose_box: Convert compose_box tooltips to tippyjs tooltips.
This commit converts the static tooltips of closed compose box
to tippy.js tooltips.
2023-04-24 11:45:56 -07:00
Hardik Dharmani 98162b7a3a left_sidebar: Show unread_mention in regular font if in unmuted topic.
If there are unread_mentions in unmuted topic in muted stream then,
show `.subscription_block unread_mention` in regular font not faded.

An additional parameter is passed to the update_count_in_dom function
to add or remove the "has-unmuted-mentions" class from the
.subscription_block, allowing for the relevant CSS to be applied to
display the unread mentions in regular font.

Fixes part of #24243.
2023-04-24 11:41:21 -07:00
Hardik Dharmani 6f1b8fe340 left_sidebar: Implement new unread_count logic for muted stream.
This commit implements a new logic to display unread messages count
in muted streams. If there are any unread messages in unmuted topics
within a muted stream, the unread counter for the stream will display
the total count of all the unread messages in the unmuted topics.
The counter will be shown in regular font (not faded).

Fixes part of #24243.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2023-04-24 11:41:10 -07:00
Hardik Dharmani 19a2365ab9 left_sidebar: Display unmuted topic in regular font (not faded).
Add class unmuted_topic to li.bottom_left_row element if topic is
unmuted. Add relevant CSS for .unmuted_topic to display unmuted
topics in regular font.

Fixes part of #24243.
2023-04-24 11:40:58 -07:00
Hardik Dharmani 8701d546f3 left_sidebar: Change CSS for fading muted stream.
Previously, muted streams in the left sidebar were faded using
opacity: 0.5, and on hover, the opacity was increased to 0.75.
This opacity was applied to all elements within the muted stream,
including the stream-privacy icon, names of the stream and topics
within, and the unread_count.

In this PR, we changed this behavior to handle opacity for each
element separately. We changed the opacity of the stream-privacy icon
and unread_count, while for the text (names of stream and topics),
we changed the alpha factor for the hsla color property.

The reason for this change is that we can have different opacity levels
for the unread_count and other elements. This will allow us to add
feature in next commits in this PR to set the opacity of unread_count
to 1 while keeping it at 0.5/0.75 for other elements in the case of
muted streams with unread messages in unmuted topics.

Fixes part of #24243
2023-04-24 11:27:53 -07:00
Lalit 2d118f098a compose: Fix opening stream picker by triggering click event.
We should trigger click event to open up the dropdown popup instead of using
`.dropdown("toggle")` because we want to clear the search state when opening up
the popup and the logic for that is registered in `on-click` handler defined in
`dropdown_list_widget`.

Fixes: #25218
2023-04-24 11:26:28 -07:00
Joelute 9192098326 unread_banner: Group all unread banners up into a folder.
Since we currently have 3 unread banners, it'd be much preferred to group
all of them up into one folder to keep them organized like how compose
banners are. This way, it's much easier to keep track of unread banners
and new ones in the future.
2023-04-24 11:20:17 -07:00
Joelute e999518d9a user_settings: Add option to only read messages on scroll in topic.
After merging #24309, we want to add an additional option to the "mark
messages as read on scroll" setting where we only mark messages as read
on scroll in conversation views.
2023-04-24 11:20:17 -07:00
Deekshith S Shetty 596abf6190 popovers: Add Copied! tooltip when `copy code` button is clicked.
`copy code` button now show a `Copied!` tooltip when clicked.
It implements a similar function used on `saved as draft` notice.

We need to modify the copy_code_button template to limit
data-tippy-trigger to not include click; otherwise, repeated clicks to
copy code will incorrectly also display the "Copy code" tooltip
alternating with "Copied".

Fixes part of #21036.
2023-04-24 11:10:19 -07:00
Lakshay Mittal f84de2212e notifications: Fix blank notification sent when no text specified.
When we send a message (for which notifications are enabled)
in format `[](file_url)`. A blank notification is sent.

Fixing this by checking if there is no text and adding
message  in that case.

Inspired from: #8796.
Fixes: #8087.
2023-04-24 10:37:23 -07:00
Aman Agrawal a90fa79bfc hotkey: Clear message sent success banners too on escape keypress.
Without this, if there was a success compose banner and user pressed
escape key, no banners were hidden and the same behaviour was repeated
without compose ever closing.
2023-04-24 10:19:19 -07:00
Lauryn Menard f1c09598bf welcome-emails: Revise text in onboarding_zulp_guide.
Revises the text prior to the link to the `/for/.../` guide in the
`onboarding_zulip_guide` email to be more engaging.
2023-04-24 10:04:47 -07:00
Lauryn Menard 2dc9e52531 welcome-email: Update call to action at end of followup_day2 email.
Updates the final phrase in the `followup_day2` email to be: "Go
to Zulip" and makes it a button instead of text with a link.
2023-04-24 10:04:47 -07:00
Joseph Ho 942cfa7118
narrow: Explicitly resume the reading state when `narrow.deactivate`.
Previously, when a user marks messages as unread in the all messages view
then enters another view and finally back to the all messages view, they'd
notice that the reading state in all messages view is still paused. 

This happened uniquely for "All messages" because we only resumed the "reading"
state in `narrow.activate` (and generally that would generate a new MessageList anyway); 
but `message_lists.home` is a singleton, so the "no longer reading" state would remain
attached to that object forever.

Fix this by explicitly resuming the reading state when we enter all messages
view/message_lists via narrow.deactivate.
2023-04-24 09:56:04 -07:00
Hardik Dharmani af24279aea
recent_conversation: Fix mute icon tooltip on focus.
Set data-tippy-trigger="mouseenter" on mute icon in recent
conversation to prevent tippy from staying on when the mute icon
is focused after clicking it. (The Tippy default is "mouseenter focus").
2023-04-24 09:52:31 -07:00
Daniil Fadeev 43669a83d8 timerender: Fix expiration date on invite modal. 2023-04-24 09:50:20 -07:00
Alex Vandiver e0eb074b23 export: Skip PreregistrationRealm data.
Much like PreregistrationUser rows, these do not make sense to export.
2023-04-24 09:48:25 -07:00
Tim Abbott dee3d7a172 user_topics: Rerender unmuted topics in Recent conversations.
Rename get_muted_topics to `get_user_topics_for_visibility_policy()`,
since it works for both muting and unmuting.

Additionally, inline rerender_for_muted_topic, as well as removing
most of the logic to diff the sets of muted topics; the event is for a
single topic being changed.

Co-authored-by: Hardik Dharmani <Ddharmani99@gmail.com>
2023-04-21 16:59:21 -07:00
palashb01 6d1efdc013 unmute_topic: Support unmuted topics in all messages feed.
This commit refactors the logic of the 'all messages' view to
display messages from unmuted topics within muted streams.

Previously, we hid all messages from muted streams except mentions
by checking if the stream was muted. With this new change, we also
check for unmuted topics within muted streams using the
'is_topic_unmuted' function inside 'user_topics', which returns
'true' if the topic is unmuted. If there is any unmuted topic, we
show the messages from that topic in the 'all messages' narrow.

Live update was handled by the previous commit.

Fixes part of: #24243
2023-04-21 13:52:02 -07:00
Tim Abbott ae314a3ca9 message_list: Deduplicate stream muting live update code path.
We can dramtically simplify the stream muting live-update code path
for updating home_msg_list by observing the only thing it was doing
intentionally differently from update_muting_and_rerender is replacing
_all_items with a new version computed from from all_messages_data,
and the rest of update_muting_and_rerender can handle the live update
correctly unmodified.

This deduplication means live-update of "Unmute topic" just requires
updating the `in:home` filter logic appropriately, without any special
live update work.
2023-04-21 13:52:02 -07:00
Joelute 47b6bec0d4 emails: Update phrasing in `confirm_registration.txt`.
Previously, the email had a line that says "Click the button below". This
sounds weird as the plain text emails don't have buttons and only had links.
We should change "Click the button below" to "Click the link below" which
makes more sense.
2023-04-21 12:06:24 -07:00
Hardik Dharmani 1e1e18d28c left_sidebar: Prioritize unmuted topics in non-zoomed topic list.
Created a new function choose_topics that loops through the topics
and push filtered topics using should_show_topic function to items
array if not zoomed else just push all topics directly to array.

If stream is muted and not zoomed call the choose_topics function
twice, first with passing unmuted_topics and second time with passing
remaining topics. else, call it only once with topic_names.

Fixes part of #24243
2023-04-21 10:32:44 -07:00
Aman Agrawal ace3ca80a8 unread_ops: Add `unread` class to messages instead of a full rerender.
When user marks messages as unread, we used to rerender them but
that was not required since we only need to add `unread` class
to their `message_row` to achieve the same effect.
2023-04-21 09:43:24 -07:00
Tim Abbott c8f1325281 message_list: Move show_message_as_read to view layer. 2023-04-21 09:43:24 -07:00
Aman Agrawal c99c71a9a5 message_list_view: Don't mark message as read after re-render.
When selecting a previously selected message after a re-render,
we don't need to mark it as read. This caused a bug where
user cannot mark the selected message in a narrow as unread.

Also, added an additional check to only select messages if the
message is re-rendered in the currently visible message list since
you cannot select a message in a view which is not visible.
2023-04-21 09:43:24 -07:00
Lauryn Menard e68a69e91f api-docs: Update docs to reference max lengths in register response.
Updates areas in the API documentation that reference the maximum
length of a stream message topic to note the `max_topic_length`.

Updates areas in the API documentation that reference the maximum
length of a stream name to note the `max_stream_name_length` and
areas that reference the maximum length of a stream description to
note the `max_stream_description_length`.

All of these maximum values are sent by the `POST /register`
response.
2023-04-21 08:33:16 -07:00
Lauryn Menard c848e0ff34 api-version: Bump to feature level 176 for URL templates for linkifiers.
See commit b7bfa5801c for related changes for this API feature
level update.
2023-04-21 08:32:19 -07:00
Lauryn Menard cad2bc7628 api-changelog: Fix feature level 174 note.
Fix typo in API changelog feature level 174, and change "will"
to "may" about removing support for deprecated "private" value
for `type` parameter.
2023-04-21 08:32:19 -07:00
Sahil Batra c80807c962 compose: Fix "Shift+Tab" behavior for stream dropdown in compose box.
We now open the stream dropdown if a user presses "Shift+Tab" from
topic input in the compose box, instead of just changing the focus
to be on dropdown toggle button.
2023-04-20 16:09:55 -07:00
Tim Abbott f4dc5afe82 compose: Add brief comments documenting the modules. 2023-04-20 16:09:55 -07:00
evykassirer 0c706aeafc compose: Extract a compose_recipient module.
This helps reduce the amount of import cycles we have in the compose
code path following the migration to a fancier stream input.

`compose_closed_ui.initialize()` was moved further down in the
initialization order because it relies on the dropdown widget
to be defined.
2023-04-20 16:09:55 -07:00
evykassirer 5948671f92 compose: Improve responsiveness for compose recipient.
This allows the dropdown to display larger names, and also
overall improves the compose recipient experience on small
screens.
2023-04-20 16:09:55 -07:00
evykassirer 5ca73388c0 compose: Overflow long stream names with ellipsis in dropdown menu. 2023-04-20 16:09:55 -07:00
evykassirer 584d3c66a3 dropdown: Add ability to update items in dropdown widget.
This is needed for the compose stream dropdown widget,
which is also updated here. Now when a user is subscribed
or unsubscribed from a stream, or a stream is renamed, or
or a stream is deleted, the dropdown widget updates
accordingly. This fixes a regression of this functionality
that happened during the switch to the dropdown.
2023-04-20 16:09:55 -07:00
evykassirer 19a47a71d8 stream dropdown: Add a space after the stream icon.
This applies to several dropdowns, and matches the spacing of
the left sidebar.
2023-04-20 16:09:55 -07:00
evykassirer 02ae5818ae compose: Add privacy icons to the stream dropdown menu.
These were previously used in the input form field and
this commit removes the code that supported that and
replaces it by using existing dropdown_widget functionality
to display the icons in the compose dropdown.
2023-04-20 16:09:55 -07:00
evykassirer 8a2455a294 compose: Change stream field in composebox to be a dropdown.
Fixes #11832

This lets the user see more options than the three that appear
in the typeahead menu, and prevents them from inputting invalid
stream names.

This change replaces the input field with the dropdown, and
updates everything that referred to the classnames of the old
input field, so that they now get the data they need from the
new dropdown.
2023-04-20 16:09:55 -07:00
evykassirer 429f23fc4f click handler: Consolidate composebox-closing logic.
Previously, we stopped the composebox from closing on
in-composebox clicks by stopping propagation from the
composebox click handler. This was an issue because
we need to propagate the event to bootstrap in
situations like dropdown clicks. We can avoid closing
the composebox on in-composebox clicks by just checking
if the click is in the composebox.
2023-04-20 16:09:55 -07:00
evykassirer 32f75085cb dropdown hot key: Generalize enter behaviour for dropup as well as dropdown.
Also updated comment to more accurately represent that this isn't
only for the gear menu.
2023-04-20 16:09:55 -07:00
evykassirer 7f7845eb78 dropdown widget: Add method to replace list data.
This is a helpful prep commit for the upcoming compose
stream dropdown, which needs to change the list of
stream names when the user changes their stream subscriptions.
2023-04-20 16:09:55 -07:00