Skip to content

feat: render markdown files with MarkdownContent in File Browser#10

Open
epaproditus wants to merge 2 commits into
agent37-platform:mainfrom
epaproditus:main
Open

feat: render markdown files with MarkdownContent in File Browser#10
epaproditus wants to merge 2 commits into
agent37-platform:mainfrom
epaproditus:main

Conversation

@epaproditus

Copy link
Copy Markdown

Makes the File Browser render .md / .markdown files as formatted previews using the existing MarkdownContent component (streamdown), with a toggle to switch to the raw textarea for editing.

Changes (one file)

client/src/components/FileBrowserPage.tsx — 23 lines added:

  1. Import MarkdownContent (already existed in codebase)
  2. isMarkdownFile() helper (follows isCsvFile pattern)
  3. preview state in EditorView — toggles between rendered preview and raw textarea
  4. Conditional render — markdown files in preview mode show <MarkdownContent> instead of <textarea>
  5. Toggle button in editor toolbar — "Edit" switches to raw source, "Preview" switches back

Behavior

Action Result
Open .md file Rendered markdown with headers, lists, code blocks, tables, links
Click Edit Raw textarea with markdown source
Click Preview Back to rendered view
Conflict Toggle hidden — forces textarea for resolution

No new dependencies — all already in the project.

Cline Bot and others added 2 commits May 31, 2026 15:07
Adds a preview/edit toggle for .md and .markdown files:
- Preview mode renders content using existing MarkdownContent (streamdown)
- Edit mode shows raw textarea for editing source
- Toggle button in toolbar switches between modes
- Hidden during conflict state (forces textarea for resolution)

Follows the same pattern as CsvEditor replacing textarea.
feat: render markdown files with MarkdownContent in File Browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant