Commit Graph

3297 Commits

Author SHA1 Message Date
N-Shar-ma 0003c3c1ef typeahead: Fix bug where typeahead showed momentarily on shift + tab.
Since the keyup event for keys including shift triggers the typeahead,
shift tabbing into the topic recipient field would show the typeahead
momentarily, which is distracting.

As we need typeahead to trigger on shift for certain use cases in the
compose box, but not in the topic recipient field, we now do not trigger
typeahead on shift keyup events in the topic recipient field.

Fixes: #24152.
2024-01-25 11:12:26 -08:00
N-Shar-ma e4258b56d5 hotkey: Introduce hotkey Alt+P to toggle preview for compose box.
On Mac, it's Option+P.

Fixes: #18471.
2024-01-25 10:51:25 -08:00
N-Shar-ma 972b4de7c4 hotkey: Correct Mac equivalent of Alt and handle exceptions separately.
Though the correct mapping for Alt in Mac is Option, we had so far been
mapping it to Command, since for the 2 pre-existing shortcuts that used
Alt, Command was the only key that worked on Mac. However, these are
exceptions.

Now we map Alt to Option, and handle the 2 exceptions separately, using
data attributes on those shortcut elements.

This is a prep commit for introducing a hotkey that uses Alt / Option.
2024-01-25 10:51:25 -08:00
N-Shar-ma 536ab78587 refactor: Extract new function `show_preview_area` for the compose box.
The code responsible for switching from edit mode to preview mode from
`compose_setup.js` is now extracted into a new function in `compose.js`,
to facilitate reuse.

This is a prep commit for introducing a hotkey to toggle between edit
and preview mode for the compose box.
2024-01-25 10:51:25 -08:00
Anders Kaseorg 118cfbea65 typeahead: Remove insecure default highlighter implementation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 17:46:56 -08:00
Anders Kaseorg 5348bee0eb settings_playgrounds: Fix HTML injection in language typeahead.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 17:46:56 -08:00
evykassirer d7b02a699c pygments_data: Move data to typescript. 2024-01-24 17:06:03 -08:00
evykassirer bd6471f0e3 page_params: Add custom_profile_field_types. 2024-01-24 17:06:03 -08:00
evykassirer ebb1105e2f typeahead: Fix type of sorting_comparator. 2024-01-24 17:06:03 -08:00
Sahil Batra 866a610664 group_settings: Empty right panel based on the url hash.
This commit adds code to empty the right panel if hash is
changed to "#groups/your" or "#groups/all".
2024-01-24 14:01:47 -08:00
Sahil Batra a87de19aa7 groups_settings: Fix browser back button for groups overlay.
There is no problem in behavior of browser back button if we open
the group settings overlay using "#groups/your", "#groups/all" or
"#groups/new" url hash, but someone can directly go to a link with
"#groups" and in this case we want to fix the browser back button.

This commit replaces "#groups" entry with "#groups/your" which is the
default section opened, such that pressing back when on "#groups/your"
does not go to "#groups", which will then a form a cycle and instead
go back actually.
2024-01-24 14:01:47 -08:00
Sahil Batra 6e61077ab4 gear_menu: Open group settings overlay with "#groups/your" hash.
This commit fixes the bug in browser back button behavior when
opening the groups overlay from gear menu. The bug was caused
due to browser history containing both "#groups" and "#groups/your"
entries, which essentially resulted in a "#groups/your" -> "#groups"
-> "#groups/your" cycle and thus nothing happend on clicking
browser back button.

The case for a user manually typing "#groups" url would be handled
in next commit.
2024-01-24 14:01:47 -08:00
Sahil Batra baad78aafd groups_settings: Make "Cancel" button work in group creation form. 2024-01-24 14:01:47 -08:00
Pratik Chanda 8559032d3a help_menu: Fix help_menu message formatting overlay not opening.
This commit fixes the behaviour of message formatting overlay in
help menu not opening due to assertion error in rendered markdown
after changes from #28418.
2024-01-23 18:09:57 -08:00
Anders Kaseorg e9ea4280ab vdom: Fix types to avoid relying on unsound bivariance.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-23 12:13:41 -08:00
Aditya Kumar Kasaudhan 19f315cf4f settings: Rename 'display_settings' to 'preferences'.
Fixes part of #26874.
2024-01-23 10:11:44 -08:00
Aditya Kumar Kasaudhan 6cd165386a settings: Rename 'emoji-display-settings' to 'emoji-preferences'.
Fixes part of #26874.
2024-01-23 10:11:44 -08:00
Aditya Kumar Kasaudhan 61a10dfca0 settings: Rename 'display-settings' to 'preferences'.
This commit renames "display-settings-radio-choice-label" to "preferences-radio-choice-label".

Fixes part of #26874.
2024-01-23 10:11:44 -08:00
Lauryn Menard ccfcb34bea activity-css: Make activity charts header row sticky.
This will be applied to both the overall installation activity chart
as well as the associated remote, client, realm and user views.

Co-authored-by: Karl Stolley <karl@zulip.com>
2024-01-23 09:31:05 -08:00
Sahil Batra 9fa39ce71d stream_edit_subscribers: Remove unnecessary logging.
There is no need to log if the stream edit UI is not opened
when an event for updating subscribers list is received and
we should just return because this is not a bug.
We do the same in other places where we just return early
without logging because we do not need to make any updates.
2024-01-22 22:08:10 -08:00
Anders Kaseorg cacdae5a10 message_viewport: Remove needlessly complex make_dimen_wrapper.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-22 18:21:53 -08:00
Lalit 6f6795f607 ts: Migrate `message_viewport` to typescript.
Used function overloading for methods - `make_dimen_wrapper`
and `scrollTop`.
2024-01-22 16:29:23 -08:00
Lalit f2c700b6e1 message_viewport: Refactor `message_viewport_info` method.
Refactoring to avoid having an object of incomplete type i.e. `res`.
2024-01-22 16:29:23 -08:00
Lalit 82841a7b5f message_viewport: Remove unused parameter from `in_view` function. 2024-01-22 16:29:23 -08:00
Lalit d4a4e2df3a message_viewport: Modify parameters for dimension wrapper functions.
JQuery's `height` and `width` methods only takes one argument in case
we want to set height or width. The argument is of type `string` or
`number` or a function.

Refrence: https://api.jquery.com/height/#height-value.

Therefore, we can get rid of argument array and just accept a single
argument in the inner function in `make_dim_wrapper`.
2024-01-22 16:29:23 -08:00
Lalit 530f4fc763 message_viewport: Avoid having unbound methods.
Passing class methods such as `$.fn.height` as values is dangereous
because it removes type safety by failing to capture `this`.
eslint-rule: @typescript-eslint/unbound-method.

Hence, I fixed this rule by directly binding `$scroll_container`
to these methods before passing them as values to wrapper function.
2024-01-22 16:29:23 -08:00
Lalit 69294d5baf message_lists: Add type for `opts` parameter of `select_id` method. 2024-01-22 16:29:23 -08:00
ColeBurch 9917ffa220 settings: Rename four custom profile fields types.
This commit renames four custom profile fields types.

Fixes part of #28511.
2024-01-21 12:51:53 -08:00
Aman Agrawal abe6e5b807 personal_menu: Fix clicking on `Set status` not working.
Use `tabindex` instead of `href` to set focus on `a` tag.

Ideally, we should use `button` for these elements but since
we want to keep the pattern for these dropdowns same where some
`a` elements do have a valid `href`.
2024-01-21 12:06:53 -08:00
Varun Singh c0a0c0e834 scheduled_messages: Convert module to TypeScript. 2024-01-21 08:54:20 -08:00
Varun Singh ac42de07eb scheduled_messages_data: Convert object to Map. 2024-01-21 08:54:20 -08:00
Aditya Kumar Kasaudhan 80ea965408 settings: Rename display_settings_labels to preferences_settings_labels.
Fixes part of #26874.
2024-01-19 17:55:13 -08:00
evykassirer 1948cf15a4 rendered markdown: Assert data-user-group-id is always defined. 2024-01-19 17:54:07 -08:00
evykassirer 8473b9dd48 rendered_markdown: Throw error if stream_id_string is undefined. 2024-01-19 17:54:07 -08:00
evykassirer 1de36ec743 rendered_markdown: Convert module to typescript. 2024-01-19 17:54:07 -08:00
evykassirer 4c5f115a6e people: Remove string type for user_id.
Further discussion here:
https://github.com/zulip/zulip/pull/28418#discussion_r1442220867
2024-01-19 17:54:07 -08:00
evykassirer e4ba07dcf2 message_store: Only allow number for message_id. 2024-01-19 17:54:07 -08:00
evykassirer e986813943 emoji_picker: Don't allow toggling of user status emoji. 2024-01-19 17:54:06 -08:00
Tim Abbott e32468e97f compose: Simplify convert_mentions_to_silent_in_direct_messages.
The behavior to replace existing message content was leftover code
from a previous version of the mechanism, and not intended.
2024-01-19 14:56:55 -08:00
Tim Abbott ca591b49ca compose: Don't convert bot mentions to silent mentions.
This fixes an unintended consequence of the silent mention conversion
logic added in 4d1ade1f88, where bots
that looked for personal mentions would not process mentions in 1:1
DMs.
2024-01-19 14:56:55 -08:00
vighneshbhat9945 d9865e960d emoji_picker: Avoid exception in emoji_picker.
Added if-else condition to check whether the
'section_head_offsets[]' is empty or not.
If it is empty then 'currently_selected' is
coded as 'Popular' else it is assigned with
'section_head_offsets[0].section'.

Fixes #24776.
2024-01-19 11:17:09 -08:00
sayyedarib 9f509d4ab2 status_emoji_selector: Replace fa-smile with custom zulip-smile-icon.
Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
2024-01-19 09:48:02 -08:00
sayyedarib d41ee3d3d8 user_status: Fix alignment of select-emoji icon of user-status modal.
use flex display justify-content for vertical alignment
instead of using offsets like "top". for horizontal
alignment of smiley-icon use text-align center.

Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
2024-01-19 09:48:02 -08:00
Aman Agrawal a17f18f155 narrow: Fix message row partially visible on narrow.
This will prevent any message we want to select after narrowing
from being offscreen entirely or partially.

Steps to reproduce the bug:
* `./manage.py populate_db -n 3000 --max-topics=2`
* Narrow to a stream and scroll high up.
* Align two recipient bars together with nothing between them.
* Click on the first recipient bar after keeping the selected message
  on the second recipient bar.
* You will see that the selected message is not in view.
2024-01-19 09:36:19 -08:00
Aman Agrawal db10cca4a2 Revert "desktop_app: Close popover when clicking on "Plan management"."
This reverts commit 1f79e6294f.
No longer required after
70ba7cc042
2024-01-19 08:42:25 -08:00
Aman Agrawal febeeb5dac popover_menu: Fix popover not closed on clicking external links.
For example, gear menu was not closed after `Integrations` button
was clicked since we don't have an event handler which opens
`/integrations` in a new tab but we let the browser navigate user
to `/integrations` after clicking on `a href='/integrations'`.

There was no handler for hiding the popover after clicking on such
links, so this commit adds one.
2024-01-19 08:42:25 -08:00
Mateusz Mandera 1f79e6294f desktop_app: Close popover when clicking on "Plan management". 2024-01-18 15:57:51 -08:00
Aditya Kumar Kasaudhan 1ab4520c4e settings: Rename display-settings-form to preferences-settings-form.
Fixes part of #26874.
2024-01-18 13:39:57 -08:00
Shubham Padia afac26e3e9 refactor: Don't use today arg from render_now in timerender tests.
We cannot remove the today argument for render_now since it is being
used in one other place: timerender.update_timestamps .
2024-01-18 08:32:30 -08:00
Shubham Padia a43a898e12 refactor: Remove today arg from absolute_time.
The today argument was only used in tests and now we're using
MockDate to set the current date.
2024-01-18 08:32:30 -08:00