HomeElementl

[dagit] Simplify logs filtering input

Description

[dagit] Simplify logs filtering input

Summary:
Relates to #3688

The current logs filter input uses TokenizingField. We don't really need strict tokens here -- plain text with suggestions is fine. To that end, create:

  • useSuggestionsForString, a hook that accepts a value string and a function to determine suggestions, and exposes the list of suggestions and suggestion-selection behavior.
  • LogsFilterInput, which replaces the existing tokenized input. This will probably be something that can be abstracted out for use in place of our other tokenized inputs so that we can be consistent everywhere, but I'm one-offing it for now while we validate that this does what we need.

I also added some more value options to the type filter. This filter is a liiiitle hacky, as it just hunts for the type string within the __typename of the row node. This doesn't necessarily match up with the text in the actual type <Tag>, which isn't great. But I think if we want this to behave differently, it should be done in a followup.

Additionally, I made a couple changes to clean up the clutter of the LogsToolbar:

  • Remove the View Raw Step Output link, which is a horizontal space hog and seems redundant given that the logs themselves have this link. (Unless I'm missing something?)
  • Remove the "Clear" button, which doesn't seem critical.
  • Reduce the horizontal padding of the bar a little bit.

I have included a test and a storybook example for the hook. Video of LogsToolbar behavior attached in comments.

Test Plan:
Buildkite.

Run Dagit, navigate to a run. Use logs toolbar to perform filtering behavior:

  • Test each of the suggestion options, using keyboard and trackpad to select suggestions and populate the input.
  • Verify that the URL updates correctly as the filter input changes, and that the logs filter correctly as well.

Reviewers: bengotow, prha, sashank

Reviewed By: bengotow

Differential Revision: https://dagster.phacility.com/D6547

Details

Provenance
dishAuthored on Feb 16 2021, 10:19 PM
Reviewer
bengotow
Differential Revision
D6547: [dagit] Simplify logs filtering input
Parents
R1:d424d9a9701f: Pull out RepositoryLocationHandleManager so we can use it in other daemons
Branches
Unknown
Tags
Unknown