Commit Graph

5830 Commits

Author SHA1 Message Date
Shubham Padia
a0deeae80e help-beta: Introduce NavigationSteps component for settings links.
Fixes #31254.
We are using `SHOW_RELATIVE_LINKS` as the env variable to set if we
want to show relative settings link or non-linked markdown instructions.
We are not trying to determine `SHOW_SETTINGS_LINK` by ourselves. See
https://chat.zulip.org/#narrow/channel/49-development-help/topic/Passing.20sitename.20for.20astro.20project.20in.20production.2E
for more details.
Until the cutover happens, we would need to manually update the mapping
in both the astro component and the python file, but since that mapping
is not frequently changed, that is a tradeoff we can make.
We had to add margin-bottom: 0 to icon styling since starlight was
inserting a margin-bottom of 1.25 em for list items.
2025-06-26 10:46:37 -07:00
Aman Agrawal
b5f7e24669 message_reminder: Add UI to schedule message reminder.
This adds an option in message actions popover menu to schedule
a message reminder.
2025-06-25 12:05:28 -07:00
Anders Kaseorg
f990a1400f ruff: Fix FURB122 Use of f.write in a for loop.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-25 11:49:02 -07:00
Anders Kaseorg
e8fdae8f7b ruff: Fix PLR1733 Unnecessary lookup of dictionary value by key.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-25 11:49:02 -07:00
Kislay Verma
9507b7b36f organization settings: Clean up labels for custom time limits.
We make the text "minutes" agree with the number
in the input field.
In the future, we could make the units configurable
as in the invitation modal.

Fixes #34692.
2025-06-24 10:12:15 -07:00
Shubham Padia
1e50a98b01 help-beta: Add TODO list to keep track of items before cutover. 2025-06-23 09:48:43 -07:00
Shubham Padia
2977bf364e help-beta: Use FlattenList component instead of hacky middleware.
We want to follow the Astro way of doing things and the middleware was
adding more magic + it was violating commonmark spec:
https://spec.commonmark.org/0.31.2/#example-301.

We insert FlattenList component where include files are being
treated as part of ordered lists. Astro renders included files as it's
own component, which would result in multiple ordered lists instead of
a single list if we did not use this component. See the astro component
file itself to know more how FlattenedSteps works.

We are not inserting FlattenList component for files with !!! tip
components, since we need to do it inside the include file. There are 4
such files at the time of writing this comment.
`is_include_only_ordered_list` makes sure of that. We can do the
conversion for it manually during cutover or in a followup PR.

All unordered lists at the time of writing this comment are standalone
components and we do not need to do any transformation for them.

We also changed the order of conversion of include and main files.
Include files are now being converted first to calculate
include_files_info.

Relevant topic:
https://chat.zulip.org/#narrow/channel/19-documentation/topic/Stage.202.3A.20New.20syntax.20for.20imports
2025-06-20 16:18:16 -07:00
Niloth P
6a1d231689 integrations: Use directory name to get HTTP headers from fixtures.
Previously, the integration's name was directly being used.
Due to this, the GitHub Sponsors integration which is in the same module
as the GitHub integration could not be used with the
`generate-integration-docs-screenshot` script, as it would be unable to
locate the fixtures.
2025-06-09 15:59:39 -07:00
Anders Kaseorg
5a090c47ad requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-06 11:35:32 -07:00
Anders Kaseorg
b6f111cc0c test-documentation: Remove unneeded HTML validation exemptions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-04 16:52:08 -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
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
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
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
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
Shubham Padia
5bbb7ebd1a help-beta: Convert tabs syntax to equivalent MDX syntax.
Fixes #31248.
For cases with zero tabs in our current help center, we were using the
tab syntax just to put a border around the instructions without any tab
label. We do not want that border anymore since Tabs also don't have any
borders. So, we just remove the old tab syntax in that case during our
conversion.

We also move the admonition to asides conversion before the tabs syntax
conversion since the tabs conversion happening first was messing with
the asides conversion and was resulting into some missing closing tags.
We can modify things to work regardless of order, but doesn't seem worth
digging into for a conversion script.
2025-05-28 16:42:16 -07:00
Shubham Padia
a23d928662 help-beta: Indent the content inside Asides or KeyboardTip.
MDX files were getting harder to read without proper indentation.
2025-05-28 16:42:16 -07:00
Shubham Padia
26595799c7 icons: Let the system using the icons specify the stroke property.
Fixes #34716.
The stroke property is ignored when we generate webfonts in our main
app. See
https://zulip.readthedocs.io/en/latest/subsystems/icons.html#cleaning-up-the-svg-code
for more details.
2025-05-27 10:00:21 -07:00
Shubham Padia
840817d2df icons: Let the system using the icons specify the fill-rule color.
The fill-rule color is ignored when we generate webfonts in our main
app. See
https://zulip.readthedocs.io/en/latest/subsystems/icons.html#cleaning-up-the-svg-code
for more details.
2025-05-27 10:00:21 -07:00
Shubham Padia
259ef423ad icons: Let the system using the icons specify the fill color.
The fill color is ignored when we generate webfonts in our main app.
For our help center beta project using Astro, we would have needed to
come up with a way to change fill colors for all the icons. Since, there
was no reason for us to keep the fill colors in the SVGs, we decided to
remove it instead and add a lint rule to keep that in check.
See
https://chat.zulip.org/#narrow/channel/6-frontend/topic/fill.20in.20our.20current.20svg.20icons
for more details.
2025-05-22 16:00:21 -07:00
Anders Kaseorg
42360c9477 production-build: Bump es-check language version to es2022.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-21 16:30:07 -07:00
Vector73
c5c1b79580 tools: Update docs for create-api-changelog tool. 2025-05-21 12:04:45 -07:00
Alex Vandiver
1f0cfd4662 email-mirror: Add a standalone server that processes incoming email.
Using postfix to handle the incoming email gateway complicates things
a great deal:

- It cannot verify that incoming email addresses exist in Zulip before
  accepting them; it thus accepts mail at the `RCPT TO` stage which it
  cannot handle, and thus must reject after the `DATA`.

- It is built to handle both incoming and outgoing email, which
  results in subtle errors (1c17583ad5, 79931051bd, a53092687e,
  #18600).

- Rate-limiting happens much too late to avoid denial of
  service (#12501).

- Mis-configurations of the HTTP endpoint can break incoming
  mail (#18105).

Provide a replacement SMTP server which accepts incoming email on port
25, verifies that Zulip can accept the address, and that no
rate-limits are being broken, and then adds it directly to the
relevant queue.

Removes an incorrect comment which implied that missed-message
addresses were only usable once.  We leave rate-limiting to only
channel email addresses, since missed-message addresses are unlikely
to be placed into automated systems, as channel email addresses are.

Also simplifies #7814 somewhat.
2025-05-19 16:39:44 -07:00
Shubham Padia
078a27def2 help-beta: Convert admonitions to asides and KeyboardTip.
Fixes #31249.
We have converted `warn` to `note` since that was the translation that
remains most faithful to how we display `warn` admonitions in our
current help center implementation. See
https://chat.zulip.org/#narrow/channel/19-documentation/topic/Stage.202.3A.20New.20syntax.20for.20!!!tip.20in.20help-beta/near/2174415
for more details.

We've also duplicated code from Python-Markdown to represent how
admonitions worked there more accurately. Duplication should be fine
since this is a one-off script and Python-Markdown is not a project
that's gonna change drastically in the future.
2025-05-15 11:53:40 -07:00
Aman Agrawal
136c0f1c44 registration: Enable import from slack using realm registration form.
Co-authored-by: Alex Vandiver <alexmv@zulip.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-05-14 13:24:38 -07:00
Alex Vandiver
41fbe0bb4f kandra: Install PostgreSQL 17 by default. 2025-05-14 09:16:46 -07:00
Shubham Padia
dfc2a7d19a help-beta: Convert include files to mdx along with required conversion.
Earlier, we were just renaming the files in help/include and copying
them over. Which meant that none of the mdx features or any of the
components we add could be used there. We could also not support nested
imports which are a part of the help/include files.

We also set an explcit height and width of 1em for icons, since some odd
behaviour for icon height and width was noticed when writing this
commit. unplugin-icons sets height and width by itself. It was setting
the height to 1024 and 960 for some icons. It is better to set the
height explicitly.
2025-05-13 10:21:17 -07:00
Shubham Padia
b1bf937cad help-beta: Remove BASE_DIR from path.join for output_dir.
BASE_DIR is already part of output_dir. There is no need to specify it
once more.
2025-05-13 10:21:17 -07:00
Shubham Padia
130877615e help-beta: Use .insert to insert string at a particular line.
The previous logic could not handle adding the given string at the 1st
line. We also rename the function to accurately represent what it does,
insert_string_at_line.
2025-05-13 10:21:17 -07:00
Shubham Padia
bb7af6e5c1 help-beta: Refactor convert_string_to_mdx to handle file read as well.
In future, we intend to add a function that will read the include files
and do a conversion to mdx. That conversion will be different from the
conversion that we are doing right now for the main help files. That is
why we have extracted the markdown file reading logic to the
`get_markdown_string_from_file` and renamed `convert_string_to_mdx` to
`convert_help_center_file_to_mdx` to be more specific for help center
files.
2025-05-13 10:21:17 -07:00
Shubham Padia
0f85d6327d help-beta: Fix bug of not rendering font-awesome icons correctly.
In `replace_icons`, when replacing zulip icons, the original
`markdown_string` was being passed instead of the result from the
previous font-awesome icon replacement.
2025-05-13 10:21:17 -07:00
Shubham Padia
68ec074a84 help-beta: Add support for displaying zulip icons.
We're using unplugin-icons to do so.
2025-05-12 18:13:26 -07:00
Shubham Padia
c97cd1c5dd help-beta: Add support for displaying font-awesome icons.
In our app, we use the font-awesome stylesheet, add it to our webpack
bundle and use the appropriate class with the <i> tag.
Here. although for font-awesome, we can use the stylesheet to do the
same, we would need to use `webfonts-loader` for our custom icons.
In this astro project, we want to follow the Astro way, and
unplugin-icons fits better with the Astro way of doing things.
See this topic on the discussion on how we chose unplugin-icons:
https://chat.zulip.org/#narrow/channel/19-documentation/topic/Stage.202.3A.20Icons/near/2168842
2025-05-12 18:13:26 -07:00
Shubham Padia
b378e33136 help-beta: Make it easier to keep track of imports in conversion.
Before this, every function itself was responsible for adding it's own
imports. That is extra string manipulation which we had to think about
everytime we were adding new conversion function.
Now, we have an import statement set that the functions can modify, and
we have a function responsible for adding those imports. This makes it
easier in the future to add more conversion functions which might be
introducing imports.
2025-05-12 18:13:26 -07:00
Vector73
8e400eb283 tools: Update files in api_docs folder along with zulip.yaml. 2025-05-12 16:00:29 -07:00
Vector73
42439b8f09 tools: Update version along with feature level.
Fixed merge-api-changelogs tool to update version too along
with feature level in API docs.
2025-05-12 16:00:29 -07:00
Anders Kaseorg
61c04078cc server_events: Extract interface for compose, transmit to new module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-12 11:07:12 -07:00
Shubham Padia
05542d6cb4 help-beta: Pass allowedHosts when running dev server.
Vite introduced allowedHosts config at
https://vite.dev/config/server-options#server-allowedhosts. This caused
our help beta dev server to break in case of dev droplets since it's
hostname is not specified in the allowed lists. Since we have a way to
know our hostname, we do not pass a blanket true for all hostnames in
this case.
2025-05-08 09:40:12 -07:00
Tim Abbott
c09b0b9b6b tools: Fix temporary feature level calculation. 2025-05-06 15:58:58 -07:00