Skip to content

fix(session-ui): upgrade DOMPurify and restore Mermaid rendering - #45773

Merged
Hona merged 2 commits into
anomalyco:v2from
Hona:upgrade-dompurify
Aug 28, 2026
Merged

Hona merged 2 commits into
anomalyco:v2from
Hona:upgrade-dompurify

Conversation

@Hona

@Hona Hona commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Upgrade DOMPurify from 3.3.1 to 3.4.14 in the workspace catalog, UI packages, and Bun lockfile.
  • Give Markdown its own DOMPurify instance. Mermaid's HTML-label hooks otherwise overwrite link rel values after dependency deduplication, removing noreferrer and existing values such as nofollow.
  • Restore code-block decoration for completed Markdown. Completed timeline responses were showing raw Mermaid code because only the streaming path invoked the diagram renderer. This also restores completed code-block copy buttons.
  • Add a production timeline story and browser regressions for sanitization, Mermaid hooks, cached remounts, invalid diagrams, and completed/streaming diagrams at 1280px and 390px.

Verification

  • 15 Markdown and timeline Playwright component tests passed.
  • session-ui unit tests: 131 passed.
  • ui unit tests: 27 passed.
  • Package typechecks and the pre-push workspace typecheck passed (33 tasks, including cached results).
  • Frozen lockfile installation, Prettier, and git diff --check passed.
  • Reproduced the Mermaid hook regression before isolating the sanitizer, and raw code in completed timeline responses before restoring decoration.
  • Visually checked desktop and narrow timeline screenshots; no image files were committed.
  • All GitHub CI checks passed, including Linux and Windows unit tests and end-to-end tests, typecheck, and PR standards.

Screenshots

Before: Completed timeline showing raw Mermaid code

After: Completed timeline rendering Mermaid diagrams

Narrow viewport: Mermaid diagrams in a narrow timeline

Copilot AI lite review requested due to automatic review settings August 27, 2026 23:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Hona
Hona enabled auto-merge (squash) August 27, 2026 23:20
@Hona
Hona merged commit 7477e21 into anomalyco:v2 Aug 28, 2026
15 of 18 checks passed
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
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