Page MenuHomePhabricator

[dagit] Allow reversing partition order on Playground
ClosedPublic

Authored by dish on Wed, Sep 30, 8:33 PM.

Details

Summary

Since the partitions dropdown list is pretty long, allow reversing the display so that you don't have to scroll all the way to the bottom or remember exactly what to search for in order to get to that part of the list.

Test Plan

Video attached.

Diff Detail

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

Event Timeline

dish requested review of this revision.Wed, Sep 30, 8:40 PM
js_modules/dagit/src/execute/ConfigEditorConfigPicker.tsx
235

What's the difference between using useCallback and just doing:

onMouseDown={() => setSortOrder((order) => (order === 'asc' ? 'desc' : 'asc'))}
This revision is now accepted and ready to land.Wed, Sep 30, 9:14 PM
js_modules/dagit/src/execute/ConfigEditorConfigPicker.tsx
235

useCallback will only create the function object once, rather than creating a new function on every render as above. The onMouseDown prop will also thus have the same value on every render, which is nice when passing props to React.memo/Pure components.

In this case, it doesn't matter much, but it's a habit.