Commit Graph

64950 Commits

Author SHA1 Message Date
Sayam Samal
f2b4480d76 blueslip: Decouple blueslip error overlay from popup alerts. 2025-06-04 11:28:49 -07:00
Sayam Samal
9008e35acb alerts: Wrap the alert-box to prevent safari container regression.
This commit wraps the alert-box into a wrapper, and moves the
position related CSS to the wrapper, to avoid safari container
regression — which results when position: fixed is applied on the
element which is also the container.
2025-06-04 11:28:49 -07:00
Niloth P
dac9e476f8 generate-integration-docs-screenshot: Add batch options.
Adds
- `--all-webhook` to batch process all webhook integrations,
- `--all-fixtureless` to batch process all fixtureless integrations.
2025-06-01 11:38:02 -07:00
Niloth P
2a2ca01cad integrations: Add FIXTURELESS_SCREENSHOT_CONFIG.
Created a `WEBHOOK_SCREENSHOT_CONFIG` to track those separately, by
renaming the existing `DOC_SCREENSHOT_CONFIG` which contained only the
configs for webhook integrations.

Tracking the screenshot configs separately allows us to generate
the screenshots of all fixtureless integrations in a single batch, and
all webhook integrations in their own separate batch.
2025-06-01 11:38:02 -07:00
Niloth P
866785784a generate-integration-docs-screenshot: Add fixtureless arguments.
Add a `fixtureless_group` of arguments to allow passing in the message,
topic and channel via the commandline.
By default, the script uses the screenshot config from
`integrations.py`.
2025-06-01 11:38:02 -07:00
Niloth P
287e1f8fac generate-integration-docs-screenshot: Support fixtureless integrations.
Example screenshots can now be generated for fixtureless integrations,
by sending mock messages using the topic and message text included in
the screenshot config added in the previous commit.
2025-06-01 11:38:02 -07:00
Niloth P
9ec98966e3 integrations: Add dataclass FixturelessScreenshotConfig. 2025-06-01 11:38:02 -07:00
Niloth P
0b8e042627 integrations: Split the getters for fixture_path and image_path.
This is in preparation of adding support for generating screenshots of
fixtureless integrations, which would need to get image_path, without
involving fixture_path.
2025-06-01 11:38:02 -07:00
Niloth P
94a5ced243 integrations: Rename ScreenshotConfig to WebhookScreenshotConfig.
This is in preparation to differentiate the current config dataclass
(used for webhooks) from the FixturelessScreenshotConfig that will be
added for non-webhook integrations in the following commits.
2025-06-01 11:38:02 -07:00
Niloth P
9f92ae710f integrations: Remove support for non-webhook example screenshots.
- Removed the BaseScreenshotConfig dataclass, and merge it with
ScreenshotConfig dataclass.
- Simplified get_fixture_and_image_paths.
- Simplified generate_screenshot_from_config in the screenshot script.
- Deleted send_bot_mock_message.
2025-06-01 11:38:02 -07:00
Niloth P
0b69548ded integrations: Remove Nagios fixture used for example screenshot.
Nagios is not a webhook integration, and the fixture is only used to
generate the example screenshot for the doc.

Support for generating the Nagios example screenshot will be added in a
later commit, in a different format and system. Removing this fixture
allows removing the current system logic, without raising errors.
2025-06-01 11:38:02 -07:00
Niloth P
88e92d050c generate-integration-docs-screenshot: Handle incorrect fixture_name. 2025-06-01 11:35:00 -07:00
Niloth P
68e03f8316 generate-integration-docs-screenshot: Refactor parsing of webhook args.
- Simplified the loading of commandline options into the config dict.
- Split the logic into two new functions. This is in preparation to
later commits that will parse commandline options for non-webhook
integrations by re-using the created functions.
2025-06-01 11:35:00 -07:00
Niloth P
2b358db46b generate-integration-docs-screenshot: Group options by integration type.
Group argparse arguments into common and webhook-specific options.

The common group contains arguments that apply to both webhook and
non-webhook integrations. It is not assigned a description.

A fixtureless, non-webhook group will be added later, when its arguments
are created.
2025-06-01 11:35:00 -07:00
Niloth P
3cb34ef03d generate-integration-docs-screenshot: Rename the fixture option.
to `fixture-name` to match the name of the corresponding field in the
ScreenshotConfig dataclass.

This is in preparation to loading all the options into a config dict
in a single step in a later commit.
2025-06-01 11:35:00 -07:00
Niloth P
20b0ddc4d1 generate-integration-docs-screenshot: Improve help and error messages. 2025-06-01 11:35:00 -07:00
Niloth P
802d1a57c1 generate-integration-docs-screenshot: Rename argument group for clarity.
Rename `group` to `batch_group`.

It's a mutually exclusive group that lets the user decide whether to
generate screenshots one at a time or in a batch.
2025-06-01 11:35:00 -07:00
Niloth P
af1ccbabf1 generate-integration-docs-screenshot: Remove unused argument group.
Removed `fixture_group`.
2025-06-01 11:35:00 -07:00
Niloth P
de0c24fdb8 generate-integration-docs-screenshot: Remove unused function parameter. 2025-06-01 11:35:00 -07:00
Anders Kaseorg
f3cbc6cee1 uv.lock: Fix sorting for aiosmtpd, altcha.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-30 17:14:52 -07:00
Aman Agrawal
4ecadd5a1d alert_popup: Fix stack trace not removed on clicking x. 2025-05-30 14:57:58 -07:00
Lauryn Menard
2912d48579 corporate: Rename CustomerPlan.invoice_overdue_email_sent field.
Renames invoice_overdue_email_sent to stale_audit_log_data_email_sent
to better reflect the email and state that field is tracking for
the CustomerPlan.
2025-05-30 14:57:00 -07:00
Lauryn Menard
9edabf5ac8 corporate: Revise internal billing emails for stale audit log data.
These emails are not necessarily sent when an self-hosted customer
has an outstanding invoice, e.g., they are on an annual plan and
the monthly check for additional licenses happens when the audit
log data is stale.

Updates the notice_reason to be "stale_audit_log_data" instead of
"invoice_overdue". Revises the email subject and text to better
reflect what the support admin needs to investigate.
2025-05-30 14:57:00 -07:00
Shubham Padia
a80941a78d help-beta: Rename include files to use pascal case during conversion.
If the file names are in Pascal case in the first place, it will
decrease mental load for any editor to convert a kebab case name to
Pascal case name.
2025-05-30 14:53:05 -07:00
Shubham Padia
c6c7c61fee help-beta: Convert MD comments to MDX comments. 2025-05-30 14:52:15 -07:00
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