Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filtering of pipelines on Kedro-Viz flowchart in VSCode #2269

Merged
merged 22 commits into from
Mar 6, 2025

Conversation

jitu5
Copy link
Contributor

@jitu5 jitu5 commented Feb 7, 2025

Description

Resolves kedro-org/vscode-kedro#157

The pull request introduces a feature to filter pipelines within the Kedro-Viz flowchart when using Visual Studio Code (VSCode). This enhancement allows users to selectively view and manage specific pipelines directly in the VSCode environment, improving navigation and focus during development.

Development notes

Key changes include:

  • Added SHOW_PIPELINE_FILTER action and togglePipelineFilter function in src/actions/index.js to manage the pipeline filter toggle state.
  • Updated middleware in src/store/middleware.js to handle the new SHOW_PIPELINE_FILTER action.
  • Modified src/components/app/app.js to load pipeline data when the selected pipeline changes.
  • Added togglePipelineFilter to src/components/flowchart-primary-toolbar/flowchart-primary-toolbar.js and included a new FilterIcon button.
  • Created a new FilterIcon component in src/components/icons/filter.js for the filter button.
  • Updated PrimaryToolbar in src/components/primary-toolbar/primary-toolbar.js to display the filter button based on the display prop.
  • Set the default state of filterBtn to false in src/store/initial-state.js.
  • pipeline_name as optional argument added in get_kedro_project_json_data in responses/pipelines.py.
  • Created toolbar-filter-button component folder and toolbar-filter-button.js component which is used in sidebar.js

QA notes

  1. Make code changes like this kedro-org/vscode-kedro@2387775 with 1.21.0-rc7 version on Add filtering of pipelines on Kedro-Viz flowchart in VSCode vscode-kedro#167
  2. Run make build on Add filtering of pipelines on Kedro-Viz flowchart in VSCode vscode-kedro#167
  3. Install the corresponding kedro.vsix and restart extension host
  4. pip install -e ./package of this PR in test Kedro project env
  5. >kedro: Run Viz command on VS Code

GIF

name-1

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

jitu5 added 3 commits February 6, 2025 13:48
Signed-off-by: Jitendra Gundaniya <38945204+jitu5@users.noreply.github.com>
@jitu5 jitu5 self-assigned this Feb 7, 2025
@jitu5 jitu5 added the Javascript Pull requests that update Javascript code label Feb 7, 2025
jitu5 and others added 9 commits February 18, 2025 12:24
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
@jitu5 jitu5 marked this pull request as ready for review February 19, 2025 20:13
@astrojuanlu
Copy link
Member

I'm not sure how to QA this. Here's what I tried:

  1. Ran make build on Add filtering of pipelines on Kedro-Viz flowchart in VSCode vscode-kedro#167
  2. Install the corresponding kedro.vsix and restart extension host
  3. pip install -e ./package of this PR
  4. >kedro: Run Viz command on VS Code

I still see the old UI for some reason.

@astrojuanlu astrojuanlu removed their request for review February 20, 2025 07:37
@jitu5
Copy link
Contributor Author

jitu5 commented Feb 20, 2025

  1. pip install -e ./package of this PR

@astrojuanlu This step is only needed when there are changes in the Kedro-Viz backend. However, in this PR, we are making changes to the frontend. Therefore, we need an npm-published version of Kedro-Viz that includes our changes to use in the extension.

I have published a test npm package to test these changes in the extension:
kedro-vi122@1.21.0-rc3

Instead of step 3 pip install -e ./package, you need to make the following changes and then run make build:
kedro-org/vscode-kedro@2387775

@astrojuanlu
Copy link
Member

Thanks 🙏🏼 Can't get to this today or tomorrow, if it's not merged yet by Monday I'll review it.

Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
@@ -163,6 +163,7 @@ The example below demonstrates how to configure your kedro-viz using different `
| `miniMap` | boolean | true | Show/Hide Mini map and mini map button |
| `sidebar` | boolean | true | Show/Hide Sidebar and action toolbar |
| `zoomToolbar` | boolean | true | Show/Hide zoom-in, zoom-out and zoom reset buttons together |
| `filterBtn` | boolean | false | Show/Hide filter button and sidebar toggle icon |

Choose a reason for hiding this comment

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

⚠️ [vale] reported by reviewdog 🐶
[Kedro-viz.Spellings] Did you really mean 'boolean'?

@@ -9,6 +9,8 @@ Please follow the established format:

## Major features and improvements

- Enable Kedro-Viz in VSCode to list pipelines using the filter icon. (#2269)

Choose a reason for hiding this comment

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

⚠️ [vale] reported by reviewdog 🐶
[Kedro-viz.Spellings] Did you really mean 'VSCode'?

Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
@@ -10,6 +10,8 @@ Please follow the established format:
## Major features and improvements
- Remove experiment tracking. (#2237)

- Enable Kedro-Viz in VSCode to list pipelines using the filter icon. (#2269)

Choose a reason for hiding this comment

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

⚠️ [vale] reported by reviewdog 🐶
[Kedro-viz.Spellings] Did you really mean 'VSCode'?

@ravi-kumar-pilla
Copy link
Contributor

Hi @jitu5 , I have tested this locally and it works well. I want to test it one more time tomorrow as I observed some inconsistency randomly and could not reproduce it again. Great work @jitu5 and @SajidAlamQB . Thank you

# Conflicts:
#	src/components/flowchart-primary-toolbar/flowchart-primary-toolbar.js
@rashidakanchwala
Copy link
Contributor

hi code-wise both the PRs look great. I am having difficulty getting the setup running at my end. Can we have a chat this morning? :) thanks

Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
@rashidakanchwala rashidakanchwala self-requested a review February 28, 2025 12:18
Copy link
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.

LGTM!

Copy link
Contributor

@ravi-kumar-pilla ravi-kumar-pilla left a comment

Choose a reason for hiding this comment

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

Works great !! As discussed apart from the design Q about the filter description, everything else looks good. Thank you :)

Copy link
Member

@astrojuanlu astrojuanlu left a comment

Choose a reason for hiding this comment

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

As mentioned internally, the dev setup for this is a bit complicated, so I trust that this is ready to be shipped 👍🏼

Copy link
Contributor

@SajidAlamQB SajidAlamQB left a comment

Choose a reason for hiding this comment

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

Tested manually and all looks great, thank you @jitu5!

rashidakanchwala and others added 4 commits March 3, 2025 11:49
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
@jitu5 jitu5 merged commit c0c2b53 into main Mar 6, 2025
63 checks passed
@jitu5 jitu5 deleted the feature/vscode-filter-pipeline branch March 6, 2025 09:36
@Huongg Huongg mentioned this pull request Mar 6, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support filtering of pipelines on Kedro-Viz flowchart in VSCode
6 participants