Commit Graph

4004 Commits

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