Commit Graph

22 Commits

Author SHA1 Message Date
Luke De Feo
12c1fdf952 Trim last indent guide
Summary: Changelog: UIDebugger: Reimplemented Tree, inline attributes, faster performance and added indent guides

Reviewed By: lblasa

Differential Revision: D42031069

fbshipit-source-id: f1394ca528005e645760ea38cb5c4c805d122a4b
2022-12-14 08:38:58 -08:00
Lorenzo Blasa
d66b513298 Add CK and iOS tags
Summary: ^

Reviewed By: LukeDefeo

Differential Revision: D41876581

fbshipit-source-id: 79b98a06abb503f4cd39a61a2ed90e7899b8fd68
2022-12-13 10:02:05 -08:00
Luke De Feo
b686567e2b Added indent guides to parent and children for selected node
Reviewed By: lblasa

Differential Revision: D41995460

fbshipit-source-id: cd4574caa6aa164d2b3a026f656609585cae65c0
2022-12-13 08:21:22 -08:00
Luke De Feo
5043e5292f Last minute tree changes
Summary:
1. Greater spacing between levels
2. Align children when one has chevron and another doesnt
3. Allow searching of inline attribute values

Reviewed By: lblasa

Differential Revision: D41955235

fbshipit-source-id: aa6bce71810a32cd218db790287aaaf506df75b7
2022-12-12 09:17:03 -08:00
Luke De Feo
8242a94ca4 Rename tree
Reviewed By: lblasa

Differential Revision: D41875028

fbshipit-source-id: a3afd0014798f03cbaefac3f9128b4e92bccb290
2022-12-12 07:28:37 -08:00
Luke De Feo
74247ee721 Remove react complex tree
Reviewed By: lblasa

Differential Revision: D41875029

fbshipit-source-id: 2af58610fe0d0f644aa8450a4210fd52f8ed4db6
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
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
Lorenzo Blasa
feb206d069 Tree styles improvement
Summary: ^

Reviewed By: antonk52

Differential Revision: D41579010

fbshipit-source-id: efb7d4300093173d85a3c5c269d79b78fe79908a
2022-11-29 06:02:11 -08:00
Luke De Feo
a93d571dc0 Unhover on mouse exit of tree
Summary: This was causing the hover state to linger which is now quite noticable in the tree

Reviewed By: lblasa

Differential Revision: D41548249

fbshipit-source-id: cdf8ed434aa064dba05ebf31773bedaef18ba007
2022-11-28 05:09:20 -08:00
Luke De Feo
6bb541a33f Group app wide ui state into one object
Summary: Should be a bit easier to see what UI state we are holding at the plugin instance level

Reviewed By: lblasa

Differential Revision: D41498272

fbshipit-source-id: 6d88086766efd9c39f71be7e2ce32c5058494c96
2022-11-24 09:23:16 -08:00
Luke De Feo
7fc64adfd4 Refactor out UI debugger menu item
Summary: We have to do a couple of odd things to get the context menu items to behave. The code was duplicated between tree and visualizer. This custom component removes duplication and makes the approach a bit clearer (via js doc)

Reviewed By: antonk52

Differential Revision: D41495718

fbshipit-source-id: ec98d5101e636a2c9034c656d29991d4fe348762
2022-11-24 09:23:16 -08:00
Luke De Feo
f78899b69f Store context menu open in app wide state to disable all hover effects which cause rerenders and mess up the context menu
Summary: Mouse over event still fires for the dom nodes behind the context menu modal. This will cause state changes and rerenders. Some of the state the context menu depends on can change so it would cause the context menu items to change while its stil open. Now we dont fire those hover state changes while context menu active

Reviewed By: lblasa

Differential Revision: D41494947

fbshipit-source-id: 17918f15d74230d9c7070a4de7a0a0ce10a08001
2022-11-24 09:23:16 -08:00
Luke De Feo
4b566dbe03 Add ability to focus on a node to tree
Summary: Added context menu to tree nodes that 'focuses' a node. This will make the node the root of the tree. Focus state can be removed again via context menu but we could add a permanent button in the future

Reviewed By: lblasa

Differential Revision: D41493002

fbshipit-source-id: 43ec7a25aeea0b169cbcbb1ac20ac22ea893fee2
2022-11-24 09:23:16 -08:00
Luke De Feo
3722ac1fea Permanent search bar
Summary: Out of the box the library search has some issues. when search matches it steals focus from the input. Eventually we want to customise the rendering of the tree items anyway so this lays the foundation for taht

Reviewed By: antonk52

Differential Revision: D41336524

fbshipit-source-id: 194f67023edd0675cd9bd8d6134260439c6b2785
2022-11-24 09:23:16 -08:00
Luke De Feo
477eae1993 Hit test can produce multiple nodes
Summary:
There are situations where multiple siblings overlap and they are both hit. Previously we picked the first one in the hierachy. Now we produce a list of hit children. The list will not have 2 nodes in the same ancestor path.

We store the hovered nodes as a list as we may want to present a modal in future to ask user which node they indented to select. That said simply sorting nodes by area seems to give decent results so we can start with this

Reviewed By: lblasa

Differential Revision: D41220271

fbshipit-source-id: 643a369113da28e8c4749725a7aee7aa5d08c401
2022-11-14 07:05:58 -08:00
Luke De Feo
062e87f50f Use mouse position for hit test for 2D vizualizer
Summary:
The Dom events for the divs that are very close together were not firing correctly causing the old implementation to not track the hovered node correctly. This was really frustrating trying to select a node amongst many close neighbours.

The new approach uses the mouse x,y position and performs a hit test. Currently we do a dfs looking for the first deepest child that interests the mouse x,y. In a future diff we will extract a list when there are multiple candidates.

Hovered node was removed from react props since both the tree and visualisor depend on it meaning when hover state changes the whole app is rerendered. Instead we have moved hover state to an atom which is subscribed to by each visualsation node. Only if the old or new value matches the particular nodes id do we set state. The viz nodes were memo'd to prevent children renderning. The result is that for a hover change at most 2 nodes out of the 500 or so will rerender.

I attempted to do the same with the tree but it wasnt working with the controlled tree environment + focus state. The perf seems fine as is so will leave it for now

Reviewed By: lblasa

Differential Revision: D41218324

fbshipit-source-id: 7f80bcee256abad2689a88d7e209f92417aab672
2022-11-14 07:05:58 -08:00
Luke De Feo
f282a5eb8a Ant tree -> React complex tree
Summary:
Upgraded from ant tree library to the much more capable React complex tree. Added the following:
1. Ability to expand / collapse nodes while automatically expanding / collapsing active/inactive children when they change
2. Keyboard controls of tree all the time
3. Basic search functionality
4. Selecting node in tree focuses and scrolls in the tree
5. Hover state for tree

Reviewed By: lblasa

Differential Revision: D40633876

fbshipit-source-id: 8dcef5ec2c277e476a3eb3cdaef62b15c25323c0
2022-10-25 07:10:38 -07:00
Andrey Goncharov
d1158e2d02 Configure eslint to prevent imports from nested paths of externally provided modules
Summary: We have a list of modules that we do not bundle with the plugins, but provide externally to them from Flipper. For the mechanism to work correctly, we have to stop importing from nested paths of these modules.

Reviewed By: mweststrate

Differential Revision: D39776237

fbshipit-source-id: 06eae9bf9d5b11b48d2720bf592bfea749773847
2022-09-26 09:42:33 -07:00
Luke De Feo
67ff09563c Improved interaction between tree and visualizer
Summary:
Improved the 2 way relationship between tree and vizualiser. There are 3 states.
1. Select, this is when you click on either tree node or view. View is highlighted darker colour, sidebar shows up for that node and select is persisted when you mouse away
2. Hover, this is when you hover over a tree node or in the vizualizer, the node is highlighted a lighter colur
3. Hover while holding control - same as hover but we dont draw any children, this lets you see how parent nodes appear without their children

Reviewed By: lblasa

Differential Revision: D39695661

fbshipit-source-id: 623e479fb03567e9f15a4a4f9201b2c7884cabe4
2022-09-22 04:26:18 -07:00
Luke De Feo
f3b7552338 2D wire frame highlight from tree, select from wireframe
Summary:
Introduced some basic bidirectional link between tree and wireframe, the specific interaction will need some tweaking but this should get us started.

When hovering over the tree we halt the rendering of the wireframe up to that point, this allows us to explore parent views that layout child views.

When clicking a view in the wireframe it is 'seleceted' as if it was clicked in the tree. This set the tree selection so you can identify it in the tree as well as opens the side bar

Reviewed By: lblasa

Differential Revision: D39539277

fbshipit-source-id: 3beb1ad4cb56b398c640ac3e7fac2cc97f3f1a18
2022-09-21 07:02:48 -07:00
Luke De Feo
c7f24eb469 Refactor UI
Summary: Split our the mega component into separate parts in preparation for the visualizer

Reviewed By: lblasa

Differential Revision: D39509406

fbshipit-source-id: 0f867c1f8a91b7592673ae47ba2b5db4f3500732
2022-09-21 07:02:48 -07:00