Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

starlight_help: Add comments for the tip components.

Shubham Padia550195463758
diff --git a/starlight_help/src/components/KeyboardTip.astro b/starlight_help/src/components/KeyboardTip.astro
index 337c026467b..dddf116147c 100644
--- a/starlight_help/src/components/KeyboardTip.astro
+++ b/starlight_help/src/components/KeyboardTip.astro
@@ -15,6 +15,12 @@ assert.ok(
);
keyboard_icon_first_child.properties.class = "zulip-unplugin-icon";
+// We want to add the `Keyboard tip: ` prefix without a line break or
+// wrapping it in a paragraph. If we write `Keyboard tip: <slot />`,
+// slot will be wrapped in it's own paragraph and thus will be placed on
+// the next line as `Keyboard tip:`. We have to edit slot HTML tree
+// directly instead to solve this. Same case applies for the keyboard
+// icon we are inserting. We just inject the icon as raw svg.
const prefix_element_list = [
keyboard_icon_first_child,
{
diff --git a/starlight_help/src/components/ZulipTip.astro b/starlight_help/src/components/ZulipTip.astro
index 375a286c2fe..b0b74b63e18 100644
--- a/starlight_help/src/components/ZulipTip.astro
+++ b/starlight_help/src/components/ZulipTip.astro
@@ -16,6 +16,12 @@ assert.ok(
lightbulb_icon_first_child.properties.class =
"zulip-unplugin-icon aside-icon-lightbulb";
+// We want to add the `Tip: ` prefix without a line break or wrapping
+// it in a paragraph. If we write `Tip: <slot />`, slot will be wrapped
+// in it's own paragraph and thus will be placed on the next line as
+// `Tip:`. We have to edit slot HTML tree directly instead to solve this.
+// Same case applies for the ligthbulb icon we are inserting. We just
+// inject the icon as raw svg.
let prefix_element_list = [
lightbulb_icon_first_child,
{