From d0a91def938947732127704910e1ea144b95918d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aatu=20V=C3=A4is=C3=A4nen?= Date: Thu, 9 Apr 2026 09:53:00 +0300 Subject: [PATCH 1/9] Improve PageActions responsiveness on mobile screen widths --- .../PageActions/PageActions.module.css | 45 +++++++++++++++---- .../ThumbsFeedback/ThumbsFeedback.module.css | 5 ++- src/styles/media.css | 3 +- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/src/components/PageActions/PageActions.module.css b/src/components/PageActions/PageActions.module.css index a293a083..5c90808d 100644 --- a/src/components/PageActions/PageActions.module.css +++ b/src/components/PageActions/PageActions.module.css @@ -1,6 +1,6 @@ .pageActions { display: flex; - gap: var(--m-3); + gap: var(--m-2); padding: var(--m-1-5) 0; border-bottom: 1px solid var(--color-tonal-neutral-2); margin-bottom: var(--m-5); @@ -10,7 +10,7 @@ &::after { content: ""; position: relative; - transform: translateX(var(--m-1-5)); + transform: translateX(var(--m-1)); width: 1px; height: 100%; background-color: var(--color-tonal-neutral-1); @@ -18,7 +18,19 @@ } } - @media (--lg-scr) { + @media (--md-scr) { + gap: var(--m-3); + + & > * { + &:not(:nth-last-child(2)) { + &::after { + transform: translateX(var(--m-1-5)); + } + } + } + } + + @media (--desktop-page-actions) { gap: var(--m-4); margin-bottom: var(--m-6); & > * { @@ -53,7 +65,8 @@ color: var(--color-foreground-slightly-muted); display: flex; align-items: center; - font-size: var(--fs-text-lg); + font-size: var(--fs-text-sm); + white-space: nowrap; letter-spacing: 0.024px; line-height: 1.625; margin: 0; @@ -61,11 +74,11 @@ font-weight: var(--fw-medium); & > svg { - width: 20px; - height: 20px; - min-width: 20px; - min-height: 20px; - margin-right: var(--m-0-5); + width: var(--m-2); + height: var(--m-2); + min-width: var(--m-2); + min-height: var(--m-2); + margin-right: 2px; & > path { fill: var(--color-foreground-muted); } @@ -74,10 +87,24 @@ @media (--xs-scr) { width: auto; height: auto; + font-size: var(--fs-text-md); + + & > svg { + margin-right: var(--m-0-5); + } } @media (--md-scr) { line-height: 1.75; + font-size: var(--fs-text-lg); + + & > svg { + width: 20px; + height: 20px; + min-width: 20px; + min-height: 20px; + margin-right: var(--m-0-5); + } } } diff --git a/src/components/ThumbsFeedback/ThumbsFeedback.module.css b/src/components/ThumbsFeedback/ThumbsFeedback.module.css index 9d6aa0a8..1adc8501 100644 --- a/src/components/ThumbsFeedback/ThumbsFeedback.module.css +++ b/src/components/ThumbsFeedback/ThumbsFeedback.module.css @@ -3,7 +3,7 @@ display: none; } - @media (--lg-scr) { + @media (--desktop-page-actions) { display: block !important; } @@ -83,7 +83,7 @@ color: var(--color-foreground-slightly-muted); align-items: center; gap: var(--m-1); - font-size: var(--fs-text-lg); + font-size: var(--fs-text-md); letter-spacing: 0.024px; line-height: 1.625; margin: 0; @@ -92,6 +92,7 @@ @media (--md-scr) { line-height: 1.75; + font-size: var(--fs-text-lg); } & > svg { diff --git a/src/styles/media.css b/src/styles/media.css index a0c29905..ec564e1c 100644 --- a/src/styles/media.css +++ b/src/styles/media.css @@ -3,4 +3,5 @@ @custom-media --md-scr (min-width: 901px); @custom-media --lg-scr (min-width: 1201px); @custom-media --xl-scr (min-width: 1401px); -@custom-media --nav (min-width: 997px); +@custom-media --nav (min-width: 1125px); +@custom-media --desktop-page-actions (min-width: 696px); From 95fc2ca4304acb28cb0555f7e1128c4c83f36e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aatu=20V=C3=A4is=C3=A4nen?= Date: Thu, 9 Apr 2026 13:57:04 +0300 Subject: [PATCH 2/9] Prevent images from appearing in the markdown version --- server/fixtures/llms/images.html | 2 ++ server/fixtures/llms/result/images.html | 2 ++ server/llms/rehype-prepare-html.test.ts | 13 +++++++++++++ server/llms/rehype-prepare-html.ts | 7 +++++++ 4 files changed, 24 insertions(+) create mode 100644 server/fixtures/llms/images.html create mode 100644 server/fixtures/llms/result/images.html diff --git a/server/fixtures/llms/images.html b/server/fixtures/llms/images.html new file mode 100644 index 00000000..40c82429 --- /dev/null +++ b/server/fixtures/llms/images.html @@ -0,0 +1,2 @@ +

Paragraph before image.

Logo +

Paragraph after image.

Diagram \ No newline at end of file diff --git a/server/fixtures/llms/result/images.html b/server/fixtures/llms/result/images.html new file mode 100644 index 00000000..7070ab1e --- /dev/null +++ b/server/fixtures/llms/result/images.html @@ -0,0 +1,2 @@ +

Paragraph before image.

+

Paragraph after image.

\ No newline at end of file diff --git a/server/llms/rehype-prepare-html.test.ts b/server/llms/rehype-prepare-html.test.ts index 2ce7472e..856e4847 100644 --- a/server/llms/rehype-prepare-html.test.ts +++ b/server/llms/rehype-prepare-html.test.ts @@ -146,6 +146,19 @@ describe("server/llms/rehype-prepare-html", () => { ); }); + test("Images: removes all img elements, preserving surrounding content", () => { + const result = transformer( + readFileSync(resolve("server/fixtures/llms/images.html"), "utf-8"), + ); + + expect((result.value as string).trim()).toBe( + readFileSync( + resolve("server/fixtures/llms/result/images.html"), + "utf-8", + ).trim(), + ); + }); + test("Irrelevant components: removes thumbsFeedback and checkpoint components, preserving other content", () => { const result = transformer( readFileSync( diff --git a/server/llms/rehype-prepare-html.ts b/server/llms/rehype-prepare-html.ts index 2ed5a4f6..88565bfb 100644 --- a/server/llms/rehype-prepare-html.ts +++ b/server/llms/rehype-prepare-html.ts @@ -11,6 +11,7 @@ import { visitParents, SKIP } from "unist-util-visit-parents"; * Code blocks: extract text content and replace with clean
 structure
  * Card links: prevent duplicate links in the markdown output
  * Heading anchor links: remove hash-link anchors from headings
+ * Images: remove all image elements from the output
  * Irrelevant components: remove interactive UI components (thumbsFeedback, checkpoint, docsHeader)
  * H1 repositioning: move the h1 heading to the top of the document
  */
@@ -86,6 +87,12 @@ const rehypePrepareHTML: Plugin<[], Root, Root> = function () {
         return SKIP; // don't traverse children (e.g. avoids capturing an h1 inside a removed node)
       }
 
+      // *** Images ***
+      if (element.tagName === "img") {
+        toRemove.push({ node: element, parent });
+        return SKIP;
+      }
+
       // *** Headings ***
       if (/^h[1-6]$/.test(element.tagName)) {
         // Remove hash-link anchor children in-place

From e1978e751dc7a67cab0f193676511dc11e9b27b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aatu=20V=C3=A4is=C3=A4nen?=
 
Date: Thu, 9 Apr 2026 13:57:48 +0300
Subject: [PATCH 3/9] Use Docusaurus Link to prevent broken relative links on
 the markdown versions of certain pages

---
 src/components/Button/Button.tsx | 3 ++-
 src/components/Tile/Tile.tsx     | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx
index f55f4fbd..b7199658 100644
--- a/src/components/Button/Button.tsx
+++ b/src/components/Button/Button.tsx
@@ -7,6 +7,7 @@ import type {
 import { clsx } from "clsx";
 
 import styles from "./Button.module.css";
+import Link from "@docusaurus/Link";
 
 export type ButtonVariant =
   | "primary"
@@ -55,7 +56,7 @@ const Button = ({
   };
 
   if (as === "link") {
-    return ;
+    return ;
   }
 
   return