Commit Graph

4499 Commits

Author SHA1 Message Date
ecxtacy 35248c1920 settings: Show user_card_popover when pill is clicked.
Add a 'click' event listener to the user pills in
stream and group settings which toggles the
user_card_popover.

Co-authored-by: PieterCK <pieterceka123@gmail.com>.
2024-05-17 10:47:22 -07:00
ecxtacy 30ede1cc80 input_pill: Pass user_id and group_id to render pill.
While rendering input pills in input_pills.create function,
pass in the user_id or group_id accordingly.
Display the id as an html attribute in input_pill.hbs.

Co-authored-by: Pieter CK <pieterceka123@gmail.com>.
2024-05-17 10:47:22 -07:00
PieterCK 3b46d0e53c settings: Refactor UserGroupPill to improve consistency.
Changed UserGroupPill's 'id' key to 'group_id' because
UserPill uses 'user_id' instead of only id.
2024-05-17 10:47:22 -07:00
ecxtacy ad177a8b48 css: Show 'x' button hover styling when hovered over 'x'.
When input pills are hovered, the 'x' button is highlighted.
This commit ensures that 'x' button is highlighted only if the
'x' button is hovered, not anywhere else on the pill.

Author: ecxtacy <dc.dhruvchouhan@gmail.com>.
2024-05-17 10:47:22 -07:00
PieterCK d882d90857 hash_parser: Add utility function to dynamically detect hash.
Added new utility function to hash_parser to dynamically
detect the hash category of an URL. This is intended to
reduce the need of adding more adhoc hash_parser utility
functions.
2024-05-17 10:47:22 -07:00
evykassirer 71a5d46de2 typeahead_helper: Clean up current_stream check.
Followup for
https://github.com/zulip/zulip/pull/29650/files#r1569209419
2024-05-17 10:41:32 -07:00
evykassirer 43a6873c57 composebox_typeahead: Clean up initalize method to take JQuery object. 2024-05-16 19:49:46 -07:00
evykassirer 96c9950115 composebox_typeahead: Convert module to typescript. 2024-05-16 14:53:26 -07:00
evykassirer 7f9361a865 composebox_typeahead: Filter and sort candidates within get_candidates.
This simplifies some of the logic and will make it easier to
convert to TypeScript.
2024-05-16 14:51:28 -07:00
evykassirer 96abc52d97 composebox_typeahead: Return mentions from get_candidates. 2024-05-16 14:51:28 -07:00
evykassirer 19a4810d53 composebox_typeahead: Remove DM blur handler.
Since #private_message_recipient is a <div contenteditable>,
not an <input> or <textarea>, it doesn’t make sense to call
.val() (it will always give the empty string).

It looks like this line is from over 10 years ago
(09deef9611 (diff-f2b22549dc2fb4824b37e787d964a2c9f4f580e767f86b6d7ded1d0ff37d5a62R291))
and probably before we had pills here. We can just remove this
whole block.
2024-05-16 14:51:28 -07:00
evykassirer e08c7548af composebox_typeahead tests: Create user_or_mention items directly. 2024-05-16 14:51:28 -07:00
evykassirer 7a9a445088 emoji: Restrict reaction_type for compatibility with typeahead.Emoji. 2024-05-16 14:51:28 -07:00
evykassirer 297fd2654d emoji: Restructure EmojiDict for compatibility with typeahead.Emoji. 2024-05-16 14:51:28 -07:00
evykassirer bccdec8971 typeahead: Create new EmojiSuggestion type.
This will be used for when we suggest emojis in
the composebox typeahead.
2024-05-16 14:51:27 -07:00
Aman Agrawal b8cec0ff2a message_edit: Restore focus to the message being edited.
When user is editing a message and we rerender it, we should always
set focus back to the textarea.
2024-05-16 09:59:22 -07:00
Aman Agrawal 2035305b89 recent_view_ui: Filter out DMs as per search query.
We use the filter we use in buddy list for consistency.
2024-05-16 09:20:43 -07:00
Aman Agrawal b2dc6f4039 people: Split search terms inside the search function.
This helps other views calling this function to not do a separate
split of the terms.
2024-05-16 09:20:43 -07:00
Aman Agrawal 2a8174baa3 recent_view: Rename filters_should_hide_topic.
Since we also filter DMs using this function, the name is
misleading.
2024-05-16 09:20:43 -07:00
Aman Agrawal aa31f9ae8d server_events: Fix infinite loading indicator on page load.
Hiding the loading indicator was based on us adding some messages
into the view which was no always the case.
2024-05-16 09:10:07 -07:00
Aman Agrawal 62c682b2e1 hashchange: Fix infinite home view <-> narrow loop on escape keypress.
Reproducer:
* Start with empty hash and combined feed as home view.
* Go to any narrow.
* Keep pressing escape key.

You will keep switching between narrow view and home view while
you should just stop at home view. This was due to
`set_hash_to_home_view` not considering empty hash as a valid
home view hash.
2024-05-16 08:59:05 -07:00
Anders Kaseorg 507eb4913c tsconfig: Enable exactOptionalPropertyTypes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-16 08:58:20 -07:00
Aman Agrawal 7203661d99 support: Set discounted price instead percentage for customers.
This allows us to set the price of a plan exactly as discussed with
the customer.
2024-05-16 02:18:43 -07:00
AfonsoOrmonde b42cd1022b
streams: Close color picker when scrolling stream settings.
Fixes #17451.
2024-05-15 17:22:03 -07:00
Isabela Pereira fee0470a97 popovers: Refine word wrapping in user profile.
This commit refines word wrapping in user profile popovers. It implements 'overflow-wrap: break-word;' for category ‘name’ items (e.g., ‘Email’, ‘User ID’) and 'overflow-wrap: anywhere;' for category ‘value’ segments, ensuring proper line breaks and preventing overflow issues. Additionally, addressed prettier problems to maintain code consistency.

Fixes #22865
2024-05-15 17:20:21 -07:00
Lauryn Menard 7a61044a03 org-settings: Update tab for default channel settings.
Updates instances of default-streams-list to instead be
default-channels-list as the data-section for the organization
settings overlay is part of the URL hash.
2024-05-15 12:18:36 -07:00
Aman Agrawal 1c7c8cede8 recent_view: Fix marking topic as read resulting in error.
Since we were trying to close dialog widget regardless of caller
after marking messages as read, it results in an error if the dialog
widget is not open especially since there was no dialog widget
involved in the process.

So, track the id of the dialog widget which called the `read` `op`
and operate on it based on it's status if there was a dialog
widget involved.
2024-05-15 12:02:57 -07:00
Aman Agrawal e51962d6ac dialog_widget: Assign each dialog widget a unique id.
This makes it easy to check if the correct dialog widget is open
and to perform actions based on the state of dialog widget in
async callbacks.
2024-05-15 12:02:57 -07:00
Sahil Batra f73f27b45f invite: Replace "streams" with "channels" in default subs banner.
This commit replaces "streams" with "channels" in the banner for
default channel subscriptions shown to user user who cannot
subscribe others.
2024-05-15 10:59:05 -07:00
Sahil Batra 6f5143b5b8 invite: Fix margins around subscriptions banner.
This commit fixes the margins around banner for default stream
subscriptions, shown to users who cannot subscribe others, to
be same as that for other banners like the one shown when
description is not set for the organization.
2024-05-15 10:59:05 -07:00
Sahil Batra 05d74a367c invite: Fix invite modal bug for users who can't subscribe others.
The bug was due to the element being accessed when not present
in the DOM. This function fixes it by calling the function to
setup streams UI only when the concerned elements are present
in DOM, i.e. when user can subscribe others.

The bug was introduced in 016917679e.
2024-05-15 10:59:05 -07:00
Anders Kaseorg fba81d1cd5 upload: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 97b0fd424d upload: Replace get_item with config object methods.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 60545fb475 upload: Reimplement get_item with config object methods.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 25b29b5cd4 upload: Centralize config object construction.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg d9f05121d9 upload: Fix @uppy/xhr-upload locale configuration.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg ac6e0a2d34 upload: Add missing get_item("upload_banner_message", …) argument.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg b132fc50b3 compose_reply: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg c8981be08f compose_state: Fix last_focused_compose_type_input type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 941e2ae5dc inbox_ui: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 1fa6c707ce inbox_ui: Split filter_should_hide_row into two functions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 77100aca6a inbox_ui: Fix CSS escaping.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
N-Shar-ma a567fb633a copy_and_paste: Fix bugs surfaced by typescript migration.
Fixed 2 bugs in the detection of the last message row copied. This fixes
the issue where when the mouse was released on the message header after
copying multiple messages, the pasted text was not formatted correctly.

Follow up to #30091.
2024-05-15 10:44:20 -07:00
Aman Agrawal 5e671de1e7 unread_ops: Fix unable to mark messages as read in Inbox view.
Converting stream_id to string invalidates the
value as our narrow parser expects integer as valid stream_id and
stream name if it is string.
2024-05-15 01:29:37 -07:00
Sahil Batra c41a352a12 invite: Use include_default_realm_subscriptions parameter in webapp.
This commit adds code to use include_default_realm_subscriptions
when user selects "Subscribe to default streams" checkbox
in the invite modal instead of passing the stream ids of
default streams.
2024-05-14 14:20:07 -07:00
Sahil Batra 016917679e invites: Do not show streams if user cannot subscribe others.
We do not show the streams list in invite modal if the user
does not have permission to subscribe others to stream and
show a notice mentioning it.
2024-05-14 14:20:07 -07:00
Anders Kaseorg 4d407c6b8d copy_and_paste: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 14:12:05 -07:00
Anders Kaseorg 2e776bf8dc copy_and_paste: Fix CSS selector injection bug.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 14:12:05 -07:00
Anders Kaseorg a41d0b16e6 user_topics_ui: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 14:01:04 -07:00
Anders Kaseorg c50b28610c user_topics_ui: Fix backwards setTimeout arguments.
Introduced by commit 401c8bbb21
(#27254).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 14:01:04 -07:00
Aman Agrawal f57fb0862e message_edit: Fix event handlers lost on restoring edit form.
To avoid event handlers being lost when we restore a message edit
form we go through the process of creating the edit form for the
message again. This has the additional benefit of updating the
status of buttons based on org settings like GIF or upload button.
2024-05-14 12:21:49 -07:00
Aman Agrawal ca8f04ea35 message_list_view: Remove unnecessary parameter passed.
Since we are already selecting the previously selected id in
`reselect_selected_id` there is no need to pass the message id here.
2024-05-14 12:21:49 -07:00
Aman Agrawal a30029c8ad upload: Don't render upload button instead of hiding.
Doesn't make sense to hide the upload button button later when
we can just not show it if the browser doesn't has support for
it.
2024-05-14 12:21:49 -07:00
Aman Agrawal 7a831617af message_edit: Directly use currently_editing_messages for checks.
Makes it easier to search and verify changes related to
currently_editing_messages.
2024-05-14 12:21:49 -07:00
Sahil Batra 9d87131fa8 settings: Use new format to update can_mention_group setting.
This commit updates the webapp code to use new format to update
the can_mention_group setting.
2024-05-14 12:17:15 -07:00
Anders Kaseorg 6479cc5970 unread_ops: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 12:15:44 -07:00
Anders Kaseorg 0cbc6cb82b unread_ops: Remove unused bulk_update_read_flags_for_narrow arguments.
Introduced by commit 664f29b4f1
(#28560).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 12:15:44 -07:00
Anders Kaseorg d7a9cb6c12 unread_ops: Simplify handle_mark_unread_from_here_error with callback.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 12:15:44 -07:00
Anders Kaseorg a54d178b8a unread_ops: Fix do_mark_unread_by_narrow arguments after rate limiting.
Introduced by commit f0d87fcf6e
(#23605); propagated by commit
0bef960b34 (#29521) and commit
42a6929f5c (#30047).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 12:15:44 -07:00
Shubham Padia 4ee37244bb recent_topics: Change background color in dark mode on hover on a row.
Fixes #30083.
We have used the dark theme color for the left sidebar row hover:
`--color-background-active-narrow-filter`. We are not using that variable
directly since we don't want a change in that color affecting the color in
recent conversations.
We've also used a single color on hover compared to 2 different colors
for unread and read row before. Light mode also uses a single color on
hover.
Relevant CZO conversation:
https://chat.zulip.org/#narrow/stream/101-design/topic/Hover.20color.20in.20Recent.20conversations.20dark.20mode.2E/near/1797727
2024-05-14 11:46:37 -07:00
Anders Kaseorg 2e8fdab896 user_pill: Avoid unnecessary array allocations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-13 18:12:54 -07:00
Anders Kaseorg c0c852046d user_group_pill: Avoid unnecessary array allocations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-13 18:12:54 -07:00
Anders Kaseorg b3fbfd9da8 stream_pill: Avoid unnecessary array allocations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-13 18:12:54 -07:00
Tim Abbott 4bf8c19b32 message_view_header: Fix misleading variable name.
It never contained only icon data.
2024-05-13 17:56:30 -07:00
nimishmedatwal 941c5daf36 navbar: Describe views in top navbar.
Adds description in views styled like stream descriptions also adds a
help center link to the appropriate page at the end of each
description.

Fixes #29769.
2024-05-13 17:56:30 -07:00
afeefuddin d36e19389d add_subscribers_pill: Convert module to TypeScript. 2024-05-13 16:57:02 -07:00
afeefuddin bf3eb2c269 user_pill: Fix type annotations.
Change the type annotation of current_items in create_item_from_email
to InputPillItem<CombinedPillItem>.
2024-05-13 16:57:02 -07:00
afeefuddin 0927e03677 user_group_pill: Fix type annotations.
Change type annotations of get_user_ids and create_item_from_group_name
to accept CombinedPillContainer and InputPillItem<CombinedPillItem>
respectively.
2024-05-13 16:57:02 -07:00
afeefuddin 0f622d3025 stream_pill: Fix type annotations.
Change type annotations of get_user_ids and create_item_from_stream_name
to accept CombinedPillContainer and InputPillItem<CombinedPillItem>
respectively.
2024-05-13 16:57:02 -07:00
afeefuddin 0b7c63a695 typeahead_helper: Add type CombinedPillItem. 2024-05-13 16:57:02 -07:00
Aman Agrawal 80d19fe15d css: Fix theme switch changing color of elements at different intervals.
Due to these transitions the theme switch from dark <-> light was
not pleasant as the background color and color changed at different
intervals.
2024-05-13 13:21:10 -07:00
evykassirer d4d57193df message_store: Clarify display_reply_to type for stream/dm messages. 2024-05-13 12:51:00 -07:00
evykassirer 724306df10 recent_view_ui: Convert module to typescript. 2024-05-13 12:51:00 -07:00
N-Shar-ma 1121d317c2 compose: Restructure HTML for common compose textarea/preview parent.
Earlier, the compose textarea and the preview (container) occupied the
same grid area, 1 at a time. Now, they are both children of a common div
which is assigned the same grid area. This allows adding more elements
to the same grid area in the future.

This is purely a code change and should have no visible effects.

This is a prep commit for relocating the compose expand / collapse
buttons to the top right inside corner of the textarea / preview.
2024-05-13 12:11:29 -07:00
Temidayo32 91bd6e2b12 compose_closed_ui: Migrate module to TypeScript. 2024-05-12 17:41:22 -07:00
evykassirer 28c13f6d0e message_store: Modify get_pm_full_names to only take user ids.
This will let us properly call it from compose_closed_ui without
a full message object, which we need to convert it to typescript.
2024-05-12 17:41:22 -07:00
evykassirer 8fb1c0683e compose_closed_ui: Reduce usage of hacky message data structure. 2024-05-12 17:41:22 -07:00
Anders Kaseorg 3d8802b276 buddy_list: Fix empty_list_widget_for_list.hbs usage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-12 16:51:47 -07:00
Aman Agrawal d4ea7e251b narrow: Fix browser back not navigation to previous selected message.
Reproducer:
* Go to a stream narrow.
* Scroll up to select a previous message.
* Click on a different stream in the left sidebar.
* Click browser back button, you land at first unread message instead
  of your selected message.

Fixed by updating the hash before we render the new message list.
2024-05-10 16:03:45 -07:00
Aman Agrawal 4619a1e028 recent_view: Make load more fetch substantially more data.
We keep fetching until we reach first unread message or have
50k messages worth of data displayed once user hits `Load more`
in recent view.
2024-05-10 16:03:45 -07:00
Prakhar Pratyush bf2360bcf2 onboarding_steps: Remove hotspot as an onboarding_step.
Earlier, hotspots and one-time notices were the valid
type of onboarding step.

Now, one-time notice is the only valid type.

Fixes #29296.
2024-05-10 12:30:22 -07:00
Aman Agrawal 97e3015ec1 stars: Fix flaky test due to message list not yet rendered.
With combined feed no longer cached, this test became flaky as
it took longer for combined feed to load.

Verified that other tests waiting on `.message-list` don't need
this change.
2024-05-10 11:59:18 -07:00
Kenneth Rodrigues 42a6929f5c mark unread: Use correct value of include_anchor in case of errors.
When the request to mark a thread as unread fails, we should use the
value of include_anchor that was sent in the request, not false.

Modified handle_mark_unread_from_here_error to take an object instead of
parameters.
2024-05-10 10:53:50 -07:00
Prakhar Pratyush ac2152fdfd onboarding: Replace channel messages in new organizations.
As a part of improving onboarding experience, this
commit updates the channels and messages initially
available in new orgs.

Fixes #29297.
2024-05-09 14:05:35 -07:00
evykassirer 08c916b337 recent_view_ui: Remove unused second argument to destroy_indicator. 2024-05-09 12:35:49 -07:00
evykassirer 67a15320ad recent_view_ui: Rename list_widget import to match convention. 2024-05-09 12:35:49 -07:00
evykassirer d7cab7c1d4 list_widget: Remove undefined from create's return type. 2024-05-09 12:35:49 -07:00
Aman Agrawal 4efc760c70 recent_view: Fix filter input focused on load.
Since there are no rows to set focus in recent view before initial
fetch, we were falling back to set focus on input filter after
rendering recent view.

Waiting for initial fetch to complete helps us set focus on the
table easily while recent view is also open for user to play with
if the load takes longer.
2024-05-09 11:02:12 -07:00
N-Shar-ma 74cdd6148e compose: Fix bug in preview where image at the end would be misaligned.
The `margin-bottom` was removed for the last element in the preview in
e55f5a1b59 to remove vertical shifts when
toggling preview mode, but it is not needed for image / video previews,
so now `margin-bottom` is not set to 0 for the last inline preview.
2024-05-09 10:48:02 -07:00
Anders Kaseorg e0f634ae11 poll_widget: Remove handle_events augmentation of jQuery interface.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-08 17:58:58 -07:00
N-Shar-ma cb58752909 widgets: Cache event handler instead of entire jquery for each widget.
In 61b3c698af we stopped restoring widgets
from the cache, so the only purpose of the cache remaining was to access
the event handler patched onto the widget jquery.

Now instead of the entire jquery object, we cache just the event handler
since that's the only thing we need from the cache, and do not patch it
onto the widget jquery object.
2024-05-08 16:47:07 -07:00
Kenneth Rodrigues 0bef960b34 mark unread: Use more efficient endpoint.
Use the "/json/messages/flags" instead of "/json/messages/flags/narrow"
when we have fully fetched the current view.
Update messages on the basis of id instead of updating the entire
narrow.

Fixes #28945.
2024-05-08 10:58:41 -07:00
Aman Agrawal 806ebdf5ad bootstrap_typeahead: Use `fixed` position for typeaheads.
Since the reference for these typeaheads is has a fixed position
unlike say message controls which move on scroll and need to be
repositioned, we can use `fixed` position for typeaheads too so
there is no jumps when user is trying to scroll when a typeahead
is active.

This basically replaces the commit where where we remove `fixed`
as an argument to `Typeahead` library. We can add it later if
any of our typeaheads don't need to be fixed positioned.
2024-05-08 10:05:27 -07:00
Aman Agrawal d1050376e1 bootstrap_typeahead: Fix compose typeahead overflowing when expanded.
When compose box is expanded, typeahead overlfows the top of the window.
We move the typeahead to the bottom of the screen and let
preventOverflow shift it into the visible area.
2024-05-08 10:05:27 -07:00
Aman Agrawal 4e87f35c7d typeahead: Use tippy to position typeaheads without a specified parent.
Except for search typeaheads which have a specific parent container,
we position typeaheads using tippy.
2024-05-08 10:05:27 -07:00
Aman Agrawal 689489573a bootstrap_typeahead: Remove fixed argument.
Tippy uses a different strategy for positioning items, so this
will not be required.
2024-05-08 10:05:27 -07:00
Karl Stolley 12984c9cef selected_message: Adjust light-mode border to specification.
This introduces the alpha described by @terpimost in #22059.
2024-05-08 09:59:40 -07:00
Karl Stolley 7baf3e5e4d selected_message: Correctly express outline colors as variables. 2024-05-08 09:59:40 -07:00
Aman Agrawal 55e6d2fbd0 message_fetch: Vary how much history we fetch based on date range.
To better make use of server load when fetching message history for
users, we limit how much history we fetch in the initial loading
experience based on how much time in the organization's message
history it corresponds to.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2024-05-08 09:47:05 -07:00
Aman Agrawal 6e2d501b71 left_sidebar: Fix underline overlapping with login icon. 2024-05-07 16:52:57 -07:00