Skip to content

Support for node previews (mermaid, text and image)#2554

Merged
ravi-kumar-pilla merged 66 commits intomainfrom
feat/task_node_previews
Jan 23, 2026
Merged

Support for node previews (mermaid, text and image)#2554
ravi-kumar-pilla merged 66 commits intomainfrom
feat/task_node_previews

Conversation

@ravi-kumar-pilla
Copy link
Copy Markdown
Contributor

@ravi-kumar-pilla ravi-kumar-pilla commented Jan 20, 2026

Description

Related to kedro-org/kedro#5317

Development notes

  • Added UI + backend support to show previews for TaskNodes (text + mermaid diagrams).

Backend changes

  • Extended node responses to include preview data (see package/kedro_viz/api/rest/responses/nodes.py). This enables the frontend to request/render previews without extra round-trips.

Frontend changes

  • Added mermaid-renderer (uses mermaid) and text-renderer (with code block support). Components and styles added under src/components/*. Tests included for renderers.
  • Updated src/utils/normalize-preview.js to normalize TaskNode previews

QA notes

  • All tests should pass

To ease testing process, I created a test-branch with a combination of #2553 , #2554 and preview_tests pipeline which is only added to test various previews

  • Install kedro from main branch - uv pip install git+https://github.com/kedro-org/kedro@main
  • Install kedro-viz from test branch - pip install git+https://github.com/kedro-org/kedro-viz.git@test/task_node_previews#subdirectory=package
  • cd demo-project
  • Run kedro viz
  • Test for all DataNode and TaskNode previews
  • Alternately you can test for any kedro project implementing DataNode previews as before and TaskNode previews as documented Implement user-injectable node preview function kedro#5317

NOTE: Text, Mermaid and Image TaskNode previews are supported as of now

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
…o-viz into feat/node_preview

Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Copy link
Copy Markdown
Contributor

@jitu5 jitu5 left a comment

Choose a reason for hiding this comment

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

Thanks.

Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
@ravi-kumar-pilla ravi-kumar-pilla changed the title Implementing TaskNode Previews Implementing TaskNode Previews Jan 21, 2026
@ravi-kumar-pilla ravi-kumar-pilla changed the title Implementing TaskNode Previews Implementing TaskNode Previews Jan 21, 2026
@ravi-kumar-pilla ravi-kumar-pilla changed the title Implementing TaskNode Previews Implementing TaskNode Preview Jan 21, 2026
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
@ravi-kumar-pilla ravi-kumar-pilla changed the title Implementing TaskNode Preview Support for TaskNode previews (MermaidPreview, TextPreview and ImagePreview) Jan 21, 2026
Comment thread src/components/text-renderer/text-renderer.jsx Outdated
Copy link
Copy Markdown

@ElenaKhaustova ElenaKhaustova left a comment

Choose a reason for hiding this comment

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

Thank you, @ravi-kumar-pilla 👍

I've tested it once again with the academy project and can confirm it now works as expected and the flickering issue is gone!

@ElenaKhaustova
Copy link
Copy Markdown

ElenaKhaustova commented Jan 22, 2026

One thing that came to mind is that we may apply a default Kedro style to these diagrams to make them look better in case the style is not defined by the user. But this is for a separate PR.
Screenshot 2026-01-22 at 12 15 15
Screenshot 2026-01-22 at 15 29 29

@ravi-kumar-pilla
Copy link
Copy Markdown
Contributor Author

One thing that came to mind is that we may apply a default Kedro style to these diagrams to make them look better in case

There is default mermaid config - https://github.com/kedro-org/kedro-viz/pull/2554/changes#diff-273d7957d8946a18bcd8d0369826fe0a084f74118a1fa20f823c5263b1bf3c96R12

But we can improve on this. Thank you

Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
@ravi-kumar-pilla ravi-kumar-pilla changed the title Support for TaskNode previews (MermaidPreview, TextPreview and ImagePreview) Support for node previews (MermaidPreview, TextPreview and ImagePreview) Jan 22, 2026
@ravi-kumar-pilla ravi-kumar-pilla changed the title Support for node previews (MermaidPreview, TextPreview and ImagePreview) Support for node previews (mermaid, text and image) Jan 22, 2026
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Copy link
Copy Markdown
Contributor

@rashidakanchwala rashidakanchwala left a comment

Choose a reason for hiding this comment

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

thank you!

@ravi-kumar-pilla ravi-kumar-pilla changed the title Support for node previews (mermaid, text and image) Support for node previews (mermaid, text and image). Jan 23, 2026
@ravi-kumar-pilla ravi-kumar-pilla changed the title Support for node previews (mermaid, text and image). Support for node previews (mermaid, text and image) Jan 23, 2026
@ravi-kumar-pilla ravi-kumar-pilla merged commit 2ce1a8e into main Jan 23, 2026
38 checks passed
@ravi-kumar-pilla ravi-kumar-pilla deleted the feat/task_node_previews branch January 23, 2026 07:02
@ravi-kumar-pilla ravi-kumar-pilla mentioned this pull request Jan 23, 2026
5 tasks
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.

4 participants