We used to keep the draft, assuming that clearing the composebox
was an accident. Now we want to delete the draft, in preparation
for auto-restoring drafts when opening the composebox for narrows
with drafts associated with them. If a user opens the composebox
and sees a draft they don't want anymore, clearing the box is a
way we expect them to try to delete it.
Previously, the sorting was broken due to
incorrect referencing of the property.
The code has been updated to use the "referrer_name"
property instead of "ref".
It's possible that for a given narrow event if we didn't fetch any
messages in the `num_after` or `num_before` space, we could have
arrived at `newest` or `oldest` messaged based on the `anchor` used.
This fixes the bug where `fetch_status` for `found_newest` didn't
update to be `true` when using `newest` anchor and `num_after = 0`.
We forgot to restore the date on sticky header if the header
is no longer sticky.
Reproducer:
* Have two messages with same sender on different dates next to
each other in a stream narrow.
* Scroll so that sticky header is on the 2nd message.
* Scroll down fast so that to avoid us capturing the sticky header
over the first message.
* Scroll up slowly so to see the group header of the messages have
the date of the second message.
In commit 449febf036, the tooltip that provided information about
the announcement stream was replace with inline text on the form.
Removes the now unused template and code in stream_create for this
tooltip.
Earlier when a user narrowed to a new topic, there was no highlighted
topic row entry in the left sidebar under the respective stream.
This commit introduces the feature to show highlighted topic in the
left sidebar for a new topic thread. It checks if narrowed topic is
present in the list of topic names to add to it.
It disappears from the left sidebar when unnarrowed and the topic
contains no messages.
Fixes: zulip#22769.
Earlier when a user narrowed to a new pm conversation, there was no
highlighted DM row entry in the left sidebar.
This commit introduces the feature to show highlighted pm thread in
the left sidebar for a new conversation. It adds narrowed dm to the
recent messages list if not already present.
It disappears from the sidebar if no message was sent and unnarrowed
from the DM.
Fixes: zulip#22769.
- On creating a stream, the user is redirected to the
"stream events" topic of the newly created stream.
- If this is the first time the user has created a stream,
an explanatory modal is shown.
test_hotspots.py is modified to account for the new addition
of the first_stream_created_banner.
stream_create.test.ts is also modified accordingly.
Fixes#29375.
This commit adds a tooltip in organization settings,
when the save button is disabled due to invalid
Jitsi URL.
Fixes#27511.
Co-authored-by: Angelica Ferlin <angelica.ferlin@gmail.com>
Co-authored-by: Peterson Linn <linn@pajp.net>
Co-authored-by: Kislay Verma <kislayuv27@gmail.com>
This commit moves the function
initialize_disable_btn_hint_popover from
stream_ui_updates.js to settings_components.js
due to circular dependencies.
Added opts parameter to append to the options for
the tippy instance.
Fixes#27511.
Co-authored-by: Angelica Ferlin <angelica.ferlin@gmail.com>
Co-authored-by: Peterson Linn <linn@pajp.net>
Co-authored-by: Kislay Verma <kislayuv27@gmail.com>
Also reduces the number of focusable elements between the "streams"
heading and the stream picker.
Fixes#26690.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
`pill_typeahead`, and possibly other places, call `typeahead_source`
for what were typed as different pill widgets but is actually
all the same combined pill widget that has pills of users, user
groups, and streams. This commit fixes that typing issue in
preparaton for the upcoming conversion of `pill_typeahead` to
TypeScript.
The pill typeahead can have pills of three different types:
user, stream, and user_group. To be able to convert this
module to typescript, we need to add a `type` attribute
to differentiate between them.
This commit also adds a `user_or_mention` type to some
items in the composebox typeahead, because the composebox
typeahead shares some functions with the pill typeahead
and we need to be able to differentiate between the
pill types being passed there.
This doesn't fully add all missing attributes, but it adds ones that
will soon be needed in upcoming commits. Ideally eventually these
objects are full fake User objects with defaults for required
attributes.
For more consistency between the emoji picker and the typeahead, now the
initial emoji list is ordered by categories for the typeahead too.
Tachnically, this means that `emoji_picker.rebuild_catalog` now updates
the typeahead's emoji data with category wise sorted emojis. Compose box
typeahead initialisation does not update the emoji data anymore.
This commit adds an option to the advanced section of
Preferences settings, that would allow users to choose
whether to receive typing notifications from other
users.
Fixes#29642
When users needed to add a new task in the todo widget, they would type
it in the field at the top, but the task would be appended to the list,
showing up at the very bottom, which can seem unintuitive.
Now the `add-task-bar` is at the bottom of the list, so that when a new
task is added, it'll appear right where it was typed. The task field
would then shift lower.
Uptil now, users could add tasks to a todo widget only after creating
it through the `/todo` command in the compose box.
Users can now add an initial list of tasks using the `/todo` command,
with each task on a new line in the compose box, where the 1st `:`
would separate a task from its (optional) description. Example:
`/todo\nTask1:description1\nTask2 without description`.
Fixes part of #20213.
Users can now name task lists by providing the task list title in the
`/todo` command on the same line. Example: `/todo School Work`. If no
title is provided by the user, "Task list" (which is also the
placeholder) is used as default.
The author of a task list can later edit / update the task list title
in the todo widget, just like the question in the poll widget.
Fixes part of #20213.
The schema now ensures extra data is validated according to the widget
type. This also makes it easier to modify the extra data for any widget
or add new widget types in the future.
Shift-clicking a link on most browsers should open the link in a new window,
not navigate inside the current tab, just like ctrl-click opens in a new tab.
This fixes the bug where on hovering / selecting an emoji picker search
results emoji, invariably its canonical name would show / be used, which
is not always the same as the matching alias. For example, searching for
"swe" would show the "sweeping" emoji, but its canonical name is "broom"
which can be a confusing search result for "swe".
Update the Filter class to use "channels" as the canoncial operator
for public stream searches and web-public message fetch narrows,
but keep using "streams" for user-facing text and URLs.
When searching, "channels" does not create any suggestions until
a colon is added and then it shows suggestions with "streams". And
when a search string with channel as an operator is entered, then
it is replaced by "streams" as well.
Part of stream to channel rename project.
Update the Filter class to use "channel" as the canoncial operator
for streams, but keep using "stream" for user-facing text and URLs.
When searching, "channel" does not create any suggestions until
a colon is added and then it shows suggestions with "stream". And
when a search string with channel as an operator is entered, then
it is replaced by "stream" as well.
Part of stream to channel rename project.
Updates filter_with_new_params so that the terms used to update the
current narrow filter are the canonical version of the terms. This
assures that the adjustments we're making are correct.
Updates filter.test.js to use constants when checking the message
type ("stream" or "private") as this eliminates overlap with the
search/narrow operator "stream" and is useful prep for eventually
updating the frontend code to use "direct" as the message type
for direct mesages.
Part of stream to channel rename project.
This change allows different types of lists to
be rendered properly inside the {{start_tabs}} /
{{end_tabs}} block in markdown.
Fixes zulip#29669
Suggested-by: Lauryn Menard <github:laurynmm>
Change the way scrolling was implemented by scrolling to the success
message. Done this by calling the scrollIntoView() method with the
success message id, it scrolls the element with id into the visible
area of the browser window.
This way the confirmation banner becomes visible, scrolling the
invitation modal to the top when a user sends invites or generates an
invite link.
Previously, it did not scroll, as we were passing the id of the whole
dialog element to the get_scroll_element function.
Fixes#28906.
Clean reactions and set message_reactions in process_new_message.
Earlier, message_reactions was being set
after the predicate for the narrow was built,
as a result functions called while building the predicate
could not access it.
This commit converts the radio buttons (for
selecting email/link) to tab
components in the user invite modal.
The selected tab is in focus by default and arrow keys
can be used to toggle the selected tab.
Appropriate tooltips are shown when a tab is disabled.
Fixes#29392.
This commit removes the unnecessary condition for a linked image to have
a label when checking whether to skip an image preview if its generating
link has already been copied.
Now whenever the bottom of the feed is visible, we always scroll to the
message/s just sent by the current user, updating the selected message
if necessary.
Scroll behaviour for messages sent by other users remains unchanged.
Fixes: #23298.
The blocks were originally separated by some code for seemingly no
reason, so now the 2nd block is brought up and combined into the first.
An old irrelevant comment is also removed.
When a long message is restored from a draft (or scheduled messages),
its end, and the cursor placed there, used to be out of view, giving the
impression that the message was not focused, when it actually was.
This is fixed by always scrolling the cursor into view.
This commit renames "View message source" to "View original message".
The meaning of "original" in this context is very similar to what
source/source code means in software jargon, while being easier to
understand and translate for a non-tech savvy user.
The simplebar core documentation, recommends to not style the element
initalising the simplebar at all and use an inner element instead.
Following the recommendation, we move the max-width property from the
popover tippy options, to the `.simplebar-content` element via the
`--popover-menu-max-width` custom property.
While doing so, we also simplify the max-width to `350px`, since the
responsiveness for smaller screen is already been taked care of in the
shared popover styling.
This prevents the issue where the content overflows and gets hidden
instead of wrapping, when the width of the popover reaches the set
max width (if any).
Following ca9b1060b7, we allow the content of popover menu items to
control the width of the popover.
While using `white-space: nowrap` works, we should instead use the
`max-content` intrinsic sizing so that, if necessary, we can still
provide a `max-width` to the popover which would then force the popover
menu content to wrap.
Added `tippy.js/dist/border.css` along with some custom CSS override,
to add arrows which inherit the border color and width of the popover,
while also supporting all placements.
Also consolidates the CSS styling of the popovers to the `tippy-box`
element, which is the recommended way to theme the element according to
https://atomiks.github.io/tippyjs/v6/themes/#creating-a-theme.
This further helps in unifying the styling of the popover and the arrow,
and prevents inconsistencies such as shadow of the popover being casted
onto the arrows.
We now always show the scrollbar in invite modal body if it is scrollable.
This avoids confusion and makes it clear that some options are out of view.
Fixes#29393.
Previously, when stream settings were updated, without opening the
compose box, assertion error were thrown.
This error was a result of a regression in compose_recipient, due to an
extra assert statement added during its typescript migration in
25ff0d4418.
This is fixed by removing the statement.
Since the type of request_method(AjaxRequestHandler) has
been extended in the previous commit.Consequently the 'data'
field of 'request_method' has to be typed such that it
satisfies this change.
Because request_method's type can also be 'typeof patch' which
does not accept undefined 'data' field, I haved 'omit'-ted
'undefined' from 'data's type in function signature to satisfy
TypeScript.
Now ,in support of the changes I have made to two different function
sign(namely setting_ui.do_settings_change,dialog_widget.submit_api_request)
I am stating some points about data field inside these respective
function signs.
1.settings_ui.do_settings_change: For this 'data' was actually never
undefined. Each function call has a 'data' object passed( with one
or more fields).
2.dialog_widget.submit_api_request: For this case many function calls
actually didn't have 'data' field (ie.'data' was undefined).
BUT,for those cases it was defaulted to '{}'(see function sign).
So effectively 'request_method' didn't recieve an undefined 'data' for
this case too. I have removed the defaulting and passed '{}' in the
function calls for those cases, which effectively does the some job,
but satisfies the type.
For both these cases 'data' field isn't undefined and hence an Omit,for me
makes sense.
Type AjaxRequestHandler is used for typing request methods
(like channel.get, channel.post etc.)Use cases include
'request_method' parameter in settings_ui.do_settings_change
and dialog_widget.submit_api_request.
Problem with the type definition:
The current type definition( ie. 'typeof call' ) satisfies every
'request_method' type EXCEPT channel.patch request.One can notice
the difference b/w 'call' and 'patch' function in channel.ts .
Hence,We need to expand the AjaxRequestHandler type.I have unioned it
with 'typeof patch' is account for the case when 'request_method'parameter
is of type channel.patch.
Discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/setting_ui.20do_settings_change/near/1754557
Fixes#18617.
- The role filter is added to both active and deactivated user
list. The original plan was to introduce a multi select checkbox
dropdown for the roles, but since that component is not ready yet,
we will use the dropdown component for the first iteration.
- To accomodate multiple filters, we have used an approach
similar to the one in recent_view_ui.js where we use dropdown
callback function and on("input") event on text search to set the
filter value in memory. The predicate functions uses these filters.
- We have also changed the default message when there are no
users to show to reflect `filters` instead of `current filter`.
Adds a loading spinner to the message history overlay,
improving the user experience by providing visual feedback while the
message edit history is loading.
In an unsaved state, when focus is in a textarea or an input of type
text, we don't yet scroll the save button into view to not interrupt the
user's typing. When the input / textarea loses focus, we scroll then if
needed, triggered via the `change` event.
We set `min-width: 0` on all nested flex containers for pills, not just
the pills label, which allows the label content to collapse as much as
needed with ellipsis when overflowing.
Fixes: #27205.
String.prototype.replace and String.prototype.replaceAll interpret
certain sequences such as $$ within a string provided as the
replacement argument. Avoid this interpretation by providing a
function.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This aligns with the comment below of "Compute bottom_whitespace_height
if not provided by caller." I'd change this to do a check for if it's
undefined, instead of checking the type, but I don't understand
enough about `ResizeObserver` to feel confident that this would be
equivalent.
We make the following changes:
- Remove the dm partnership check before calling the comparator passed
by the caller, and instead have the more thorough `compare_by_pms` be
the final tie breaker. This deprioritization of dms fixes the bug where
dm partners would be prioritized even if they had not participated in
a stream conversation over recent senders who are not dm partners.
- Make the passed comparator optional, since the tie breaker is same as
the comparator that was passed so far for dms, and only pass it in case
of a stream conversation.
For the rare case where there is no recent recipient count for a pair of
users when sorting, we now check if either has been a dm conversation
partner ever before.
When user is trying to open a modal after clicking on a button
in a popover, we call popovers.hide_all() before opening the modal
which hides the popover but since the event handler call isn't
finished running yet, we call instance.hide() again resulting in
tippy throwing errors that this could be a memory leak.
We introduce a wrapper function for `instance.hide` which if
the popover/tooltip is visible before hiding it to fix it.
Until "stream" is renamed to "channel" in user facing strings,
when "channel" is selected from the composebox typeahead options,
the "stream" wildcard syntax will be inserted in the message
content instead.
Adds some helper functions to util.ts to initially be used to
check/convert "channel" to "stream" during the rename process,
with the intention of then converting those helpers for the
reverse (check/convert "stream" to "channel") in the final part
of the rename process.
Part of project to rename "stream" to "channel".
Adds "channel" to the `stream_wildcards` frozenset for stream
wildcard notifications on the backend/server.
Updates frontend/web-app to handle "channel" as the other stream
wildcards are handled in the typeahead and composebox modules.
Updates the API version and documentation for the addition of
"channel" as a wildcard mention. But does not change any of the
functionailty of (or deprecate) the "stream" wildcard at this
point.
Part of project to rename "stream" to "channel".
92fa9ee78c switched this regex to match the server-side regex, but
Safari < 16.4 does not support look-behind in regexes.
Switch to matching on start-of-string or a positive character class.
At least one of the callers already passes the field in the opts
parameter, and the other can easily include it in the object.
(It might have it already, but that'll be easily checked while
converting compose_actions).
In `composebox_typeahead`, it is completely possible to call
`people.get_mention_syntax` for a wildcard mention, which will not
have a `user_id`.
Updates `get_mention_syntax` to not raise a blueslip error if the
mention syntax is for a wildcard mention.
Adds "topic" to the array of possible wildcard mention strings.
Tightens the types for the parameters for `get_mention_syntax`, by
setting `user_id` to be number or undefined, and by setting `silent`
to default to false (which is expected in a number of modules where
this function is called).
This commit updates the user invitation terminology in the right
sidebar, user invitation modal, and settings, to clarify exactly what
sort of invitation this is.
Fixes#29582.
This commit adds the /help link to the User Identity section heading
of the Organization Permissions, linking to /help/restrict-name-and-
email-changes.
Previously, users were allowed to signup or change their names to
those which already existed in the realm.
This commit adds an Organization Permission, that shall enforce
users to use unique names while signing up or changing their
names. If a same or normalized full name is found in realm,
then a validation error is thrown.
Fixes#7830.
Removes the extra side margin on tip, warning and keyboard tips when
they are in ordered lists.
Removes the extra bottom margin for h3 elements in the integrations
docs.
Removes the unordered list style for the integrations docs.
Closing overlay before switching narrow takes sets the previous
hash of the new narrow incorrectly, which results in browser
back taking user the previous narrow instead of opening the overlay
again.
Fixed by switching narrow before closing the overlay.
Display manage this user in the three-dot menu on the user card
regardless of is_active.
Similarly, display edit user icon in deactivated users list.
Do not hide edit button when user is deactivated.
Fixes#29486.