Commit Graph

64925 Commits

Author SHA1 Message Date
Karl Stolley
2458f57547 lightbox: Use icons for control elements.
Fixes #33068.

Co-Authored-By: sammamama <samridhsame@gmail.com>
2025-05-30 14:50:45 -07:00
Aditya Kumar Kasaudhan
fbb0516385 compose: Keeps focus on channel picker input during navigation.
This commit ensures the hover state appears on the first list item in
the channel picker dropdown by default. It enables navigation through
the list using Up/Down arrows while keeping browser focus in the text
input. The Tab key now shifts focus to the topic input instead of the
next list item.

Fixes: #33448.
2025-05-30 13:31:37 -07:00
Aditya Kumar Kasaudhan
b79547d9e2 dropdown_widget: Add focus management options.
This commit add configuration options to improve dropdown behavior:
- `keep_focus_to_search`: Keeps focus in the search input during
navigation.
- `tab_moves_focus_to_target`: Moves focus to the target item on
Tab key press.
2025-05-30 13:31:37 -07:00
Aditya Kumar Kasaudhan
209a7023b2 dropdown_widget: Refactor, add utils for focus management.
This commit refactors dropdown_widget with a utility functions
to streamline focus management behavior and reduce code duplication.
2025-05-30 13:31:37 -07:00
Aditya Kumar Kasaudhan
9971b08cce dropdown_widget: Rename active class to current_user_setting.
This commit renames `active` to `current_user_setting` and
`is_item_selected` to `is_current_user_setting` to clarify
it’s the user’s current choice, not hover, and to prevent
future naming conflicts.
2025-05-30 13:31:37 -07:00
Karl Stolley
a59f730279 popovers: Correct logic for visible reaction icon. 2025-05-30 12:50:12 -07:00
Karl Stolley
133bc1e1b5 hotkey: Correct emoji_picker_reference logic. 2025-05-30 12:50:12 -07:00
Sahil Batra
d8ae21a4f4 folders: Don't allow archiving a folder if it contains channels. 2025-05-29 15:39:03 -07:00
Sahil Batra
677390d3f6 channel_folders: Add tests for case-insensitive duplicate name check.
This commit adds tests for checking the requirement of folder
names to be unique case insensitively.
2025-05-29 15:39:03 -07:00
Sahil Batra
88b47be938 channel_folders: Pass realm as argument to check_add_channel_folder.
Passing realm explicitly to check_add_channel_folder instead of
using realm field from acting_user seems much cleaner and readable.
2025-05-29 15:39:03 -07:00
Sahil Batra
ad9abb8e2d streams: Use "isinstance" instead of "is" for "Missing" check. 2025-05-29 15:39:03 -07:00
Niloth P
e826a232d3 integration-docs: Update Errbot for new doc format.
Part of zulip#29592.
2025-05-29 15:36:11 -07:00
Karl Stolley
f1a2921f41 copy_paste: Remove .copy-paste-text from document flow. 2025-05-29 13:36:02 -07:00
Prakhar Pratyush
b837c47ac3 hotkey: Support non-latin keyboard locales for shortcuts.
Earlier, keyboard shortcuts were not supported for non-latin
keyboard layouts.

This commit adds support for it.

Keyboard can be:
* configured to type latin text, with the QWERTY, AZERTY, etc layout.
* configured to type non-latin text.

For non-latin users, if a shortcut requires a key and it is not
present on the keyboard, they press the same physical key that a
QWERTY user would press.

Pressing QWERTY equivalent key is not a Zulip specific requirement,
non-latin users have confirmed in CZO that they use the same behaviour
on other applications.

Algorithm:
We need to determine the key combination pressed in a consistent way,
irrespective of the keyboard layout.

For keyboard layouts (e.g. QWERTY) where `event.key` results in
printable ASCII characters or named key attribute values like "Tab",
"Enter", etc., we use `event.key` directly to determine the key
combination.

For layouts where the character defined for a hotkey can't be typed
directly (e.g. 'a' in Cyrillic), users press the same physical key
combination that a QWERTY user would use (e.g. 'ф' on Cyrillic maps
to 'a' on QWERTY). In such cases, we derive the key combination
(QWERTY equivalent) using `event.code` and the `CODE_TO_QWERTY_CHAR`
map.

Here `event` is "keydown" event.

Once, the key combination is determined the action to perform is
executed.

Fixes: #19605.
2025-05-29 13:24:22 -07:00
Prakhar Pratyush
f506ccc5f4 hotkey: Fix Caps Lock incorrectly affecting Shift state in shortcuts.
Earlier, with Caps Lock enabled, pressing letters like 'a', 'i', etc
resulted in the keyboard shortcuts for 'Shift+A', 'Shift+I', etc
getting executed. Ideally, they should work only when 'Shift + Key'
is pressed.

We used to check capitalized letters, which can result either due
to `key` pressed with Caps Lock enabled or `Shift + key` pressed.

This commit fixes the bug by using the event modifiers states to
construct a fully descriptive string like 'Cmd+Ctrl+Alt+Shift+A',
and then look up that string in a single mapping for further execution.

We treat a-z letters case-insensitively. We distinguish between
'a' and 'A' as 'A' vs 'Shift+A'.

This descriptive string approach also resolves a bug where
`Ctrl + Meta + C/K/S/.` was working. We define the valid hotkey as
`Meta + C/K/S/.` for macOS and `Ctrl + C/K/S/.` for others.
2025-05-29 13:24:22 -07:00
Prakhar Pratyush
c2d0002b4f hotkey: Remove the usage of deprecated keypress event.
This commit removes the deprecated `keypress` event.

Now, we use the `keydown` event to handle all the cases.

Earlier, we used `keypress` because it allowed us to distinguish
between lowercase and uppercase characters using `event.which`.

For example:
* For 'r':
  * keypress.which = 114
  * keydown.which = 82
* For 'R':
  * keypress.which = 82
  * keydown.which = 82

As shown, `keydown.which` cannot distinguish between 'r' and 'R',
which is why `keypress` was helpful.

Now, modern browsers support `event.key` on `keydown`, which directly
gives 'r' or 'R' as needed. This makes `keypress` unnecessary, and
we can safely rely on `keydown` with `event.key` to get the exact
character.

An earlier commit in this PR #34570, in which we replaced
the `event.which` with `event.key` plays a major role as a prep
commit to help removing `keypress` event in this commit.
2025-05-29 13:24:22 -07:00
Prakhar Pratyush
ed87932c8a hotkey: Fix 'H' & 'N' being tested as unmapped keys.
Earlier, 'H' and 'N' were being tested as unmapped keys and the test
was falsely passing because these keys are handled by `process_keydown`
but the test was processing it with `process_keypress`.

This commit removes those keys from the test.

We already test them with keydown in other tests.
2025-05-29 13:24:22 -07:00
Prakhar Pratyush
e646c1bbec hotkey: Add tests for Shift + H hotkey.
Node tests for `Shift + H` hotkey was missing.
2025-05-29 13:24:22 -07:00
Prakhar Pratyush
075e398307 hotkey: Replace deprecated e.which with e.key.
The `keydown` and `keypress` event handlers defined in `hotkey.js`
were using `event.which`, which is deprecated.

This commit makes changes to use `event.key` instead.

As a side effect, it fixes a small bug where both `Alt+P` and
`Alt+Shift+P` could be used to toggle preview mode. Only `Alt+P`
is the defined shortcut for that.
2025-05-29 13:24:22 -07:00
Prakhar Pratyush
104b5c9731 hotkey: Remove a stale item in codes, in motion_keys test.
`"+": 187` was an unused item in `codes` object, in `motion_keys`
test.

This commit removes that.
2025-05-29 13:24:22 -07:00
Prakhar Pratyush
6e18aad7a6 hotkey: Fix "e shortcut works for anonymous users" test.
In f768d3330b, the node test
written was a noop because "e" hotkey is handled by `keypress`
instead of `keydown`. So, the expected codepath was never getting
executed at all.

This commit fixes the test.
2025-05-29 13:24:22 -07:00
Karl Stolley
2405bbbe84 right_sidebar: Adjust spacing to accomodate status emoji. 2025-05-29 12:57:20 -07:00
Karl Stolley
207c874593 inbox: Swap :focus for :focus-visible where necessary. 2025-05-29 12:08:39 -07:00
Alex Vandiver
f3d6de390f i18n: Remove a spurious leading space in a translation string. 2025-05-29 11:58:57 -07:00
Alex Vandiver
4ab77e519b i18n: Update translations for trimmed text. 2025-05-29 11:58:57 -07:00
Alex Vandiver
5828bfe8ce i18n: Trim {% trans %} sections by default.
This pulls in changes from the latest django-jinja[^1]
`makemessages.py` monkey-patching.  Specifically, it adds support for
`trimmed`, `notrimmed`, and the `ext.i18n.trimmed` policy.  We enable
that, which removes unsightly and unnecessary whitespace inside of
`{% trans %}` blocks.

[^1]: aac828ca63/django_jinja/management/commands/makemessages.py
2025-05-29 11:58:57 -07:00
Evy Kassirer
4751740d3c composebox_typeahead: Focus composebox when topic is selected.
Fixes bug reported here:
https://chat.zulip.org/#narrow/channel/9-issues/topic/focus.20after.20choosing.20from.20topic.20typeahead/near/2180336
2025-05-29 11:39:42 -07:00
Sahil Batra
760026c7a7 groups-ui: Fix scrollbar for groups list in left panel.
Simplebar was not being implemented correctly in groups UI
left panel because $container and $simplebar_container args
passed to ListWidget.create were same elements and thus the
simplebar related elements were being removed when rendering
the list.

This commit fixes it by adding a wrapper element to be used
as simplebar container.
2025-05-29 10:57:02 -07:00
Sahil Batra
bbc1435968 settings: Fix resizing of streams and groups overlay.
We set the height of left and right panel elements in
groups UI when browser window is resized as per the
heights of header, search container, etc.

We used common classes to set the height in both streams
and groups UI so the height for left panel and right panel
of groups UI were being set as per the height of headers,
search container, etc. of streams UI which made the UI
and scrolling experience buggy.

This commit fixes it by changing the Jquery selectors to
be more specific and calling the functions separately for
streams and groups UI.
2025-05-29 10:57:02 -07:00
Sérgio Glórias
d817bd5faf email_mirror: Also strip "SV:" from subject.
Observed in emails from Nordic countries, the prefix SV: is used instead of RE:.
2025-05-29 10:55:18 -07:00
Alya Abbott
d01b147ba2 help: Clarify how to avoid paying after a free trial. 2025-05-29 10:54:27 -07:00
Evy Kassirer
17ce7b90d3 input_pill: Add semi-transparent border around avatar.
Fixes #34499.
2025-05-28 17:40:28 -07:00
Evy Kassirer
8f7aab05e7 input_pill: Round all corners of user avatar.
Fixes part of #34499.
2025-05-28 17:40:28 -07:00
Lauryn Menard
fd16c2e2b0 templates: Update deactivated organization template for deleted data.
If a realm's data has been scrubbed, update the deactivated realm
to note the URL can be reused, but not that the realm can be
reactivated.

Updates the template for context variables that are no longer used.
2025-05-28 17:32:29 -07:00
Evy Kassirer
0563a36b47 buddy_list: Fetch all subscribers before showing search results.
Work towards #34244.
2025-05-28 17:27:18 -07:00
Aman Agrawal
6e9a65e0dc slack_import: Rename heading for input. 2025-05-28 17:19:51 -07:00
Aman Agrawal
9b2bf87bff realm_import_post_process: Show verified email in bold. 2025-05-28 17:19:51 -07:00
Aman Agrawal
47e70ef6b5 slack_import: Show ellipsis for overflowing select option. 2025-05-28 17:19:51 -07:00
Aman Agrawal
33c4185eae slack_import: Use custom string invalid file type error. 2025-05-28 17:19:50 -07:00
Aman Agrawal
6de3ed350b signup: Show error message on upload failure due to restrictions.
Error message due to uppy restrictions were not visible to the user.
2025-05-28 17:18:08 -07:00
Aman Agrawal
2d509c2351 slack_import: Add missing element to show error message.
This appears to have been lost somewhere in one of the rebases.
2025-05-28 17:18:07 -07:00
Aman Agrawal
4823477a70 slack_import: Allow replacing uploaded data export files.
Uppy doesn't allow uploading another file and replacing the exisiting
one in the same session due to `maxNumberOfFiles: 1` set by us.
We don't want to remove this restriction, so only way to allow
replacing files easily is to just resert the current uppy session
after the last upload finishes.

Our backend deletes any existing upload by default. So, this works
as expected on all fronts.
2025-05-28 17:18:07 -07:00
Aman Agrawal
9502d8f9bf signup: Remove obsolete option.
Since v2, this removeFingerprintOnSuccess is obsolete.
See this migration guide here:
https://uppy.io/docs/guides/migration-guides/#removed-resume-and-removefingerprintonsuccess-options-from-uppytus
2025-05-28 17:18:07 -07:00
Aman Agrawal
e07a17eff5 slack_import: Add instruction to get export file. 2025-05-28 17:18:07 -07:00
Aman Agrawal
ef8f9f0585 slack_import: Use textarea for slack access token.
This is to help user see the complete access token at once.
2025-05-28 17:18:07 -07:00
Aman Agrawal
b57b783dd8 slack: Don't show error code to users.
We log the error internally and only show invalid token as the
error message.
2025-05-28 17:18:07 -07:00
Aman Agrawal
18b0681d26 slack_import: Show validation error on empty slack access token.
We used to rely on browser to show error for empty slack access
token, but now we are using our own error element for this.
2025-05-28 17:18:07 -07:00
Aman Agrawal
68372f8e03 slack: Change invalid token error message. 2025-05-28 17:18:07 -07:00
Aman Agrawal
079e46404f slack_import: Tweak instruction to get slack bot user OAuth token.
Note that the link highlights the section to get bot OAuth token.
2025-05-28 17:18:07 -07:00
Sahil Batra
460c471a29 tests: Move channel access tests to test_channel_access. 2025-05-28 17:02:41 -07:00