Commit Graph

360 Commits

Author SHA1 Message Date
Kevin Strider
89740f7e0a Features
Summary: This diff includes minor changes to the pages within the Features section of Flipper Docs.

Reviewed By: passy

Differential Revision: D41471000

fbshipit-source-id: 0a414d1e5e0cff5d874d3fe6eab647c3877b9caf
2022-11-24 06:18:38 -08:00
Kevin Strider
98d2f37f10 Setup - Part 2
Summary: This diff includes minor changes to the pages within the Setup section of Flipper Docs.

Reviewed By: mweststrate

Differential Revision: D41496698

fbshipit-source-id: a338931bd08e474ee348e25798463647f9a0be29
2022-11-24 06:18:36 -08:00
Lorenzo Blasa
c23f62219b Rename raw attributes flag to rawEnabled
Summary:
^

IMHO, this is a better name.

... and secretly make it enabled by default

Reviewed By: LukeDefeo

Differential Revision: D41495973

fbshipit-source-id: f287a4beadb70587ff43ac896213a20746dd8c22
2022-11-23 08:31:13 -08:00
Lorenzo Blasa
ef64abb495 Improve color inspector
Summary:
Before this change, color inspector used a color picker that showed: color, rgba, hex.

The problem is that engineers have to click on it to see these values.

This change leaves the picker as is, but presents both hex and rgba inlined within the inspector thus avoiding extra interactions.

Reviewed By: antonk52

Differential Revision: D41495740

fbshipit-source-id: c8af01e3060d2e6725295418293b1e30679c1b1f
2022-11-23 08:31:13 -08:00
Lorenzo Blasa
ae5eeb137d Add unknown type support in visualiser
Summary:
^

In this case, the unknown value, which is a text will be displayed as sent by the client.

Reviewed By: antonk52

Differential Revision: D41494094

fbshipit-source-id: 9295e3f7e055a8ce9b430137600108a4cdf32c90
2022-11-23 05:14:00 -08:00
Luke De Feo
7ec09b4f95 Shift fetching litho attributes to background thread
Summary: Due to litho component instances being immutable we are able to process them later if we hold on to the instance. We have added a Maybe deferred type which sort of resembles a Monad. It wraps a value which may or may not be calculated later.

Reviewed By: lblasa

Differential Revision: D41474251

fbshipit-source-id: 2ba6e688518dba55cf4aa5ba53f390a92cf0921f
2022-11-23 03:45:26 -08:00
Lorenzo Blasa
5b3e110821 Remove Enumeration type
Summary:
Enumeration used to be a type containing a single property value of type string.

The InspectableEnum is a type that had an Enumeration value and possible values.

As we removed possible values from the enum value, this structure no longer serves its purpose.

Reviewed By: antonk52

Differential Revision: D41400874

fbshipit-source-id: e5c2d1e15ee9b3074ddd69f75ee9b8150d44379f
2022-11-21 05:30:18 -08:00
Lorenzo Blasa
c92a9ae03e Enrich raw data with metadata
Summary:
As metadata got split from attributes, raw data became harder to read.

This change annotates raw data with attribute names to ease readability and thus usability.

Reviewed By: antonk52

Differential Revision: D41400622

fbshipit-source-id: 8bebb2bd368490b9d7a2b4435749cdf0570b7571
2022-11-21 04:51:23 -08:00
Lorenzo Blasa
1adcf2bc68 No data available
Summary: If there are no attributes for a given section, display a 'No data available' message rather than having an empty panel.

Reviewed By: antonk52

Differential Revision: D41400252

fbshipit-source-id: 0337702f638b9b917e6b3be5962838d2eb15c20d
2022-11-18 05:21:56 -08:00
Luke De Feo
1d920efe10 Change hit test to explore all nodes
Summary:
Previously we would only consider a node hit if the nouse pos was inside every parents. There are a few reason why this isnt ideal:
1. Fragments are return 0 bounds
2. Many hierachys (particually in litho ) have nonsensical strucutres where your parent may have hieght 0, or children overflow parents bounds. Therefore it was impossible to select many nodes but unclear why

Reviewed By: lblasa

Differential Revision: D41304499

fbshipit-source-id: d75c8060f71fa0b972f136cb11258b62a9c98ebc
2022-11-16 10:38:23 -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
bfe098485f Nested node structure for vizualiser
Summary: This structure makes sense for the vizualiser which itself is a nested structure. It also saves the awkward branch of there is no key in the map.

Reviewed By: lblasa

Differential Revision: D40670371

fbshipit-source-id: 6c1b960a77749be9e8a193decf6b8d50ce6c7968
2022-11-14 07:05:58 -08:00
Shreesh Ayachit
79bf56e72c Add export and import to Shared Preferences plugin
Summary:
We want to enable backing up and restoring debug settings between app installations.

Currently it is a manual process to click into menu and perform multiple operations.

With this feature, we can export and import shared preferences which will eliminate manual steps on devices.

Reviewed By: mweststrate

Differential Revision: D40987341

fbshipit-source-id: 15dd9600ee5cfd80a085117bdba4d434e4d2198f
2022-11-11 07:09:09 -08:00
Lorenzo Blasa
612bd69605 Styles refactoring
Summary: This change extracts most styles used across the inspector components and puts them in Styles.tsx

Reviewed By: passy

Differential Revision: D41026862

fbshipit-source-id: 461a78fb4a707d9a455281ec020bac95191ddfce
2022-11-11 03:22:39 -08:00
Lorenzo Blasa
f33e3fc78b Add qualified name to Node
Summary:
Our descriptors currently have a method to return the name as it will be displayed on the elements hierarchy.

However, it doesn't provide enough context if the name is to be used to discover the type in our code base.

This change adds a qualified name method that can provide a more complete name which can indeed be used by the Open In IDE functionality, for example.

Reviewed By: passy

Differential Revision: D40936785

fbshipit-source-id: 790ae02b9ebf37501765c52a24307fcaaaf9c14d
2022-11-11 03:22:39 -08:00
Lorenzo Blasa
caaded026b Big Grep Search
Summary: Add Big Grep Search for Android elements.

Reviewed By: antonk52

Differential Revision: D40634183

fbshipit-source-id: faecfc8900211478655ddff6499ff797e3136f91
2022-11-10 11:52:28 -08:00
Lorenzo Blasa
01dc22b1ab Attributes Metadata
Summary:
Before this change, attributes and attribute metadata were intermingled and sent as one unit via subtree update event.

This represented a few issues:
- Repetitiveness. For each declared and dynamic attribute, metadata was included on each value unit.
- Metadata can vary in size and thus can have a negative impact on payload size.
- The attribute name which is part of metadata is a string which always overhead on processing.
- Metadata instantiation is not cheap thus this also incurs in processing overhead i.e. even instantiating a single string can have an impact.

The proposal is to separate metadata of attributes from the actual node reported attributes. This solves the problems mentioned above.

Reviewed By: LukeDefeo

Differential Revision: D40674156

fbshipit-source-id: 0788551849fbce53065f819ba503e7e4afc03cc0
2022-11-10 11:52:28 -08:00
generatedunixname89002005306973
019bcaeb9e Flipper Release: v0.174.0
Summary: Releasing version 0.174.0

Reviewed By: mweststrate

Differential Revision: D41154768

fbshipit-source-id: bc9dbccae2ae413024a6573ec7ba57f4933f1741
2022-11-10 06:52:13 -08:00
generatedunixname89002005306973
aef077f54f Flipper Release: v0.173.0
Summary: Releasing version 0.173.0

Reviewed By: lblasa

Differential Revision: D40803306

fbshipit-source-id: 502ae3cb94994454c31aee05573ec1d43150862a
2022-10-28 09:27:02 -07:00
Lorenzo Blasa
587f428cf8 Allow plugins to use css
Summary:
Flipper plugins fail when importing css from third-party dependencies. This diff tries to fix that.

Effectively, the plugin can import the css and export it when is bundled.

When we load the plugin, we check if there's a css file for it. If there's one, we return it and try to use it.

Reviewed By: aigoncharov

Differential Revision: D40758178

fbshipit-source-id: e53afffcc481504905d5eeb1aea1f9114ee2a86b
2022-10-27 22:50:30 -07:00
generatedunixname89002005306973
1923ad0142 Flipper Release: v0.172.0
Summary: Releasing version 0.172.0

Reviewed By: aigoncharov

Differential Revision: D40720215

fbshipit-source-id: 24b3c7a82d285ee6bfc1819a38aaa7243350ea0a
2022-10-26 08:55:46 -07:00
Luke De Feo
b2c7d67586 More subtile selection and hover state for vizualizer
Summary:
Old hover state is now selection state
New hover state is a slightly thicker border

Reviewed By: lblasa

Differential Revision: D40637724

fbshipit-source-id: 7b13bc864bc1f626cf0982517befcb80615e7cc0
2022-10-25 07:10:38 -07: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
Luke De Feo
0c52ad307e Improve selection in vizualizer
Summary:
Clicking on a node a second time will unselect which was impossible before.

The behaviour of the on click handler doesnt always line up what is currently hovered, this is a temporary work around. There are deeper issues with this in that on exit we hover the parent, but in some situations the parent is too small to propagate. In future we will use the mouse position and do a hit test and drive selection / hover from that

Reviewed By: lblasa

Differential Revision: D40637356

fbshipit-source-id: 9df19dbf619845891bb46624730d7cf74f73cf25
2022-10-25 07:10:38 -07:00
Luke De Feo
b1bee28f08 Coordinate update event when litho scrolls or is shifted
Summary: See doc comment for explanation

Reviewed By: lblasa

Differential Revision: D40587610

fbshipit-source-id: f0909440c4e6e3cc9f5c7b557198a93ba8809bd9
2022-10-25 07:10:38 -07:00
Lorenzo Blasa
edb7de7311 Fix style naming for bounds and spacebox inspectors
Summary: ^

Reviewed By: passy

Differential Revision: D40632902

fbshipit-source-id: ae4cc57b3b64cac0cbeffc20c3189e3a01e13949
2022-10-25 03:09:00 -07:00
Lorenzo Blasa
bb3b1cecef Simple antd types for each inspectable type
Summary:
Replace draft inspectors with read-only components.

This is a first step into having a richer UI. At the moment, these are read-only components but will likely be extended in the future as to allow editing of values.

Reviewed By: LukeDefeo

Differential Revision: D40345016

fbshipit-source-id: a6aef5861474b4aa8353c00ef257ab17b4cff00e
2022-10-25 03:09:00 -07:00
Lorenzo Blasa
9721993576 Displayable name for attributes utility function
Summary:
Utility function that transforms lower camel case attribute names to a more readable name.

e.g. sizeToFit -> Size To Fit

Reviewed By: antonk52

Differential Revision: D40344715

fbshipit-source-id: f0745b892a78cc262133197a4d4b7624a7e2141d
2022-10-25 03:09:00 -07:00
Lorenzo Blasa
1ee89d0e64 Add enum and boolean inspectables
Summary: Add types to support enum and boolean inspectables

Reviewed By: aigoncharov

Differential Revision: D40344566

fbshipit-source-id: c1f719e634a4096e5dd63d3b96c6d64c9684c62b
2022-10-25 03:09:00 -07:00
Lorenzo Blasa
c46ddf7912 Foundations for inspector
Summary:
^

This laids the foundation for the inspector. It just reorganises a few bits.

Reviewed By: LukeDefeo

Differential Revision: D40319611

fbshipit-source-id: 8cf9b151c631faa1f26a7a6dfaa86b01abc42fe5
2022-10-25 03:09:00 -07:00
Tianyu Yao
c1ec891fd0 Upgrade React DevTools deps to 4.26.1
Summary:
Changelog:
[General][Changed] - Upgraded react-devtools-core dependency to 4.26.1

Reviewed By: lunaruan

Differential Revision: D40394563

fbshipit-source-id: 70a841c7478d8944dc8a57dd7711953d6bd7958a
2022-10-18 10:43:18 -07:00
Lorenzo Blasa
0572808f1a Add additional inspectables
Summary:
This change adds support for more inspectables and also introduces more complex types to be used as a value.

This become specially useful for more complex yet primitive types like coordinate, size, bounds, etc.

Reviewed By: LukeDefeo

Differential Revision: D40307885

fbshipit-source-id: 125e832f06d6b31f56eb5405182d1c0d61388930
2022-10-18 04:30:51 -07:00
generatedunixname89002005306973
6d6ad3cb80 Flipper Release: v0.171.1
Summary: Releasing version 0.171.1

Reviewed By: aigoncharov

Differential Revision: D40466532

fbshipit-source-id: 2fecb1810df67b450430957801dfd10ffe114c31
2022-10-18 04:06:55 -07:00
Lorenzo Blasa
5089f0319f Hide overflow
Summary: ^

Reviewed By: mweststrate

Differential Revision: D40316441

fbshipit-source-id: 235d0d3260743e3cdd85921aa27d20eef8217cae
2022-10-18 02:49:58 -07:00
generatedunixname89002005306973
71d0bbb90a Flipper Release: v0.171.0
Summary: Releasing version 0.171.0

Reviewed By: aigoncharov

Differential Revision: D40436300

fbshipit-source-id: 700b21b8025f32a6d81d19aa64ab0fb38e31d3c2
2022-10-17 11:48:51 -07:00
generatedunixname89002005306973
af16963251 Flipper Release: v0.170.0
Summary: Releasing version 0.170.0

Reviewed By: mweststrate

Differential Revision: D40295174

fbshipit-source-id: 3a38e99f0e4d0cda25921e0586a9a53e7f7ad4aa
2022-10-12 09:00:41 -07:00
Luke De Feo
941225e3d6 Only show node name when hovered
Summary: This makes the vizualiser a lot less cluttered

Reviewed By: lblasa

Differential Revision: D40021837

fbshipit-source-id: 8901c9bff6f05ee3fa4517e103c770be1fcfa403
2022-10-10 04:13:06 -07:00
generatedunixname89002005306973
dd99fc8e79 Flipper Release: v0.169.0
Summary: Releasing version 0.169.0

Reviewed By: lblasa

Differential Revision: D40173740

fbshipit-source-id: 6009a2621d98a706a94c5bca1121946b9604b7ab
2022-10-07 04:57:44 -07:00
generatedunixname89002005306973
84a5d8e184 Flipper Release: v0.168.0
Summary: Releasing version 0.168.0

Reviewed By: aigoncharov

Differential Revision: D40059591

fbshipit-source-id: b5ea55b6afd813cafff72b5264768bb60c7350e0
2022-10-04 08:44:13 -07:00
Luke De Feo
7ae2c35476 Remove redundant native scan event
Summary: It didnt need to exist and can be seen as a subtree update of type full scan

Reviewed By: lblasa

Differential Revision: D39731552

fbshipit-source-id: e351413d9480e118fc000c5e55eae0e7980233f2
2022-09-29 05:31:18 -07:00
Luke De Feo
78e84a0cc3 added metrics for snapshot
Reviewed By: lblasa

Differential Revision: D39886448

fbshipit-source-id: b229f6947d199026c6e4bdc89def6ac0a0fa9d0a
2022-09-29 05:31:18 -07:00
generatedunixname89002005306973
dcf2380fd4 Flipper Release: v0.167.0
Summary: Releasing version 0.167.0

Reviewed By: LukeDefeo

Differential Revision: D39924111

fbshipit-source-id: 30e26a9551eb3350ba4b526dc6ca014d868dd1ea
2022-09-29 04:38:46 -07:00
Lorenzo Blasa
ee9415a8d4 Be able to handle different snapshots for different roots
Summary:
^

This change allows to take different snapshots for different nodes and render them each on the visualiser.

At the moment, more than likely, this is not really used. At the same time, it fixes an issue whereas any subtree update can override and set the only visible snapshot.

Reviewed By: LukeDefeo, antonk52

Differential Revision: D39821920

fbshipit-source-id: ab8f6a4a2a5e96801c951a4e3009cc571a617f22
2022-09-27 13:00:04 -07:00
Lorenzo Blasa
945e26d0f1 Snapshots on Visualiser
Summary:
^

TODO: the snapshot corresponds to the referring subtree update. However, the snapshot is getting applied as if it was the current top view of the running app. This is true in most cases but it doesn't for some. To solve this, we need to use the rootId for the subtree and apply the snapshot only if appropriate.

Having said that, is good enough for the current submission as we keep iterating on it.

Reviewed By: LukeDefeo

Differential Revision: D39813307

fbshipit-source-id: 33b6aff6e9dd085934150ebd2f247062447a59ff
2022-09-27 13:00:04 -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
Tianyu Yao
2bf5410316 Upgrade React DevTools deps to 4.26.0
Summary:
Changelog:
[General][Changed] - Upgraded react-devtools-core dependency to 4.26.0

Reviewed By: lunaruan

Differential Revision: D39587418

fbshipit-source-id: 1b1841b72329fd3ef4ae8a08095a30a26a0b6455
2022-09-23 12:46:33 -07:00
Jacy
5b794dc28f Fix: [Android] Flipper Leakcanary plugin's OnHeapAnalyzedListener has been deprecated (#3923)
Summary:
Flipper Leakcanary plugin's OnHeapAnalyzedListener has been deprecated.

Flipper Leakcanary plugin's OnHeapAnalyzedListener has been deprecated change to EventListener implement.

## Changelog

1. add FlipperLeakEventListener.kt to implement EventListener.
2. update doc

Pull Request resolved: https://github.com/facebook/flipper/pull/3923

Test Plan:
Setup the  Leakcanary plugin use FlipperLeakEventListener, test if it works.

**Static Docs Preview: flipper**
|[Full Site](https://our.intern.facebook.com/intern/staticdocs/eph/D39652084/V4/flipper/)|

|**Modified Pages**|

Reviewed By: antonk52

Differential Revision: D39652084

Pulled By: antonk52

fbshipit-source-id: 0afeb52dce6c1749a894a15dbb7921580c094ae6
2022-09-22 05:57:28 -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