Commit Graph

66772 Commits

Author SHA1 Message Date
Sahil Batra
764f4aa2e0 groups: Use realm_for_sharding for limiting NamedUserGroup queries.
For get and filter queries of NamedUserGroup, realm_for_sharding
field is used instead of realm field, as directly using
realm_for_sharding field on NamedUserGroup makes the query faster
than using realm present on the base UserGroup table.
2025-09-23 12:15:53 -07:00
Sahil Batra
d4d7a8fe2a streams: Make sure that unused anonymous groups are not created.
Anonymous groups were being created for stream permission
settings when calling the subscriptions endpoint without
any streams data or when calling it only for subscribing
users to streams and not for creating any new streams.

This commit makes sure that no such unused anonymous groups
are created.
2025-09-23 12:15:51 -07:00
Sahil Batra
1e21f7b224 register: Rename stream_creator_or_nobody to channel_creator.
This commit renames `stream_creator_or_nobody` value for
`default_group_name` field in `server_supported_permission_settings`
object to `channel_creator`.
2025-09-23 12:12:23 -07:00
Sahil Batra
8c7628fbc4 openapi: Improve description for default_group_name field.
This commit updates the description for `default_group_name`
field in `server_supported_permission_settings` object to
clearly mention that `stream_creator_or_nobody` is one of
the possible values and explain its meaning.
2025-09-23 12:04:07 -07:00
Sahil Batra
a9afe1becf openapi: Improve description for channel creator.
This commit updates description for channel creator field
`creator_id` to mention that it can be null for channels
created during realm creation.
2025-09-23 12:04:07 -07:00
Evy Kassirer
fc9bbd37a0 search: Align suggestion left padding with search bar icon space. 2025-09-23 11:39:12 -07:00
Prakhar Pratyush
03897c42e1 ui_init: Fix flashing of 'try zulip' modal.
On visiting 'https://chat.zulip.org/?show_try_zulip_modal',
a 'try zulip' modal is displayed to spectators.

Previously, the modal flashed briefly and disappeared.

Reason:
Earlier, in 'ui_init.js' we called 'show_try_zulip_modal'
followed by a network call - which on success called
'initialize_everything'.

'hashchange.initialize' (in 'initialize_everything') closes
any active modal.

So, the race between 'show_try_zulip_modal' & 'hashchange.initialize'
was resulting in this flash.

Fix:
We call 'show_try_zulip_modal' only after 'initialize_everything'
completes - there's no point to try to display modal when the
loading screen is still visible to users.
2025-09-23 11:20:22 -07:00
Aman Agrawal
7f81665b58 views_util: Fix hotkeys not working when views filter is in focus.
When focus for recent view / inbox is in focus, hotkeys were
not working since #36035 didn't account for inputs inside the
view.

Fixed by removing recent view and inbox filter elements from
`.input-element` selector.

Tested that hotkeys now work for recent view, inbox and
channels topics list as expected.
2025-09-23 07:28:28 -07:00
Kislay Verma
1b0ec6e923 stream_list_sort: Add tests for channel folders.
This commit re-enables one of the tests disabled in #35075 and
adds new test cases.

Fixes part of #35494.
2025-09-22 09:38:36 -07:00
Aman Agrawal
e36147a94e realm_creation: Disable import from input.
We are not processing this input at the POST endpoint, this
commit just disables the selection from changing.

It is not easy to process changing "import from" at this stage,
but we can possible allow that in a future refactor.
2025-09-22 09:37:34 -07:00
Aman Agrawal
f45552fadd slack_import: Disable submit button if file is invalid. 2025-09-22 09:37:34 -07:00
Aman Agrawal
04fa43e1df slack_import: Don't use a tag for form submission.
This can mislead user into thinking this is a link they can
open in a new tab, which we don't want to allow.
2025-09-22 09:37:34 -07:00
Sahil Batra
203e8be1df groups-ui: Fix check and plus icon in group row.
This change was missed in 310a2323b6.
2025-09-19 09:20:58 -07:00
Prakhar Pratyush
d78f338916 event_queue: Add compatibility code for push_device_registered_user_ids.
In #35965 we added `push_device_registered_user_ids` to message &
update_message event.

Zulip servers with such events in their event queues when upgraded
to the new version set push_device_registered_user_ids to empty list,
which is incorrect - it leads to no push notification sent.

This commit adds compatibility code to handle such events. The newly
introduced `push_device_registered` check is used only for events
with `push_device_registered_user_id` present in them.
2025-09-19 09:19:36 -07:00
Alex Vandiver
3c2ed0e202 docs: Cross-link to the reverse proxy pages. 2025-09-18 17:56:39 -07:00
Nikita Tarasov
c75535a154 puppet: Use memory limits from cgroup, if set.
This fixes behaviour where a Docker image with a memory limit would
immediately OOM, as it would not detect the container's memory limit,
only the host's.

Fixes: #29794
2025-09-18 16:38:37 -04:00
Alex Vandiver
3064939ff7 email_mirror_server: chown the logfile before dropping privileges.
This prevents the logger from failing due to an old, root-owned,
logfile already existing.
2025-09-18 09:04:08 -07:00
Alya Abbott
58e0d6fc12 docs: Remove stray paren. 2025-09-17 15:30:05 -07:00
Lauryn Menard
69f5aa787d docs: Update writing documentation for starlight help center.
The help center documentation now uses astro/starlight, so the
contributor documentation is updated here for the general changes
to that documentation, such as where to find files, and features
and components used in that documentation.

Moves features that are still used for integrations and API docs,
to those guides, e.g., tabbed sections and our macros system, so
that we still have documentation for those systems/features.

Co-authored-by: Shubham Padia <shubham@zulip.com>
2025-09-17 14:20:10 -07:00
Shubham Padia
310a2323b6 subscriptions: Move raw svg for plus and check icons to zulip-icon.
Fixes #35899.

We don't make any visual changes to how the svgs/icons look, we just
move them to use the zulip-icon system.

We also replace use of the raw images of each in the help center and add
appropriate color for both in the help center.
2025-09-17 14:15:05 -07:00
Tim Abbott
c0f89d261f docs: Improve directory structure article introduction.
Fixes #25348.
2025-09-17 13:57:42 -07:00
Tim Abbott
6a5d214be6 help: Fix linter errors in last merged PR. 2025-09-17 13:53:02 -07:00
Alya Abbott
d3ca0fc7ae docs: Revamp production doc on security.
- Remove duplicative content.
- Move content to topic-focused pages.
2025-09-17 13:28:02 -07:00
Alya Abbott
be0fc99b58 help: Organize details on bots overview page.
Also document can_forge_sender permission.
2025-09-17 13:27:16 -07:00
Alya Abbott
9e3fea7ed3 help: Add a note about DMs privacy model. 2025-09-17 13:27:16 -07:00
Alya Abbott
10ce39a82c help: Add links to releated articles. 2025-09-17 13:27:16 -07:00
Alya Abbott
9b1c7f761a help: Document logging out by resetting API key and password. 2025-09-17 13:27:16 -07:00
Alya Abbott
f1f9769a08 help: Add a page on protecting your account. 2025-09-17 13:27:16 -07:00
Alya Abbott
0edacce98e help: Update password reset instructions for new UI. 2025-09-17 13:27:16 -07:00
Tim Abbott
0c04f5f101 postprocess_content: Simplify and clarify video logic. 2025-09-17 13:25:50 -07:00
Karl Stolley
d8e58f31b9 tooltips: Rename media tooltip partial. 2025-09-17 13:25:50 -07:00
Karl Stolley
bdf7bdba39 compose_paste: Handle new and legacy media classes. 2025-09-17 13:25:50 -07:00
Karl Stolley
a64276c58f media: Replace legacy .message_inline_image class.
This introduces two new replacement classes, depending on
whether the inner content is an image or a video.
2025-09-17 13:25:50 -07:00
Karl Stolley
1b3ea708be markdown: Don't double-process video elements. 2025-09-17 13:25:50 -07:00
Karl Stolley
a3831770af postprocess_test: Separate link, media tests. 2025-09-17 13:25:50 -07:00
Karl Stolley
d932d8909b postprocess_test: Replace contrived example with real-world one.
The removed lines appear to be fully contrived, as there is no
apparent case where the server would deliver a block of HTML
with `.message_inline_image` without also delivering an inner
<img> or <video> element.

It appears the original outer block was introduced as part of
3df0cacd9e for ensuring coverage
of the post-processing of the `title` attribute to `aria-label`,
which change has since become covered by numerous other
non-contrived examples.

The replaced (and contrived) `<a role="button">` part introduced
by 911b3b5365 is meant to test the
absence of an `href` attribute, which is the minimal new line
introduced here to maintain test coverage while also testing
a genuinely possible pattern a user could send, namely
`[missing href]()`.

See https://chat.zulip.org/#narrow/channel/43-automated-testing/topic/unusual.20.60.2Emessage_inline_image.60.20HTML/with/2261114 for further discussion.
2025-09-17 13:25:49 -07:00
Alex Vandiver
b39188f9cf email_mirror_server: Drop privileges before attaching file handler. 2025-09-17 13:23:48 -07:00
Shubham Padia
468a7a82dd help: Do not treat Help Center as a proper noun.
Fixes https://chat.zulip.org/#narrow/channel/101-design/topic/help.20center.20capitalization
2025-09-17 13:20:25 -07:00
Prakhar Pratyush
421637ce31 push_notifications: Skip enqueuing notif for users without push devices.
Previously, we enqueued events to "missedmessage_mobile_notifications"
even for users who had no registered push devices.
'handle_push_notification' later used to perform the check & skip
if there were no registered devices.

This commit avoids putting such events into the
"missedmessage_mobile_notifications" queue at all. By doing so,
we reduce unnecessary churn.
2025-09-17 12:32:49 -07:00
Tim Abbott
aa317ee844 docs: Remove inaccurate docs on removed avatar feature.
We removed this specific feature a few years ago. While the general
docs there are stale in other ways, we can at least remove this
confusing documentation.

Fixes #18326.
2025-09-17 12:14:09 -07:00
Lauryn Menard
0af56bb80b integrations: Update GitLab doc to direct to create webhook.
GitLab has both integrations and webhooks, and our documentation
should direct users to the webhooks set up for integrating with
Zulip.

Adds a link to GitLab's create a webhook documentation as well.
2025-09-17 09:39:48 -07:00
Rakshit Chauhan
35ed477b32 portico: Scroll to top when clicking logo on home page.
Previously, clicking the logo always triggered a full page reload,
even if the user was already on the home page. This commit adds logic
to intercept the click and smoothly scroll to the top instead,
avoiding an unnecessary reload.

Fixes #35422.

Co-authored-by: Rakshit Chauhan <rxkshit04@users.noreply.github.com>
2025-09-16 11:56:26 -07:00
Karl Stolley
14c51bd0ec compose: Track when the recipient box has recently had focus.
This helps to prevent an edge case where clicking the
new-topic button, `[+]`, in the left sidebar when the
topic box was already empty caused an unexpected flash
of the *general chat* topic.
2025-09-16 11:53:46 -07:00
Karl Stolley
52c75b52fb compose: Update conversation arrow after clearing topic. 2025-09-16 11:53:46 -07:00
Karl Stolley
a4657a5bd7 compose: Correct for undesired outline flash on pills. 2025-09-16 11:53:46 -07:00
Karl Stolley
75714bb44f compose: Remove competing transitions.
The transitions here do not work correctly across all
states, and directly interfere or look goofy with the
transitions in the recipient-row area.

Particularly with the removal from #message-content-container,
that had the annoying effect of just delaying the
appearance of the focus border, regardless of whether
focus was established via keyboard or mouse.
2025-09-16 11:53:46 -07:00
Karl Stolley
de7419a528 compose: Only transition when low-attention row hovered.
Previously, if the mouse cursor were in the vicinity of
the compose box, we'd see transitions even on keyboard
interactions, which should not have been happening.

This also allows instantaneous highlighting for keyboard
users, as well as avoiding any transitions when a
mouse user clicks into a recipient-row element (at
which point the hover transitions will have already
run).
2025-09-16 11:53:46 -07:00
Karl Stolley
2fce6fa317 compose: Offset low-attention pill outlines. 2025-09-16 11:53:46 -07:00
Karl Stolley
415f7610c9 compose: Avoid multiple 'input' handlers on topic box.
It's not good form to register an event handler on a
function that runs fairly frequently--especially one
that stands to override another listener's handler.
2025-09-16 11:53:46 -07:00
Sai
eaa2ece4e1 slack: Fix bugs during import of thread messages.
Consider the following messages JSON (taken from real data, redacted):
```json
[
    {
        "subtype": "bot_message",
        "text": "",
        "attachments": [
            {
                "fallback": "Open Slack to cast your vote in this Simple Poll",
                "title": "Should we do a thing?",
                "id": 1,
                "color": "6ecadc",
                "fields": [
                    {
                        "title": "",
                        "value": "1️⃣ Yes 👍\n\n"",
                        "short": false
                    },
                    {
                        "title": "",
                        "value": "2️⃣ No 👎\n\n",
                        "short": false
                    },
                    {
                        "title": "",
                        "value": "3️⃣ Abstain :spock-hand:\n\n",
                        "short": false
                    }
                ],
                "mrkdwn_in": [
                    "fields"
                ]
            },
            {
                "callback_id": "12345678-1234-1234-1234-123456789abc",
                "fallback": "Open Slack to cast your vote in this Simple Poll",
                "id": 2,
                "color": "6ecadc",
                "actions": [
                    {
                        "id": "1",
                        "name": "vote",
                        "text": "1️⃣",
                        "type": "button",
                        "value": "1",
                        "style": ""
                    },
                    {
                        "id": "2",
                        "name": "vote",
                        "text": "2️⃣",
                        "type": "button",
                        "value": "2",
                        "style": ""
                    },
                    {
                        "id": "3",
                        "name": "vote",
                        "text": "3️⃣",
                        "type": "button",
                        "value": "3",
                        "style": ""
                    },
                    {
                        "id": "4",
                        "name": "delete-v2",
                        "text": "Delete Poll",
                        "type": "button",
                        "value": "",
                        "style": "danger",
                        "confirm": {
                            "text": "Are you sure you want to delete the Poll?",
                            "title": "Delete Poll?",
                            "ok_text": "Yes",
                            "dismiss_text": "No"
                        }
                    }
                ]
            },
            {
                "callback_id": "12345678-1234-1234-1234-123456789abc",
                "fallback": "Open Slack to cast your vote in this Simple Poll",
                "footer": "Simple Poll        <https:\/\/simplepoll.rocks\/dashboard\/redacted\/settings\/|Edit Settings>",
                "id": 3,
                "footer_icon": "https:\/\/simplepoll.rocks\/static\/main\/favicon.png",
                "color": "6ecadc"
            }
        ],
        "type": "message",
        "ts": "1234567890.123456",
        "bot_id": "B1ABCDEF1",
        "thread_ts": "1234567890.123456",
        "reply_count": 1,
        "reply_users_count": 1,
        "latest_reply": "1234567890.765432",
        "reply_users": [
            "U1ABC1234"
        ],
        "replies": [
            {
                "user": "U1ABC1234",
                "ts": "1234567890.765432"
            }
        ],
        "is_locked": false,
        "subscribed": false
    },
    {
        "user": "U1ABC1234",
        "type": "message",
        "ts": "1234567890.765432",
        "text": "Maybe do qux instead",
        "team": "T1AB23456",
        "user_team": "T1AB23456",
        "source_team": "T1AB23456",
        "user_profile": {
            "avatar_hash": "a123456789ab",
            "image_72": "https:\/\/avatars.slack-edge.com\/2017-01-01\/123456789abc_def123456789abcdef12_72.jpg",
            "first_name": "Alice",
            "real_name": "Alice Smith",
            "display_name": "a.smith",
            "team": "T1AB23456",
            "name": "a.smith",
            "is_restricted": false,
            "is_ultra_restricted": false
        },
        "thread_ts": "1234567890.123456",
        "blocks": [
            {
                "type": "rich_text",
                "block_id": "EoBdt",
                "elements": [
                    {
                        "type": "rich_text_section",
                        "elements": [
                            {
                                "type": "text",
                                "text": "Maybe do qux instead"
                            }
                        ]
                    }
                ]
            }
        ]
    }
]
```

533f177175/zerver/data_import/slack.py (L922-L924)
fails for the first message, because it lacks a 'user' key. It should fall back to the bot_id.

533f177175/zerver/data_import/slack.py (L925-L926)
fails for the second message, because it lacks a 'parent_user_id' key.
However, the thread root will have been processed earlier, so
memoization of thread parents fixes this issue. Because the original
message may not be in the same file, the memoization needs to be global
rather than in `channel_message_to_zerver_message`.
2025-09-16 11:35:53 -07:00