Commit Graph

60263 Commits

Author SHA1 Message Date
Shubham Padia 7dfe68e0a2 run-dev: Add option to host help center with starlight.
We also add a script called `build-help-center` that is required
to build the starlight documentation. If the `help-beta/dist` dir
is not present, `run-dev` will show an error message but will not
fail.
2024-08-02 18:18:01 -07:00
Shubham Padia dd9cfb5bdd tools: Add script to convert .md files to .mdx.
This is the tool that we will consistently use for our project to
migrate our help center to use starlight.
We're only doing string manipulation in this tool for now, we will
start to use existing markdown preprocessors whenever appropriate
as we start to add support for different components.
Running the tool again will overwrite the existing files.
2024-08-02 18:18:01 -07:00
Shubham Padia 33ef160b06 help-beta: Create initial starlight project.
We are adding MDX files to `.gitignore` for now since they are
just a result of a build process, once the migration is done,
we will not ignore them.
We're using PNPM workspaces to manage this project.
The new project's tsconfig.json has been copied from the current
root tsconfig.json while omitting some details that are only
relevant to that project.
`help-beta/src/env.d.ts` is a type declaration file auto-generated
by Astro. See https://github.com/withastro/astro/issues/6013.
2024-08-02 18:18:01 -07:00
Shubham Padia 25b480e5e0 help: Move span to new line for channel-permissions.
Before, the `span` opening tag was split between two lines. This
led to `[@mdx-js/rollup]` throwing an error on the build step saying
`Expected a closing tag for <span> before the end of paragraph`.
This is a preparatory commit for the migration to use starlight
for help center docs.
2024-08-02 18:18:01 -07:00
Tim Abbott f4343f1b09 docs: Update changelog for Zulip Server 9.1 release. 2024-08-02 16:53:29 -07:00
Aman Agrawal 2011e0df76 inbox_ui: Fix row_focus not synced with inbox rows.
Have one inbox row and focus on it. Mark the message as read in
another tab. Press `r` in the first tab will return an error as
the row_focus didn't change but there is no present. So, we
fix it by updating the row_focus if it can get out of bounds
when updating inbox view.
2024-08-02 09:36:37 -07:00
Sahil Batra 6919448917 settings: Remove create_web_public_stream_policy setting.
This commit removes create_web_public_stream_policy setting
since web-public channel creation permissions are now
handled by group-based setting.

We still pass "realm_create_web_public_stream_policy" in
"/register" response though for older clients with its
value being set depending on the value of group based
setting. If we cannot set its value to an appropriate enum
corresponding to the group setting, then we set it to
"Admins and moderators" considering that server will not
allow the users without permissions to create web-public
channels but the client can make sure that UI is
available to the users who have permission.
2024-08-01 22:49:33 -07:00
Sahil Batra 506ead4468 settings: Use new group setting to check web-public stream creation.
This commit updates code in webapp to use new group-based setting
for checking web-public stream creation permission.
2024-08-01 22:49:33 -07:00
Sahil Batra e71c3007f6 tests: Refactor group settings test in settings_data.test.ts.
This commit refactors the common function used for test in
such a way that we can test more cases for a group setting
along with the ones tested by the common function.
2024-08-01 22:49:33 -07:00
Sahil Batra 09102c5780 streams: Check permission to create web-public streams based on group setting. 2024-08-01 22:49:33 -07:00
Sahil Batra a15bc5e264 realm: Add new group setting for web-public stream creation. 2024-08-01 22:49:33 -07:00
Anders Kaseorg c03839f42f mypy: Reenable explicit-override for models.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-08-01 17:39:04 -07:00
evykassirer 09f4f787b8 search_pill: Replace user display_value with full_name. 2024-08-01 17:31:59 -07:00
evykassirer 271efb70fa input_pill: Remove InputPillItem now that details are handled elsewhere. 2024-08-01 17:31:59 -07:00
evykassirer 6e47d851ec input_pill: Remove display_value in favor of module-specific values.
This commit is part of a bigger project to remove custom logic in
the input_pill module. This commit move us away from a world where
we have a `display_value` that's used as identifying information
for a pill as well as for what we display to the user. Now individual
widgets can configure how they come up with a display value based
on the data of that type of pill.

Note: The change in the stream pill test for setting subscribers
for denmark is fixing an issue that wasn't discoverable before.
There always should have been three subscribers.
2024-08-01 17:31:59 -07:00
evykassirer 7dfb928277 search: Calculate display_value from SearchPill item.
We no longer need to do `robust_url_decode` because we're
creating the display value ourselves, whereas previously
we were using `Filter.unparse` which does encoding.
2024-08-01 17:31:59 -07:00
evykassirer c19ecf7c07 input_pill: Remove (now) unused custom stream logic. 2024-08-01 17:31:59 -07:00
evykassirer ccbc569bab invite_stream_picker: Don't rely on custom code in input_pill.
By using a custom `generate_pill_html`, we can remove the
`has_stream` logic in `input_pill`, as part of a wider effort
to remove custom pill logic in `input_pill`.
2024-08-01 17:31:59 -07:00
evykassirer 0d52ced27a input_pill: Move group and stream logic to add_subscribers module.
This is part of a larger effort to refactor input_pill to
remove custom logic and move it into relevant modules.

This commit completely removes group_id from all modules, but
there's another module that uses stream that must be refactored
before that can be removed from input_pill.
2024-08-01 17:31:59 -07:00
evykassirer 443e24390b input_pill: Move user fields off of InputPillItem to UserPill.
This is part of a larger effort to move custom code out of
the input_pill module, and this commit is made possible by
earlier commits.
2024-08-01 17:31:59 -07:00
evykassirer 2b7d14084b input pill: Move user pill rendering code to user_pill.
This is part of a larger effort to refactor input_pill to
remove custom logic and move it into relevant modules.
2024-08-01 17:31:59 -07:00
evykassirer aa0b150265 input pill: Move search html logic to search_pill.
This is part of a larger project to move custom
logic out of input_pill. The `generate_pill_html`
function will be used for other modules in upcoming
commits.
2024-08-01 17:31:59 -07:00
evykassirer 92d67fb00c input_pill: Rename <T> to <ItemType>. 2024-08-01 17:31:59 -07:00
evykassirer 78c9adb33c search: Remove unused description_html. 2024-08-01 17:31:59 -07:00
evykassirer c09dbcc781 search: Use search terms instead of query text for some helper code.
NarrowTerm can hold more information than a string, and is more
robust.
2024-08-01 17:31:59 -07:00
Alex Vandiver 6f20c15ae9 thumbnail: Resolve a race condition when rendering messages.
Messages are rendered outside of a transaction, for performance
reasons, and then sent inside of one.  This opens thumbnailing up to a
race where the thumbnails have not yet been written when the message
is rendered, but the message has not been sent when thumbnailing
completes, causing `rewrite_thumbnailed_images` to be a no-op and the
message being left with a spinner which never resolves.

Explicitly lock and use he ImageAttachment data inside the
message-sending transaction, to rewrite the message content with the
latest information about the existing thumbnails.

Despite the thumbnailing worker taking a lock on Message rows to
update them, this does not lead to deadlocks -- the INSERT of the
Message rows happens in a transaction, ensuring that either the
message rending blocks the thumbnailing until the Message row is
created, or that the `rewrite_thumbnailed_images` and Message INSERT
waits until thumbnailing is complete (and updated no Message rows).
2024-08-01 16:48:16 -07:00
Anders Kaseorg 2a14a08e63 requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-08-01 16:46:58 -07:00
Anders Kaseorg ea60bc3ff8 ruff: Fix PLR1714 Consider merging multiple comparisons.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-08-01 16:46:58 -07:00
Anders Kaseorg 05e54a0af2 ruff: Fix E721 Use `isinstance()` for isinstance checks.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-08-01 16:46:58 -07:00
Alex Vandiver 9e02e562bb confirmation: Use BigInteger to match other models' "id" field.
Without this, Django builds queries with which compare tables' "id"
fields to `("confirmation_confirmation"."object_id")::bigint`; the
explicit cast prevents the index added in the previous commit from
being used.
2024-08-01 16:44:18 -07:00
Alex Vandiver fcb04598f0 confirmation: Add an index on content_type, object_id.
This makes lookups of `.confirmation`, or joins through
`confirmation__` as we do in the `/json/invites`, actually fast.  See
https://code.djangoproject.com/ticket/23435
2024-08-01 16:44:18 -07:00
Alex Vandiver ab1e858eb9 invites: Use the realm on the PreregistrationUser, to save a join. 2024-08-01 16:44:18 -07:00
Alex Vandiver 2bc118892a migrations: Add missing dependency.
This migration references the "confirmation" app for the first time,
which means we must have migrated at least part of it by this point.

Set the migration to depend on the latest "confirmation" migration at
the time of this migration.
2024-08-01 16:44:18 -07:00
Karl Stolley 2f726b20ed compose: Specify non-alpha message-area colors.
This keeps colors uniform between edit and preview modes, and also
ensures no bleedthrough of the editor when in preview mode.

ID selectors have been used for those colors to both keep the text
color declaration in the same place, and to avoid a dark-theme
specificity problem where the generic textarea took precedence over
the colors specified on the compose box's own textarea.
2024-08-01 16:30:56 -07:00
Karl Stolley bee5cd4e04 rendered_markdown: Update markdown timestamps to use Zulip icon.
Fixes: #28830
2024-08-01 16:28:30 -07:00
Alex Vandiver cf5accfa7f docs: Note required OS upgrade in upgrade notes. 2024-08-01 16:27:31 -07:00
bedo 1ab4723d59 user_groups: Migrate to @typed_endpoint.
Migrate the following endpoints from @has_request_variables
to @typed_endpoint:

- get_user_group()
- delete_user_group()
- update_user_group_backend()
- update_subgroups_of_user_group()
- get_is_user_group_member()
- get_user_group_members()
- get_subgroups_of_user_group()

With tweaks from tabbott to avoid calling thunks unnecessarily.
2024-08-01 09:56:06 -07:00
Alex Vandiver 163863c0d1 nginx: Adjust default gzip level.
The default compression level is 1; increasing this to 3 takes a small
amount more CPU time (single-digit ms on multi-MB transfers), but
results in a small but noticeable (4-7%) percentage better
compression in JSON content.

Assuming a 25 megabit connection (the current average data rate for
cell phones in the U.S.), a 2MB file which is shrunk an additional 4%
saves approximately 25 milliseconds of transfer time; thus the
additional few milliseconds of CPU-time is well worth the cost.  For
faster connections (e.g. 100 megabit), the tradeoff is more or less a
wash.
2024-08-01 09:54:41 -07:00
Lauryn Menard 53e7fc38d6 help: Use screenshots for global times examples.
Fixes #31131.
2024-08-01 09:31:00 -07:00
Alex Vandiver 2d0468bde5 lightbox: Disable controls on video previews in lightbox.
Setting any value for a boolean attribute (like "controls") enables
it.
2024-08-01 09:23:45 -07:00
Alex Vandiver d70935ae04 clients: Drop "desktop app" substring check.
The last desktop client to use that was 0.5.8, released 2017-04-12.
There are no clients with such old versions still observed in the
wild.
2024-08-01 09:23:16 -07:00
roanster007 7b3e163d55 refactor: Rename `huddle` to `direct_message_group` in non api files.
This commit completes rename of "huddle" to "direct_message_group"
in all the non API files.

Part of #28640
2024-07-31 23:25:56 -07:00
Kenneth Rodrigues 4b04e2c09c ListWidget: Fix sliding of actions column in tables.
Added right padding to the actions heading in the table.

Fixes #29633.
2024-07-31 22:38:42 -07:00
Prakhar Pratyush 04347bb315 schedule_messages: Update do_schedule_messages to send event on commit.
Earlier, we were using 'send_event' in 'do_schedule_messages' which
can lead to a situation, if any db operation is added after the
'send_event' in future, where we enqueue events but the action
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-07-31 22:33:52 -07:00
Prakhar Pratyush 7302d533fe user_status: Update do_update_user_status to send event on commit.
Earlier, we were using 'send_event' in 'do_update_user_status' which
can lead to a situation, if any db operation is added after the
'send_event' in future, where we enqueue events but the action
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-07-31 22:33:52 -07:00
Prakhar Pratyush dc27711399 alert_words: Update remove_alert_word codepath to send event on commit.
Earlier, we were immediately enqueueing event in
'do_remove_alert_words' which can lead to a situation, if any
db operation is added after enqueueing event in future, where the
action function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-07-31 22:33:52 -07:00
Prakhar Pratyush ba80266b7e alert_words: Update add_alert_words codepath to send event on commit.
Earlier, we were using 'send_event' in 'do_add_alert_words' which
can lead to a situation, if any db operation is added after the
'send_event' in future, where we enqueue events but the action
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-07-31 22:33:52 -07:00
afeefuddin eab78d996d node tests: Add make_stream helper to create streams in node tests.
With a bunch of comments by tabbott on some details to pay attention
to.
2024-07-31 22:26:55 -07:00
Tim Abbott 5b22f03509 version: Add changelog entry for Zulip Server 8.5. 2024-07-31 21:53:50 -07:00
Kenneth Rodrigues 454f2f5b0c video_calls: Migrate to typed_endpoint. 2024-07-31 17:10:06 -07:00