Page MenuHomeElementl

[dagit] RFC: Multi-repo switcher
ClosedPublic

Authored by dish on Mar 11 2021, 7:46 PM.

Details

Summary

Create a handful of components for managing and representing repos in Dagit.

  • RepoSelector, which shows a list of repositories that can be toggled on/off for filtering purposes. This would be rendered in a popover triggered from the left nav.
  • RepoNavItem, which would display the filtered repo(s) in the nav. If one repo, just show its name and a reload button. If multiple repos, show a "Filter" button that renders the RepoSelector in a popover.
  • RepoBlob, a possible approach for succinctly representing repos throughout Dagit. Basically a Google-Calendar-like blob of color that helps distinguish between different repos. Not in use in these components, but I was playing around with it in RepoSelector and didn't want to have to slice it back out into another diff.

Next step would be to follow D6893 by replacing the existing repo picker with these components, to enable multiple repo selection in the nav.

Test Plan

Run storybook, click on components and verify rendering.

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dish requested review of this revision.Mar 11 2021, 7:53 PM

This looks reasonable to me. Will defer to others on the technical approach.

This looks great! I like this multi-select concept because it makes it really clear that the repo selection is a piece of view state specific to the sidebar and not a page-wide setting. It seems more valid to view a pipeline run of repo X with repo Y in the sidebar if it's "1 of 6" and the choice is behind a "Filter" button. Code looks good!

js_modules/dagit/package.json
9

Ooh interesting, need to read up on what they improved here in v2!

js_modules/dagit/src/nav/RepoNavItem.tsx
32

This is a bit of a nit, but I wonder if it'd make sense to use selected.size here? I imagine selecting one repo will be a common case, and having it say "Showing 1 of 6" is a bit of a bummer. I wonder if we could show the name of the selected repo and make the filter label Filter (6) > or something like that to indicate the total available.

(Feel free to disregard if we're moving to the subway dots!)

This revision is now accepted and ready to land.Mar 15 2021, 2:59 AM
js_modules/dagit/src/nav/RepoNavItem.tsx
32

Yeah, I think that could be a good change. Subway dots aren't quite there yet, so I think this would make sense in the meantime.

Just show the repo name when 1/x selected

This revision was automatically updated to reflect the committed changes.