From b1e58fd0300ac0553fc405fc5298c200eddf59c2 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 06:50:18 +0200 Subject: [PATCH] =?UTF-8?q?feat(markdown-editor):=20Markdown-Editor=20mit?= =?UTF-8?q?=20Live-Preview=20f=C3=BCr=20notes=20[tsc:fail]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .phase13-state.json | 3 +- .phase14-state.json | 5 + GENERATION_LOG.md | 24 ++++ apps/web/src/components/MarkdownEditor.tsx | 101 +++++++++++++++ scripts/phase14_features.py | 142 +++++++++++++++++++++ 5 files changed, 274 insertions(+), 1 deletion(-) create mode 100644 .phase14-state.json create mode 100644 apps/web/src/components/MarkdownEditor.tsx create mode 100644 scripts/phase14_features.py diff --git a/.phase13-state.json b/.phase13-state.json index 183ebf9..20bea98 100644 --- a/.phase13-state.json +++ b/.phase13-state.json @@ -6,6 +6,7 @@ "undo-toast", "breadcrumb-navigation", "in-app-changelog", - "aria-improvements" + "aria-improvements", + "kpi-comparison" ] } \ No newline at end of file diff --git a/.phase14-state.json b/.phase14-state.json new file mode 100644 index 0000000..d23398a --- /dev/null +++ b/.phase14-state.json @@ -0,0 +1,5 @@ +{ + "completed_features": [], + "current_feature": "markdown-editor", + "started_at": "2026-05-23T06:49:38.915806" +} \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 46cbf6b..e2230b9 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -1652,3 +1652,27 @@ src/index.ts(27,25): error TS2769: No overload matches this call. Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy +- `06:47:56` **INFO** Committed feature kpi-comparison +- `06:47:57` **INFO** Pushed: rc=0 + +## Phase-13 Run beendet (2026-05-23 06:47:57) + +- `06:47:57` **INFO** OK: 0, Attempted: 5, Total: 5 + +## 🚀 Phase-14 Codegen-Run gestartet (2026-05-23 06:49:38) + + +## Phase-3 Feature: markdown-editor (2026-05-23 06:49:38) + +- `06:49:38` **INFO** Description: Markdown-Editor mit Live-Preview für notes +- `06:49:38` **INFO** Generating apps/web/src/components/MarkdownEditor.tsx (MarkdownEditor-Component. Props: value, onChange, placeholder. Split-V…) +- `06:50:16` **INFO** wrote 4122 chars in 37.6s (attempt 1) +- `06:50:16` **INFO** Running tsc --noEmit on api… +- `06:50:18` **WARN** tsc errors: +src/index.ts(27,25): error TS2769: No overload matches this call. + Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTypeProvider>, opts: { ...; }, done: (err?: Error | undefined) => void): void'. + Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy diff --git a/apps/web/src/components/MarkdownEditor.tsx b/apps/web/src/components/MarkdownEditor.tsx new file mode 100644 index 0000000..2a9de39 --- /dev/null +++ b/apps/web/src/components/MarkdownEditor.tsx @@ -0,0 +1,101 @@ +import React, { useState } from 'react'; +import { LayoutPanelLeft, LayoutPanelRight, LayoutTemplate } from 'lucide-react'; + +interface MarkdownEditorProps { + value: string; + onChange: (val: string) => void; + placeholder?: string; +} + +type ViewMode = 'edit' | 'preview' | 'split'; + +export default function MarkdownEditor({ value, onChange, placeholder }: MarkdownEditorProps) { + const [mode, setMode] = useState('split'); + + const parseMarkdown = (text: string) => { + if (!text) return

No content...

; + + return text.split('\n\n').map((paragraph, idx) => { + let content = paragraph; + + // Headers + if (content.startsWith('## ')) { + return

{content.replace('## ', '')}

; + } + if (content.startsWith('# ')) { + return

{content.replace('# ', '')}

; + } + + // Lists + if (content.startsWith('- ')) { + const items = paragraph.split('\n').filter(line => line.startsWith('- ')); + return ( +
    + {items.map((item, i) => ( +
  • + ))} +
+ ); + } + + return

; + }); + }; + + const applyInlineFormatting = (text: string) => { + return text + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/\*\*(.*?)\*\*/g, '$1') + .replace(/\*(.*?)\*/g, '$1') + .replace(/`(.*?)`/g, '$1'); + }; + + return ( +

+
+ Markdown Editor +
+ + + +
+
+ +
+ {(mode === 'edit' || mode === 'split') && ( +