Commit Graph

969 Commits

Author SHA1 Message Date
Lalit 888d6d8037 settings_playground: Fix sorting issues in playgrounds table.
Removed the sorting functions which were sorting under the assumption that
our comparison items were a list instead I used the generic sort functions
functionality of our `list_widget` module.
2023-05-22 09:36:24 -07:00
Aman Agrawal f04ae8acd3 drafts: Fix message header overlapping outline. 2023-05-22 09:31:21 -07:00
Lalit 7346ce98f3 ts: Convert `emojisets` to TypeScript.
Declared types for '*.png' modules and '!style-loader?*' modules in
`assets.d.ts` and used them in `emojisets.ts`.
2023-05-22 09:02:42 -07:00
Hardik Dharmani d9716bc189 left_sidebar: Improve mentions in muted topics.
When there are only muted unread mentions in a stream, show `@` icon
and unread count in faded style, also align the `@` on more topics
with no unead counter on it.

If there are only muted unread messages without mentions don't show
the unread counter on the stream.

Fixes #25382.
2023-05-19 18:40:57 -07:00
Hardik Dharmani 8c6f9b3f95 unread: Improve live update for direct mentions in muted topics.
The "Mark as unread" event handler was not passing through the
mentioned_me_directly value, which is now important to left sidebar
rendering.

See the extended comment for how this solution is incorrect/incomplete
and has to fall back to guessing a potentially incorrect value in rare
situations.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2023-05-19 18:00:25 -07:00
Lalit 7ac891a6b9 people: Add `version` parameter for medium sized avatar urls.
We need to append the `version` parameter when constructing the urls for
medium-sized images so that the browser updates the image in real time when
the user uploads a new avatar.

Fixes #25558.
2023-05-19 13:52:00 -07:00
Akarsh Jain 12db83b011 help: Open Help Center links in new tab for empty message lists.
This commit updates the Help Center links in all relevant empty message
list views to open in a new tab by default. This prevents users from being
navigated away from the app.

Fixes #25337.
2023-05-19 13:51:00 -07:00
Karl Stolley c2f6167c01 css: Remove superfluous grid- properties.
The use of named areas with `grid-area` make it unnecessary to
declare `grid-row` or `grid-column` values. (Note also that
grid areas must not be presented in quotation marks.)

Additionally, because `.unread_marker` is no longer placed on the
grid by itself (i.e., it always accompanies `.date_unread_marker`
or `.message_unread_marker`), it does not need any manual grid
placement, `grid-area` or otherwise.
2023-05-19 13:48:16 -07:00
Aman Agrawal 9aa9f9b3c8 message: Separate unread marker of date_row from message.
This allows us to easily disable unread marker for date row of
the first unread message without producing any bugs.
2023-05-19 13:48:16 -07:00
Karl Stolley ef3289b73b css: Present message_row as CSS Grid.
This change enables the unread marker to participate as a grid item,
rather than the product of various absolute/relative positioning
hacks. The intention is to therefore prevent the blue active-message
box from disappearing on browsers that have zoomed out (~80% zoom).

With grid in place, this also makes for a more robust presentation
of each message row, and named grid areas should make it possible to
modify and extend the grid into the future.

Finally, this change removes styles that are no longer necessary in
the context of CSS Grid.
2023-05-19 13:48:16 -07:00
Tim Abbott 9c09edd7af ui_init: Fix loading spectators view.
18578cc5da broke the success code path.
2023-05-19 13:42:48 -07:00
Josiah Kievit 28c5c64b8d
css: Remove copy code button outline.
Added styling to show no outline around the copy to clipboard button on click. 

Previously, when clicking this button, a rectangular outline appeared around 
the button, which didn't look good, since a 'Copied!' message was already displayed.

Fixes #25533.
2023-05-19 13:09:10 -07:00
evykassirer 27bc36b7d6 settings: Revert dark mode background color changes. 2023-05-19 10:57:50 -07:00
Sahil Batra a4db19f9aa signup: Fix selector used for validating the forms.
This commit fixes a typo in the selector used to
validate registration, support, realm creation,
password reset and terms of service forms. This
typo also resulted in a bug where "This field is
required" error message was shown at incorrect
position and this change fixes it.

This commit also fixes the client side error
handling of these forms which did not work
perfectly due to the selector being wrong.
2023-05-19 10:48:52 -07:00
Alex Vandiver 18578cc5da ui_init: Properly call reject with an error, not an xhr.
If the spectator registration call fails, properly log the error and
call `reject` with an error object, not the xhr that `channel.post`
calls its error callback with.

This does nothing to address the UI question of what to do should this
request fail.
2023-05-19 10:48:21 -07:00
Karl Stolley 0407abc788 help_pages: Improve anchor highlights.
These changes ensure that only headings targeted by URL fragments are
highlighted in full. Div elements will have their immediate first
child element highlighted instead (e.g., the first element of an API
parameter box).
2023-05-18 13:57:42 -07:00
Aman Agrawal 44ae67d426 css: Fix gap between header and sticky header at some zoom level. 2023-05-18 13:39:46 -07:00
Aman Agrawal 3acd7b8f47 css: Move message header padding to the element with border.
Apply border and top margin on the same element so that browser
has no way to introduce a gap between them.
2023-05-18 13:39:46 -07:00
Lalit a2db6df826 ts: Convert `deprecated_feature_notice` module to TypeScript. 2023-05-18 08:52:26 -07:00
Lalit 0216eb8915 deprecated_feature_notice: Use `zod` for validating data when fetching it from `localstorage`.
Refactored `maybe_show_deprecation_notice` to use zod to parse the `shown_deprecation_notices`
array stored in localstorage for better type-safety.
2023-05-18 08:52:26 -07:00
Lalit 656a31d38d refactor: Move `maybe_get_stream_name` from `stream_data` to `sub_store`.
This commit moves `maybe_get_stream_name` function from `stream_data` to `sub_store`
as it didn't had any dependency on `stream_data` and it also helps us to cut off
dependency on `stream_data` for some of the modules including `user_topics`.
2023-05-18 08:46:16 -07:00
Lalit a3f46957bc ts: Convert `confirm_dialog` module to TypeScript. 2023-05-18 08:44:30 -07:00
Tim Abbott ac3acc941f css: Increase opacity for grey elements.
The message timestamp and a few settings elements looked off with the
new 25% off white dark theme font color.
2023-05-16 16:52:22 -07:00
Trident Pancake 6fb16f3598 message_edit: Disable save btn after edit time limit
Fixes #25413.

The old code was disabling the save button wrong by using
`.addClass("disabled")` instead of `prop()`.

Added tooltip for the disabled save button as per issue #25413 and changed
"Times up!" color to red.

The textbox readonly logic was changed to no longer becoming readonly. Reason
being there are edge cases involving the compose buttons such that simply
marking the textbox as readonly is not sufficient.

E.g. using the compose buttons after readonly still modifies the content.

One solution might be to just hide the compose buttons visually. However, there
are edge cases for that too. If preview mode was previously active, then
perhaps that state needs to be reverted. If any modal is open, such as the emoji
picker, then that needs to be closed. Solving these edge cases doesn't
improve the user experience. Keeping the textbox editable allows an easier way
for user to copy the text and don't have weird cases.
2023-05-16 15:59:29 -07:00
Trident Pancake b1c801847b message_edit: Remove redundant is_editable check 2023-05-16 15:59:29 -07:00
Lakshay Mittal a208da9c4d style: Fix dropdown text alignment by reducing vertical padding.
Zulip's select widgets have a 30px height; this comes from Bootstrap
but is also generally nice for visual consistency.

In modals, we use a 15px font-size, instead of the 14px used in the
rest of the app, and in that context, the 4px vertical padding plus
30px fixed height resulted in the text not being vertically aligned.

Fix this by removing that vertical padding; all of our select elements
with these classes appear to position the text in the center of the
dropdown through other CSS mechanisms.
2023-05-16 15:43:06 -07:00
Alex Vandiver 4a43856ba7 realm_export: Do not assume null extra_data is special.
Fixes: #20197.
2023-05-16 14:05:01 -07:00
Sahil Batra 007a51f277 accounts: Allow user to change email visibility during first login.
We now allow users to change email address visibility setting
on the "Terms of service" page during first login. This page is
not shown for users creating account using normal registration
process, but is useful for imported users and users created
through API, LDAP, SCIM and management commands.
2023-05-16 13:52:56 -07:00
Daniil Fadeev 859903648b scheduled_messages: Add banner for unscheduled message.
Fixes: #25614.
2023-05-16 12:39:01 -07:00
Mateusz Mandera 632e856240 support: Add option to delete user from /activity/support. 2023-05-16 12:38:12 -07:00
Karl Stolley 386d87635e popovers: Shorten 'Quote or reply' label.
This removes the previous "or forward" text from the message
actions popover, and keeps the documentation in sync with the
new text. Internationalization tests are updated, too.

Fixes #25603.
2023-05-16 12:36:29 -07:00
Aman Agrawal e6c7363613 css: Make top message logo less bright. 2023-05-16 12:35:17 -07:00
Aman Agrawal 29880a4a1e css: Change border-bottom color for message header. 2023-05-16 12:35:17 -07:00
Aman Agrawal c84681c69c css: Color tweaks. 2023-05-16 12:35:17 -07:00
Aman Agrawal 2a98968846 css: Use 75% white as default text color. 2023-05-16 12:35:17 -07:00
Aman Agrawal 3f4deedba1 css: Remove stale css.
`message_view_header_underpadding` is no longer present in the
codebase as we move the padding to be above the sticky recipient
bar.
2023-05-16 12:35:17 -07:00
Aman Agrawal 9f5b7ba9b0 css: Separate out text colors. 2023-05-16 12:35:17 -07:00
Aman Agrawal c96de330b0 stream_color: Dim recipient bar background color. 2023-05-16 12:35:17 -07:00
Aman Agrawal 17bdf22521 css: Allow `actions_hover` icon to have a focus outline. 2023-05-16 11:57:17 -07:00
Brijmohan Siyag 17ec4f1e06 tooltip: Update max-width of disabled send button tooltip.
Changes the tooltip max-width on the disabled send button
from 300px to 350px to remove the weird looking padding at
the end.
2023-05-16 11:24:35 -07:00
Brijmohan Siyag cb00fbc42f compose: Check posting policy for direct messages.
Prior this commit, changing the message type from a stream (where posting
was not allowed) to a direct message using the compose box dropdown, did not
changed the state of the send button from disabled to enabled even though
direct messages were allowed in the organization.

This was happening because `check_stream_posting_policy_for_compose_box` was
only for streams.

Now, function is updated to check for both streams and direct
messages, as it checks if direct messages are allowed or not, and depending on
that, it updates the send button's state, tooltip and displays a relevant banner.
2023-05-16 11:24:35 -07:00
Josh Yap ee88bb5187 popovers: Hide emoji reaction when icon already present.
When hovering over another user's message, the emoji reaction
icon is already present. This commit removes the "Add emoji
reaction" menu item from the popover menu in this case, to
avoid redundancy.

Fixes #25602.
2023-05-16 10:53:54 -07:00
Josh Yap 231888b5a5 popovers: Add keyboard shortcut to emoji reaction menu item.
Fixes #25602.
2023-05-16 10:53:54 -07:00
Tim Abbott 3876171df1 compose: Fix opening compose box when viewing invalid stream.
This likely needs further refactoring to switch to using stream IDs
rather than names in this code path, but this change fixes an
exception that would be throw when opening the compose box while
viewing a narrow to an invalid stream name/ID.
2023-05-16 10:39:33 -07:00
Tim Abbott 74e6367455 css: Increase constrast for blue box. 2023-05-15 16:01:09 -07:00
Joelute 584b11af2d unread_banner: Apply updated design to message feed banners.
In #22524, we have updated the compose banner to the new, updated design
while the unread banners have remained the same. When comparing them side
by side, they look rather old and outdated. We should apply the updated
design to the unread banners as well.

Fixes: #25551.
2023-05-15 15:59:12 -07:00
Joelute d556b73084 unread_banner: Update HTML of unread banners to use zulip icons.
Previously, the close buttons on the unread banners used "x" as the icon.
This unfortunately doesn't scale well as we increase the font-size. To fix
this, we should update the button to use zulip icons instead of a character
as the button.
2023-05-15 15:59:12 -07:00
Karl Stolley b852da6eed help_pages: Preserve anchor highlights.
This commit assigns a `.scroll-target` class to preserve any URL
fragment whose corresponding ID is on the self-same page as the
activating link.

This accommodates a side-effect of the fetch-based page-loading
logic, which seems to lose the `:target` reference once a load
or reload is complete.
2023-05-15 14:57:42 -07:00
Karl Stolley ceec61ba10 help_pages: Highlight headings targeted by URL fragments.
One caveat: While the approach here works fine when loading a new
docs page whose URL includes a fragment, there appears to be something
about `simplebar` that clears out the `:target` reference. If you
click a heading link on a help page, for example, you might
momentarily see the highlighted style appear before it disappears.
2023-05-15 14:57:42 -07:00
Brijmohan Siyag a4c7be68cc stream: change ID in selector to match updated one.
Updates the left-over ID in a5580264eb.
2023-05-15 14:55:21 -07:00
Daniil Fadeev cb69413301 send_later: Add keyboard navigation to message scheduling modal.
Fixes: #25404.
2023-05-15 14:52:06 -07:00
Daniil Fadeev fa112adcb7 send_late: Change the class `send_later_options` to an id.
It will be easier to locate the send later options in different code
 paths with the id.
2023-05-15 14:52:06 -07:00
Daniil Fadeev e64e5f2413 scheduled_messages: Add keyboard navigation.
Keyboard navigation has been added to the scheduled messages modal
in this commit. The solution is based on the `modals_handle_events`
function from the `messages_overlay_ui.js` module, as well as some
helpful functions from the same module.

Fixes: #25181.
2023-05-15 14:46:21 -07:00
Daniil Fadeev f2e627ba51 drafts: Move code handling keyboard navigation to a separate module.
The keyboard navigation that used to only work in drafts can now be
reused. This commit has moved the related functions to a separate
module.
2023-05-15 14:46:21 -07:00
Daniil Fadeev 35c23d0269 drafts: Refactor keyboard functions for reusability.
This is a preparatory commit to implement keyboard navigation in the
 message scheduling modal. The main goal is to make the
 `modals_handle_events` function reusable. To achieve this, we have
 extracted all the context-related variables and replaced all
 mentions of "draft" with the more neutral term "item". The
 `modals_handle_events` function now also has a context parameter,
 which contains all the necessary methods and properties to work in
 different modal contexts.
2023-05-15 14:46:20 -07:00
Aman Agrawal ae02a93d35 scheduled_message: Change tooltip of failure icon. 2023-05-15 14:43:04 -07:00
Aman Agrawal c375d36c9e css: Dim color of failed message sent icons. 2023-05-14 16:46:20 -07:00
Aman Agrawal 1bffdda59f scheduled_message_overlay: Add a failed delivery indicator.
Fixes #25501
2023-05-14 16:46:20 -07:00
Aman Agrawal 06cbe95583 scheduled_message: Extract common elements into a separate file. 2023-05-14 16:46:20 -07:00
Satyam Bansal fad5c88aa9 select_recipient_widget: Use "button" tag instead of "div".
Previously, hovering over the stream selector in the
compose box would show a mouse/text pointer instead
of a hand pointer.

Fixes #25592.
2023-05-14 16:35:48 -07:00
Lalit cab3a992c0 refactor: Extract `message_feed_loading` module from `message_scroll`.
This new module allows us to remove dependency on `message_scroll` in `fetch_status`
and hence allowing us to migrate it to TypeScript.
2023-05-14 11:24:31 -07:00
Lalit 9e1b4dafc0 message_list_data: Remove dependency on `filter.js`.
This commit removes dependency on `filter.js` by lifting the construction
of `Filter` object up in `all_messages_data.js`.
2023-05-14 11:24:31 -07:00
Ujjawal Modi fc22b86eb6 streams: Correctly disable adding subscribers while creating streams.
This commit disables the field used for adding other subscribers
in stream creation box for users who are not allowed to add
other users to streams because of realm level setting
"Who can add users to  streams".

Fixes #24900.
2023-05-14 11:19:41 -07:00
Ujjawal Modi 105acc8495 streams: Disable option to add other subscribers in existing streams.
This commit disables the field used for adding other subscribers
to existing streams for users who are not allowed to add other users
to streams because of realm level setting "Who can add users to streams".
2023-05-14 11:19:05 -07:00
Ujjawal Modi eda1ee555b streams: Properly disable add subscriber container for existing streams.
Earlier the field used for adding subscribers to existing
streams was not properly disabled.

This commit properly disables the field and also adds a new function
for enabling and disabling add subscribers container.
2023-05-14 11:19:05 -07:00
Aman Agrawal f66dde4a33 left_sidebar: Move tooltips to the `focus` element.
Since tippy relies on the `blur` event of `target` to hide
the toolips, it is important that the tooltip is triggered
by the element that receives that focus in keyboard navigation which
is `a` tag for left sidebar elements.
2023-05-12 17:35:52 -07:00
Alex Vandiver b20aeadcb8 sentry: Downsample typing spans.
These can come fast and furious, and are not worth reporting all of.
Like presence reporting, we leave a small percentage of them for
network and endpoint latency information.
2023-05-12 13:53:57 -07:00
Alex Vandiver 6a3f97ba80 sentry: Heavily downsample presence spans.
Instead of dropping all of these spans, downsample them heavily (1% of
expected sampling rate).  These are some of the most frequent requests
to the server, and the high volumes do not add much information.  We
leave a small percent of requests, since it is a useful measure of
overall client network latency.
2023-05-12 13:53:57 -07:00
Alex Vandiver 9912b4c815 sentry: Unify logic for skipping span reporting.
This changes to not report any `call POST /json/users/me/presence`
spans, which we previously reported despite not including the inner
auto-instrumented HTTP spans.
2023-05-12 13:53:57 -07:00
Tim Abbott 2b2ee686f3 portico: Extract CSS variable padded-content-padding. 2023-05-12 11:54:17 -07:00
Karl Stolley f1db7c1d72 portico_css: Keep targeted elements below menu bar.
This PR ensure that all elements targeted by URL fragments will
remain visible below the portico's menu bar at all viewport
sizes and also when a user zooms in, provided the target is on a
page with the menu bar, which will have the `portico-landing`
class.

Whether a quirk or a bug, Chrome appears to ignore the padding on
ancestral containing elements when calculating the offset for
`scroll-margin-top`, which is why padding has been moved to
`.inner-content` for `.why-page` and `.case-studies-page`, which
are the two unique class names for portico pages where the targeted-
element scrolling behavior is used.
2023-05-12 11:54:17 -07:00
Karl Stolley a5ff3d7e59 portico_pages: Add uniform structure HTML structure.
This commit ensures that the Attribution, Jobs, and Team pages all
share a uniform structure to match those of other pages. This will
simplify styling and should ensure greater confidence when modifying
portico landing-page styles.

The one CSS modification here, for the jobs page, maintains the space
at the top of the "How we work" section.
2023-05-12 11:54:17 -07:00
Aman Agrawal dd73f7272d recent_conversation: Fix incorrect `if` condition.
row_focus cannot be equal to `$topic_rows.length` since it follows
0 array indexing.
2023-05-12 11:32:40 -07:00
Hardik Dharmani 0738dfd126 edit_bot_modal: Keep Save Changes button disable until changes are made.
Use update_submit_disabled_state_on_change parameter of dialog_widget
instead of setting up input handlers in show_edit_bot_info_modal.

Added new hidden input field to store value of current selected option
in edit_bot_form.hbs whose value is updated by item_click_callback
function of in settings_bots.js.

Also, called $(".edit_bot_avatar_file_input").trigger("input") on
clearing avatar so input event handler gets called and compare the
values to disable the submit button again.

Fixes #24568
2023-05-12 11:30:50 -07:00
Hardik Dharmani 81dfaa0602 dialog_widget: Update `get_current_values` function.
Updated `get_current_values` function to not include undefined keys
in current_values object and if the input field is of type file and
a file is selected then set the value equal to file object.
2023-05-12 11:30:50 -07:00
Aman Agrawal 461d935463 css: Fix unread marker leaking through message header. 2023-05-12 11:13:20 -07:00
Anders Kaseorg ea28083ba4 eslint: Fix unicorn/prefer-at.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-12 11:12:20 -07:00
Anders Kaseorg 54f90e41c0 eslint: Fix unicorn/prefer-string-replace-all.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-12 11:12:20 -07:00
Tim Abbott fe54df0b01 css: Darken light theme message feed borders.
This was a design bug caused by Figma's grey background.

https://chat.zulip.org/#narrow/stream/101-design/topic/UI.20redesign.3A.20background/near/1567435
2023-05-11 16:05:05 -07:00
Hardik Dharmani ede1e547ee stream_settings: Fix bugs with #stream-creation .modal-footer.
This commit addresses `#stream-creation .modal-footer` becoming
transparent after an error in creating a stream due to overlapping
with `.stream-creation-body`. Instead of adding data-simplebar on
.stream-creation-body, added it to a new div
`stream-creation-simplebar-container` which contains 3 divs:
stream_create_info,stream_creating_indicator and stream-creation-body.

Additionally, fixed the border-radius of the modal footer on the
bottom left side for device width > $md_min.

Fixes #25526
2023-05-11 15:50:56 -07:00
Anders Kaseorg 362556b540 app: Use ES module from flatpickr.
https://github.com/flatpickr/flatpickr/issues/2468 was fixed in
flatpickr@4.6.10.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-11 14:50:37 -07:00
Anders Kaseorg 5173511e77 debug: Remove print_elapsed_time in favor of console.time.
https://developer.mozilla.org/en-US/docs/Web/API/console#timers

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-11 14:49:55 -07:00
Aman Agrawal 35278a74bb css: Fix highlighted stream color with keyboard navigation.
Instead of highlighting the topics of the `active-stream`, we
highlight the stream name.
2023-05-11 12:44:23 -07:00
Aman Agrawal 232543d425 billing: Making /upgrade page header visible.
This was hidden following #25518
2023-05-11 11:30:31 -07:00
Karl Stolley 1d5e026b66 left_sidebar: Adjust size and position of DM icons. 2023-05-11 10:53:03 -07:00
Joelute 99dbea3331 narrow_banner: Drop empty action line from empty `dm-including:` views.
Previously, when a user enters a empty dm-including view, they'll notice
the "Why not start the conversation" action line and click on the link.
When this happens, the compose box would open but the receipent box is
never populated.

Since the dm-including view is a search view, we should drop that phrase
from dm-including views altogether. It also isn't super natural to
have a button that starts the conversation with the user anyways.

Fixes: #25524.
2023-05-10 18:07:53 -07:00
Tim Abbott 1514d651f4 compose_banner: clear_all shouldn't remove simplebar.
Simplebar introduces a bunch of intermediate divs, and we want to be
clearing the content element, not the entire container including the
simplebars divs.
2023-05-10 17:54:28 -07:00
Lalit 407629b46c compose_banner: Add `update_or_append_banner` method in `compose_banner`.
`update_or_append_banner` abstracts the logic for not creating another compose
banner if one is already present in the DOM, it just replaces the content of the
old banner with the new one.
2023-05-10 17:54:28 -07:00
Lalit 577c150ffa compose: Open send later modal when user accepts the warning on scheduling message.
When the user has a wildcard @-mention we show a warning if the stream has more than
15 members. When the user clicks "Yes, schedule" and confirms the intend to schedule
the message we open the send later modal to let user choose scheduling time.

Fixes #25426.
2023-05-10 17:54:28 -07:00
Lalit 87397ed000 popover_menus: Extract `open_send_later_menu` function.
Extracted opening send later menu code in its own function `open_send_later_menu`
so that we can reuse to directly open the modal from different parts of code.
2023-05-10 17:54:28 -07:00
Lalit c2b1463224 compose_validate: Accept `scheduling_message` argument in show_wildcard_warnings.
Added a new param `scheduling_message` which is passed down to the `show_wildcard_warnings`
this argument will help us to do logic relevant to when we are doing validation on scheduling
a message.
2023-05-10 17:54:28 -07:00
Tim Abbott f6dde97ec9 popovers: Fix 'u' keyboard shortcut on messages without avatars.
In ab0c5f3092, it was missed that this
code depended on the sender_info_hover CSS class, which is no longer
an empty element on messages without a message sender avatar/name
element.

The logic is still hacky, as it relies on the position of an invisible
element, but we're rewriting the positioning logic using Tippy anyway,
so it's not worth doing much to make it nicer.

Fixes #25496.
2023-05-10 17:38:46 -07:00
Tim Abbott 59daf54ec9 scheduled_messages: Fix broken node test.
This test just used the current hour, and thus would always fail at
24:00 UTC.
2023-05-10 17:06:59 -07:00
Daniil Fadeev e10997b0e6 scheduled_messages: Rerender send later options at specific time.
Fixes: #25451.
2023-05-10 16:14:10 -07:00
Daniil Fadeev 45c3f8aa96 send_later: Extract send later options to separate template.
This is a preparatory commit that will help to render the options
for the send-later modal separately. This is necessary to have
actual sending options if the user keeps the modal open.
2023-05-10 16:14:10 -07:00
Lalit ebaabc6b68 ts: Migrate `feedback_widget` to TypeScript.
This commit migrates `feedback_widget` module to TypeScript.
2023-05-10 14:31:42 -07:00
Trident Pancake e52eee330c message_edit: Avoid registering duplicate events.
Fixes #25462.

hotkey.js is the file that handles the 'e' keyboard shortcut. It maps to the
'edit_message' event and will simply call message_edit.start().

message_edit.start() doesn't check whether it's already been opened previously,
so it will go through and try to register handler for the clipboard button
again. When the clipboard button gets clicked, the handler will be called
twice. Once with a properly target element, and once with null.

Fix this issue by checking if message_edit.start() has already operated on
the given $row.
2023-05-10 14:09:19 -07:00
Joelute 2b93b2eb98 bootstrap: Remove unused stylings for `btn-info`.
Currently, we are in the process of removing bootstrap out of the current
Zulip codebase. A quick git grep on btn-info shows that the class is only
used in `templates/corporate/billing.html`. But it doesn't take advantage
or use most of the styling rules that are set.

We should get rid of those rules as it's not being used and help simplify
the process in removing bootstrap.
2023-05-10 12:10:14 -07:00
Aman Agrawal 012f91eaba dropdown_widget: Show "No search results" instead of an empty list. 2023-05-10 12:00:18 -07:00
Aman Agrawal 0e79689c72 dropdown_widget: Move to last item on arrow up on search box. 2023-05-10 12:00:18 -07:00
Aman Agrawal 5156f465ef css: Increase max-height so that no element is partially visible.
I didn't want to use JS for it since calculating height based on
item height before rendering the dropdown is expensive and after
rendering the dropdown will cause it jump.
2023-05-10 12:00:18 -07:00
Aman Agrawal 79b00d3c2a minor: Correct comments. 2023-05-10 12:00:18 -07:00
Aman Agrawal 781a22bf81 dropdown_widget: Improve arrow navigation experience.
After `ArrowDown` on the last visible, don't jump the next item
into the center of the view, instead align the bottom of the item,
to the bottom of the visible container.
2023-05-10 12:00:18 -07:00
Aman Agrawal 393bcb4a9a compose: Increase font size of recipient privacy icon. 2023-05-10 12:00:18 -07:00
Aman Agrawal 4f8424b63b scheduled_message: Hide success compose banner on `remove` event.
Fixes #25441

`remove` event is triggered when scheduled message is sent and
when the scheduled message is removed, so this will remove
success banner in both cases.
2023-05-10 11:53:22 -07:00
Aman Agrawal 4f6af93f5d overlays: Add method to check if the correct modal is open.
This will be used to avoid this code syntax:
```
if (overlays.is_modal_open()) {
   overlays.close_modal("send_later_modal");
}
```
2023-05-10 11:10:32 -07:00
Tim Abbott 6e0ea3d79a message_edit: Avoid confusing notice editing wildcard mention messages.
It's highly confusing to suggest to a user that we'll send a second
notification to all users when that's not the case.

Fixes #25507.
2023-05-09 23:05:04 -07:00
Tim Abbott 859a96e0d7 message_store: Keep track of wildcard_mentioned.
We'll need this to check if a message already had a wildcard mention
in the message edit code path.
2023-05-09 23:05:04 -07:00
Daniil Fadeev dd65ec2916 compose: Validate stream message mentions on edit save.
This commit adds a message mentions validation for message editing.
The behavior will be similar to the validation on the compose box
when the user sends a message.

Fixes: #25411.
2023-05-09 23:05:04 -07:00
Daniil Fadeev 1bab164d39 compose: Simplify `user_acknowledged_wildcard` to a Boolean. 2023-05-09 23:05:04 -07:00
Daniil Fadeev f914e2a54e compose: Remove the global variable for wildcard mentions. 2023-05-09 23:05:04 -07:00
Daniil Fadeev 209e9edd9d compose: Add container parameter to functions.
This commit introduces a new container parameter for functions that
can be used for both compose and edit mode. It provides the function
with information about the context in which it is being used.
2023-05-09 23:05:04 -07:00
Daniil Fadeev 815aeccd04 compose: Create a helper function to calculate input information.
Function retrieves the input information based on the target event
and returns it as an object. It determines if the input is an edit
form or a compose form and returns the appropriate banner container.
2023-05-09 23:05:04 -07:00
Daniil Fadeev e22c44131b compose: Use the passed container value to remove the banner. 2023-05-09 23:05:04 -07:00
Sahil Batra 0ec16407ba invite: Add checkbox to select all default streams.
We now add a checkbox in "Steams they should join" to directly
select all default streams in the realm for the invite.
We hide the stream list if that option is selected.
2023-05-09 17:05:18 -07:00
Sahil Batra 4ca887bade invites: Allow users to invite without specifying any stream to join.
We now allow users to invite without specifying any stream to join.
In such cases, the user would join the default streams, if any, during
the process of account creation after accepting the invite.

It is also fine if there are no default streams and user isn't
subscribed to any stream initially.
2023-05-09 17:05:17 -07:00
alik-balika c0560b3ea9 about_zulip: Change icon color when copy button is hovered.
`Version` and `Forked from` copy buttons in the "About Zulip" UI
will now change color when hovered over.
This allows the copy button to pop out more when hovering over it.

Fixes part of #23210.
2023-05-09 16:32:06 -07:00
Aman Agrawal df6c47565f css: Increase border opacity for message header and content. 2023-05-09 16:25:28 -07:00
Aman Agrawal ddc1406090 css: Fix unread indicator being partially displayed on date_row.
Add a border to the left of date row to override the unread
indicator.
2023-05-09 16:25:28 -07:00
evykassirer c578a38423 navbar: Widen navbar to fill the full screen on large screens.
Now that the navbar is a different color, we want it to also
take up the full width of the screen. Because the navbar has
margin, this commit adds a new div. To not have to add a new
div, the scrollbar would need to be moved to the `html`
element, which is a bigger project.

This commit also moves the zulip logo to be left-justified instead
of centered, since it looks strange centered with the full
width navbar.
2023-05-09 16:25:28 -07:00
evykassirer e026aa1217 UI redesign: Change background color.
Fixes: #21750
2023-05-09 16:25:28 -07:00
Tim Abbott 77ac1a10de compose: Collapse recipient widget with few options.
This looks visually nicer, and I think is necessary to merge it for
now, but I'm doing this as a separate commit so it's easy to revert if
we change our mind.
2023-05-09 14:11:26 -07:00
Aman Agrawal d64ad8653b edit_bot_form: Use new tippy dropdown for selecting bot owner. 2023-05-09 14:11:26 -07:00
Aman Agrawal 8ea59f7f02 compose: Use tippy for stream select dropdown.
Fixes #25434
2023-05-09 14:11:26 -07:00
Aman Agrawal a196b949f7 dropdown_widget: Implement dropdown widget using tippy.
This will soon replace DropdownListWidget.
2023-05-09 14:11:26 -07:00
Hardik Dharmani bb78d9741f move_modal: Focus input in "Move messages" and "Move topic" modals.
If user has permissions to move the message(s) to a different stream
and can't edit topic name then focus stream input; else, focus topic
input on "Move messages" and "Move topic" modals render by
`ui_util.place_caret_at_end($(".move_messages_edit_topic")[0])` to
position the cursor at end on focus.

Wrapped if else logic in function focus_on_move_modal_render()
and passed it to on_shown parameter of dialog_widget.launch()
to focus stream/topic input once widget is rendered.

Fixes #24805
2023-05-09 13:51:07 -07:00
Hardik Dharmani cfbcbe901a topic_edit: Rename `inline_topic_edit` to `move_messages_edit_topic`.
In move_topic modal, Renamed inline_topic_edit to
move_messages_edit_topic to be more specific selector as
inline_topic_edit is also used in message header.

Additionally, Removed id inline_topic_edit as it was only used
in zulip.css instead used `.inline_topic_edit` selector as that
element also have class with same name inline_topic_edit.

Fixes #24805
2023-05-09 13:51:07 -07:00
Tim Abbott e0f6a7a48d scheduled_messages: Avoid hardcoding minimum delay.
This deduplicates the 5 minutes calculation across the scheduled
messages code path.
2023-05-09 13:48:28 -07:00
Hardik Dharmani 697cdb31e5 message_headers: Abbrevate direct message recipient names.
Abbrevated DM recipient names in message feeds, Drafts and Scheduled
messages overlays by wrapping recipient names in span with class
private_message_header_name and applying `overflow: hidden` and
`text-overflow: ellipsis` CSS to it.

Fixes #25353
2023-05-09 13:43:40 -07:00
Hardik Dharmani 99a988e220 message_header: Abbreviate topic names in all overlays.
Fixes #25353
2023-05-09 13:43:40 -07:00
Alex Vandiver 64b277d845 blueslip: Reduce cardinality of blueslip.error() calls.
Particularly when grouping in Sentry, pushing the ids and such into
the additional data section helps group like errors together better.
2023-05-09 13:16:28 -07:00
Alex Vandiver 1769f981da blueslip: Show more-info context in alert popup, if we have it. 2023-05-09 13:16:28 -07:00
Alex Vandiver 5d97dbf8b3 zblueslip: Show chained causes in unexpected messages. 2023-05-09 13:16:28 -07:00
Alex Vandiver fa92895731 blueslip: Support nested Error objects by .cause. 2023-05-09 13:16:28 -07:00
Alex Vandiver 8e3a6d17bd blueslip: Move BlueslipError into blueslip_stacktrace.ts.
Its existence is purely to add more context when displaying the
stacktrace.
2023-05-09 13:16:28 -07:00
Alex Vandiver 591b800ba4 blueslip: Pass original exception down into BlueslipError, if present. 2023-05-09 13:16:28 -07:00
Alex Vandiver 7898818983 blueslip: Pass the Error around, rather than re-creating a dummy one. 2023-05-09 13:16:28 -07:00
Alex Vandiver 52c613471a blueslip: Add a more specific type. 2023-05-09 13:16:28 -07:00
Alex Vandiver 086e64dfe4 blueslip: More tightly annotate more_info. 2023-05-09 13:16:28 -07:00
Alex Vandiver fea5a3fdb8 sentry: Always capture an Error, rather than a string.
We pass the original exception down as the `cause`, if present.  This
makes Sentry properly capture the callstack.
2023-05-09 13:16:28 -07:00
Alex Vandiver 9d6ca32c59 sentry: Annotate all channel calls. 2023-05-09 13:16:28 -07:00
Alex Vandiver c67cd5adb4 sent_messages: Remove from cache when message has been fully received.
There is no reason to keep these messages in a local memory store once
we have completed sending them and seen their events.
2023-05-09 13:16:28 -07:00
Alex Vandiver 3cc2adcd3b sentry: Switch to using Sentry spans for message send timings. 2023-05-09 13:16:28 -07:00
Alex Vandiver 00ea197744 sentry: Switch to using Sentry spans for narrow/unnarrow timings. 2023-05-09 13:16:28 -07:00
Alex Vandiver 3ab22233f0 sentry: Add tracing extensions when Sentry is not enabled. 2023-05-09 13:16:28 -07:00
Alex Vandiver 8089cb70dd sentry: Don't create spans for the longpoll or presence.
These will help Sentry skip span creation for these requests, which
are background events and not part of the pageload time.
2023-05-09 13:16:28 -07:00
Alex Vandiver 37c3cfb348 sentry: Do not start a navigation transaction on hash change. 2023-05-09 13:16:28 -07:00
Alex Vandiver 768ab19cd3 sentry: Do some basic URL client-side aggregation.
Doing client-side aggregation is better than letting Sentry try to
guess the grouping.  While ideally this would be generated from the
Django routes, automatically parsing those to generate a route map is
quite difficult.  We include basic numerical groupings, as well as the
few paths which have Confirmation objects.
2023-05-09 13:16:28 -07:00
Alex Vandiver bfdc057e3a sentry: Tag JS reports with the user's role.
User attributes are not indexed and searchable, unlike tags.
2023-05-09 13:16:28 -07:00
Alex Vandiver e2a6a0c440 sentry: Stop importing from `@sentry/tracing`, which is deprecated.
This was deprecated in 7.47.0[^1].

[^1]: https://github.com/getsentry/sentry-javascript/releases/tag/7.47.0
2023-05-09 13:16:28 -07:00