Page MenuHomePhabricator

Fix typeahead suggest token values, autoselect first completion

Authored by bengotow on Nov 19 2019, 6:13 AM.



This diff addresses the two issues that were making the typeahead search annoying. Rather than typing "pipeline:" and then seeing the available options, you can now type "airline_" and see "pipeline:airline_demo" right off the bat. When no chars are entered you see the available search space / keywords, but as soon as you start typing it suggests full autocompletions.

The second fix is that the typeahead autoselects the first autocompletion so you can press "Enter" to confirm your search without down-arrow first. To enter text that is NOT an autocompletion, you press esc to close the options and then press enter, but it's unclear if you'd really do that.

Test Plan

I added a few tests for this component's behavior. We should definitely write more, but I think we need to switch to a better React testing library like enzyme to test interactions efficiently and that might require another diff.

Diff Detail

R1 dagster
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bengotow created this revision.Nov 19 2019, 6:13 AM
bengotow edited the summary of this revision. (Show Details)Nov 19 2019, 6:13 AM
bengotow updated this revision to Diff 6712.Nov 19 2019, 7:34 AM
  • Add a few tests - we should probably add Enzyme soon
bengotow edited the test plan for this revision. (Show Details)Nov 19 2019, 7:35 AM
alangenfeld accepted this revision.Nov 20 2019, 5:25 PM
alangenfeld added a subscriber: alangenfeld.


This revision is now accepted and ready to land.Nov 20 2019, 5:25 PM