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>
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.
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
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.
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.
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.
This commit allow the users to modify notification settings for muted
streams through the 'notification' section located in the personal
settings.
Fixes#27272.
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'.
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.
- 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
Tippyjs is equipped to handle reference element moving from
its initial position so that the popover moves / changes
along with the reference / window size.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
`recent_view_focusable` class should be set on element whose
children can receive focus as per
`$topic_row.find(".recent_view_focusable").eq(col).children().trigger("focus")`
We should remove this overly defensive code and remove the `undefined`
type from the return type of this function to avoid handling unexpected
`undefined` values in the downstream code.
Now that the "new organization" form is quite tall, we were seeing
this autofocus logic causing the browser to automatically scroll to
the middle of the form (to reach the first editable input), which felt
like a pretty bad user experience.
This commit renames default_view and escape_navigates_to_default_view
settings to web_home_view and web_escape_navigates_to_home_view in
database and API to match with our recent renaming of user facing
strings related to this.
We also rename the variables, functions, comments in code and class
names and IDs for elements related to this.
The logic added in b57ebe717e introduced
a different bug, namely that if you had selected text in the input,
Backspace would delete the input pill itself, not your selected text.
Fix this, without re-introducing the old bug, by checking explicitly
if there's a range selected before inspecting anchorOffset.
Also improve the comments.
Fixes#19544.