Commit Graph

4086 Commits

Author SHA1 Message Date
sujal eba0097c7f message_feed: Modify tooltips to clarify draft saving.
Update the tooltips for the "Cancel" and "Spinner".  Provide clear
information about the draft saving behavior when a message fails to
send successfully.

Fixes part of #29100.
2024-04-20 18:00:22 -07:00
sujal shah f144400d46 settings: Change links to user_pills in invitations seciton.
Previously, links were displayed for the user's name,
but now they are presented as pills. These pills are rendered
using the user_display_only_pill.hbs template.
To obtain the avatar of a user,
the small_avatar_url_for_person function is utilized.
2024-04-20 16:59:45 -07:00
sujal shah 16db1df416 templates: Use 'panel_user_list' as classname.
The term 'subscriber' might be misleading as it doesn't accurately
reflect the purpose of the list, which simply contains all users
within the organization. To enhance clarity and maintain consistency,
I've replaced the classname 'panel_subscriber_member_list'
with 'panel_user_list'.
2024-04-20 16:59:45 -07:00
Kislay Verma 156c708614 compose: Refactor create_message_object.
This function now accepts an argument for message content in the
message object returned and use compose_state.message_content()
to preserve the behavior for existing callers.

Preparation for #28626
2024-04-20 16:24:54 -07:00
Kislay Verma ecac0d6c80 compose_ui: Refactor cursor_inside_code_block.
Renamed the function to position_inside_code_block and changed the
parameters to accept a string and number (index), and check if the
position in the string is inside a code block (as per previous logic).

Preparation for #28626.
2024-04-20 16:24:50 -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 43120709f7 narrow: Move clear_message_sent_banners into reset_ui_state. 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 45a81650f4 compose: Add option to not restore drafts, to avoid overwriting.
This could happen e.g. when quote-replying a message,
because we open the composebox before adding the quote
reply content. We need to make sure that we don't restore
a draft when opening the composebox, because otherwise
that draft will be replaced with the quote reply.
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 0e369e7ff3 compose_send_menu_popover: Rename module to reflect broader uses. 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
evykassirer fd4246def5 drafts: Append a space to draft when restoring it.
If a user starts typing before they see that a draft was restored,
this makes that experience a little smoother by adding some
separation between the old draft and the new text.
2024-04-20 12:31:51 -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
sujal shah 01e898252b setting_ui: Fix sorting by "Invited by" column.
Previously, the sorting was broken due to
incorrect referencing of the property.
The code has been updated to use the "referrer_name"
property instead of "ref".
2024-04-20 12:28:39 -07:00
Aman Agrawal 07699eb1d2 message_fetch: Allow updating fetch status without updating messages.
It's possible that for a given narrow event if we didn't fetch any
messages in the `num_after` or `num_before` space, we could have
arrived at `newest` or `oldest` messaged based on the `anchor` used.

This fixes the bug where `fetch_status` for `found_newest` didn't
update to be `true` when using `newest` anchor and `num_after = 0`.
2024-04-20 08:49:54 -07:00
Aman Agrawal fb8a05a683 server_events: Rename home_view_loaded related variables.
Gave them a more general name which reflected what they were
really doing.
2024-04-20 08:49:54 -07:00
Aman Agrawal 6d7856fa37 message_list_data: Move comments to the type definitions. 2024-04-20 08:49:54 -07:00
Aman Agrawal ca0f79ce34 message_list_view: Restore date on previous sticky header.
We forgot to restore the date on sticky header if the header
is no longer sticky.

Reproducer:
* Have two messages with same sender on different dates next to
  each other in a stream narrow.
* Scroll so that sticky header is on the 2nd message.
* Scroll down fast so that to avoid us capturing the sticky header
  over the first message.
* Scroll up slowly so to see the group header of the messages have
  the date of the second message.
2024-04-18 11:52:59 -07:00
Lauryn Menard b71f4b9342 stream-settings: Remove unused tooltip for announcement stream.
In commit 449febf036, the tooltip that provided information about
the announcement stream was replace with inline text on the form.

Removes the now unused template and code in stream_create for this
tooltip.
2024-04-18 08:52:53 -07:00
Pratik Chanda 3f1ffd0068 topic_list: Show topic row for empty conversations in left sidebar.
Earlier when a user narrowed to a new topic, there was no highlighted
topic row entry in the left sidebar under the respective stream.

This commit introduces the feature to show highlighted topic in the
left sidebar for a new topic thread. It checks if narrowed topic is
present in the list of topic names to add to it.
It disappears from the left sidebar when unnarrowed and the topic
contains no messages.

Fixes: zulip#22769.
2024-04-17 17:51:12 -07:00
Pratik Chanda e1a63d57a2 pm_list: Show DM row for empty conversations in left sidebar.
Earlier when a user narrowed to a new pm conversation, there was no
highlighted DM row entry in the left sidebar.

This commit introduces the feature to show highlighted pm thread in
the left sidebar for a new conversation. It adds narrowed dm to the
recent messages list if not already present.
It disappears from the sidebar if no message was sent and unnarrowed
from the DM.

Fixes: zulip#22769.
2024-04-17 17:51:12 -07:00
Kislay Verma 245357c868 stream_settings_ui: Go to newly created stream.
- On creating a stream, the user is redirected to the
 "stream events" topic of the newly created stream.
- If this is the first time the user has created a stream,
an explanatory modal is shown.

test_hotspots.py is modified to account for the new addition
of the first_stream_created_banner.

stream_create.test.ts is also modified accordingly.

Fixes #29375.
2024-04-17 15:35:19 -07:00
Kislay Verma a90f7cce6f settings: Add tooltip to clarify invalid Jitsi URL.
This commit adds a tooltip in organization settings,
when the save button is disabled due to invalid
Jitsi URL.

Fixes #27511.

Co-authored-by: Angelica Ferlin <angelica.ferlin@gmail.com>
Co-authored-by: Peterson Linn <linn@pajp.net>
Co-authored-by: Kislay Verma <kislayuv27@gmail.com>
2024-04-17 15:30:33 -07:00
Kislay Verma 5f35384c80 settings: Move init disable button function.
This commit moves the function
initialize_disable_btn_hint_popover from
stream_ui_updates.js to settings_components.js
due to circular dependencies.
Added opts parameter to append to the options for
the tippy instance.

Fixes #27511.

Co-authored-by: Angelica Ferlin <angelica.ferlin@gmail.com>
Co-authored-by: Peterson Linn <linn@pajp.net>
Co-authored-by: Kislay Verma <kislayuv27@gmail.com>
2024-04-17 15:30:33 -07:00
Karl Stolley 1878f920a8 katex: Properly align timestamps with KaTeX-only messages. 2024-04-17 12:46:30 -07:00
Tim Abbott 62fb452e9c keyboard-shortcuts: Improve home view labels. 2024-04-17 12:42:21 -07:00
Tim Abbott 2c62152a8b left-sidebar: Rename "All direct messages" => "Direct message feed".
This aligns with the new naming scheme for other left sidebar
elements.
2024-04-17 12:42:21 -07:00
nimishmedatwal 1594011b67 left_sidebar: Rename All messages to Global Feed.
Fixes part of #27802.
2024-04-17 12:42:21 -07:00
nimishmedatwal 561cc9eab3 user_profile: Add focus to subscribe button.
Also reduces the number of focusable elements between the "streams"
heading and the stream picker.

Fixes #26690.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2024-04-17 11:52:57 -07:00
evykassirer 2b2c6d642b people: Remove redundant is_known_user function. 2024-04-17 10:45:14 -07:00
evykassirer f6b87cf0fb pill_typeahead: Convert module to typescript. 2024-04-17 10:45:14 -07:00
evykassirer 22aca110a5 typeahead: Fix typing for pill containers with multiple pill types.
`pill_typeahead`, and possibly other places, call `typeahead_source`
for what were typed as different pill widgets but is actually
all the same combined pill widget that has pills of users, user
groups, and streams. This commit fixes that typing issue in
preparaton for the upcoming conversion of `pill_typeahead` to
TypeScript.
2024-04-17 10:45:14 -07:00
evykassirer 45e9c046d8 pill_typeahead: Differentiate between pills with type attribute.
The pill typeahead can have pills of three different types:
user, stream, and user_group. To be able to convert this
module to typescript, we need to add a `type` attribute
to differentiate between them.

This commit also adds a `user_or_mention` type to some
items in the composebox typeahead, because the composebox
typeahead shares some functions with the pill typeahead
and we need to be able to differentiate between the
pill types being passed there.
2024-04-17 10:45:14 -07:00
evykassirer 67486a43b2 composebox_typeahead tests: Add some missing attributes to user objects.
This doesn't fully add all missing attributes, but it adds ones that
will soon be needed in upcoming commits. Ideally eventually these
objects are full fake User objects with defaults for required
attributes.
2024-04-17 10:45:14 -07:00
evykassirer 1d16fdd7b9 typeahead_helper: Add test for compare_by_pms for missing codecov. 2024-04-17 10:45:14 -07:00
evykassirer 6264bf3b76 typeahead_helper: Fix types for sort functions.
The call to `typeahead_helper.sort_recipients` in
`pill_typeahead` shows that these parameters are
optional.
2024-04-17 10:45:11 -07:00
evykassirer 4dfe60a6c5 typeahead_helper: Move two functions from composebox_typeahead. 2024-04-17 10:45:10 -07:00
N-Shar-ma f39b57dd04 typeahead: Sort emojis by categories initially.
For more consistency between the emoji picker and the typeahead, now the
initial emoji list is ordered by categories for the typeahead too.

Tachnically, this means that `emoji_picker.rebuild_catalog` now updates
the typeahead's emoji data with category wise sorted emojis. Compose box
typeahead initialisation does not update the emoji data anymore.
2024-04-17 10:13:23 -07:00
roanster007 68b4298d8e settings: Add option to disable seeing typing notifications.
This commit adds an option to the advanced section of
Preferences settings, that would allow users to choose
whether to receive typing notifications from other
users.

Fixes #29642
2024-04-16 11:38:12 -07:00
roanster007 c7e2e048cb settings: Reorder starred_message_counts and fluid_layout_width.
This commit re orders the 'Use full width on wide screens' and
'Show counts for starred messages' settings of Preferences settings.
2024-04-16 11:33:25 -07:00
Mateusz Mandera 540d419ef7 events: Fix realm_upload_quota_mib value to be in MiB.
This was bytes until now.
2024-04-15 15:08:56 -07:00
Tim Abbott 3df46d542b Revert "message_reactions: Clean meassge reactions during initial processing."
This reverts commit c22a94dc89.

This broke live-update when adding new reactions.
2024-04-15 14:58:06 -07:00
N-Shar-ma 352e2ebc5a todo_widget: Move the `add-task-bar` from above to below the task list.
When users needed to add a new task in the todo widget, they would type
it in the field at the top, but the task would be appended to the list,
showing up at the very bottom, which can seem unintuitive.

Now the `add-task-bar` is at the bottom of the list, so that when a new
task is added, it'll appear right where it was typed. The task field
would then shift lower.
2024-04-13 21:56:33 -07:00
N-Shar-ma d8a8364d1a todo_widget: Allow tasks to be added through `/todo` command.
Uptil now, users could add tasks to a todo widget only after creating
it through the `/todo` command in the compose box.

Users can now add an initial list of tasks using the `/todo` command,
with each task on a new line in the compose box, where the 1st `:`
would separate a task from its (optional) description. Example:
`/todo\nTask1:description1\nTask2 without description`.

Fixes part of #20213.
2024-04-13 21:56:33 -07:00
N-Shar-ma 6df3ad251a todo_widget: Allow task list title to be set and edited by author.
Users can now name task lists by providing the task list title in the
`/todo` command on the same line. Example: `/todo School Work`. If no
title is provided by the user, "Task list" (which is also the
placeholder) is used as default.

The author of a task list can later edit / update the task list title
in the todo widget, just like the question in the poll widget.

Fixes part of #20213.
2024-04-13 21:56:33 -07:00
N-Shar-ma 8c000f348a widgets: Make Zod schema for widget extra data stricter and extendable.
The schema now ensures extra data is validated according to the widget
type. This also makes it easier to modify the extra data for any widget
or add new widget types in the future.
2024-04-13 21:56:33 -07:00
Olivier FAURE 29e32c3977
keyboard ui: Add early-exit to click handlers with shift.
Shift-clicking a link on most browsers should open the link in a new window, 
not navigate inside the current tab, just like ctrl-click opens in a new tab.
2024-04-13 21:48:03 -07:00