Commit Graph

5750 Commits

Author SHA1 Message Date
Shubham Padia
de472a09f9 help-beta: Add footer to the new help center.
Fixes #35116.
We copied whatever logic we needed from documentation_main.html. We have
not added the policy footer case from that html file into our footer
since that case does not apply to the new help center yet.
We process and pass the support email in the build help center step.
2025-07-14 10:45:40 -07:00
Shubham Padia
37da139442 help-beta: Use CORPORATE_ENABLED instead of SHOW_BILLING_HELP_LINKS.
We should use the generic name of the env variable since we intend to
use it in places without the billing help links context.
2025-07-14 10:45:40 -07:00
Vector73
a77fc6aa79 stream_settings: Add new disable_topics option to topics_policy.
Adds new configuration option `disable_topics` in `topics_policy`
channel setting to support disabling topics in the channel.

Fixes #34553.
2025-07-09 14:25:53 -07:00
Vector73
f9d52189fc github_actions: Check if feature levels are updated in API docs.
In the past, some API documentation changes were merged with
unresolved placeholders like "ZF-..." instead of actual feature level numbers.
This commit introduces a GitHub Action that scans the API docs for
any occurrence of "ZF-". If found, it will fail the CI check and block the
commit from being merged into main.

This ensures that all feature level references are properly updated before merging.
2025-07-09 09:33:55 -07:00
Kislay Verma
e6dabb4ef4 compose_paste: Convert large pasted text into uploaded text file.
When pasting a long piece of text into the compose box (or
message edit textarea), we show a banner giving an option to
put the text into a file and upload it.

The banner is only shown if the text is larger than
`MINIMUM_PASTE_SIZE_FOR_FILE_TREATMENT`.

If the user chooses to "convert to file", the textarea content is
restored to its state before pasting and a file with the pasted
content is uploaded. The banner is hidden as soon as any change is
made to the textarea content to avoid inconsistent state and
confusion.

Fixes #33107.

Co-authored-by: Aditya Chaudhary <aditya.chaudhary1558@gmail.com>
2025-07-08 18:58:03 -07:00
Sayam Samal
71d75532fe inputs: Implement redesigned input component.
This commit serves as the base for the ongoing effort to standardize
redesigned input elements throughout the Zulip Web UI. It introduces a
new Handlebars partial block for inputs, located at
web/templates/components/input.hbs.

The partial can be used with the partial block syntax: {{#> input}},
allowing contributors to pass in the input element as a template. This
approach wraps the input with a consistent structure that includes
support for an icon and an action button. It also applies the necessary
styling to ensure visual and functional consistency across the web UI.

This commit also implements the filter input component at
/devtools/inputs/ showroom page for design discussions and prototyping.
2025-07-03 11:45:35 -07:00
Aman Agrawal
4a8d86f151 overlays: Add overlay to display scheduled reminders. 2025-07-02 13:02:45 -07:00
Vector73
459b4867f2 tools: Add support for viewing updated changelog for testing.
Adds support for showing unmerged changelogs in
"changelog.md" for testing purposes.
2025-07-02 11:34:34 -07:00
Tim Abbott
3593c5f4c7 run-dev: Disable Django runserver warning. 2025-07-02 11:25:30 -07:00
Shubham Padia
30ff98c2f6 help-beta: Function to insert flattened steps should run on includes.
We were not running this function on includes, for relative/settings
links and for nested includes, we need to flatten them in the includes
too.
2025-07-02 09:27:48 -07:00
Shubham Padia
aebbdee5b5 help-beta: Add eslint plugin for astro files. 2025-06-30 09:06:18 -07:00
Shubham Padia
f37ffd8937 help-beta: Add prettier plugin for astro files.
Even though we have separate packages for `help-beta`, we have opted to
put the prettier plugin and config for astro files in the main project
itself, so that linting needs to be configured only at one place.
2025-06-30 09:06:18 -07:00
Shubham Padia
7e359465cd help-beta: Do not use stderr=subprocess.STDOUT in build-help-center.
The default of using actual STDERR is fine.
2025-06-30 09:06:02 -07:00
Shubham Padia
b7fa1e6a3c help-beta: Only convert .md files.
Fixes https://chat.zulip.org/#narrow/channel/19-documentation/topic/build-help-center.20exceptions

We were getting an error during the conversion step if there was somehow
a non utf-8 file in /help. In the case that we encountered, it was most
likely .DS_Store created by MacOS.
2025-06-29 23:32:25 -07:00
Anders Kaseorg
a113a42e11 semgrep: Strengthen HTML and SQL injection checks.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-29 23:14:11 -07:00
Tim Abbott
ed2e9777c9 build-help-center: Don't fail the first time. 2025-06-26 11:24:31 -07:00
Tim Abbott
48c2b19066 tools: Fix linter error in build-help-center.
I'm not sure how I missed this when moving the django import.
2025-06-26 11:19:40 -07:00
Shubham Padia
8d4c2b7847 help-beta: Add support for relative links.
Fixes #31253.
We've added another env variable called `SHOW_BILLING_HELP_LINKS`.
This env variable is set to `settings.CORPORATE_ENABLED` if the
`build-help-center` tool is used.
2025-06-26 10:53:53 -07:00
Shubham Padia
a90856864a help-beta: Convert build-help-center to a Python script.
We need to fetch some values from settings in the future and use it in
the build process, we need our script to be in Python for that.
2025-06-26 10:53:51 -07:00
Shubham Padia
224b98b455 help-beta: Fix relative path during initial stages of conversion.
When we were doing it later, the issue we encountered was that when we
add support for relative links in the future, relative path fixing was
happening after `relative/help` had been added to the modified markdown
file, replacing it with `relative/help-beta` which wasn't the
replacement we intended.
2025-06-26 10:46:37 -07:00
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