Description
The Notes editor in Notes.tsx is a plain <textarea> that renders saved content as whitespace-pre-wrap text. Notes are primarily used to record algorithm insights, time complexities, and code snippets — all of which benefit greatly from markdown formatting. The project already has both react-markdown and remark-gfm installed in app/package.json.
Requirements
- Add an Edit / Preview toggle to the note editor header.
- In Edit mode, the existing
<textarea> is shown.
- In Preview mode, content is rendered via
<ReactMarkdown> with remark-gfm plugins.
- Code blocks in the preview should be syntax-highlighted.
- On
lg: breakpoints, show both panels side-by-side.
- No new mandatory dependencies — use the already-installed
react-markdown and remark-gfm.
Expected Behavior
Edit Mode — Raw markdown text input in the existing <textarea>.
Preview Mode — Rendered HTML with formatted headings, lists, code blocks, and bold/italic text. Code blocks are syntax-highlighted.
Large Screens (lg: and above) — Editor on the left, live preview on the right, no toggle needed.
Tasks
Acceptance Criteria
Description
The Notes editor in
Notes.tsxis a plain<textarea>that renders saved content aswhitespace-pre-wraptext. Notes are primarily used to record algorithm insights, time complexities, and code snippets — all of which benefit greatly from markdown formatting. The project already has bothreact-markdownandremark-gfminstalled inapp/package.json.Requirements
<textarea>is shown.<ReactMarkdown>withremark-gfmplugins.lg:breakpoints, show both panels side-by-side.react-markdownandremark-gfm.Expected Behavior
Edit Mode — Raw markdown text input in the existing
<textarea>.Preview Mode — Rendered HTML with formatted headings, lists, code blocks, and bold/italic text. Code blocks are syntax-highlighted.
Large Screens (
lg:and above) — Editor on the left, live preview on the right, no toggle needed.Tasks
isPreviewboolean state to the note editor.whitespace-pre-wrapdiv in note view with<ReactMarkdown remarkPlugins={[remarkGfm]}>.prismorreact-syntax-highlighter).lg:screens, use a CSS grid to show editor and preview side-by-side.Acceptance Criteria