Commit Graph

66 Commits

Author SHA1 Message Date
Anders Kaseorg
d0f9fb73cc dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-07-22 14:19:56 -07:00
Shubham Padia
81464c2812 help-beta: Make icons work in dark mode.
The icons were not changing color in dark mode, after setting fill to
currentColor, that problem should be solved.
2025-07-22 12:55:05 -07:00
Shubham Padia
bd935e07d8 help-beta: Use defaultClass instead of defaultStyle.
Somehow defaultStyle was not getting applied in all cases, but
defaultClass was getting applied in all cases. We don't have time to
investigate, but using a class is better anyways, so this change should
be fine.
2025-07-22 12:55:05 -07:00
Anders Kaseorg
7236476a9d help-beta: Downgrade to Zod 3.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-07-22 10:29:37 -07:00
Shubham Padia
21558bd784 help-beta: Decrease line height to make text easier to read. 2025-07-21 12:56:52 -07:00
Shubham Padia
6d93465f3b help-beta: Remove header from Zulip note.
We don't want to have a title of note and the ⓘ  icon in the note aside.
The only way to do this is to have our custom component called
ZulipNote.
2025-07-21 12:56:52 -07:00
Tim Abbott
eaf4970215 help-beta: Shrink all the headings some more. 2025-07-18 14:12:16 -07:00
Shubham Padia
4dc802aa9a help-beta: Add option to format mdx documents.
Partially fixes #35129.

Prettier could not be used because of prettier issue number 12209, not
linked here to avoid spam backlinks on the original issue. Prettier does
not have support for mdx v2 and v3.

We are using remarkLintRulesLintRecommended and
remarkPresentLintMarkdownStyleGuide as our starting set of rules.
None of the rules were giving an error on the starting set, but some
rules were giving lots of warnings on the generated mdx. They are
set to false in this file, we can add them back later as and when
required.

We have not inserted this in the main lint tool, we should do that in
the final cutover PR since we don't want the lint here to give any
unexpected warnings when people are linting stuff unrelated to the mdx
files.

This commit has been tested out on the current state of help center to
not produce any errors or warnings. The first run of format will produce
tons of warnings which are the issues being auto-fixed by the linter.
After that, the second run should produce zero errors.
2025-07-18 12:44:29 -07:00
Shubham Padia
9c22cc07f6 help-beta: Remove top margin from unplugin icons.
In some cases, some of the starlight css was inserting a margin top of
1rem to the svg tag inserted by unplgin-icons. We make the top margin
0 explicitly to make sure that extra margin is not added.
2025-07-17 09:21:16 -07:00
Shubham Padia
a738ac0ff7 help-beta: Fix incorrectly linked entries in sidebar.
Slug was mentioned for the two entries in question as if they were
normal help pages, but they were external links and should have been
mentioned accordingly.
2025-07-17 09:20:34 -07:00
Shubham Padia
070b94aabc help-beta: Set first paragraph of content as meta.description.
Fixes #35115.
2025-07-16 12:02:32 -07:00
Shubham Padia
c03328eeee help-beta: Use astro recommended tsconfig for our project.
Having some options not set to true was causing hard to debug issues
when it comes to types. While that can be solved by changing `allowJs`
to true, it would be good to use the standard tsconfig they recommend in
order to avoid such issues in the future.
2025-07-16 12:02:32 -07:00
Shubham Padia
e0abc5253b help-beta: Adjust kbd tags if the user is using a mac style keyboard.
Fixes #31287.
These tags are not limited to just KeyboardTip, so we want to run the
transformation on all html.
We need to run the transformation client-side since the user's keyboard
style is only known at that time.
We had to override the HEAD component since that's what starlight
recommends to do if we want to include local assets on every page. If we
were using a remote js file, we could have modified the head config
option provided by starlight.
The script file to adjust the tags is mostly just copy-paste of the
original function to adjust for the lack of JQuery. Most of the comments
are also copy-pasted.
One change in the new script is to just use ⌘ symbol directly instead of
using zulip-icon since we don't have any centering problems in the new
help center.
2025-07-16 12:00:45 -07:00
Shubham Padia
1a2adb4e82 help-beta: Update sidebar to the current state.
Partially fixes #35130.
We will still need to do a second check before the cutover, but this
commit does most of the work before the cutover happens.
The comparison was done manually.
Added comment to sidebar index should help update these changes to astro
config, although we will not solely rely on people reading that. A
second check before cutover would be prudent.
2025-07-15 12:23:47 -07:00
Shubham Padia
183b79b1ab help-beta: Highlight heading if it is the target.
Fixes #35119.
In the old help center, our css used to target each heading tag, h1, h2,
etc. individually. We don't need to do that anymore since the first
child of .sl-heading-wrapper is the heading element in starlight.

The rounded border on the top left and top right has been removed since
it did not look good with the default starlight theme.
2025-07-15 09:15:37 -07:00
Shubham Padia
2cdcadf1c6 help-beta: Remove border after the title. 2025-07-15 09:11:27 -07:00
Shubham Padia
4f23bd2e68 help-beta: Decrease heading sizing by a factor of 1.
Fixes #35123.
2025-07-15 09:11:27 -07:00
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
Shubham Padia
124da4d588 help-beta: Nested lists should not have 1rem margin.
Fixes #35126.
2025-07-14 10:42:25 -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
b630c1d175 NavigationSteps: Rename LINK_TYPE_HANDLERS to signify their behaviour.
Also modify a comment in the file to be more accurate.
2025-06-30 09:06:18 -07:00
Shubham Padia
9c00f3b746 NavigationSteps: Use correct template for help menu relative links.
The wrong template was used here by mistake when the logic from
`help_relative_links` was ported here.
2025-06-30 09:06:18 -07:00
Shubham Padia
aa98915371 NavigationSteps: Rename setting_type_name to setting_type.
The trailing `_name` was redundant.
2025-06-30 09:06:18 -07:00
Shubham Padia
2ba160ec19 NavigationSteps: Use shared constant value for setting_type.
We only have two possible values for setting_type in
setting_link_mapping, and we should use a shared constant value for
them.
2025-06-30 09:06:18 -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
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
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
Shubham Padia
a25000298f help-beta: Add styling for ordered lists to be similar to Steps.
Fixes #34705.
We just copied the css from Steps component of Astro and applied it to
all ordered lists in our case. Future starlight upgrades have the
potential to break this css if they change the underlying variable
names, but the breaks would be obvious when testing the upgrade and if
it becomes a consistent issue, we can look into some other solution.
2025-06-12 11:34:39 -07:00
Shubham Padia
d134c1fa01 help-beta: Pass fill property to component instead of str manipulation.
The reason we were doing string manipulation was that when using the
keyboard icon for KeyboardTip.astro, we were getting a blank spot if the
fill was not sent to currentColor. This commit instead passes the
currentColor for the imported unplugin icon directly. This commit only
addresses this specific component, any other instances of the icon color
being same as the page color still remain and this commit does not solve
that.
2025-05-16 11:05:39 -07:00
Shubham Padia
9d9b0c01fc help-beta: Add KeyboardTip component.
We also add unplugin types to tsconfig.json. We didn't need them before
since those types were not used in any astro components and were used in
mdx files directly instead.

We have an open PR to the upstream starlight repository to add support
for custom icons in the Aside starlight component. The PR is stalled
due to dependency on some of the custom icons work being done on
starlight. We should replace the code below with the Aside starlight
component along with a custom icon (keyboard in out case).
Not linking it directly to avoid necessary mentions on the original PR
whenever this commit is pushed. The PR number is 2261 in
https://github.com/withastro/starlight.
2025-05-15 11:53:40 -07:00
Shubham Padia
231cae594e help-beta: Set svg fill color explicitly to currentColor.
unplugin-icons suggests to set the fill color, there were some cases
were it was being set to none.
2025-05-15 11:53:40 -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
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
Anders Kaseorg
dc7f34491b dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-05 14:15:44 -07:00
Shubham Padia
b813d868a7 help-beta: Merge lists of same type adjacent to each other.
Fixes #31252.
One of our major use cases for file imports is to have bullet points as
partials to import at different places in the project. But when
importing the file with Astro, it creates its own lists. So we merge
lists together if they have nothing but whitespace between them.
There were some talks to use a component called FlattenList that would
flatten the list inside it, but that would also flatten lists that were
nested on purpose. This approach while feeling a bit hacky would not
flatten nested lists.
2025-04-15 13:55:09 -07:00
Shubham Padia
c0a2b2a31d help-beta: Convert our custom file import syntax to astro.
We use all these markdown files in `include` only to import them into
our main help markdown files. Most of these files are bulleted lists of
text. When importing these files, they might appear as an indented
sublist of an existing list. We plan to introduce mechanism to flatten
it in further commits.
2025-04-15 13:55:09 -07:00
Shubham Padia
1982aae0fc help-beta: Remove deleted page from sidebar config.
I haven't done a pass for the new pages, that should be done when the
actual transition happens.
2025-04-15 13:55:09 -07:00
Anders Kaseorg
440864e7c9 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-04-09 15:46:56 -07:00
Shubham Padia
496aa16f19 help-beta: Add component for emoticon translations table.
Fixes #31257.
2025-04-07 10:33:39 -07:00
Lauryn Menard
e853f3cb9b help: Rename and redirect "Edit a bot" to "Manage a bot".
Fixes #32887.

Co-authored-by: ahmedgulabkhan <demoncommand97@gmail.com>
2025-03-17 10:52:25 -07:00
Anders Kaseorg
c71aeae34d dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-26 16:20:47 -08:00
Lauryn Menard
2de2b22d55 help: Update for subscribe/unsubscribe user to channel terminology.
Instead of referring to users being added or removed from channels,
we now use subscribe or unsubscribed from channels.

Splits the article for adding and removing users from a channel
into separate articles: /help/subscribe-users-to-a-channel and
/help/unsubscribe-users-from-a-channel.

The URL redirects for the combined add/remove articles (for both
channel and stream terminology) go to the subscribe users to a
channel article.
2025-02-10 15:54:35 -08:00
Anders Kaseorg
ac19e90f40 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-29 15:04:09 -08:00
Anders Kaseorg
a9d64d5604 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-02 17:30:40 -08:00
Anders Kaseorg
ed6dc25710 help-beta: Fix sidebar for change-a-users-role rename.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-23 13:01:27 -08:00
Anders Kaseorg
f0aa6e0a05 help-beta: Fix sidebar for roles-and-permissions rename.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-23 13:01:27 -08:00
Anders Kaseorg
18218f3100 help-beta: Fix sidebar for review-your-organization-settings removal.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-23 13:01:27 -08:00