Commit Graph

165 Commits

Author SHA1 Message Date
Luke De Feo
cd67ce59f7 Improve selection / hovered state of visualiser
Summary:
Previously we used an overlay to indicated selected but this was kind of hard to see due to <1 opacity. I think this approach where we enchance the border is clearer.

Also we used border colour earlier to indicate type of node which i think was never obvious to the user. Given that nodes heavily overlap we should remove this design language

changelog: UIDebugger, improve selected and hover state of the visualiser

Reviewed By: antonk52

Differential Revision: D45737758

fbshipit-source-id: 5299043656787d6479cff6ec2b38cebe8417fd53
2023-05-11 08:15:19 -07:00
Luke De Feo
0f9eeda2dd Remove ctrl to stop drawing children
Summary: This feature is annoying and useless

Reviewed By: antonk52

Differential Revision: D45696921

fbshipit-source-id: 01c007d3e196a7511b940b7973bb8e6a880e27e5
2023-05-10 09:14:47 -07:00
Luke De Feo
42320e1c09 Remove focus mode when frame no longer contains previously focused mode
Summary:
The logic was a little outdated to when we were accumulating subtrees, now its much simpler, if the previously focused id is not in the new frame, remove focus

Changelog: UIDebugger, fix focus mode behaviour

Reviewed By: mweststrate

Differential Revision: D45523026

fbshipit-source-id: 894a85df21cc27eb57dbef411ae57743d0c4f753
2023-05-03 06:24:07 -07:00
Luke De Feo
862592e03d Account for race conditions with stream intercetor
Summary:
Given that stream interceptor is async the folling race conditino could occur.

Frame at time t=0 comes in, we yeild to the event loop while fetching metadata, fetch takes 5 ticks

Frame at time t=1 comes in, we yeild to the event loop but fetch takes 1 tick

At time t=2 the second frame is augmented  and display

At time t=5 the first fetch returns and we display and older frame

This is a simple check to avoid this.

Reviewed By: aigoncharov

Differential Revision: D45314013

fbshipit-source-id: 054e7e6beb52dfbfd94bc9f8ee3d0a758a669f66
2023-04-27 07:28:41 -07:00
Luke De Feo
7ce19f4359 Add static attributes from reduction trace
Summary:
In order to support this the stream inceptor transform nodes now is able to return a list of new meta enties, since these are new attributes we try to mimic what would have happened if they were generated on the client. This makes the rest of the logic downstream simpler

Introduced metadata register, same idea as on the clients.
The attributes available are a mixed bag, will work with blok server to imporove

Reviewed By: antonk52

Differential Revision: D45177781

fbshipit-source-id: 9d761b2f682e7e0fd4710f5b2e9d9d6ff26741fc
2023-04-27 07:28:41 -07:00
Luke De Feo
42963b16ab Subtree Update => Framescan
Summary: This is purely a cosmetic change but more accurately reflects the nature of how we send data from device to desktop. Ie its always an entire frame rather than subtrees. This helps with correctness great Both ios and android are like this and have been for a while.

Reviewed By: lblasa

Differential Revision: D45080088

fbshipit-source-id: 8f68047056c4825b0b1dd89f26c7fa462e2ecb1b
2023-04-27 07:28:41 -07:00
Luke De Feo
47fe0641aa Add error handling for reduciton trace and remove redundent memoization
Summary: We were memoizing the reduction trace fetch in the stream interceptor but this was redundant. We let the library handle that. Also pulled the calls into the uidebugger so we have more control over the retry behaviour

Reviewed By: mweststrate

Differential Revision: D45079132

fbshipit-source-id: 7354fce0fddbebdb0b027dade03398a36adc5e9a
2023-04-27 07:28:41 -07:00
Luke De Feo
4fdfbdc8df Open in IDE for bloks derived components
Summary:
* Added line number as an attribute to node, in theory we could get it from the device in the case of compose
* dont need to use miles as have the file already
* cleaned up naming in ide file resolver so its clear its the qualified name we are talking about

Reviewed By: lblasa

Differential Revision: D45079135

fbshipit-source-id: 24f2d5814800a4a404b680599d307cc750758fcd
2023-04-27 07:28:41 -07:00
Luke De Feo
7cc1a1246e Process Bloks derived components
Reviewed By: lblasa

Differential Revision: D45079131

fbshipit-source-id: 363f5ed2fedc6183130ef0185f8ff5bf58579c10
2023-04-27 07:28:41 -07:00
Luke De Feo
e34f3f4883 Process Bloks Bound tree
Summary:
1. Need to unminify the names from something call the minification map
2. Bloks attributes themselves are already minified. However the uidebugger also has a similar concept in its own metadata so the data we get off the device has been minified twice. To fix this we remap the metadata off the device using the minification map. In order to find the correct entry we need to get the style id of the bloks model parent. this is sent as a metadata custom attribute

Reviewed By: lblasa

Differential Revision: D45079136

fbshipit-source-id: bb448d81918c0b8c9e8ac87c4390b46a8a374d78
2023-04-27 07:28:41 -07:00
Luke De Feo
c96535e15f Infrastructure for stream inteceptor transform metadata
Summary:
Hooked up metadata to the stream inteceptor, enhanced error handling to deal with:
1. Recording subsequent metadata messaages that came in while in error state such that all of them are processed
2. Recording any frames that came in while in error state such that after recovering from error we have the latest state
3. Splitting out recoverable and non recoverable errors more explicitly

Reviewed By: lblasa

Differential Revision: D45079137

fbshipit-source-id: 67a2ffef72d94d2b1492f201a2228659720e306b
2023-04-27 07:28:41 -07:00
Luke De Feo
fd673d0535 Infrastructure for stream interceptor transform nodes
Summary:
Added stream interecptor which gets a chance to augment the messages off the wire. Stream interceptor transformations are async and can fail  due to network errors so added error state with a retry button. The retry button will just call the function again.

I am also handling errors better generally when this method fails unexpectedly, logging more clearly what went wrong and communicating it to the user

Did some refactoring of subtree update event to support this

Reviewed By: lblasa

Differential Revision: D44415260

fbshipit-source-id: a5a5542b318775b641d53941808399a8fa4634d3
2023-04-27 07:28:41 -07:00
Luke De Feo
6b7c5297a5 Added Hidden attributes to node
Summary: Type is any as it can be litterally anything, using json is a bit of pain as we have to do a lot of type checks to access anything

Reviewed By: lblasa

Differential Revision: D45079133

fbshipit-source-id: bcce93a1fce48d2779a648576f12df6392a0938e
2023-04-27 07:28:41 -07:00
Luke De Feo
9d34d12111 Added custom attributes to metadata typing
Summary: These replace tags, and are KV instead. They allow us to send framework specific data that arent common enough to be promoted to the top level, similar to hidden attributes. They will be needed for bloks

Reviewed By: lblasa

Differential Revision: D45079134

fbshipit-source-id: e4962bd56f0c24608504367f50cd796fd3d79fcd
2023-04-27 07:28:41 -07:00
Luke De Feo
1777cbf697 Remove coordinate update
Summary: This is no longer needed or sent by the client given our new approach to frames

Reviewed By: antonk52

Differential Revision: D44872566

fbshipit-source-id: 9ec340a5cc68605f730cf6677fb89778bf77a3a1
2023-04-27 07:28:41 -07:00
Lorenzo Blasa
8cd2bb97bf Add payload size to performance stats event
Summary: Payload size is useful to understand how much data is going down the wire for frame updates.

Reviewed By: LukeDefeo

Differential Revision: D45114582

fbshipit-source-id: d0c2a01deb84a67017db88bd396b4859e08d0037
2023-04-20 09:11:55 -07:00
Lorenzo Blasa
985a9eda33 Fix Visualiser cropping issue
Summary:
An issue was reported for the visualiser whereas there seemed to be some cropping taking place on the right hand side.

https://pxl.cl/2BhPT

The issue was the resizable panel and visualiser both were set with the same width.

The resizable panel was set as to have a gutter which was not taken into consideration, add this width to the panel width and that fixes the issue.

Also change box sizing model as to not affect the dimensions of the wireframe.

Reviewed By: LukeDefeo

Differential Revision: D44664377

fbshipit-source-id: e640af2090f7c3378e624626fe3ea5df631caa11
2023-04-04 22:10:39 -07:00
Lorenzo Blasa
a419aaaf1b Outer Border removal
Summary: Not in use, remove.

Reviewed By: LukeDefeo

Differential Revision: D44664459

fbshipit-source-id: 226fa7b36eea6696057f46ae482c16ca1959e099
2023-04-04 22:10:39 -07:00
Lorenzo Blasa
8f5fcf9444 FrameworkEventsInspector
Summary:
As events get bigger, this change includes the following:
- Dedicated event inspector
- Stacktrace viewer for events with stacktrace attribution
- Stacktrace viewer is displayed within a new BottomPanel. BottomPanel can display any React component and can be reused in the future in different use cases.

Reviewed By: LukeDefeo

Differential Revision: D44628768

fbshipit-source-id: 71a9ef87e71c9a17f58c2544a1aa356eed14ed27
2023-04-04 05:54:42 -07:00
Lorenzo Blasa
d127ac76ac Remove console logs for events
Summary:
May be a debugging left-over, remove.

https://pxl.cl/2B9bg

Reviewed By: LukeDefeo

Differential Revision: D44630930

fbshipit-source-id: a585a54f807259d50b38fc62df21c30cefcb6510
2023-04-04 03:55:44 -07:00
Lorenzo Blasa
e4eecc53c4 EventAttribution -> FrameworkEventAttribution
Summary:
Make it more specific as to keep it consistent with the other types.
Do not export JSON.

Reviewed By: antonk52

Differential Revision: D44625218

fbshipit-source-id: 9cab52ee7e7be21d13f85102597a60c9be967fd0
2023-04-03 10:35:15 -07:00
Lorenzo Blasa
0c4ec03e69 Add event payload as event properties for the timeline view
Summary: Leverage the properties prop of `TimelineDataDescription`. Whenever an event is selected, the event payload is shown as the event properties.

Reviewed By: antonk52

Differential Revision: D44497058

fbshipit-source-id: 09782d583957a0df8c3efd3f5a62af6b321a26e3
2023-04-03 10:35:15 -07:00
Lorenzo Blasa
ce2bfe320b Payload and attribution for framework events
Summary: ^

Reviewed By: LukeDefeo

Differential Revision: D44496975

fbshipit-source-id: 4f633d0f00239cac16ee332d35755b343d46b124
2023-04-03 10:35:15 -07:00
Lorenzo Blasa
04911d9d85 Tabs need key now
Summary: Because Tabs now depend on the selected node (i.e. some nodes have events, some don't) they need to use a key.

Reviewed By: antonk52

Differential Revision: D44624658

fbshipit-source-id: 693983f6a82c090adae3a2e009873d903626ab75
2023-04-03 04:39:25 -07:00
Andrey Goncharov
5b0ae2a4f8 Fix NPE when activeChildIdx points to the non-existent entry
Summary:
Based on the stack trace in T145744183, `activeChildIdx` could point to a non-existent array element.
Previously, we used to:
1) Find the index of the activeChild in the non-filtered array of children
2) Filter the array

As a result, it could lead to some of the elements in the child array to be filtered and shifting activeChildIdx, making it invalid.

Now, we search activeChild in the already filtered array.

Reviewed By: LukeDefeo

Differential Revision: D44575170

fbshipit-source-id: 2cb9a0b24badc8509a859011694f77b048d93316
2023-03-31 07:21:28 -07:00
Lorenzo Blasa
174c04accf Open in IDE diagnostics
Summary: Copy in IDE and BigGreep search usage

Reviewed By: LukeDefeo

Differential Revision: D44297978

fbshipit-source-id: deb3288c7afbea7fc7aa13937db1478f300d6307
2023-03-22 11:53:54 -07:00
Lorenzo Blasa
c2e41cd095 Copy diagnostics
Summary: Track copy events, both names and inline attributes.

Reviewed By: LukeDefeo

Differential Revision: D44297218

fbshipit-source-id: 5d2b1f2f4fa59d4a86e9e2ae1aa883712ceccb8c
2023-03-22 11:53:54 -07:00
Lorenzo Blasa
583eabdd79 UI actions diagnostics
Summary:
Track:
- Element selected. Include name and tags. Useful to understand what type of elements engineers are selecting in a hierarchy i.e. ui framework, element type, etc.
- Element focused. Same as above.
- Context menu usage

Reviewed By: LukeDefeo

Differential Revision: D44294618

fbshipit-source-id: f2b9642e70818e8a382bbbddc28115a40734dfe8
2023-03-22 11:53:54 -07:00
Lorenzo Blasa
8d83fa2185 Control use diagnostics
Summary:
Current control diagnostics:
- Play/Pause
- Search
- Framework Event Monitoring
- Toggle more options

Reviewed By: LukeDefeo

Differential Revision: D44292835

fbshipit-source-id: c1ef6181141ef47262de8e75abeeb88ffebd4bd6
2023-03-22 11:53:54 -07:00
Lorenzo Blasa
9b9674be2d Track play-pause usage
Summary: ^

Reviewed By: aigoncharov

Differential Revision: D44169950

fbshipit-source-id: 7a10c6849382680723687a63fd987b9766076af9
2023-03-17 10:37:02 -07:00
Lorenzo Blasa
723bc52c38 Update overview to include iOS
Summary: ^

Reviewed By: aigoncharov

Differential Revision: D44169429

fbshipit-source-id: 4e1b35f753e5cd390d6533f7b31d55f87a64b061
2023-03-17 10:23:54 -07:00
Lorenzo Blasa
bd9bc79cc7 No longer beta
Summary:
^

Time to remove the beta tag.

Reviewed By: aigoncharov

Differential Revision: D44168533

fbshipit-source-id: 5009170328269577aa01e68298753ec0738394d7
2023-03-17 10:23:54 -07:00
Lorenzo Blasa
5d0e0137d5 Better performance metrics
Summary:
Current metrics are deltas from an initial set timestamp. This works but is limiting or affecting the overall accuracy of them.

The aim of this task is to replace the deltas with actual measurements for the operations.

This way we can add/remove operations in between which will not create any impact of them.

Reviewed By: LukeDefeo

Differential Revision: D44026823

fbshipit-source-id: fd7d62c4eab86bab8239b44beecd5c133f6d11c7
2023-03-16 07:35:44 -07:00
Luke De Feo
fa2ea39405 Fix bad types and npe
Summary: Framework events was added recently so no garentueed to always be on all clients. Should fix T145084769

Reviewed By: mweststrate

Differential Revision: D44064430

fbshipit-source-id: 5dab14a7de5815a25cf8fe7bfa485a6a57d60071
2023-03-15 04:01:44 -07:00
Lorenzo Blasa
c192af7fa0 Event name declutter
Summary:
The current event label used the event type. The type in itself can have this shape:

`ck:willMountComponent`

The event name is just 'willMountComponent'.

So, extract that piece of data instead.

Reviewed By: aigoncharov

Differential Revision: D43983728

fbshipit-source-id: e232b59cfe3eb0710e56fc9ba7f94b644b07ee74
2023-03-13 03:55:03 -07:00
Lorenzo Blasa
2dde672045 Events tab
Summary:
Add a frameworks events tab. This is currently using the `TimelineDataDescription` component which may ultimately be replaced by something more sophisticated.

In the meanwhile, this does the job of chronologically displaying events with a label.

Reviewed By: mweststrate

Differential Revision: D43948891

fbshipit-source-id: 31ebf8a1d0e126856c3aa5291a1a06d7f2547233
2023-03-10 06:18:21 -08:00
Lorenzo Blasa
d349135683 Badge for events instead of inline approach
Summary:
Instead of showing events as inline attributes, just show a badge with the number of it. Event details will be displayed with other means:

- Hover
- Dedicated tab
- Other

Reviewed By: mweststrate

Differential Revision: D43946575

fbshipit-source-id: 762a241040d7fc6afb2c86d129a620ff2bb15feb
2023-03-10 06:18:21 -08:00
Lorenzo Blasa
ed4903576a Better guidelines
Summary: Removes dotted/dashed lines for the hierarchy guidelines.

Reviewed By: ivanmisuno

Differential Revision: D43912904

fbshipit-source-id: c65de8258c7efc997ae739022e6af5919d6453f6
2023-03-10 03:14:32 -08:00
Lorenzo Blasa
4d5bf8084b Remove feedback request
Summary: It has served its purpose, remove.

Reviewed By: LukeDefeo

Differential Revision: D43769239

fbshipit-source-id: 36fb575b15fe9d092c7728a56b735ff98ff78608
2023-03-03 07:33:24 -08:00
Lorenzo Blasa
3a36c269e7 Element name to not overflow
Summary: ^

Reviewed By: LukeDefeo, antonk52

Differential Revision: D43697303

fbshipit-source-id: 4acb6d50c02581688bcfd9ad65bf107412cffa42
2023-03-01 08:51:32 -08:00
Luke De Feo
95ef9bf585 Preserve scroll position after exiting focus mode
Summary: Previously we would scroll back to the top of the list

Reviewed By: passy, ivanmisuno

Differential Revision: D43390481

fbshipit-source-id: ce2d5d57d35b22e87a538720fe2760707a6bc058
2023-02-17 04:10:17 -08:00
Luke De Feo
d28748e69f Dont allow focusing nodes with zero area
Summary: If you focused a node with zero area (e.g a fragment) it would make the visualiser disappear. Simple solution is to prevent this in this case

Reviewed By: mweststrate

Differential Revision: D43363219

fbshipit-source-id: 8035db47486a2872fd86a5336e9fcaabeb0016a6
2023-02-17 02:45:05 -08:00
Luke De Feo
f12d8221d6 Fixed issue where visualiser would crop bottom few pixels of screen
Summary:
Fixes https://fb.workplace.com/groups/443457641253219/permalink/522118536720462/

On android for some reason our display metrics for the application, activity and winow were smaller than the decor view. We were using the root view as the base static view for the visualiser with overflow hidden. Since it will slightly smaller than the decor view we were losing some of the lower pixels of the snapshot

The decor view is the one that is actually snapshot so any bounds for nodes above are meaningless . The fix is to simply have the visualiser start at the snapshot view. We know this bounds is correct.

Tested on ios and android and all looks ok

Reviewed By: lblasa

Differential Revision: D43356523

fbshipit-source-id: 4d6177c8242365f33b1d64fc149a10baff7c85d6
2023-02-17 02:45:05 -08:00
Luke De Feo
d24343d2ac Make the visualiser scrollable and remember width
Summary:
Previously If you set the visualiser too wide, the height adjusts with the aspect ratio and  the bottom was cut off and there was no way to scroll. Have added a scrollbar if it exceeds the available height

Also the width state was promoted to an atom so the users resize amount is preserved when moving between plugins

A better solution might be to prevent the visualiser from getting too wide for the available hieght but it get complex when the window resizes.

Reviewed By: lblasa

Differential Revision: D43351294

fbshipit-source-id: f618a69ed025214593a74b952ce75c5fd98447cd
2023-02-17 02:45:05 -08:00
Luke De Feo
0651bb27df Fix automatic scrolling bug
Summary:
Fixes https://fb.workplace.com/groups/443457641253219/permalink/522121466720169/

For context see changelog.

The issue was because when an update comes in it creates an entirely new treeList. Since we were accessing that treeList in useEffect it was added to the dependency array. Therefore when an update came in we would scroll back to the last selected node. This effect was only meant to run when the selection changed in the visualiser. To fix we have to put the data it depends on in a ref so it can access the latest value without needing this data in the dependency array

changelog: UIDebugger Fix bug where if video playing on android and if element selected it would sometimes jump back to selected element when you scroll away

Reviewed By: mweststrate

Differential Revision: D43347501

fbshipit-source-id: f03bb32ddfa7828a4742d1a57e9be133a455ec30
2023-02-17 02:45:05 -08:00
Luke De Feo
8cae1f0de6 On select expand ancestory
Summary: Previously when selecting from the visualiser nothing would happen in the tree if one of the parents was collapsed

Reviewed By: lblasa

Differential Revision: D43318177

fbshipit-source-id: 7bf9296dec2ca82e3f983b4cf2676ea8741a9d0e
2023-02-17 02:45:05 -08:00
Luke De Feo
1cd916e414 Increase indent and automatically scroll horiztonally on selection
Summary:
Indent is made bigger so the horizontal lines have more space and the whole thing can breath more. To componesate the view scroll horiztontally so that the tree node is always visible. Was also able to clean up the hierachy a bit

changelog: increase tree indent and automatically scroll both horizontally and vertically when selecting an element

Reviewed By: lblasa

Differential Revision: D43311566

fbshipit-source-id: 53bc7bd55027e87fdecadac9aa8bc41612bb684a
2023-02-17 02:45:05 -08:00
Luke De Feo
d1e6b27358 Remove gap between tree scroll bar and visualiser resize handle
Summary:
So much tidier

changelog: UIDebugger remove gap between tree and visualiser

Reviewed By: lblasa

Differential Revision: D43307743

fbshipit-source-id: ceec9b3b164c93ecadfe8c0b7299a978b2915e3b
2023-02-17 02:45:05 -08:00
Luke De Feo
8581aa1944 Memoise selection of nodes
Summary:
For the visualiser we use the same trick as with the hover state. We subscribe to selection changes and only render if the prev or new state concerns us.

For the tree we change from object identity to the node id + and indent guide are added to the memoisation equal check.

Depending on teh change this tree memoisation can vary in effectiveness. If you go from nothing selecting to selecting the top element nothing is memoised since react needs to render every element to draw the indent guide. If you have somethign selected and select a nearby element the memoisation works well.

There are ways to improve this more down the road

changelog: UIDebugger improve performance of selecting nodes

Reviewed By: lblasa

Differential Revision: D43305979

fbshipit-source-id: 5d90e806ed7b6a8401e9968be398d4a67ed0c294
2023-02-17 02:45:05 -08:00
Luke De Feo
25149cc8c9 Added bgs on android ID + cleanup
Summary:
Paddings and alignments were improved also

changelog:
UIDebugger - Added ability to big grep search based on android ID if available

Reviewed By: lblasa

Differential Revision: D43159228

fbshipit-source-id: e2d7190ea2411e936ba065328bcc375c64619e8f
2023-02-15 08:27:19 -08:00