From 49aa9e6cf3fe9e7397996ddd1e16e52515318c5e Mon Sep 17 00:00:00 2001 From: Emanuele Di Bella Date: Tue, 23 Jun 2026 14:29:20 +0200 Subject: [PATCH 1/2] feat(markdown): add wide editor toggle Add a header control to expand Markdown editing to the full available editor box.\n\nKeep the wide layout scoped to the editor container and use English labels for the toggle. --- .../components/markdown-artifact-editor.tsx | 38 ++++++++++++++----- web/src/styles/milkdown-theme.css | 7 ++++ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/web/src/components/markdown-artifact-editor.tsx b/web/src/components/markdown-artifact-editor.tsx index cbc197b..ff13546 100644 --- a/web/src/components/markdown-artifact-editor.tsx +++ b/web/src/components/markdown-artifact-editor.tsx @@ -1,4 +1,6 @@ import { useCallback, useEffect, useRef, useState } from "react" +import { FullScreenIcon, MinimizeScreenIcon } from "@hugeicons/core-free-icons" +import { HugeiconsIcon } from "@hugeicons/react" import { CrepeMarkdownEditor } from "@/components/crepe-markdown-editor" import type { @@ -6,6 +8,8 @@ import type { MarkdownCommandFile, MarkdownCommandUser, } from "@/components/crepe-markdown-editor" +import { Button } from "@/components/ui/button" +import { cn } from "@/lib/utils" import { sanitizeMarkdownLinks } from "@/lib/markdown-safety" export type MarkdownEditorMode = "rich" | "source" @@ -177,6 +181,7 @@ function LoadedMarkdownArtifactEditor({ const metadata = parseFrontmatter(content) const editorRef = useRef(null) const [mode, setMode] = useState("rich") + const [wideEditor, setWideEditor] = useState(false) const [savedFullContent, setSavedFullContent] = useState(initialFullContent) const [draftFullContent, setDraftFullContent] = useState(initialFullContent) const [savedBody, setSavedBody] = useState(initialBody) @@ -308,18 +313,33 @@ function LoadedMarkdownArtifactEditor({ return (
-
-
- {path || title} - {metadata.creator ? {metadata.creator} : null} - {metadata.created ? ( - {formatMetaDate(metadata.created)} - ) : null} +
+
+
+ {path || title} + {metadata.creator ? {metadata.creator} : null} + {metadata.created ? ( + {formatMetaDate(metadata.created)} + ) : null} +
+
{mode === "source" ? ( -
+