Skip to content

[codex] Add markdown preview content type#4475

Draft
TrueCrimeDev wants to merge 5 commits into
Flow-Launcher:devfrom
TrueCrimeDev:codex/markdown-preview-pane
Draft

[codex] Add markdown preview content type#4475
TrueCrimeDev wants to merge 5 commits into
Flow-Launcher:devfrom
TrueCrimeDev:codex/markdown-preview-pane

Conversation

@TrueCrimeDev
Copy link
Copy Markdown

@TrueCrimeDev TrueCrimeDev commented May 18, 2026

Summary

  • Add PreviewContentType to Result.PreviewInfo, defaulting to Text for existing plugins.
  • Render PreviewContentType.Markdown descriptions in the default preview pane with MdXaml and Flow theme resources.
  • Add SDK/JSON-RPC tests for default text behavior, markdown serialization, and Python/JS-style contentType: "markdown" deserialization.
  • Include a small CsWin32 compatibility fix for SHParseDisplayName so the current generated bindings compile.

Validation

  • dotnet build .\Flow.Launcher\Flow.Launcher.csproj --no-restore
  • $env:DOTNET_ROLL_FORWARD='LatestMajor'; dotnet test .\Flow.Launcher.Test\Flow.Launcher.Test.csproj --no-restore --filter "FullyQualifiedName~ResultPreviewTest|FullyQualifiedName~JsonRPCPluginTest.GivenMarkdownPreviewContentType"
  • $env:DOTNET_ROLL_FORWARD='LatestMajor'; dotnet test .\Flow.Launcher.Test\Flow.Launcher.Test.csproj --no-build
  • dotnet build .\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj --no-restore

Summary by cubic

Adds a markdown preview option for result descriptions and renders it in the preview pane using MdXaml. Hides the old preview chrome when markdown is active, polishes code-block visuals, and fixes emphasis/code rendering; text previews remain the default.

Summary of changes

  • Changed
    • Preview pane switches between Text UI and MdXaml based on ContentType; hide icon/title/description chrome when markdown.
    • Disable outer markdown horizontal scrollbar so code blocks manage horizontal scrolling.
    • Normalize MdXaml output to remove stray emphasis markers around code spans and apply bold/italic correctly.
    • Style MdXaml/ICSharpCode.AvalonEdit code blocks at runtime; wrap editors in a rounded frame and retint syntax colors to a softer palette.
    • CsWin32: pass null for optional SHParseDisplayName out param.
  • Added
    • PreviewContentType enum (text, markdown) with JSON string serialization.
    • Result.PreviewInfo.ContentType (defaults to Text) and VM flag IsMarkdownPreview.
    • PreviewMarkdownScrollViewer that post-processes the FlowDocument.
    • Theme style PreviewMarkdownStyle (headings, lists, links, code spans/blocks via ICSharpCode.AvalonEdit).
    • Direct AvalonEdit package reference.
  • Removed
    • No behavior removed; text previews remain unchanged by default.
  • Memory
    • Small, opt-in overhead to render markdown and a one-time FlowDocument traversal. No persistent allocations.
  • Security
    • Markdown only; no scripts. Links require user action. No new permissions.
  • Unit tests
    • ResultPreviewTest (defaults, lowercase enum serialization) and JsonRPCPluginTest (JSON-RPC contentType: "markdown" deserialization).

Release Note
You can now view rich, formatted markdown in the preview panel, with improved code block styling; regular text previews still work as before.

Written for commit e0201cb. Summary will update on new commits. Review in cubic

UHQ-Actual and others added 2 commits May 18, 2026 09:26
Pass null for the optional SHParseDisplayName attribute output pointer so the CsWin32 signature compiles with current generated bindings.

Co-authored-by: Codex <noreply@openai.com>
Expose an opt-in PreviewContentType.Markdown value on Result.PreviewInfo and render markdown descriptions through MdXaml in the default preview pane while preserving text previews by default.

Co-authored-by: Codex <noreply@openai.com>
@github-actions github-actions Bot added this to the 2.2.0 milestone May 18, 2026
UHQ-Actual and others added 3 commits May 18, 2026 10:23
Render markdown previews as the primary preview-pane content, resolve the MdXaml AvalonEdit code-block style at runtime, and normalize MdXaml's emphasized code-span output so valid markdown like **\code\** does not leak raw markers.

Co-authored-by: Codex <noreply@openai.com>
Use explicit markdown visibility bindings for the standard preview icon, title, and description surfaces so markdown content is not rendered behind the old preview chrome. Disable the outer markdown horizontal scrollbar so code blocks own horizontal scrolling instead of the full preview pane.

Co-authored-by: Codex <noreply@openai.com>
Wrap embedded AvalonEdit in a rounded Border (CornerRadius=6,
SeparatorForeground 1px) and retint its syntax palette to softer
Catppuccin Macchiato-inspired tones — cornflower methods, mauve
keywords, mint strings, peach numbers, cream types.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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