Skip to content

[codex] Add markdown preview content type#4475

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

[codex] Add markdown preview content type#4475
TrueCrimeDev wants to merge 6 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 pane with code highlighting and images, plus smarter preview suppression and icon/logo fallbacks for more reliable visuals. Default text previews remain unchanged.

Summary of changes

  • Changed
    • Preview pane switches between Text UI and MdXaml; hides old chrome for markdown and lets code blocks own horizontal scrolling.
    • Adjusted preview layout widths; switched search/settings icons to PNG.
    • Results without icons inherit the plugin icon and fall back to a generic glyph if still empty.
    • Preview can be suppressed per-result (e.g., hidden content); restores when selecting a normal result.
    • Image loading logs warnings instead of errors on failures and constrains wide icons to the small-icon box.
    • UWP logos resolve localized/nested assets and use larger tiles for preview; Win32 and .lnk parsing handle COM/missing-path cases without noisy logs.
    • Unobserved task exceptions are logged without destabilizing DEBUG sessions.
  • Added
    • PreviewContentType now supports text, markdown, and hidden; Result.PreviewInfo defaults to text.
    • PreviewMarkdownScrollViewer and CodeHighlightTheme to render markdown with AvalonEdit highlighting; normalized emphasis around code spans and rounded code-block frames.
    • Theme style PreviewMarkdownStyle and a direct AvalonEdit package reference.
    • Tests covering preview behavior, JSON-RPC contentType: "markdown" deserialization, image loading/fallbacks, UWP/Win32 logo resolution, and results collection updates.
  • Removed
    • No behavior removed; text previews remain default.
  • Memory
    • Small, opt‑in overhead for markdown rendering and a one-time document pass; no persistent allocations.
  • Security
    • Markdown only; no scripts. Links require user action. No new permissions.
  • Unit tests
    • ResultPreviewTest, PreviewMarkdownScrollViewerTest, PreviewMarkdownStyleTest, MainViewModelPreviewTest, ResultsViewModelTest, ResultViewModelPreviewImageTest, ImageLoaderTest, UwpPackageLogoTest, Win32ProgramTest, JsonRPCPluginTest.

Release Note
You can now view rich Markdown (with code highlighting and images) in the preview panel; icons and app logos load more reliably, and text previews still work as before.

Written for commit b8cf3fa. 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 4 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>
Preview pipeline: Result/ResultViewModel/ResultsViewModel/MainViewModel plumbing, PreviewMarkdownScrollViewer + CodeHighlightTheme rendering, and Themes/MainWindow XAML for the pane.

Image loading: ImageLoader, UWPPackage, Win32, and ShellLinkHelper icon/logo handling plus the mainsearch.png asset.

Tests: preview, image loader, results VM, and UWP/Win32 program coverage.

Co-Authored-By: Claude Opus 4.8 (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