Files
AgenticCode/openspec/changes/archive/2026-04-05-enable-rich-text-display/specs/chat-ui/spec.md
local 7a5c22593a feat: enable rich text display for assistant messages
Add markdown-to-HTML rendering for assistant messages using Markdig with
HTML sanitization. Includes cached rendering to avoid lag during streaming,
styled markdown elements (code blocks, tables, lists, blockquotes) within
chat bubbles, and 18 unit tests covering rendering and XSS prevention.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:29:58 +01:00

1021 B

MODIFIED Requirements

Requirement: Message display

The chat page SHALL display messages in a vertically scrolling list, with each message showing the sender role (user or assistant), the message content, and a visual distinction between user and assistant messages (e.g., alignment, color, or avatar). Assistant messages SHALL render content as formatted HTML converted from markdown; user messages SHALL display as plain text.

Scenario: User message displayed

  • WHEN the user sends a message
  • THEN the message appears in the message list aligned or styled to indicate it is from the user, rendered as plain text

Scenario: Assistant message displayed

  • WHEN the assistant responds
  • THEN the response appears in the message list with distinct styling from user messages, with markdown content rendered as formatted HTML

Scenario: Message ordering

  • WHEN multiple messages exist in the conversation
  • THEN messages are displayed in chronological order, oldest at top