From 390b541b0a0260e605525cb6250fe0edb2cb0141 Mon Sep 17 00:00:00 2001 From: Andrew S Erwin Date: Mon, 2 Nov 2026 21:56:51 -0600 Subject: [PATCH] Add a visible Markdown formatting bar to pages and bookmark notes Shared component (components/markdown-toolbar.tsx): bold/italic/ strikethrough/inline code/link with URL preselected, H1-H3, quote, bullet/numbered/to-do line-prefix toggles across the selection, divider. Mounted above the page editor textarea and the notes editor in the bookmark detail sheet; the textarea stays the source of truth so autosave/conflict handling and the notes save flow are untouched, and the page slash menu remains as the keyboard path. Gitea issue #7. --- web/app/(app)/pages/client.tsx | 2 + web/components/bookmark-detail-sheet.tsx | 9 +- web/components/markdown-toolbar.tsx | 118 +++++++++++++++++++++++ 3 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 web/components/markdown-toolbar.tsx diff --git a/web/app/(app)/pages/client.tsx b/web/app/(app)/pages/client.tsx index e98fb03..49b3f17 100644 --- a/web/app/(app)/pages/client.tsx +++ b/web/app/(app)/pages/client.tsx @@ -17,6 +17,7 @@ import { Textarea } from '@/components/ui/textarea' import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog' import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover' import { cn } from '@/lib/utils' +import { MarkdownToolbar } from '@/components/markdown-toolbar' import { PageAutosave, PageConflictError, type PageSaveState } from '@/lib/page-autosave' import { PAGES_CHANGED, collectionEmbedMarkdown, descendantPageIds, internalPageId, nextUntitledTitle, @@ -822,6 +823,7 @@ export function PagesClient({ initialId }: { initialId: string | null }) { {mode === 'edit' ? (
+