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

[2/n][Asset Graph Sidebar] - Consolidate filtering #16536

Merged
merged 2 commits into from
Sep 20, 2023

Conversation

salazarm
Copy link
Contributor

Summary & Motivation

Consolidate the group and code location filters to use our Filtering component.

How I Tested These Changes

Screenshot 2023-09-15 at 1 50 53 AM Screenshot 2023-09-15 at 1 50 47 AM Screenshot 2023-09-15 at 1 50 45 AM

@salazarm salazarm changed the base branch from master to salazarm/asset-sidebar September 15, 2023 05:51
@github-actions
Copy link

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-b9gfp962u-elementl.vercel.app
https://salazarm-asset-sidebar-2.components-storybook.dagster-docs.io

Built with commit a47a16c.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

github-actions bot commented Sep 15, 2023

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-l7tcbyd4t-elementl.vercel.app
https://salazarm-asset-sidebar-2.core-storybook.dagster-docs.io

Built with commit 37b3e58.
This pull request is being automatically deployed with vercel-action

Copy link
Collaborator

@bengotow bengotow left a comment

Choose a reason for hiding this comment

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

This looks better but I'm worried that one of the primary use cases was /hiding/ one or two repos or asset groups and that is now more challenging because you have to check every single box? I think we should talk to Josh about this one and see if it's desirable without the ability to say "NOT my_massive_asset_group"

@@ -250,7 +250,7 @@ export const FilterDropdown = ({filters, setIsOpen, setPortaledElements}: Filter
<Container
ref={parentRef}
style={{
maxHeight: '500px',
maxHeight: `min(500px, 50vh)`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Stupid question I think but does min work outside of calc? I thought this would have to be calc(min(500px, 50vh))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes it does

</>
<AssetGraphExplorerFilters
assetGroups={assetGroups}
visibleAssetGroups={React.useMemo(() => filters.groups || [], [filters.groups])}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the decode in the useQueryPersistedState on line 35 achieves this and you don't need the memo here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah okay wasn't sure

<AssetGraphExplorerFilters
assetGroups={assetGroups}
visibleAssetGroups={React.useMemo(() => filters.groups || [], [filters.groups])}
setGroupFilters={React.useCallback((groups) => setFilters({...filters, groups}), [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still not a fan of inlining hooks into the rendered content because it can break with early returns / refactoring (eg: if you moved this into const content = () => {...) but maybe I will get used to it 😂

Copy link
Contributor Author

@salazarm salazarm Sep 18, 2023

Choose a reason for hiding this comment

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

I like inlining because of code co-colocation but yeah I can definitely see refactoring being a bit more work although not very challenging work

@salazarm
Copy link
Contributor Author

salazarm commented Sep 18, 2023

This looks better but I'm worried that one of the primary use cases was /hiding/ one or two repos or asset groups and that is now more challenging because you have to check every single box? I think we should talk to Josh about this one and see if it's desirable without the ability to say "NOT my_massive_asset_group"

The existing behavior is still intact, this was mostly a visual change

@salazarm salazarm force-pushed the salazarm/asset-sidebar-2 branch from a47a16c to 8eb59a1 Compare September 18, 2023 15:51
…16537)

## Summary & Motivation

Hooks up showing upstream/downstream graph to the asset selection filter

## How I Tested These Changes

Used the feature with the toys repo.

<img width="315" alt="Screenshot 2023-09-15 at 1 55 06 AM"
src="https://github.com/dagster-io/dagster/assets/2286579/52d79d84-0de0-48ee-af92-83267dc109e2">
<img width="244" alt="Screenshot 2023-09-15 at 1 55 02 AM"
src="https://github.com/dagster-io/dagster/assets/2286579/1bd509fb-171b-4745-b32f-4b0a9e5135ea">
@salazarm salazarm merged commit 8ae569b into salazarm/asset-sidebar Sep 20, 2023
1 check passed
@salazarm salazarm deleted the salazarm/asset-sidebar-2 branch September 20, 2023 16:07
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