Commit Graph

13 Commits

Author SHA1 Message Date
Luke De Feo
ed35623bef Only render a single context menu for the entire tree
Summary: There is no reason to have a context menu rendered by react for each item in the tree, its pretty wastefull. It also means less props drilled to the tree node

Reviewed By: lblasa

Differential Revision: D41872778

fbshipit-source-id: b13491a310c03334d7f3056207f5de23d20c3e61
2022-12-12 07:28:37 -08:00
Luke De Feo
040240ec34 Tree2 feedback
Summary:
1. only useValue from tree root
2. Pass down props for ui state  instead subscribing ad hoc
3. Pass down callbacks, instead of updating atoms ad hoc.
4. Create ui actions object holding api, will use this later on in the vizualizer as some of the same

In general its more verbose but with memoizing perf should be fine should hopefully be easier to reason about components and what they can do as things are more explicit

Hopefully this serves as a general template for how to organise the react code going forward

Reviewed By: lblasa

Differential Revision: D41872490

fbshipit-source-id: 94a33b0e951c04df367ba102fa0a097d4a0389cd
2022-12-12 07:28:37 -08:00
Luke De Feo
1a9724d790 Added inline tree attributes
Summary:
This is temporary solution to get to parity with the old plugin. In future would like to make this more flexible on the desktop side

Additionally getData was renamed to getAttributes for consistency

Reviewed By: lblasa

Differential Revision: D41845248

fbshipit-source-id: 50e94a7712f5d42938229134e212cef5d379475d
2022-12-12 07:28:37 -08:00
Luke De Feo
fc43580134 Memoize tree nodes
Reviewed By: antonk52

Differential Revision: D41838164

fbshipit-source-id: 3184f4ee607f0dd47604265fc259480403c083f0
2022-12-12 07:28:37 -08:00
Luke De Feo
65d6089ed2 Added context menu and focus mode
Reviewed By: antonk52

Differential Revision: D41838172

fbshipit-source-id: 7c5fad5a7520cea5f0dbabb9f99ef436ad87ec60
2022-12-12 07:28:37 -08:00
Luke De Feo
88e2bb7607 Fix order of items
Reviewed By: lawrencelomax

Differential Revision: D41838169

fbshipit-source-id: 2cc82eb1d50552de5f7970b61f6375d6ff8985fd
2022-12-12 07:28:37 -08:00
Luke De Feo
8784691e62 If no children dont show chevron
Reviewed By: lawrencelomax

Differential Revision: D41809088

fbshipit-source-id: 7f4bef5390561671cc53a12be8aa99ea5efe228c
2022-12-12 07:28:37 -08:00
Luke De Feo
0e51914e9e Made kb controls scroll friendly
Reviewed By: antonk52

Differential Revision: D41838167

fbshipit-source-id: fb32941ed750fa22797586bab8da39880131eac9
2022-12-12 07:28:37 -08:00
Luke De Feo
2692476647 Added scroll into view when when node selected
Reviewed By: lblasa

Differential Revision: D41838165

fbshipit-source-id: 4b135f9bfaf3ac0dd536ab7250a22dc4e739aed6
2022-12-12 07:28:37 -08:00
Luke De Feo
d61f36a0d2 Added basic kb controls to tree
Reviewed By: lawrencelomax

Differential Revision: D41838171

fbshipit-source-id: 1e89c689b2c371f870b1a3f1c7dd8c611426195a
2022-12-12 07:28:37 -08:00
Luke De Feo
a2ce6d5aac Added fast hover to tree
Summary: While moving mouse and changing hover state react render is under 1ms due to subscribing to state rather than passing hover as prop to all components

Reviewed By: lblasa

Differential Revision: D41838168

fbshipit-source-id: c9b3334adc44df5018e0a785684a2883aeb3bab1
2022-12-12 07:28:37 -08:00
Luke De Feo
2bdb068531 Added chevon icon when expanding / collapsing
Reviewed By: lblasa

Differential Revision: D41838170

fbshipit-source-id: f04438d77445736e45e29e2c46e9e8f8dd0906a8
2022-12-12 07:28:37 -08:00
Luke De Feo
a6544489f3 Basic new tree implemenation
Summary: The old implementation would always rerender on every operation (select, hover etc) and was quite slow for large hierachies

Reviewed By: lblasa

Differential Revision: D41838166

fbshipit-source-id: 1270841027926440a9c1f1a846d3aedc75ffe8bf
2022-12-12 07:28:37 -08:00