Commit Graph

4605 Commits

Author SHA1 Message Date
evykassirer 825fa6f0e1 narrow_state: Remove narrowed_to_topic function.
This was only being used in one place in compose_closed_ui
to create the label for the closed composebox. But it
only checked if the `channel` and `topic` filters existed,
while `stream_sub` can return `undefined` for a few other
reasons. To ensure that we're catching the undefined sub
while also avoiding duplicate work, it makes sense to just
call `stream_sub()` directly.

Fixes this bug:
https://zulip.sentry.io/issues/5367251929/events/40073ecf007a4a9798e728061a576377/?project=450455688282112
2024-05-24 10:24:16 -07:00
Karl Stolley 852637d3b3 left_sidebar: Convert stream-privacy icon sizes to ems. 2024-05-24 10:23:41 -07:00
Karl Stolley d5a5044ecd left_sidebar: Improve icon alignment in stream rows. 2024-05-24 10:23:41 -07:00
Karl Stolley 0818aa759d icons: Correct whitespace around lock, vdots icons.
This fixes a perennial problem with a droopy lock icon, and better
situates the vdots in the box created in the SVG-to-font
conversion.
2024-05-24 10:23:41 -07:00
Karl Stolley dda75a56bc left_sidebar: Consolidate .stream-privacy styles. 2024-05-24 10:23:41 -07:00
Aman Agrawal 29048bf19a compose: Prevent lingering textarea typeahead after sending message.
Compose textarea typeaheads don't hide when `Send` button is clicked.
If you type `@` and press send, mention typeahead is still visible.
This happens since the textarea is still focused after sending the
message while other input area trigger a `blur` event which hide
the typeahead for them.

We always call `clear_compose_box` wherever textarea is cleared
as a result of sending message. So, it is the right function to
hide the typeahead in.
2024-05-24 10:12:17 -07:00
Anders Kaseorg a1895683b2 message_list_data: Fix _next_nonlocal_message type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 19:18:46 -07:00
Anders Kaseorg 24904f32bb message_list: Remove ids_greater_or_equal_than.
It’s unused since commit c876e12b86
(#23579).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 19:08:08 -07:00
Anders Kaseorg 9cee037f2a message_list: Remove nth_most_recent_id.
It’s unused since commit 748e5b6da6.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 18:56:59 -07:00
Anders Kaseorg 8f0dda3d4b e2e-tests: Fix check_compose_state arguments.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 16:51:36 -07:00
Anders Kaseorg 931f515207 message_list_data: Fix type of first, first_including_muted.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 16:41:50 -07:00
Anders Kaseorg 26fd6be88f billing helpers: Add missing $ prefix to jQuery object parameter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 15:41:18 -07:00
evykassirer 27b5c61399 composebox_typeahead: Allow for undefined topic in PersonSuggestionOpts.
Fixes this error, which occured when editing DM messages and bringing
up the mention typeahead with "@"

https://zulip.sentry.io/issues/5389123227/events/46ab6c6ca68344ac89af7444fa0f8c39/?project=4504556882821120
2024-05-23 14:55:40 -07:00
Sahil Batra 959c78e1e1 invite: Fix rendering invite modal for realms without default channels.
The default channels checkbox only exists in DOM if there are default
channels in the realm, so we should make sure that we check whether
there are default channels in the realm before accessing the
checkbox element in set_streams_to_join_visibility.
2024-05-23 11:32:09 -07:00
Aman Agrawal e6c074e206 recent_view: Fix no topic found at center of recent view.
The bug is hard to reproduce, but I was able to reproduce with #30134
and used the same strategy to fix it here.
2024-05-23 10:39:27 -07:00
Aman Agrawal e530af5013 narrow: Fix combined feed selecting random messages on narrow.
Reproducer:

* Have some unreads in the Combined feed view.
* Scroll up and select a message that was not part of initial fetch.
* Reload.
* Go a another narrow.
* Come back to combined feed to find your at a random message. This
  message is actually last message of the current fetch of
  combined feed view which was returned via `first_unread_message_id`.
2024-05-23 10:37:29 -07:00
Aman Agrawal b22adc1d5f filter: Fix combined feed navigating to muted unread message.
Some we didn't have a check for if topic is muted here which
resulted in combined feed trying to navigate user to muted
unread message if it was the first unread in the narrow.
2024-05-23 09:17:40 -07:00
Karl Stolley 20d6dd110a left_sidebar: Align more-topics indicator on topic grid. 2024-05-22 17:24:35 -07:00
Karl Stolley 50a7e3cf2c left_sidebar: Flatten renamed .sidebar-topic-name selector. 2024-05-22 17:24:35 -07:00
N-Shar-ma 68c83bce44 widgets: Fix bug where `process_submessages()` was run for empty rows.
We now check if the row exists in the current view, and only then do we
process the submessages in it, instead of letting `Error: Failed to
do_process_submessages` happen.
2024-05-22 17:16:54 -07:00
roanster007 3b73f19719 refactor: Extract method to create and update message lists in narrow.
This commit extracts the method to create and update message
lists in the narrow. This is particularly useful in cases when we
need to update the narrow and view with our own message lists.

This is a preparatory commit to #30114, since it involves
creating a new message list from the messages fetched,
which may be of a different narrow from that of the
initial filter, and updating the view and narrow with it.
2024-05-22 15:31:49 -07:00
Karl Stolley 0fbdd02d87 compose: Tune send-controls vdots for narrowest viewports. 2024-05-22 11:36:28 -07:00
Karl Stolley ac6ac58385 compose: Strengthen layout in send-controls area. 2024-05-22 11:36:28 -07:00
Sahil Batra 39c6a01c74 settings: Fix updating realm join restrictions setting.
This commit fixes the bug when updating
"Restrict email domains of new users?" setting by
adding data-setting-widget-type attribute to the select
element as get_input_element_value now expects every
element to have that attribute after 64c8262eaf.

Due to this change, we also need to update the code in
populate_data_for_request function to not send invalid
parameter in the request. This change resulted in some
refactoring which now helps in not passing in the
"disallow_disposable_email_addresses" and
"email_restricted_to_domains" when these fields are
not changed.
2024-05-21 21:20:50 -07:00
Sahil Batra ed8d7ed864 settings: Fix code for updating realm default language.
This commit fixes the bug when updating realm default
language setting by adding data-setting-widget-type
attribute to the relevant element with "prop-element"
class as get_input_element_value now expects every
element passed to it to have that attr after 64c8262eaf.

As a result we can now remove the code from
get_complete_data_for_subsection to handle realm
default language and just let get_input_element_value
handle it and it also helps in passing the parameter
unnecessary to request when the setting is not changed.
2024-05-21 21:20:50 -07:00
Sahil Batra a530311646 settings: Fix user notification batching settings.
This commit solves the bug for user notification batching
setting which was introduced during the typescript migration
of settings_components.js due to assertion error in
get_input_element_value.
2024-05-21 21:20:50 -07:00
Aman Agrawal 0d3e223493 compose: Fix formatting popover persists on wide screens.
Reproducer:

1. Make your window narrow, to get the `...` formatting buttons menu.
2. Open the menu.
3. Make your window wide again.
2024-05-21 14:56:00 -07:00
afeefuddin 206c8ffedc settings_profile_field: Fix class selector. 2024-05-21 09:09:58 -07:00
Aman Agrawal 7d41c8ce06 narrow: Add minor comment. 2024-05-20 15:01:48 -07:00
Aman Agrawal cd41e5f4fa narrow: Rename save_narrow. 2024-05-20 15:01:48 -07:00
Aman Agrawal 625b07c010 recent_view: Complete TODO to use first unmuted unread message id.
We already had the data at initial request, so we just add
some plumbing to make it available.
2024-05-20 15:01:47 -07:00
Anders Kaseorg ffb182fb25 compose_popovers: Fix message_type typo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-20 14:30:29 -07:00
Anders Kaseorg b545abe1e2 typos: Fix typos caught by mwic.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-20 13:55:00 -07:00
afeefuddin dbd44bff5c settings_components: Rename subsection to $subsection_elem. 2024-05-20 13:33:08 -07:00
sujal 4a652ed38d stream_settings: Update feedback message to include user name.
Add user name in feedback message so that it is more clear
which user is unsubscribed.

With tweaks by tabbott to handle the yourself case.

Fixes #19165.
2024-05-20 11:32:19 -07:00
afeefuddin 64d8a18b76 settings_profile_fields: Convert Module to TypeScript. 2024-05-20 11:17:58 -07:00
afeefuddin 578f0319b2 types: Add UserExternalAccountData type. 2024-05-20 11:17:58 -07:00
afeefuddin ea4fdcb2a5 state_data: Add realm_default_external_accounts to realm_schema. 2024-05-20 11:17:58 -07:00
afeefuddin e40ef29e63 settings_profile_fields: Pass Jquery consistently. 2024-05-20 11:17:58 -07:00
afeefuddin 448870225b settings_profile_fields: Use this keyword instead of e.currentTarget. 2024-05-20 11:17:58 -07:00
afeefuddin 1fcc3e8878 settings_org: Move populate_data_for_request to settings_components. 2024-05-20 11:17:58 -07:00
Lalit 5ea98cba54 input_pill: Add test for `input` event handler. 2024-05-20 09:13:26 -07:00
Sayam Samal dbebd0ddbf popovers: Move navbar popovers to a subdirectory. 2024-05-20 09:10:36 -07:00
Sayam Samal a289a823a0 popovers: Move left sidebar popovers to a subdirectory. 2024-05-20 09:10:36 -07:00
Sayam Samal dd4b1fdfed popovers: Rename and move topic_sidebar_actions.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal 7e021e6699 popovers: Rename and move stream_sidebar_actions.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal e6cb690037 popovers: Rename and move personal_menu.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal 018142e6ec popovers: Rename and move gear_menu_popover.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal 05b1ae42b2 popovers: Rename and move navbar_help_menu.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal dae9b6b9ed popovers: Rename actions_popover.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal b30698e49d popovers: Rename and move starred_messages_sidebar_actions.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal f4129aa9df popovers: Rename and move drafts_sidebar_action.hbs. 2024-05-20 09:10:36 -07:00
Aman Agrawal 44fa39c4c4 recent_view: Fix error on initial fetch being all muted messages.
If the initial fetch pre #29740 fetches all muted messages we don't
have any messages in all message list and hence query for
oldest message is undefined.

This results in us trying to render oldest_message_timestamp
with its value as infinity.

To fix it, we include muted messages in our search for oldest
message in the list and if we still cannot find one, we wait
for the next fetch.
2024-05-19 23:27:14 -07:00
ecxtacy 6af748fa77 pills: Optimize removePill function.
The removePill function of input_pill module uses a for loop
for iterating and finding the required pill.
Replace the for loop with inbuilt findIndex function for efficiency.

Authored-by: Dhruv Chouhan <dc.dhruvchouhan@gmail.com>.
2024-05-17 10:47:22 -07:00
ecxtacy ac7dd6fa08 settings: Show user_group_popover when pill is clicked.
Add 'click' event listener to the pills in stream settings
to toggle the user_group_info_popover.

Fixes #28687.

Co-authored-by: Pieter CK <pieterceka123@gmail.com>.
2024-05-17 10:47:22 -07:00
PieterCK 82a817aaab hashchange: Fix popover not disappearing on overlay hash URL.
Refactored hashchanged() so that popover.hide_all()
is executed before checking is_overlay_hash() to close
popovers when the user changes hash but still on overlay.
2024-05-17 10:47:22 -07:00
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