Commit Graph

2683 Commits

Author SHA1 Message Date
N-Shar-ma ed59316ff6 refactor: Rename `is_search` to `is_keyword_search` for clarity.
For more clarity, the 3 related functions `is_search` in `filter.js`,
`message_list.js` and `message_list_data.js` are all renamed to
`is_keyword_search`.
2023-11-13 08:09:03 -08:00
Sahil Batra d1113b5371 invite: Use ICU plural syntax for invite success message.
The message shown on successful invitation included "User(s)"
previously. This commit updates it to include "User" or "Users"
according to the number of users invited.
2023-11-13 08:07:12 -08:00
Aman Agrawal 060b94b71f inbox: Fix search icon position on narrow widths.
Due to filters dropdown's variable width, the search icon was
incorrectly positioned, we fix it by positioning it relative to
the filter dropdown.
2023-11-10 18:20:26 -08:00
Lalit b86022ea52 ts: Convert `activity.js` module to TypeScript. 2023-11-10 16:37:44 -08:00
BrandonAWong 6edf24b0f7 search: Remove "All messages" typeahead
Previously, the "All messages" typeahead would be shown whenever
the search bar had an empty input. This change removes that typeahead
completely in favor of using other filters such as -is:muted.

Fixes #27358

Co-authored-by: Heran Zhang & Wei-Cheng Sung
2023-11-10 16:27:32 -08:00
N-Shar-ma c3c72cda6d compose: Completely remove style elements when pasting HTML as markdown.
Turndown would strip `<style>` tags, but retain the content enclosed.
This resulted in unwanted content being pasted, like the comment nodes
inside the `<style>` tag when pasting cell/s copied from Google Sheets.
2023-11-10 13:56:51 -08:00
N-Shar-ma e15f518ccc compose: Always retain `ul` tag when pasting content enclosed by it.
This functionally makes no difference, but we add it along with `ol`
for consistency.
2023-11-10 13:56:51 -08:00
N-Shar-ma db9ac4b674 commit: Disable automatic numbering / bulleting when inside code block. 2023-11-10 13:56:51 -08:00
N-Shar-ma 602d1d7323 compose: Do not paste formatted markdown when inside a code block.
We usually default to pasting formatted markdown (unless the Shift key
is used to paste plainly instead), but when we're inside a code block,
we always want to paste plainly.
2023-11-10 13:56:51 -08:00
N-Shar-ma f5bcf5d608 compose: Add a function checking whether the cursor is in a code block.
This is a prep commit for the following 2 commits, so we can opt out of
the formatted paste and automatic bulleting / numbering behaviors when
inside a code block.
2023-11-10 13:56:51 -08:00
Prakhar Pratyush 2f469ff830 hotkey: Give feedback when no unreads left in followed topics.
When navigating to the next unread followed topic using
the Shift+N hotkey, we notify the user when there are no more
unread messages in followed topics.

Earlier, the hotkey simply did nothing in such a case.

We use feedback_widget to do so.

Fixes #27604.
2023-11-10 13:33:13 -08:00
Joelute 4d1ade1f88 compose: Automatically change @ mentions to silent mentions in 1:1 DMs.
It is common for users in other chat tools to start off a direct message
with @ mentioning the addressee. However, this results in potentially
unexpected behavior in Zulip, where the message is highlighted and shows
up in @ mentions in addition to DMs. We want to prevent this behaviour by
automatically changing the @ mentions to silent @ mentions for the user.
These changes only apply to 1:1 DMs and not group chats.

Fixes: #17998.
2023-11-10 12:59:44 -08:00
Prakhar Pratyush c597de6a1d topic_mentions: Rename wildcard_mentioned to stream_wildcard_mentioned.
Rename the existing 'wildcard_mentioned' flag to
'stream_wildcard_mentioned'.

The 'wildcard_mentioned' flag is deprecated and exists for
backwards compatibility.

We have two separate flags for stream and topic wildcard mentions,
i.e., 'stream_wildcard_mentioned' and 'topic_wildcard_mentioned',
respectively.

* stream wildcard mentions: `@all`, `@everyone`, and `@stream`
* topic wildcard mentions: `@topic`

The `wildcard_mentioned` flag is included in the events and
API response if either `stream_wildcard_mentioned` or
`topic_wildcard_mentioned` is set.
2023-11-10 11:06:26 -08:00
Aman Agrawal a7f02c89d7 inbox_view: Move filters dropdown to the left of search box. 2023-11-10 10:22:18 -08:00
Aman Agrawal 69d59acc5a inbox: Focus currently selected option in dropdown. 2023-11-10 10:22:18 -08:00
Aman Agrawal f191efce1b inbox: Add dropdown to filter topics.
Fixes #27522

Replace `Include muted` checkbox with a dropdown to filter displayed
topics.

Also, adds a new filter to display only followed topics.
2023-11-10 10:22:18 -08:00
Aman Agrawal 03dcb9c0e4 dropdown_widget: Add option to hide search box. 2023-11-10 10:22:18 -08:00
Karl Stolley 2557f90c01 left_sidebar: Set extra-long hover delay for Views, DMs tooltips. 2023-11-10 09:22:07 -08:00
Karl Stolley f3887f1fa7 left_sidebar: Add a Views expand/collapse tooltip. 2023-11-10 09:22:07 -08:00
Karl Stolley f8ce278e76 left_sidebar: Include DM expand/collapse tooltip on arrow. 2023-11-10 09:22:07 -08:00
Karl Stolley 5f1c9ca107 left_sidebar: Center Streams tooltip over heading text. 2023-11-10 09:22:07 -08:00
Akarsh Jain d8d70d9e43 compose_banner: Display time for messages with < 5 mins scheduled time.
This commit addresses the issue where scheduling a message for a
time less than 5 minutes in the future resulted in the confirmation
banner not displaying the scheduled time, which should have actually
been 5 minutes in the future, as enforced at the UI level by the
MINIMUM_SCHEDULED_MESSAGE_DELAY_SECONDS variable.

We remove the `is_send_later_timestamp_missing_or_expired` method along
with it's tests since `selected_send_later_timestamp` is already set to
the minimum of 5 minutes in the future through the `minDate` option of
the flatpickr.

Fixes: #26784.

Co-authored-by: Sayam Samal <samal.sayam@gmail.com>
2023-11-10 09:20:15 -08:00
Karl Stolley f2e8d2dc07 left_sidebar: Set border radius on rows for all states. 2023-11-09 17:39:26 -08:00
Karl Stolley 34475bf867 left_sidebar: Establish filter-handling grid on Streams, DM headers.
Fixes part of #27559.
2023-11-09 17:39:26 -08:00
Karl Stolley 2235413c15 left_sidebar: Establish grid on Direct Messages header. 2023-11-09 17:39:26 -08:00
Karl Stolley 12bf754a8a left_sidebar: Consolidate left-sidebar-title styles. 2023-11-09 17:39:26 -08:00
Karl Stolley 3f36c52f41 sidebars: Structurally separate left- and right-sidebar headings. 2023-11-09 17:39:26 -08:00
Karl Stolley ee32654723 sidebars: Express heading colors as CSS variables. 2023-11-09 17:39:26 -08:00
Aman Agrawal df703f847c billing: Fix free trial billing page end plan button not working. 2023-11-10 05:17:52 +05:30
Aman Agrawal bb557d5193 billing: Add different modals for increasing / decreasing licenses. 2023-11-10 05:17:52 +05:30
Aman Agrawal 3d45e7ca64 billing: Make plan cancel/renew work. 2023-11-10 05:17:52 +05:30
Aman Agrawal e185e91581 billing: Redirect to stripe card change page on clicking change card. 2023-11-10 05:17:52 +05:30
Aman Agrawal 8c4ef3e9aa billing: Temporarily remove tests.
These seem important to have but will have to be rewritten.
2023-11-10 05:17:52 +05:30
Aman Agrawal cce5666e5d billing: Make changing current and next cycle licenses work. 2023-11-10 05:17:52 +05:30
Aman Agrawal 9d7e10950f billing: Fix style of cancel button and adjust app margins. 2023-11-10 05:17:52 +05:30
Aman Agrawal d79b59d3b1 billing: Make payment method look nice. 2023-11-10 05:17:52 +05:30
Aman Agrawal f9aba9ba33 billing: Make license count management buttons look nicer. 2023-11-10 05:17:52 +05:30
Aman Agrawal a75afe1462 bililng: Style similar to sponsorship page. 2023-11-10 05:17:52 +05:30
Aman Agrawal a4425d26d2 billing: Add plan change buttons, modals and notices. 2023-11-10 05:17:52 +05:30
Aman Agrawal 2f532e49d1 billing: Add field to show billing frequency. 2023-11-10 05:17:52 +05:30
Aman Agrawal c41a8317cf billing: Convert plan name to new style. 2023-11-10 05:17:52 +05:30
Aman Agrawal b5b7fc9957 billing: Use navbar used in login/help pages. 2023-11-10 05:17:52 +05:30
Aman Agrawal 757675db80 rows: Use message under / next to sticky header for narrowing / info.
Fixes #27489

For sticky message headers, we should not use the `first_message_in_group`
for narrowing to the topic since can be out of view for the user.
2023-11-09 10:04:58 -08:00
Anders Kaseorg 9b83dc1b79 stylelint: Fix declaration-block-no-redundant-longhand-properties.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-08 16:11:15 -08:00
roanster007 273081d0a6 lightbox_view: Fix media title update on change in title.
Presently in a session when an image or video title is updated,
the same change is not reflected in the lightbox view of
them, until a new session is made.

This is because the metadata of the media is stored in Map
for the session with the preview_src as keys, and hence,
when title is changed the preview_src being same, the title
change is not reflected inside lightbox view.

This is fixed by modifing the asset_map (cache map) keys
from preview_src to an array of preview_src, and the media
title. Hence, when title is modified now, the keys won't map
to the existing value, and hence new metadata would be
shown.
A new function get_asset_map_key_for_media() introduced
to get the corresponing metadata from this asset_map
by passing in the prview_src and media elements.

Fixes #21311
2023-11-08 14:10:51 -08:00
Karl Stolley e8fe6f873e left_sidebar: Register mark-all-read handlers on all home views. 2023-11-08 14:04:58 -08:00
Aman Agrawal f6516cba89 personal_menu: Add opacity hover effect on clear status button. 2023-11-08 10:19:24 -08:00
Aman Agrawal 66276d88ef personal_menu: Add different colors for status text. 2023-11-08 10:19:24 -08:00
N-Shar-ma eca6738b00 compose: Always retain link formatting when pasting just a link.
We add anchors to the list of enclosing elements we don't strip away.
2023-11-08 09:51:33 -08:00
evykassirer c3bee2038a message edit: Use a default error message for failed edits.
Bug reported here:
https://chat.zulip.org/#narrow/stream/464-kandra-js-errors/topic/Error.3A.20The.20partial.20.40partial-block.20could.20not.20be.20found/near/1673466

The reported issue was for a message edit request, and it was
happening because `channel.xhr_error_message` can return the
empty string sometimes, and `render_compose_banner` shows the
banner text if it exists and otherwise tries to render a
`@partial-block`. Unfortunately the empty string acts as falsy
in the template, leading to the partial block error.

This commit adds a default error message that was removed
in 96680e95fb.

It also adds a check to not show an error banner at all if
`readyState` is 0, which means the request was cancelled.
2023-11-08 09:47:32 -08:00
Aman Agrawal 3a7ce432e5 popovers: Fix topic visibility popover in sticky header not working.
The popover didn't open since sticky_header is part of message feed
and we were hiding popovers if `elements_at_reference_position`
had `sticky_header`. Now, we just don't do that check if the
reference is part of sticky_header.
2023-11-08 09:17:25 -08:00
ecxtacy f2deb8da46 settings-ui: Change `<select>` style using custom chevron-down icon.
Align the `dropdown-widget` and `<select>` UIs.
Removed default `<select>` tag styles with `appearance: none` css.
Added custom chevron-down icon with `background-image` attribute
to the `<select>` tag.

The svg icon is used in a CSS variable with a data URI.
The CSS variable is used to set different colors for dark and light
theme.

Tweaked by tabbott to scope selectors appropriately and also delete a
10px font-size in one settings dropdown widget.

Fixes #26859.
2023-11-07 16:55:34 -08:00
ecxtacy 0c1f340934 settings-ui: Replace chevron-down fa-icon with svg icon.
Fixes part of #26859.
2023-11-07 16:55:34 -08:00
ecxtacy 952c5e1865 icons: Add chevron-down svg icon for dropdowns. 2023-11-07 16:55:34 -08:00
Pratik 137505e2ad settings_notifications: Enable muted stream notification settings.
This commit allow the users to modify notification settings for muted
streams through the 'notification' section located in the personal
settings.

Fixes #27272.
2023-11-07 13:46:19 -08:00
Aman Agrawal ebd0dcd5d2 actions_popover: Fix copy link not working on `enter` keypress. 2023-11-07 13:31:53 -08:00
Rahul 4dfb04d501 compose_ui: Use Intl.ListFormat rather than .join(", ").
This commit changes .join(",") to Int1.ListFormat.
This produces more accurate translations.

Refactor compose_ui.test to update the testcase for Alice and Bob.
The previous test case output of "Alice,Bob"  modify to "Alice and Bob"
to align with the behavior of Int1.ListFormat,
which joins lists using ',' & 'and'.
2023-11-07 13:18:57 -08:00
Joelute 76024e479d alerts: Fix improper copied tooltip location in About Zulip Modal.
Previously when a user tries to click on the clipboard to copy the merge
base version info, the copied tooltip would appear in the wrong location
where the Zulip version is instead. This is caused by both clipboard
icon using the same Clipboard instance where the success event would only
display the tooltip at the Zulip version. These changes fixes this and
allows the clipboards to be independent of each other.
2023-11-07 13:17:55 -08:00
David Rosa b5351285b6 help: Document "Jitsi server URL" setting.
- Updates "Start a call", documents the "Jitsi server URL" setting,
  and links to it in a (?) from the relevant admin UI.
- Fixes misplaced include block for opening the compose box.

Fixes #26907.
2023-11-07 13:09:52 -08:00
N-Shar-ma ff5e389e9b compose: Allow pasting plainly, when Shift is held down, for Firefox.
We introduce a state variable `shift_pressed` for the purpose of
detecting whether the Shift key is pressed when pasting content. Only if
it is not, do we proceed with the default formatted paste behavior.

In Chrome, plain paste works out of the box for `Ctrl+Shift+V`, but in
Firefox, we need to handle it ourselves.
2023-11-07 11:39:06 -08:00
N-Shar-ma dac56b4d08 compose: Paste content into the compose box without adding any space.
We replace the call to `insert_syntax_and_focus` with a direct call to
`insert_and_scroll_into_view` when pasting content into the compose box,
which fixes the bug where leading and trailing spaces were added to any
pasted content.
2023-11-07 11:39:06 -08:00
N-Shar-ma 24e8119350 compose: Always retain `ol` tag when pasting content enclosed by it. 2023-11-07 11:39:06 -08:00
Aman Agrawal 25877114cf popover_menus: Move popoover to top if focused on text field.
Fixes #11448

Tested on Chrome, Firefox (iOS, Android) and Safari (iOS).
2023-11-07 11:31:10 -08:00
Aman Agrawal 75960bba16 emoji_picker: Don't autofocus search input on mobile.
Since focus on input elements on mobile opens keyboard which
changes window height, emoji popover can hide or scroll out of
view. To fix it, we don't focus on search input unless user
wants to when emoji popover is open.
2023-11-07 11:31:10 -08:00
Aman Agrawal 6e9da8ab2a popover_menus: Only take special care of references in message feed.
If the popover reference is in an overlay, the below check:
```js
elements_at_reference_position.some(
    (element) =>
        element.id === "navbar-fixed-container" ||
        element.id === "compose-content" ||
        element.classList.contains("sticky_header"),
)
```
would make the popover not appear if the reference was above them.

To make things simpler for us to check, we only handle popover
references inside message list which we know for sure will
always be below the elements checked above in stacking context.

Hiding popovers for other view is done good enough by
`data-reference-hidden` check that we don't need to manually
handle them.
2023-11-07 09:23:48 -08:00
Aman Agrawal a4b4b0ad38 popover_menus: Fix popovers not shown if reference is beside compose.
Since `#compose` occupies full width of the window, it is a
part of `elements_at_reference_position` if the reference is
under it.

Since `#compose-content` only occupies the part of window where
compose box is actually visible, we use it decide if the
popover should be hidden.
2023-11-07 09:23:48 -08:00
evykassirer 8cf436370c stream search: Always close search on Escape.
Fixes #27491.
2023-11-06 15:10:23 -08:00
evykassirer b51da3bb9a hotkey: Close text fields before closing sidebar.
Before this change, we'd try to close the sidebar before
closing text fields. This means if the user sidebar was
open with a text search in progress, pressing Escape
would close the full sidebar instead of closing search.

This change deprioritizes closing the sidebar, in favor
of closing input fields like search.

This also helps with #26717, because the sidebar seems to
be marked as open even when it's not an overlay, which
means pressing Escape will first "close" it (no visual
changes), before a second Escape would trigger closing
the search field. Ideally we differentiate between
situations where we are showing the sidebar as an
overlay and when we aren't, but that might be a more
involved change.
2023-11-06 15:10:23 -08:00
evykassirer ac0e03fe89 user search: Always close widget on escape instead of clearing first.
Fixes part of #27491
2023-11-06 15:10:23 -08:00
evykassirer a764a3e66f more topics: Escape clears input when input is focused.
Fixes part of #27491

We don't immediatley remove the input box, because there's
no existing UI for reopening the input box. (The input box
is always visible when the more topics view is visible.)

This commit makes the change of blurring and clearing the
input, instead of only blurring.
2023-11-06 15:10:23 -08:00
Aman Agrawal 1c03d5e5ce gear_menu: Don't show sponsorship link for orgs on paid plan. 2023-11-06 14:55:14 -08:00
Aman Agrawal 48c907e1a2 gear_menu: Show Zulip Cloud Plus for orgs on that plan.
Fixes #27525
2023-11-06 14:55:14 -08:00
Aman Agrawal e8c70a71d9 gear_menu: Show options based on sponsorship status.
Includes some additional tweaks for when to show various
billing related options.

Fixes #27524
2023-11-06 14:55:14 -08:00
Aman Agrawal 4fef63de52 sponsorship: Show error message for the field under the field. 2023-11-06 14:55:14 -08:00
Aman Agrawal b5fd5f2f5e sponsorship: Minor changes.
Wrap sponsored / sponsorship pending message in a white box.
Remove green heart.
2023-11-06 14:55:14 -08:00
Aman Agrawal ff5e1c3aee sponsorsihp: Make submitting the form work.
Includes various changes to make submitting the sponsorship form work.
2023-11-06 14:55:14 -08:00
Aman Agrawal 2466101fe1 sponsorship: Set width of elements like on support page. 2023-11-06 14:55:14 -08:00
Aman Agrawal 349f6f8ab8 sponsorship: Use new style for existing input fields. 2023-11-06 14:55:14 -08:00
Aman Agrawal 00df9c6c18 urls: Show sponsorship page on a new URL.
Fixes #27377

Replaced #sponsorship links with sponsorship/ links and in other
places liking gear menu.
2023-11-06 14:55:14 -08:00
Aman Agrawal 3ba0fe4349 sponsorship: Remove from billing and upgrade pages. 2023-11-06 14:55:14 -08:00
Aman Agrawal 48d0bedda9 left_sidebar_popovers: Show sidebar icon when visible.
Fixes #27508

Show sidebar icon when sidebar popover is visible so that
it tells users for which row popover is visible and also helps
tippy track when the reference of the popover so that it
can apply [data-reference-hidden] property appropriately.
2023-11-06 14:20:48 -08:00
Aman Agrawal 1a1c5863e4 ui_util: Import entire ui_util module. 2023-11-06 14:20:48 -08:00
Aman Agrawal 6dc17fab57 stream_popover: Extract functions to show sidebar menu icon. 2023-11-06 14:20:48 -08:00
Aman Agrawal eaf69dc9d5 left_sidebar: Employ existing left_sidebar_menu_icon_visible.
Seems like `left_sidebar_menu_icon_visible` had a regression where
its CSS was removed.

We use it show stream row icon when stream popover is visible.
2023-11-06 14:20:48 -08:00
Prakhar Pratyush 5697084832 css: Improve the css of popover used to change visibility policy.
This commit improves the CSS of popovers in the recipient bar,
recent conversations, and Inbox, which are used to change the
visibility policy.
2023-11-06 10:16:53 -08:00
N-Shar-ma 3a8aac8c67 compose: Remove formatting enclosing entire selection when pasting.
If the selection copied, is entirely within a single element, like text
within a heading (like `h1`) we discard this outermost element and only
convert the inner HTML to markdown.

However, we retain `pre` so a code block within it stays as is and does
not change into inline code, losing all its linebreaks.
2023-11-06 09:07:50 -08:00
roanster007 cf4b46d6f7 compose: Fix re-upload of files when upload fails.
Previously, when uploading of a file fails, the same file
couldn't be re-uploaded again without re opening the
compose box. This is because, the default behaviour of
uppy is that it won't allow re-upload of same files.

This could be fixed by removing the uploaded file when
the upload-error event is invoked for it.

Fixes #27495
2023-11-06 08:53:56 -08:00
Karl Stolley a2ae715226 left_sidebar: Align no-alpha variable for light mode unreads. 2023-11-04 12:50:46 -07:00
Aman Agrawal ac8ad111de recent_view: Handle topics_widget being undefined.
update_load_more_banner can still be called from message_fetch
before topics_widget is defined.
2023-11-04 12:23:48 -07:00
Aman Agrawal 8ea49aa5b5 recent_view: Remove unnecessary call to update_load_more_banner.
Since we are already updating load more banner after each
render in ListWidget, we don't need to call it separately.
2023-11-04 12:23:48 -07:00
N-Shar-ma 5c73744aca compose: Fix bug where pasted content would only go to the compose box.
This commits ensures that we pass in the correct context (compose box
or a message being edited) when pasting content.
2023-11-03 14:49:58 -07:00
Aman Agrawal 826f25744d scroll_bar: Hook to window resize event instead of ResizeObserver.
ResizeObserver isn't supported for Safari iOS versions we support.

We support iOS Safari ≥ 12.2 but ResizeObserver support requires
iOS Safari >=13.4. So if they're on iOS Safari >= 12.2 and < 13.4,
it crashes.
2023-11-03 10:24:36 -07:00
Karl Stolley 322b06b364 left_sidebar: Ensure mark as read vdots follows home view.
Regardless of which home view a user selects, it will have a
hoverable vdots menu and the option to mark all as read.
2023-11-03 10:08:37 -07:00
Karl Stolley 2e4bd4639f left_sidebar: Update order and unreads when switching home views. 2023-11-03 10:08:37 -07:00
Karl Stolley 9226e8bdca left_sidebar: Use grid or flexbox to order selected home view. 2023-11-03 10:08:37 -07:00
Karl Stolley 5d2d8f9215 left_sidebar: Add logic and styles to show unreads on selected home view. 2023-11-03 10:08:37 -07:00
Karl Stolley 4759fc9f69 left_sidebar: Prepare home views with selection logic, unread counts. 2023-11-03 10:08:37 -07:00
Aman Agrawal 00d00036fe recent_view: Don't show load more banner until all rows are rendered.
Fixes #27365
2023-11-03 10:02:17 -07:00
Aman Agrawal 556b61d778 list_widget: Add method to check if all items are rendered. 2023-11-03 10:02:17 -07:00
Aman Agrawal 339f85c308 compose_tooltips: Don't show tooltip on focus.
Fixes #27383
2023-11-03 10:01:21 -07:00
Karl Stolley 14ef3a5464 left_sidebar: Display dark-mode condensed unreads without alpha. 2023-11-03 09:33:06 -07:00
Aman Agrawal 666ac2c445 user_card_popover: Fix reactivate user button not working.
Fixes #27459
2023-11-03 08:47:04 -07:00
Aman Agrawal c2d45e4cf7 emoji_picker: Stop propagating enter keypress to message.
Similar to emoji_picker.process_keypress, process_enter_while_filtering
should have a stopPropagation.
2023-11-03 08:46:15 -07:00
Aman Agrawal 8b5110d218 popover_menus: Hide popover for which the reference element is hidden. 2023-11-02 16:27:18 -07:00
Aman Agrawal c3eb17a411 popover_menus: Do early return if possible. 2023-11-02 16:27:18 -07:00
Aman Agrawal 434d156cbc personal_menu_popover: Don't make clear status tooltip interactive.
There is no need for that tooltip to be interactive.
2023-11-02 16:27:18 -07:00
Aman Agrawal bee8ce4e56 popover_menus: Don't hide on scroll / resize.
Tippyjs is equipped to handle reference element moving from
its initial position so that the popover moves / changes
along with the reference / window size.
2023-11-02 16:27:18 -07:00
Nehal Sharma d08d287431
compose: Disallow hotkeys when dropdowns (like stream pickers) are open.
When the focus is inside a dropdown, we do not consider any key strokes
to be hotkeys.  This prevents the user from accidentally triggering an
action while trying to type into the dropdown search / filter.

This aims to fix the bug where on pressing a character key that is also
a hotkey, the hotkey action would be triggered, even if the focus was
inside the stream picker dropdown.

Fixes #27492.
2023-11-02 16:08:36 -07:00
Sayam Samal 0c04246723 stream_settings: Remove muted notice string for muted streams.
The muted notice string "Muted streams don't show up in "All messages"
or generate notifications unless you are mentioned." doesn't properly
explain the behavior of muted streams.

A user can still get notifications for muted streams if they follow a
topic in the stream. This is because the followed topics global
settings will override the stream notifications settings.

Fixes #27274.
2023-11-02 14:07:44 -07:00
Sayam Samal 67fd391e3d stream_settings: Add a `?` link to "/help/mute-a-stream".
Fixes part of #27274.
2023-11-02 14:07:44 -07:00
Sayam Samal 9f70c531a8 stream_settings: Move "Mute stream" to the top of Notification settings.
In this commit, we move the "Mute stream" option to the top of the
notification settings, since the action of muting a stream works
in conjunction with the other notification settings.

We also rename `is_notification_setting` to
`has_global_notification_setting` which better defines the purpose of
the function and now use `is_notification_setting` only to check which
options we need to show under the "Notification settings" section.

This allows us to accommodate the "Mute stream" option under the
"Notification settings" section without affecting the functionality of
the other notification options.

Fixes part of #27274.
2023-11-02 14:07:44 -07:00
Anders Kaseorg 2e3a8afe2a tests: Add missing $ prefix to jQuery object parameter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 14:06:04 -07:00
Anders Kaseorg b3fa7b15fc compose_state: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 14:06:04 -07:00
Anders Kaseorg d6be353299 compose_state: Make get_or_set accept a full selector.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 14:06:04 -07:00
Pratik daa34685c3 stream_edit: Enable notification settings for muted streams.
This commit allows the user to change notification settings even though
the stream is muted and adds a line of text in stream settings and
notification settings.

Fixes #27272.
2023-11-02 13:57:56 -07:00
N-Shar-ma a01d670fb2 turndown: Improve pasting experience, focused on pasting Zulip messages.
Turned off and tested escaping with `/` (for now).

Added support + tests for:
- headings.
- strikethrough.
- nested lists.
- code blocks.

Improved handling of:
- links (custom and raw, ignored when wrapping a single image).
- images (now pasted in Zulip's link like syntax).
- custom emojis.
- LaTeX (no garbage symbols, unformatted plain text is pasted)

Added tests for emojis.

Known concerns:
- External images aren't handled anymore by upload.js -- is this a bug?
- Tables lose their formatting on paste.
2023-11-02 13:52:30 -07:00
N-Shar-ma 7c10775e96 markdown: Add `zulip-code-block` class to code blocks.
We add this class to code blocks so that we can easily detect them in
`copy_and_paste.js` in the next commit.
2023-11-02 13:52:30 -07:00
evykassirer bbfe1c7e30 sidebar_ui: Move initializing functions to module file. 2023-11-02 12:23:25 -07:00
Karl Stolley c56bd24715 left_sidebar: Attach navigation Tippies to <li> elements.
This corrects a likely long-standing bug where nav tippies appear
over the navigation box. With the gridded DM rows having corrected
the placement of DM Tippies, this commit brings the nav Tippies in
league with those.
2023-11-02 09:56:29 -07:00
Karl Stolley 6784dee775 left_sidebar: Align 'more conversations' and 'back to streams'. 2023-11-02 09:56:29 -07:00
Karl Stolley 65ed4d0ac2 left_sidebar: Provide inline-grid layout for DM row status emoji. 2023-11-02 09:56:29 -07:00
Karl Stolley b50a09f99e left_sidebar: Set vertical alignment on 22px-tall DM row. 2023-11-02 09:56:29 -07:00
Karl Stolley 4e03209c76 left_sidebar: Establsh CSS Grid on DM rows. 2023-11-02 09:56:29 -07:00
Anders Kaseorg a0656a6c56 inbox_util: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 08:36:44 -07:00
Anders Kaseorg 9ed74cbfcd inbox_util: Remove unused get_dm_key function.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 08:36:44 -07:00
Anders Kaseorg 519a2af2a4 stream_color: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 08:36:44 -07:00
Anders Kaseorg 8208776b47 stream_color: Remove unused container argument to spectrum-colorpicker.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 08:36:44 -07:00
Anders Kaseorg 341ba92f23 stream_settings_api: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 08:36:44 -07:00
Anders Kaseorg 1c5321e57f stream_settings_api: Adjust set_stream_property usage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 08:36:44 -07:00
Sahil Batra bb15b2d708 users: Send "update" events when deactivating or reactivating users.
We now send "realm_user/update" (and "realm_bot/update" for bots)
events with "is_active" field when deactivating and reactivating
users, including bots.

We would want to use "remove" event for a user losing access
to another user for #10970, so it is better to use "update"
event for deactivation as we only update "is_active" field
in the user objects and the clients still have the data for
deactivated users.

Previously, we used to send "add" event for reactivation along
with complete user objects, but clients should have the data
for deactivated users as well, so an "update" event is enough
like we do when deactivating users.
2023-11-02 08:31:12 -07:00
Anders Kaseorg 5dc9b060d2 compose_pm_pill: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-01 21:39:05 -07:00
Anders Kaseorg b8acfe08a4 user_pill: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-01 21:39:05 -07:00
Prakhar Pratyush 8e2264b585 hotkey: Add 'narrow to next unread followed topic' hotkey.
This commit adds a 'Shift + N' keyboard shortcut, which is
used to narrow to the next unread followed topic.

Fixes part of #27323.
2023-11-01 17:37:41 -07:00
Lauryn Menard 784c599c7b integrations: Use stream ID for incoming webhook URL generated in modal.
Instead of using the stream name for the incoming webhook URL that is
generated in the web-app, we used the stream ID instead.

Also, limits the streams listed in the dropdown widget to streams that
the bot owner has permission to post in.
2023-11-01 16:15:23 -07:00
Aryan Bhokare 646128db9e
ts: Migrate ‘user_sort.js’ to TypeScript.
Also fixes a bug in the people.ts User; `delivery_email` is never undefined.
2023-11-01 11:19:30 -07:00
Sahil Batra c756259094 settings: Use server_supported_permission_settings in webapp.
Since we now get the configuration for group permission settings
from server, we can directly use that in webapp instead of
defining it again.
2023-11-01 10:42:56 -07:00
Alex Vandiver 9f0008372c message_fetch: opts.msg_list can be undefined.
See also 69e10b4dae.

Even though opts.msg_list can be undefined, we still want to retry
loading messages for it since our code needs that data regardless
of opts.msg_list being undefined.
2023-10-31 23:33:37 -07:00
Aman Agrawal cd48ee2152 recent_view: Fix error when user has no messages.
If the user has no messages, `message_list_data` can be empty,
so, in that case, we just use the current oldest_message_timestamp.

The bug can also be reproduced if the last 400 messages were
in a muted topic for the user and we process recent_view_message_list_data
before all messages data.

We still process the remaining logic in `set_oldest_message_date` to
update has_found_newest/oldest.
2023-10-31 22:34:11 -07:00
evykassirer 1f8db236f5 buddy list: Rename user_presences to buddy-list-users-matching-view.
This switches to our preferred dash-separated classnames
instead of underscore-separated, and also updates the
classname to be differentiable from users that aren't
part of the current narrow.

Until the next commit that splits the buddy list, the
name is a bit inaccurate since it still contains all
the users.
2023-10-31 16:06:07 -07:00
evykassirer beead8e614 lazy set: Increase code coverage.
This was pvreviously covered by tests for the buddy list.

We shouldn't rely on other code to complete code coverage
for this module. In the future it would be good to add
more tests to the lazy set tests to directly cover lazy
set functionality.
2023-10-31 16:06:07 -07:00
roanster007 e2a6d0f4b2 input_pill: Fix backspace behavior on selecting text from start.
This commit fixes the behavior of trying to remove the selected
text when selection is made from start in stream membership
input and compose box dm using backspace button.

Previously the selected text was not removed if no typeahead
was shown for the text and it instead removed the last pill.

Now we remove the selected text and not any input pills on
pressing the backspace button irrespective whether tyepeahead
is shown or not.

This commit updated the code to remove pill only when there is no
other text or when the pointer is at start of input but its selection
 length is 0, in the input and let it follow the default behavior in
cases when there is any text (other than user pills) in the input
to fix the bug.
2023-10-31 15:13:27 -07:00
N-Shar-ma ad26247247 compose: Add a placeholder "is …" for the `/me` slash command.
Fixes: #27399.
2023-10-31 12:32:03 -07:00
evykassirer 2f6d3605d9 recent view: Rename topic to conversation. 2023-10-31 10:28:55 -07:00
evykassirer 83e0f8bd33 recent view data: Rename get to get_topics. 2023-10-31 10:28:55 -07:00
evykassirer f786b10403 recent view: Import module instead of separate functions. 2023-10-31 10:28:55 -07:00
Anders Kaseorg 05d8a65f75 user_status: Remove useless number coercion for object keys.
There’s no such thing as a numeric object key in JavaScript.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-30 13:30:47 -07:00
Anders Kaseorg 9989365fe8 user_status: Use unknown, not object, for unvalidated type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-30 13:30:31 -07:00
Karl Stolley 3f5764e5ba navbar: Correct for alpha background on unread dot's border.
This is a case where the use of alpha channels in HSL color values
shows its limits.

The use of an alpha channel is necessary for the background
elements for the top navbar elements, because they sit over the
top of the navbar's bottom border (actually an inset shaddow).

However, it's impossible to use the alpha-channel based color on
elements like the unread dot, where the border actually sits on
top of the element itself--meaning that the effect would be a
larger dot with an imperceptibly darker ring around it.

What this commit does is use a technique suggested by Anders
Kaseorg for using CSS's `color-mix()` functional notation to
calculate an opaque version of the alpha color for use on
elements that do not or cannot directly take the color with
the alpha channel.

See CZO discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/alphas.20in.20color.20definitions/near/1670102
2023-10-30 11:25:12 -07:00
Lalit Kumar Singh dcf45da09c ts: Migrate `user_status` module to TypeScript.
Also removed an defensive if check from `emoji.ts` since it is not
needed now that we have `emoji.ts` converted to TypeScript.
2023-10-30 11:10:47 -07:00
Aman Agrawal e1960670ca hello: Make logos more visible in light theme. 2023-10-30 11:05:02 -07:00