Commit Graph

4171 Commits

Author SHA1 Message Date
evykassirer cb3f22c30e drafts: Delete a draft if it is cleared from the compose box.
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.
2024-04-20 12:31:51 -07:00
sujal shah 01e898252b setting_ui: Fix sorting by "Invited by" column.
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".
2024-04-20 12:28:39 -07:00
Aman Agrawal 07699eb1d2 message_fetch: Allow updating fetch status without updating messages.
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`.
2024-04-20 08:49:54 -07:00
Aman Agrawal fb8a05a683 server_events: Rename home_view_loaded related variables.
Gave them a more general name which reflected what they were
really doing.
2024-04-20 08:49:54 -07:00
Aman Agrawal 6d7856fa37 message_list_data: Move comments to the type definitions. 2024-04-20 08:49:54 -07:00
Aman Agrawal ca0f79ce34 message_list_view: Restore date on previous sticky header.
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.
2024-04-18 11:52:59 -07:00
Lauryn Menard b71f4b9342 stream-settings: Remove unused tooltip for announcement stream.
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.
2024-04-18 08:52:53 -07:00
Pratik Chanda 3f1ffd0068 topic_list: Show topic row for empty conversations in left sidebar.
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.
2024-04-17 17:51:12 -07:00
Pratik Chanda e1a63d57a2 pm_list: Show DM row for empty conversations in left sidebar.
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.
2024-04-17 17:51:12 -07:00
Kislay Verma 245357c868 stream_settings_ui: Go to newly created stream.
- 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.
2024-04-17 15:35:19 -07:00
Kislay Verma a90f7cce6f settings: Add tooltip to clarify invalid Jitsi URL.
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>
2024-04-17 15:30:33 -07:00
Kislay Verma 5f35384c80 settings: Move init disable button function.
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>
2024-04-17 15:30:33 -07:00
Karl Stolley 1878f920a8 katex: Properly align timestamps with KaTeX-only messages. 2024-04-17 12:46:30 -07:00
Tim Abbott 62fb452e9c keyboard-shortcuts: Improve home view labels. 2024-04-17 12:42:21 -07:00
Tim Abbott 2c62152a8b left-sidebar: Rename "All direct messages" => "Direct message feed".
This aligns with the new naming scheme for other left sidebar
elements.
2024-04-17 12:42:21 -07:00
nimishmedatwal 1594011b67 left_sidebar: Rename All messages to Global Feed.
Fixes part of #27802.
2024-04-17 12:42:21 -07:00
nimishmedatwal 561cc9eab3 user_profile: Add focus to subscribe button.
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>
2024-04-17 11:52:57 -07:00
evykassirer 2b2c6d642b people: Remove redundant is_known_user function. 2024-04-17 10:45:14 -07:00
evykassirer f6b87cf0fb pill_typeahead: Convert module to typescript. 2024-04-17 10:45:14 -07:00
evykassirer 22aca110a5 typeahead: Fix typing for pill containers with multiple pill types.
`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.
2024-04-17 10:45:14 -07:00
evykassirer 45e9c046d8 pill_typeahead: Differentiate between pills with type attribute.
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.
2024-04-17 10:45:14 -07:00
evykassirer 67486a43b2 composebox_typeahead tests: Add some missing attributes to user objects.
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.
2024-04-17 10:45:14 -07:00
evykassirer 1d16fdd7b9 typeahead_helper: Add test for compare_by_pms for missing codecov. 2024-04-17 10:45:14 -07:00
evykassirer 6264bf3b76 typeahead_helper: Fix types for sort functions.
The call to `typeahead_helper.sort_recipients` in
`pill_typeahead` shows that these parameters are
optional.
2024-04-17 10:45:11 -07:00
evykassirer 4dfe60a6c5 typeahead_helper: Move two functions from composebox_typeahead. 2024-04-17 10:45:10 -07:00
N-Shar-ma f39b57dd04 typeahead: Sort emojis by categories initially.
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.
2024-04-17 10:13:23 -07:00
roanster007 68b4298d8e settings: Add option to disable seeing typing notifications.
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
2024-04-16 11:38:12 -07:00
roanster007 c7e2e048cb settings: Reorder starred_message_counts and fluid_layout_width.
This commit re orders the 'Use full width on wide screens' and
'Show counts for starred messages' settings of Preferences settings.
2024-04-16 11:33:25 -07:00
Mateusz Mandera 540d419ef7 events: Fix realm_upload_quota_mib value to be in MiB.
This was bytes until now.
2024-04-15 15:08:56 -07:00
Tim Abbott 3df46d542b Revert "message_reactions: Clean meassge reactions during initial processing."
This reverts commit c22a94dc89.

This broke live-update when adding new reactions.
2024-04-15 14:58:06 -07:00
N-Shar-ma 352e2ebc5a todo_widget: Move the `add-task-bar` from above to below the task list.
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.
2024-04-13 21:56:33 -07:00
N-Shar-ma d8a8364d1a todo_widget: Allow tasks to be added through `/todo` command.
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.
2024-04-13 21:56:33 -07:00
N-Shar-ma 6df3ad251a todo_widget: Allow task list title to be set and edited by author.
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.
2024-04-13 21:56:33 -07:00
N-Shar-ma 8c000f348a widgets: Make Zod schema for widget extra data stricter and extendable.
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.
2024-04-13 21:56:33 -07:00
Olivier FAURE 29e32c3977
keyboard ui: Add early-exit to click handlers with shift.
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.
2024-04-13 21:48:03 -07:00
Varun Singh ee232bba05 settings_linkifiers: Convert module to TypeScript. 2024-04-13 21:45:44 -07:00
Varun Singh bc530162ca state_data: Add 'realm_linkifiers' to type. 2024-04-13 21:45:44 -07:00
Aman Agrawal 42c5a04804 hello: Apply same link styles to all the screen descriptions. 2024-04-13 21:32:50 -07:00
N-Shar-ma e7a19aca75 emoji_picker: Search result emojis now named as the matching alias.
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".
2024-04-12 17:40:24 -07:00
Karl Stolley e43384bd90 markdown: Modernize presentation of spoiler headers. 2024-04-12 17:39:36 -07:00
Karl Stolley f2a1c96940 spoilers: Adjust HTML source order to match presentation. 2024-04-12 17:39:36 -07:00
Lauryn Menard a446033f32 filter: Use "channels" operator for the Filter class.
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.
2024-04-12 13:44:25 -07:00
Lauryn Menard 1e7c5b38f8 filter: Use "channel" operator for the Filter class.
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.
2024-04-12 13:44:25 -07:00
Lauryn Menard e3a521f4ba filter: Use canonical terms when updating Filter for message moves.
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.
2024-04-12 13:44:25 -07:00
Lauryn Menard 7761675497 tests: Update filter.test.js to use constants for message type.
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.
2024-04-12 13:44:25 -07:00
PieterCK 9b107e3ce1 integrations: Fix styling of unordered lists inside ordered lists.
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>
2024-04-12 13:30:33 -07:00
joaoafonso07 5eff81407c
invite: Fix scrolling to invitation success/error messages.
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.
2024-04-12 13:06:22 -07:00
Kenneth Rodrigues c22a94dc89 message_reactions: Clean meassge reactions during initial processing.
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.
2024-04-12 12:42:54 -07:00
Kislay Verma 505d66afeb user_invite: Convert invite modal to tabbed format.
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.
2024-04-12 08:23:00 -07:00
Jose Corte b41a116d42 onboarding: Fix formatting of registration page buttons.
This ensures that in the registration page the text does not overlap icons in any language.

Fixes #20563.
2024-04-12 08:15:24 -07:00
Aman Agrawal 402f589e76 user_topic_popover: Keep reference visible when popover is open.
In recent view and inbox view, we keep the topic visibility icon
visible when the topic visibility popover is visible.
2024-04-12 08:13:40 -07:00
Aman Agrawal 9a8ebf3a34 recent_view: Only normal show topic visibility indicator on focus.
This is now similar to how they behave in inbox view.
2024-04-12 08:13:40 -07:00
N-Shar-ma 633d814df9 upload: Rename variable `filename_url` to `syntax_to_insert`.
This variable holds the markdown syntax for a file that's to be inserted
into a message, hence the new name.
2024-04-11 16:52:33 -07:00
N-Shar-ma 7b7c52b7c9 copy_and_paste: Fix bug where an unlabelled image could be pasted twice.
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.
2024-04-11 16:52:32 -07:00
N-Shar-ma 358bb6b342 message_view: For message sent by current user, always scroll into view.
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.
2024-04-11 16:39:58 -07:00
N-Shar-ma a7719184ad compose: Refactor code to combine 2 same if condition blocks into one.
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.
2024-04-11 16:34:33 -07:00
N-Shar-ma 94dc5723c6 compose: Scroll cursor at message's end into view when restoring draft.
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.
2024-04-11 16:34:33 -07:00
Sayam Samal 610f46d74e actions_popover: Rename "View message source".
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.
2024-04-11 15:57:24 -07:00
Sayam Samal 27c85af6d9 message_controls: Remove view message source icon.
With this commit, if a user cannot edit or move his own message,
we no longer show the view message source icon.
2024-04-11 15:57:24 -07:00
Sayam Samal 7744c8b264 actions_popover: Fix content overflowing when the max-width is defined.
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).
2024-04-11 15:57:24 -07:00
Sayam Samal f9ec17e78e popovers: Fix styling for multi-line menu options. 2024-04-11 15:57:24 -07:00
Sayam Samal 678a3eccab popovers: Fix width discrepancies in popover menus.
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.
2024-04-11 15:57:24 -07:00
Sayam Samal ba64900373 popovers: Simplify popover menu top and bottom padding. 2024-04-11 15:57:24 -07:00
Sayam Samal f5bedd9501 hotkeys: Show Level 2 Shift key symbol for Shift key in popovers. 2024-04-11 15:57:24 -07:00
Sayam Samal 4105a38c1f popovers: Add minimum width to popover hotkey hints. 2024-04-11 15:57:24 -07:00
Sayam Samal dcb6252e57 popovers: Update popover hotkey hint colors. 2024-04-11 15:57:24 -07:00
Sayam Samal 19077fa1f6 actions_popover: Update icons for message actions menu options. 2024-04-11 15:57:24 -07:00
Sayam Samal 299aa7c39f popovers: Add hotkey hints support via a new handlebar template. 2024-04-11 15:57:24 -07:00
Sayam Samal 36e709c934 hotkeys: Rename adjust_mac_tooltip_keys to adjust_mac_hotkeys. 2024-04-11 15:57:24 -07:00
Sayam Samal 4b0e6ae3d8 actions_popover: Use the new "popover-menu" theme.
Fixes part of #28699.
2024-04-11 15:57:24 -07:00
Sayam Samal 422230e82d popovers: Add consistent tippy arrows which support all placements.
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.
2024-04-11 15:57:24 -07:00
Sayam Samal 6bf9c2bdfc popovers: Rename "navbar-dropdown-menu" theme to "popover-menu" theme.
Also renames the navbar dropdown related CSS terms, to their equivalent
popover related terms to accompany the name change of the theme.
2024-04-11 15:57:24 -07:00
Shubham Padia c44450c054
settings_users: Reverse order of roles in role filters.
Fixes #29687.
2024-04-11 15:35:01 -07:00
tnmkr 536f2e09e2 invite_user_modal: Always show scrollbar.
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.
2024-04-11 14:41:38 -07:00
roanster007 0be93b8519 stream_settings: Fix error on stream setting update when compose closed.
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.
2024-04-11 11:28:55 -07:00
Karl Stolley 7291f0a919 info_density: Set font size, line height vars in dev. 2024-04-11 10:25:03 -07:00
Varun Singh 9ad7a9f0be data: Restrict parameter type to not be undefined.
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.
2024-04-11 10:08:45 -07:00
Varun Singh 9b9ea01dfa channel: Use TypeScript unions for 'AjaxRequestHandler'.
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
2024-04-11 10:08:45 -07:00
Varun Singh b6473deca0 zod: Consistently use named imports. 2024-04-11 09:47:28 -07:00
Varun Singh 4985363bd7 poll_widget: Rename type to be more relevant. 2024-04-11 09:47:28 -07:00
Varun Singh 2d4bed4ab4 state_data: Fix alphabetical order. 2024-04-11 09:47:28 -07:00
evykassirer a8d261a68f dropdown_widget: Fix DropdownWidgetOptions.
Addresses this comment
https://github.com/zulip/zulip/pull/29611/files#r1559751399
2024-04-11 09:32:19 -07:00
Shubham Padia 3f6ceba39a settings_users: Add role filter to user list.
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`.
2024-04-10 13:45:06 -07:00
Mahhheshh 68646cacfc message_edit_history: Add loading spinner.
Adds a loading spinner to the message history overlay,
improving the user experience by providing visual feedback while the
message edit history is loading.
2024-04-10 13:10:12 -07:00
evykassirer 16bf8d3df6 views_util: Convert module to typescript. 2024-04-10 12:19:52 -07:00
evykassirer 9366d42f14 dropdown_widget: Pass current value to get_options to avoid hacky this. 2024-04-10 12:19:52 -07:00
evykassirer c449bb35e2 narrow_title: Fix filter type. 2024-04-10 12:19:52 -07:00
Mahhheshh 619f85fac7 message_edit_history: Set cursor to default on hover. 2024-04-10 11:25:31 -07:00
N-Shar-ma 30b68214d3 settings: Do not scroll to save button when typing in textarea / input.
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.
2024-04-10 11:18:17 -07:00
afeefuddin 61966e9d6e compose_tooltips: Convert module to TypeScript. 2024-04-10 11:17:20 -07:00
Lauryn Menard 39c5855b88 hash-util: Use NarrowTerm type from state_data.
Replaces the Term type in hash_util.ts with the NarrowTerm type
that is defined in state_data.
2024-04-10 11:15:27 -07:00
N-Shar-ma 7072794871 css: Make pills' content collapse according to width available.
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.
2024-04-05 09:14:37 -07:00
Aman Agrawal 4812c81968 click_handlers: Don't handle clicks with meta / ctrl keypress.
Fixes #17935

This allows users to ctrl + click a link to open it in new tab
without changing the state in the current tab.
2024-04-05 09:12:03 -07:00
Anders Kaseorg 64cabae46d web: Fix usage of .replace with variable replacement.
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>
2024-04-05 09:11:23 -07:00
evykassirer d6f4424102 compose_actions: Convert module to typescript. 2024-04-04 16:34:42 -07:00
evykassirer 55cf08c4e6 compose: Allow stream_id of ComposeTriggeredOptions to be undefined. 2024-04-04 16:34:42 -07:00
evykassirer 5e0343816f page_params: Add narrow_topic. 2024-04-04 16:34:42 -07:00
evykassirer 85c5fe635e compose_actions: Include message type in opts for `fill_in_opts_from_current_narrowed_view`. 2024-04-04 16:34:42 -07:00
evykassirer 9cea1c0ee1 compose_actions: Include message type in opts for `complete_starting_tasks`. 2024-04-04 16:34:42 -07:00
evykassirer 2014c25cb4 compose_actions: Include message type in opts for `start`. 2024-04-04 16:34:42 -07:00
evykassirer 3ea46542ce compose_actions: Include message type in same_recipient_as_before opts. 2024-04-04 16:34:42 -07:00
evykassirer 1f7e419cee compose_actions: Include message type in show_compose_box opts. 2024-04-04 16:34:41 -07:00
evykassirer 5934081801 resize: Let bottom_whitespace_height be optional.
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.
2024-04-04 16:34:41 -07:00
evykassirer d05c7a64c8 stream_data: Remove unused code branch. 2024-04-04 16:34:41 -07:00
Evy Kassirer 466560faa1
compose_actions: Fix automated scroll when resizing compose.
This code has been inoperative since 86073588be
upgraded the autosize library without migrating this event.
2024-04-04 16:33:05 -07:00
N-Shar-ma a3ed41efa0 typeahead: Redesign the function `compare_people_for_relevance`.
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.
2024-04-04 13:13:11 -07:00
N-Shar-ma a8954ad00e tests: Add missing setup to typeahead_helper tests passing as a fluke. 2024-04-04 13:13:11 -07:00
N-Shar-ma 7c2772022b typeahead: Add check for all time dm partners to `compare_by_pms`.
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.
2024-04-04 13:13:11 -07:00
Aman Agrawal 0a90a13bec popover_menus: Fix event handler trying to hide a hidden popover.
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.
2024-04-04 12:51:35 -07:00
Lauryn Menard 80d4a704fe mentions: Replace "channel" wildcard when selected via typeahead.
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".
2024-04-04 11:16:07 -07:00
Lauryn Menard e700e818e5 mentions: Add "channel" as a wildcard mention.
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".
2024-04-04 11:16:07 -07:00
afeefuddin b32c837c6b settings_playgrounds: Convert module to TypeScript. 2024-04-04 10:45:53 -07:00
afeefuddin 50f35a22b3 state_data: Update realm properties. 2024-04-04 10:45:53 -07:00
afeefuddin af0a31f0e4 bootstrap_typeahead: Make updater property optional in TypeaheadOptions. 2024-04-04 10:45:53 -07:00
Prathamesh Kurve f9bc21f4bf
keyboard ui: Fix vim keyboard navigation from inbox view filter.
Fixes #29509.
2024-04-04 10:17:09 -07:00
Anders Kaseorg b9e55f2c4d eslint: Enable no-jquery/no-append-html.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-04 10:11:57 -07:00
Anders Kaseorg 8fb1117cef eslint: Fix no-jquery/no-append-html errors that need test changes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-04 10:11:57 -07:00
Anders Kaseorg 382af5f79f eslint: Fix no-jquery/no-append-html errors that need no test changes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-04 10:11:57 -07:00
Alex Vandiver 01860422af util: Do not use look-behind in wildcard mention checks.
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.
2024-04-03 17:39:26 -07:00
Karl Stolley 6d5243148a timestamps: Calculate the maximum timestamp width in use.
Fixes: #26970
2024-04-03 17:38:43 -07:00
Karl Stolley 82d0eec0bc timestamps: Consolidate and simplify message-time properties.
This is better form, and also sets things up to render sample
timestamps for calculating their max width.
2024-04-03 17:38:43 -07:00
Karl Stolley 09d7105747 timestamps: Consolidate variable-based timestamp width. 2024-04-03 17:38:43 -07:00
Karl Stolley 1425d2f71f message_body: Hyphenate message-time class. 2024-04-03 17:38:43 -07:00
Karl Stolley c25975642a message_body: Remove status-time references.
The `.status-time` class was used only for setting a `top` value,
but that's made moot by the use of grid in the message area.
2024-04-03 17:38:43 -07:00
Anders Kaseorg 1e4427caf5 tests: Fix incorrect uses of .indexOf(…) > 0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-03 15:13:33 -07:00
Anders Kaseorg 1188a0f26d stream_settings_ui: Add missing $ prefix to jQuery object variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-03 14:10:21 -07:00
Anders Kaseorg 191345f9d6 ui_util: Fix HTML injection bug in replace_emoji_with_text.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-03 13:11:47 -07:00
Anders Kaseorg 4dc27216f4 rendered_markdown: Fix HTML injection bug in update_elements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-03 13:11:47 -07:00
Anders Kaseorg e1029b59ed copy_and_paste: Fix HTML injection bug in construct_copy_div.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-03 13:11:47 -07:00
Temidayo32 25ff0d4418 compose_recipient: Convert module to TypeScript. 2024-04-03 13:08:10 -07:00
Tim Abbott f16c32e3a4 compose_ui: Fix incorrect ComposePlaceholderOptions type.
When opening compose without a stream prefilled from say the inbox
view, stream_id will be undefined here.
2024-04-03 13:08:10 -07:00
Tim Abbott d5422fe7c8 compose_recipient: Simplify update_compose_for_message_type.
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).
2024-04-03 13:08:10 -07:00
Temidayo32 80a3cadf4e compose_recipient: Fix missing argument. 2024-04-03 13:08:10 -07:00
Lauryn Menard 48a486a584 people: Update get_mention_syntax to better account for wildcards.
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).
2024-04-03 12:19:27 -07:00
Pratik 6b31823c23 right_sidebar: Update invite modal label.
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.
2024-04-03 11:45:33 -07:00
roanster007 acc7444575 organization-permissions: Add help page link for User Identity section.
This commit adds the /help link to the User Identity section heading
of the Organization Permissions, linking to /help/restrict-name-and-
email-changes.
2024-04-03 11:01:52 -07:00
Anders Kaseorg 8f00ed4178 settings_components: Rename weirdly named type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-02 22:35:28 -07:00
Anders Kaseorg 919f24a60d state_data: Accept null for realm_*_limit_seconds fields.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-02 22:35:28 -07:00
evykassirer c083d7c126 compose_ui: Split ComposePlaceholderOptions by message type. 2024-04-02 17:26:12 -07:00
evykassirer 249a3935ac compose_ui: Add message_type to ComposeTriggeredOptions. 2024-04-02 17:26:12 -07:00
evykassirer 86979b98c7 compose_ui: Rename message type to have correct casing. 2024-04-02 17:26:12 -07:00
Sahil Batra e595b9d611 settings: Remove template for group creation modal.
We no longer use this file as we have removed the old groups
UI from "#settings" overlay and instead now use the new
"#groups" overlay UI.
2024-04-02 17:21:36 -07:00
roanster007 c7a08f3b77 settings: Add permission to enforce unique names in realm.
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.
2024-04-02 14:55:59 -07:00
afeefuddin a283a19c9f stream_color_events: Convert module to TypeScript. 2024-04-02 14:55:30 -07:00
Lauryn Menard 6f8d23b759 portico-styles: Updates some CSS rules used in the integrations docs.
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.
2024-04-02 09:30:48 -07:00
Aman Agrawal 329eda74a9 settings_overlay: Fix browser back not working as expected.
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.
2024-04-01 18:33:08 -07:00
afeefuddin fd970e0520 user_group_components: Convert module to TypeScript. 2024-04-01 17:32:48 -07:00
afeefuddin ab14b2e04a settings_components: Fix check_property_changed types.
The group/subscription parameters are optional, as they're only used
in those settings panes.
2024-04-01 17:32:48 -07:00
Kenneth Rodrigues faccfb9bdc organization settings: Add links to manage deactivated users.
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.
2024-04-01 15:43:16 -07:00
evykassirer bedbaa3a41 message_view_header: Convert module to typescript. 2024-04-01 13:22:39 -07:00