Skip to content

feat(code): add copy source button to markdown viewer#1948

Merged
dmarticus merged 1 commit intomainfrom
dmarticus/markdown-copy-source-button
Apr 30, 2026
Merged

feat(code): add copy source button to markdown viewer#1948
dmarticus merged 1 commit intomainfrom
dmarticus/markdown-copy-source-button

Conversation

@dmarticus
Copy link
Copy Markdown
Contributor

@dmarticus dmarticus commented Apr 29, 2026

Problem

When viewing a markdown file in PostHog Code's split view, there's a "View rendered" toggle but no way to grab the raw source. If you want to copy the markdown (e.g. to paste into Slack, an issue, or another doc), you have to switch to source view, select-all, then copy.

Changes

Added a Copy icon button next to the existing rendered/source toggle in the markdown viewer header. Clicking it copies the file's source contents to the clipboard and swaps the icon to a checkmark for 2s — same pattern as CodeBlock.tsx.

Demo

https://screen.studio/share/gxuVthEc

How did you test this?

  • Pre-commit hook ran biome + typecheck — both pass.
  • Have not yet manually verified in the running app (no dev server spun up here).

Publish to changelog?

no

@dmarticus dmarticus merged commit 1f53297 into main Apr 30, 2026
15 checks passed
@dmarticus dmarticus deleted the dmarticus/markdown-copy-source-button branch April 30, 2026 00:43
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.

2 participants