Skip to content

Feat/render md in prompt registry#19615

Merged
WeichenXu123 merged 8 commits intomlflow:masterfrom
iyashk:feat/render-md-in-prompt-registry
Jan 21, 2026
Merged

Feat/render md in prompt registry#19615
WeichenXu123 merged 8 commits intomlflow:masterfrom
iyashk:feat/render-md-in-prompt-registry

Conversation

@iyashk
Copy link
Contributor

@iyashk iyashk commented Dec 24, 2025

🛠 DevTools 🛠

Open in GitHub Codespaces

Install mlflow from this PR

# mlflow
pip install git+https://github.com/mlflow/mlflow.git@refs/pull/19615/merge
# mlflow-skinny
pip install git+https://github.com/mlflow/mlflow.git@refs/pull/19615/merge#subdirectory=libs/skinny

For Databricks, use the following command:

%sh curl -LsSf https://raw.githubusercontent.com/mlflow/mlflow/HEAD/dev/install-skinny.sh | sh -s pull/19615/merge

Related Issues/PRs

Resolve #19516

What changes are proposed in this pull request?

This PR adds markdown rendering support to the Compare mode in the Prompt Registry UI, addressing the feature request in #19516.

What changes are proposed in this pull request?

  1. Markdown rendering toggle in Compare view (PromptContentCompare.tsx)

    • Added a segmented control toggle (Text/Markdown) in the compare view header
    • When "Markdown" mode is selected, prompts are rendered with proper formatting using GenAIMarkdownRenderer
    • When "Text" mode is selected, prompts are displayed as plain text with diff highlighting (additions in green, deletions in red with strikethrough)
    • Default mode is Markdown (consistent with the Preview mode behavior)
  2. Improved Compare mode version selection (usePromptDetailsPageViewState.tsx)

    • Fixed the default version selection when entering Compare mode
    • Previously: Always compared the two latest versions regardless of which version was being previewed
    • Now: When switching from Preview to Compare mode, the currently previewed version is preserved as the baseline (left side), and it's compared against the latest version (or second-to-last if the previewed version is already the latest)

Technical Details:

  • Added imports for MarkdownIcon, SegmentedControlButton, SegmentedControlGroup from design system
  • Added GenAIMarkdownRenderer from @databricks/web-shared/genai-markdown-renderer
  • Added shouldRenderMarkdown state with useState hook
  • Conditional rendering based on toggle state

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

Manual Testing:

  1. Created prompts with markdown content (headers, lists, bold text, code blocks)
  2. Tested Preview mode - markdown renders correctly with existing toggle
  3. Tested Compare mode:
    • Toggle switches between Text (with diff highlighting) and Markdown (formatted) views
    • Default is Markdown mode
  4. Tested version selection fix:
    • Preview version 1 → Click Compare → Left side shows version 1
    • Preview latest version → Click Compare → Left side shows latest, right side shows second-to-last
Before:
Screenshot 2025-12-25 at 12 12 32 AM
After:
Screenshot 2025-12-25 at 12 11 12 AM

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.
    Added markdown rendering support to the Prompt Registry Compare view, allowing users to toggle between formatted markdown and plain text (with diff highlighting) when comparing prompt versions. Also improved the default version selection in Compare mode to preserve the currently previewed version.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/tracking: Tracking Service, tracking client APIs, autologging
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflows
  • area/gateway: MLflow AI Gateway client APIs, server, and third-party integrations
  • area/prompts: MLflow prompt engineering features, prompt templates, and prompt management
  • area/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionality
  • area/projects: MLproject format, project running backends
  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Should this PR be included in the next patch release?

Yes should be selected for bug fixes, documentation updates, and other small changes. No should be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.

What is a minor/patch release?
  • Minor release: a release that increments the second part of the version number (e.g., 1.2.0 -> 1.3.0).
    Bug fixes, doc updates and new features usually go into minor releases.
  • Patch release: a release that increments the third part of the version number (e.g., 1.2.0 -> 1.2.1).
    Bug fixes and doc updates usually go into patch releases.
  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)

Signed-off-by: Yashwanth Kiran <yashwanthkiran2624@gmail.com>
Signed-off-by: Yashwanth Kiran <yashwanthkiran2624@gmail.com>
@iyashk iyashk force-pushed the feat/render-md-in-prompt-registry branch from 732ebd0 to 65e04df Compare December 24, 2025 19:22
@iyashk iyashk marked this pull request as ready for review January 2, 2026 19:00
@github-actions github-actions bot added area/prompts MLflow Prompt Registry and Optimization area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server rn/feature Mention under Features in Changelogs. labels Jan 2, 2026
iyashk added 2 commits January 7, 2026 10:59
Signed-off-by: Yashwanth Kiran <yashwanthkiran2624@gmail.com>
Signed-off-by: Yashwanth Kiran <yashwanthkiran2624@gmail.com>
Copy link
Collaborator

@B-Step62 B-Step62 left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2026

Documentation preview for fe262aa is available at:

More info
  • Ignore this comment if this PR does not change the documentation.
  • The preview is updated when a new commit is pushed to this PR.
  • This comment was created by this workflow run.
  • The documentation was built by this workflow run.

Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
Signed-off-by: Yashwanth Kiran <yashwanthkiran2624@gmail.com>
@iyashk
Copy link
Contributor Author

iyashk commented Jan 20, 2026

@B-Step62 , I fixed the CI JS errors, can you check?

Signed-off-by: Yashwanth Kiran <yashwanthkiran2624@gmail.com>
@WeichenXu123 WeichenXu123 added this pull request to the merge queue Jan 21, 2026
Merged via the queue into mlflow:master with commit e7cd1fc Jan 21, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/prompts MLflow Prompt Registry and Optimization area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server rn/feature Mention under Features in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Render markdown in prompt registry UI

3 participants