Commit Graph

187 Commits

Author SHA1 Message Date
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
Luke De Feo
96bed18df2 More context menu options in the tree
Summary:
Added ability to copy element name and any inline attributes

Changelog:
UI Debugger - Added extra context menu items for copying element name and attributes
UI Debugger - Added open in Android studio button
UI Debugger - Improve speed of loading the Open in IDE buttons

Reviewed By: lblasa

Differential Revision: D43153666

fbshipit-source-id: 8b440d77444cd6849388e7e9d348da4527db5baf
2023-02-15 08:27:19 -08:00
Lorenzo Blasa
ada748170f Make glyph optional
Summary:
Make it optional to display the icon (glyph) with a default of true.

Not used in this diff, but it will in future diffs.

Reviewed By: ivanmisuno

Differential Revision: D43186605

fbshipit-source-id: b525e126bcc46604e0abc0f83b6ff33a7ce78962
2023-02-10 06:04:04 -08:00
Lorenzo Blasa
5fc0bcb631 Dark mode fix for Glyph
Summary: <NoData /> didn't support dark mode, now it does.

Reviewed By: ivanmisuno

Differential Revision: D43186565

fbshipit-source-id: 9952535d8762d8510afcce03b6cde7b603292107
2023-02-10 06:04:04 -08:00
Lorenzo Blasa
ca602bffd0 Clearer section creation
Summary: A bit more explicit with the intent, clearer code.

Reviewed By: ivanmisuno

Differential Revision: D43186540

fbshipit-source-id: 24f2168f5be91673683966208c9b8b54125aaa5b
2023-02-10 06:04:04 -08:00
Lorenzo Blasa
6316852026 Remove unnecessary fragment
Summary: Remove unnecessary fragment.

Reviewed By: ivanmisuno

Differential Revision: D43186534

fbshipit-source-id: cf9c761b1ce3b9103d2facfba3c7acc7fc1fe339
2023-02-10 06:04:04 -08:00
Lorenzo Blasa
d858459516 Search placeholder and icon
Summary: ^

Reviewed By: antonk52

Differential Revision: D43118750

fbshipit-source-id: 46c341772d05d6712ac2c0d76d94ee942609c1b3
2023-02-08 07:09:08 -08:00
Lorenzo Blasa
39a4cc22b1 Dark mode support
Summary:
This change addresses some obvious issues which made the ui-debugger unusable with dark mode on.

There may more things that need changing, but at the very least this should be a good place to start.

Reviewed By: fabiomassimo

Differential Revision: D43083218

fbshipit-source-id: 8e4338b79178d3a0f05f9bcaffa2fc6f35eb0e21
2023-02-07 07:58:12 -08:00
Lorenzo Blasa
9c9cd91832 Remove id from Inspector
Summary: This is internal to ui-debugger so there's no need to surface this information to users.

Reviewed By: ivanmisuno

Differential Revision: D43081188

fbshipit-source-id: f6abdeb7828a1709d2590cf2a10407baec645420
2023-02-07 07:16:20 -08:00
Luke De Feo
c19dc150e6 Use event metadata in init event
Summary:
Previously we were checking the framework events stream for any new events and populating the map from that. Now we expect the init event to contain event types.

This allows us to know if the app supports framework event and therefore we dont show the controls to monitor it. Additionally we can fully populate the event monitoring dialog

Reviewed By: lblasa

Differential Revision: D42996552

fbshipit-source-id: 7850ada53d0630ba102af6c0d74d9d904f75eada
2023-02-06 04:33:11 -08:00
Luke De Feo
dc9c445f9e Highlight tree nodes when monitored event matches
Summary: Tree node flashes to highlight an event occured

Reviewed By: lblasa

Differential Revision: D42996554

fbshipit-source-id: fc51a76ce7e33d041d094fedc91f05338b907bec
2023-02-06 04:33:11 -08:00
Luke De Feo
8fc97f2caa Add monitored event summary
Summary: When an event is monitored show running total  in the tree

Reviewed By: lblasa

Differential Revision: D42996553

fbshipit-source-id: 9b7bd5d2e98d8775f28b0b541f4eb1bd8231cc3e
2023-02-06 04:33:11 -08:00
Luke De Feo
d93c9d45a9 Ability to highlight nodes that match monitored event
Summary:
Listen to framework events and store in a map based on node id

Added UI to allow for monitoring framework event types.

The event type is a string separated by : Each segment of this string represents a level in the dialog hierachy. For example Litho:Layout:StateUpdateSync  would have levels, Litho Layout StateUpdateSync

When event type monitored and event comes in for a node flash the visualiser node briefly

Reviewed By: lblasa

Differential Revision: D42074988

fbshipit-source-id: 52458ad87ab84bf7b1749e87be516ed73106a6c0
2023-02-06 04:33:11 -08:00
Luke De Feo
d3df6bc00e Attempt to render txid as date if possible
Summary: We are using frame time on android so make sense to present it

Reviewed By: lblasa

Differential Revision: D42996555

fbshipit-source-id: 595a08571ccd82de0761cfeea8a204e576981ee0
2023-02-06 04:33:11 -08:00
Lorenzo Blasa
4e21a67903 Better offset
Summary: For deep nested hierarchies, the current offset was too big making the hierarchy almost un-browsable. The current offset seems to work better.

Reviewed By: LukeDefeo

Differential Revision: D42996296

fbshipit-source-id: 808a2ecc32aff2d8d252bdb9f653344866e5653b
2023-02-03 08:37:33 -08:00
Lorenzo Blasa
dacc6ebb16 Feedback request
Summary:
^

Only for iOS this time.

Note: passing the device OS freely to the main component as this is just temporary code that will be deleted soon.

Reviewed By: antonk52

Differential Revision: D42990221

fbshipit-source-id: 41b4107caa6bf312191889af75afd28873f6eda5
2023-02-03 07:43:00 -08:00
Luke De Feo
df9b0a6aa6 Use react query to cache myles query
Summary: The call to myles was a little slow and very cachable so use react query. Additionally it depends on VPN / light so added an error state to make that clear.

Reviewed By: lblasa

Differential Revision: D42990344

fbshipit-source-id: 8d6ad20aea79f1972a7cf1f61f8af729e5f3464f
2023-02-03 04:38:51 -08:00
Lorenzo Blasa
92ac6988d5 Attributes inspector style improvements
Summary:
- Vertically center values
- Add gutter between rows/cols
- Tryout the removal of the indentation border (it could either be removed in the future or brought back)

Reviewed By: antonk52

Differential Revision: D42581663

fbshipit-source-id: cd682adca7f76f80240a0ca6d9023368a33453c3
2023-01-19 05:05:49 -08:00
Lorenzo Blasa
49403df95f Remove survey banner
Summary:
^

Not removing the component, yet, as we may re-introduce the survey once we officially release on iOS.

Reviewed By: antonk52

Differential Revision: D42499399

fbshipit-source-id: 596ebda7acf39c0b8377bbd3a1a8f4dfa81e59a4
2023-01-13 07:36:20 -08:00
Luke De Feo
edf7dd1b8f Add entire node to raw data
Reviewed By: lblasa

Differential Revision: D41612115

fbshipit-source-id: a89dc1b3c994435afa9b85f6681df73f637c3f3f
2022-12-19 09:20:27 -08:00
Luke De Feo
989797a225 Dynamic scaling of visualizer and resizable window
Summary: Fixes https://fb.workplace.com/groups/443457641253219/permalink/480446154221034/

Reviewed By: mweststrate

Differential Revision: D42095625

fbshipit-source-id: 364577141f2819dd22b0b499b11770d0bb88b1f5
2022-12-16 03:47:58 -08:00
Luke De Feo
a4525790a2 Revert always root snapshot
Summary: this assumption doesnt hold true for android as the snapshot is of the decor view and app bounds include the status bar / bottom bar

Reviewed By: elboman

Differential Revision: D42035810

fbshipit-source-id: 177b5d086487a940e0bdbe20c2a001c420a08d69
2022-12-14 08:41:23 -08:00
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
dc25a698d5 Snapshot to root of tree instead of root of subtree
Summary: ^

Reviewed By: LukeDefeo

Differential Revision: D42002750

fbshipit-source-id: 66639d9f55aa850d4be83adee440489cba78d321
2022-12-13 13:26:18 -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