-
Notifications
You must be signed in to change notification settings - Fork 113
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
Refactor modular pipeline expansions to instantly update UI #2225
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expand/collapse doesn't work with the NodeList in the sidebar.
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
…kedro-org/kedro-viz into introduce-manage-toolbarOptions Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
I noticed for the first time the toggle doesn't update the view instantly but subsequent presses do. |
yeah i noticed that too. |
Signed-off-by: Sajid Alam <[email protected]>
Fixed the |
Signed-off-by: Sajid Alam <[email protected]>
src/components/flowchart-primary-toolbar/flowchart-primary-toolbar.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
…pipelines Signed-off-by: Huong Nguyen <[email protected]>
@@ -7,7 +7,10 @@ import { | |||
toggleTextLabels, | |||
toggleExpandAllPipelines, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you should add this actions/modular-pipelines as well, it's confusing why this is here. and the other expanded ones are in the other
@@ -7,7 +7,10 @@ import { | |||
toggleTextLabels, | |||
toggleExpandAllPipelines, | |||
} from '../../actions'; | |||
import { loadInitialPipelineData } from '../../actions/pipelines'; | |||
import { | |||
toggleModularPipelinesExpanded, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i suppose we no longer need this action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have left some minor comments. Around repeated code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @SajidAlamQB, thank you for the updates! I have two main comments:
-
Could we rename the reducers
TOGGLE_EXPAND_ALL_PIPELINES
andTOGGLE_ALL_MODULAR_PIPELINES_EXPANDED
to better reflect their purpose? -
Both
TOGGLE_ALL_MODULAR_PIPELINES_EXPANDED
andnormalize
share similar logic (I replicated the logic from normalize). Could this be moved to a helper function?
@@ -24,6 +27,7 @@ import { useGeneratePathname } from '../../utils/hooks/use-generate-pathname'; | |||
* @param {Boolean} textLabels Whether text labels are displayed | |||
*/ | |||
export const FlowchartPrimaryToolbar = ({ | |||
modularPipelineIDs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need it anymore i think
onToggleExpandAllPipelines: (isExpanded) => { | ||
dispatch(toggleExpandAllPipelines(isExpanded)); | ||
dispatch(loadInitialPipelineData()); | ||
dispatch(toggleAllModularPipelinesExpanded(isExpanded)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we decide to go with this refactor, I suggest renaming two reducers to improve clarity: TOGGLE_EXPAND_ALL_PIPELINES (which returns a boolean) and TOGGLE_ALL_MODULAR_PIPELINES_EXPANDED (which updates the state). Currently, their names are very similar, even though they do slightly different things.
Description
This PR updates the logic for determining which nodes are visible when toggling
expandAllPipelines
. Previously, modular pipeline expansions were applied once during initial start, requiring data reloads to see changes. Now, the visibility logic is integrated directly intodisabled.js
, allowing the UI to reflect state changes immediately.Checklist
RELEASE.md
file