Commit Graph

2544 Commits

Author SHA1 Message Date
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