Skip to content

feat(chat): render assistant messages as sanitized markdown#60

Open
kathifis wants to merge 5 commits into
mainfrom
feat/chat-markdown-rendering
Open

feat(chat): render assistant messages as sanitized markdown#60
kathifis wants to merge 5 commits into
mainfrom
feat/chat-markdown-rendering

Conversation

@kathifis

@kathifis kathifis commented Jun 15, 2026

Copy link
Copy Markdown

Summary (Issue #57)

Adds sanitized Markdown rendering for chat messages and a copy button for fenced code blocks.

Markdown rendering

  • Add marked + dompurify
  • New MarkdownRenderer.vue, used in ChatMessage.vue
  • Loading/error states remain plain text

Copy button (sub-issue #61)

  • Copy button on fenced code blocks (hover, top-right)
  • Clipboard copy with brief "Copied!" / "Kopiert!" feedback
  • No button on inline code; labels in EN/DE

Acceptance criteria

Criterion Status
Lightweight Markdown library (marked + DOMPurify)
ChatMessage.vue renders formatted Markdown
Sanitized output (no XSS via v-html)
Inline code & code blocks ✅ (no syntax highlighting yet)
Lists, bold, italic, headings, links
Styling fits chat theme (light/dark via CSS variables)
Loading/error states unchanged
Tests for Markdown component
Copy button for code blocks
Syntax highlighting ➖ follow-up issue

@opencode-agent

Copy link
Copy Markdown

Reviewing the PR for WoPeD Next to render assistant chat messages as sanitized markdown:

  • i18n: No new user-visible strings added, so no i18n keys needed. This aligns with the PR scope.
  • Tests: New comprehensive tests added for MarkdownRenderer component covering formatting, lists, code blocks, links, and XSS safety. Good coverage.
  • CSS variables: The MarkdownRenderer.vue component uses CSS variables for theming (currentColor, etc.) consistent with project guidelines.
  • TypeScript: The newly added test file and components appear to be properly typed with TypeScript.
  • nanoid: No new Petri net element IDs created, so no use of nanoid expected or needed.

Summary comment:
The PR correctly adds safe Markdown rendering for chat messages with thorough tests and proper use of CSS variables and TypeScript. No i18n impact and no nanoid use, all fitting WoPeD Next coding conventions. Ready for merge.

New%20session%20-%202026-06-15T13%3A34%3A06.816Z
opencode session  |  github run

@opencode-agent

Copy link
Copy Markdown

Review summary for PR "feat(chat): render assistant messages as sanitized markdown":

  • i18n: Minor updates adding keys in en.ts and de.ts for chat markdown-related labels, consistent with conventions.
  • Tests: Comprehensive new tests for MarkdownRenderer component covering formatting, lists, code blocks, links, and XSS sanitization.
  • CSS variables: MarkdownRenderer.vue uses CSS variables and currentColor for adaptive theming as per project guidelines.
  • TypeScript: New components and test files properly typed; env.d.ts added correctly for module declarations.
  • nanoid: No new Petri net IDs created, so no use of nanoid necessary.

The changes align well with WoPeD Next conventions on i18n, tests, styling, typings, and IDs. This PR is well-structured, maintains security (sanitization), and is ready for merge.

New%20session%20-%202026-06-15T14%3A05%3A00.586Z
opencode session  |  github run

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