Commit Graph

684 Commits

Author SHA1 Message Date
Pascal Hartig
daf8cfea2a Remove unneeded flow fixme
Summary: Per title.

Reviewed By: jknoxville

Differential Revision: D14561355

fbshipit-source-id: 45681a754ff91d90057d48ba9f567770a87bc3c6
2019-03-21 08:38:25 -07:00
Pritesh Nandgaonkar
5964f1621e Open source Import/Export feature to open source
Summary: Exposes Import/Export feature to open source. This diff also makes sure that, "Shareable Link" option doesn't show up, as it is specific to fb's infrastructure.

Reviewed By: passy

Differential Revision: D14526634

fbshipit-source-id: 3aeb97c91bc00a9c5f01c74c34a5690ec3b5739d
2019-03-20 06:59:28 -07:00
JianyingLi
2564bce5a0 Fix DataInspector Component diff some problems. (#397)
Summary:
1. In `diffMetadataExtractor` function, when the `data` or `diff` is `null`, it diff view does not display correctly.

```jsx

<Panel floating={false} heading={'Test'}>
  <ManagedDataInspector
    diff={{
      auth: null
    }}
    data={{
      auth: {
        user: {
          name: 'JianyingLi'
        }
      }
    }}
    expandRoot={true}
  />
</Panel>
```

Before:
![2561552808023_ pic](https://user-images.githubusercontent.com/3889523/54486986-db383b80-48ca-11e9-9869-a008f72f4324.jpg)

After:
![2551552807969_ pic](https://user-images.githubusercontent.com/3889523/54486992-ea1eee00-48ca-11e9-90b0-7fd043f1c2bd.jpg)

2. Status `added`(green) and `removed`(red) should be the opposite

```jsx
<ManagedDataInspector
  diff={{
    user: {
      name: 'Leo'
    }
  }}
  data={{
    user: {
      name: 'JianyingLi'
    }
  }}
  expandRoot={true}
/>
```

Before:
![2591552808195_ pic](https://user-images.githubusercontent.com/3889523/54487019-35390100-48cb-11e9-8c20-1526aeae52a1.jpg)

After:
![2581552808145_ pic](https://user-images.githubusercontent.com/3889523/54487022-3c600f00-48cb-11e9-9ea9-75a8c8490c22.jpg)
Pull Request resolved: https://github.com/facebook/flipper/pull/397

Reviewed By: danielbuechele

Differential Revision: D14505757

Pulled By: passy

fbshipit-source-id: 35ca1bf8721468fdde13f3a9ede75cb72a59caea
2019-03-19 17:04:15 -07:00
Pritesh Nandgaonkar
574ae7a3e8 Improve CrashReporter UI for the latest crash
Summary: I have updated the UI of the crash reporter. It doesn't show the multiple crashes now. I will work on that in other diff. This diff just updates the current UI that shows the latest crash, as per the [design](https://our.intern.facebook.com/intern/px/p/pJ11/)

Reviewed By: danielbuechele

Differential Revision: D14399400

fbshipit-source-id: f6f28c2c6d386f4cd99a257922993ef355b1059b
2019-03-19 08:18:13 -07:00
Daniel Büchele
a54b02b583 release v2
Summary:
- Moving the new layout plugin from `layout2` to `layout`.
- updating dependencies
- removed beta toolbar

Reviewed By: passy

Differential Revision: D14519490

fbshipit-source-id: d184767e767e1717368f66e2bda2af318b7e63c9
2019-03-19 06:47:06 -07:00
Daniel Büchele
f9ec0cd326 fix colorpicker in panel. Fixes #396
Summary: Overflow on panels was clipped. Setting overflow visible to make it visible.

Reviewed By: passy

Differential Revision: D14519402

fbshipit-source-id: 264f99e3ac20986365c8f69564c4633818dd4a94
2019-03-19 04:17:40 -07:00
Daniel Büchele
f30ff068a7 Show offline devices in dropdown
Summary:
This diff aims to make the selected device a little clearer, the button now shows different icons depending on the selected devices: physical, emulators and archived devices.

The dropdown now is grouped in these sections, depending on their availability:
- Connected Devices
- Running Emulators
- Imported Devices
- Launch Android emulators
- Open File...

"Open File..." allows to import a file the same way as File -> Open File...

Reviewed By: jknoxville

Differential Revision: D14460789

fbshipit-source-id: 8d6edff0d90d5e02e4ef5976af5680ab8eaf77b4
2019-03-15 11:30:38 -07:00
Pritesh Nandgaonkar
51139500f4 Add revision information in the exported file
Summary: Adds revision information which is used to build the flipper app. for more context follow the [discussion](https://fb.workplace.com/groups/1489943347777350/permalink/2046366362135043/)

Reviewed By: danielbuechele

Differential Revision: D14458169

fbshipit-source-id: 71860f1e78c042f76d0e220dd3be96f2adaf609e
2019-03-15 09:57:12 -07:00
Pritesh Nandgaonkar
e184af7f2a fix the parsing error
Summary:
The headless version used to use `JSON.stringify` to serialize the output of `serializeStore` which basically transformed the store to a specific format which is serializable.  But we have written the custom serialize function which cateres to the non serializable object types. Headless didn't use it, so thats why it exported Flipper trace in an unrecognizable format for the flipper.

I have also renamed `serializeStore` to `prepareToSerializeStore` so that the confusion doesn't occur in future. I have used an `exportStore` function in headless which exports the store to the `Promise<String>`

Reviewed By: jknoxville

Differential Revision: D14480096

fbshipit-source-id: f312d7637aa082d96c3bc1dfd00eefb19182e97f
2019-03-15 09:49:31 -07:00
Pascal Hartig
3141b954bf Run prettier fix
Summary: Should also fix the build.

Reviewed By: jknoxville

Differential Revision: D14477777

fbshipit-source-id: 01fcfb2321c9b7a12acdf079473d91b6805d4dda
2019-03-15 05:13:30 -07:00
Pascal Hartig
e97dddfda6 Add readCurrentRevision helper
Summary: To read the current revision written into the manifest at build-time.

Reviewed By: danielbuechele

Differential Revision: D14454983

fbshipit-source-id: adad7d85dbf410701d2f8601bfccbcfbc0f30dff
2019-03-14 04:48:01 -07:00
Daniel Büchele
aad970defd UI for sharable URLs
Summary:
Uploading the Flipper data could take some while. With the current implementation the user didn't know what was happening. This is why this diff immediately shows a sheet with a spinner, until the upload is finished.

The URL is still copied to the clipboard and a notifications is displayed. Additionally the user can copy the URL from the sheet.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14441759

fbshipit-source-id: c853526a7da76e2dea5e1aaf6b6eff21e4268789
2019-03-14 04:22:15 -07:00
Pritesh Nandgaonkar
2f3678d6e3 Solve the bug when default state was not added
Summary:
Due to faulty condition default state was not being added in the persistedState, which casued the following bug.

{F153286217}

Reviewed By: danielbuechele

Differential Revision: D14425166

fbshipit-source-id: 557dc3717b650dae90dc44ad12970a684cecbf24
2019-03-13 05:28:36 -07:00
Pritesh Nandgaonkar
f2627dbc8b Hide target and alignment mode for archived device
Summary: As per title. Target mode and Alignment mode doesn't make sense for archived devices.

Reviewed By: danielbuechele

Differential Revision: D14407780

fbshipit-source-id: cf6f56456674ad8fec422d6f84d58c6d5b211c25
2019-03-12 07:08:24 -07:00
Pritesh Nandgaonkar
145addf1c9 Fix search for accessibility view
Summary:
Bug: On search, the accessibility views didn't used to expand.Look at the following video to understand the bug

{F153135892}

Reviewed By: danielbuechele

Differential Revision: D14407511

fbshipit-source-id: 011bf31b5bd10f5a7dad3d5d30703ec3bdeaf9c1
2019-03-12 07:08:24 -07:00
Pritesh Nandgaonkar
1c8fffa20b Enable import all the nodes for android
Summary: Enables Import and Export for all the nodes for android. Also search and Accessibility feature works

Reviewed By: danielbuechele

Differential Revision: D14406016

fbshipit-source-id: 8976db66d1ca91e98c52983a31ea584764bde0f6
2019-03-12 07:08:24 -07:00
Pascal Hartig
063d8aa416 Remove FlowFixMes
Summary: Flow tells me these too are unnecessary now. Yay!

Reviewed By: danielbuechele

Differential Revision: D14406869

fbshipit-source-id: c09c11fd548798a3fe97c74d23d3b2e9637e5f3a
2019-03-12 03:37:00 -07:00
Daniel Büchele
e0127b8438 Electron 4.0.8
Summary:
Upgrading to electron 4.0.8 to fix CVE-2019-5786

Learn more: https://electronjs.org/blog/filereader-fix

Reviewed By: passy

Differential Revision: D14403928

fbshipit-source-id: 47bd198196de789958c93cfecd2e5e01e24ea7ef
2019-03-11 12:13:09 -07:00
Pritesh Nandgaonkar
b65581262a Enable search on layout2 for archived devices
Summary:
Enables search on the imported layout data. The way search is implemented is that the Flipper app asks for the search results from the mobile clients. Since mobile client will not exist in the archived case, the search won't work. To solve this problem I added a proxy client which will get all the messages fired by the Layout Inspector and it will accordingly revert back with the responses. In the case of search, it will give back the search result tree for a particular query.

Also added extensive tests for the proxy client

Reviewed By: danielbuechele

Differential Revision: D14281856

fbshipit-source-id: 651436084ebacd57f86e4fe9bb2036e7f666880c
2019-03-08 10:19:14 -08:00
Daniel Büchele
2c05fdf347 correctly handle gzipped unicode fixes 394
Summary:
For gzipped requests, the decoding of unicode characters was failing, because it was was done, before decompressing the response payload.

In this diff, the payload is first decompressed and decoded afterwards. For the calculation of the response size, this is removed, because it doesn't matter for the calculation of the size to correctly decode unicode characters. However, there might be a problem with displaying the correct size. This is tracked in T41427687.

Reviewed By: jknoxville

Differential Revision: D14366841

fbshipit-source-id: e375df1ec44505f6315dedbe71b3b62eac0f281a
2019-03-07 10:08:29 -08:00
Pascal Hartig
83c9d3399f Add missing title attributes
Summary:
Extended the linter to check for the title attribute, too, and fixed
all violations. Linter will follow in next diff.

Reviewed By: jknoxville

Differential Revision: D14366410

fbshipit-source-id: b4de3592f2537e2bb16d4c2af231e5bee45346e4
2019-03-07 09:44:25 -08:00
Pritesh Nandgaonkar
04d2880b25 Bug fix when the selectedPlugin is Layout, and trace is imported
Summary:
Fixes a bug which happened when the selected plugin was layout and the flipper trace was imported. While importing the trace in the mentioned scenario, the redux store didn't used to get updated in the first render but got updated in the second render. Due to which the persisted state passed in the props was undefined. Look at the attached video to understand the bug.

BUG:

{F152642401}

Reviewed By: passy

Differential Revision: D14343465

fbshipit-source-id: 59110fd6ee5839f2e3944792e1c288d2388d3340
2019-03-06 09:30:23 -08:00
Daniel Büchele
b304126af3 Share Flipper file
Reviewed By: jknoxville

Differential Revision: D14340965

fbshipit-source-id: 9145ae8d409e9d4f8becfd1a19a8a9b3739af3fb
2019-03-06 05:54:21 -08:00
Daniel Büchele
c0a30380dc fix sidebar scrollbars
Summary: Only show scrollbars in sidebar when necessary.

Reviewed By: jknoxville, passy

Differential Revision: D14341446

fbshipit-source-id: e75f02b9de7796fc9ed8a42618ade3be015a1889
2019-03-06 05:50:14 -08:00
John Knox
fac138ded3 Use full emulator path when running it
Summary: This is required on linux or it isn't found. It's already done elsewhere this way.

Reviewed By: passy

Differential Revision: D14303606

fbshipit-source-id: 8b3fca776d43076cdc2f814de19b0b381350dcc9
2019-03-05 10:26:49 -08:00
JianyingLi
f4b2ce9a2b Support Chinese characters
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/377

Reviewed By: passy

Differential Revision: D14299674

Pulled By: danielbuechele

fbshipit-source-id: 6b10370a4a367ae6e58415b8eeb5aef0864354f4
2019-03-04 05:16:00 -08:00
Pritesh Nandgaonkar
c098269533 Added telemetry for import and export
Summary: Adding telemetry for import and export feature

Reviewed By: jknoxville

Differential Revision: D14267533

fbshipit-source-id: 1a5e041d0dc8c59c325e7d80dc83f6135f479161
2019-03-04 05:08:19 -08:00
Daniel Büchele
7d39c33fc4 get children on invalidation
Summary: When a node was invalidated, not only the node itself needs to be refetched, but also its children.

Reviewed By: jknoxville

Differential Revision: D14280318

fbshipit-source-id: a262a2c95347dc9bf72f83b6a9eba9d3f9badb5a
2019-03-04 02:06:05 -08:00
Pritesh Nandgaonkar
b0551bb74e Export Flipper trace along with bug report
Summary:
Exports Flipper trace along with bug report. I was not able to upload `.flipper` file, thus I have uploaded `.json` file. One can download the json file from the portal and then can rename it to `.flipper` inorder to open it into flipper app.

I am looking into downloading `.flipper` directly, instead of `.json`. But that change, if it happens, will be done in other diff. I think having flipper trace on the bug report will be helpful to debug the issues.

Reviewed By: danielbuechele

Differential Revision: D14266218

fbshipit-source-id: fb7cf4c9773fb355f3569ce8d08b83bd736ab1ca
2019-03-01 08:22:46 -08:00
Pritesh Nandgaonkar
9a9c5a229b Cold start filter
Summary:
This diff adds filter for cold start in the Images plugin.

I also moved the Loading indicator as a sibling of filter bar, because it used to show up when the images to display were zero. Earlier zero images case used to happen only at the start, but now with the options to apply filter, this case may happen often, so user should have access to filter bar to change the filters in order to reset it.

Look at the video for more information

Reviewed By: danielbuechele

Differential Revision: D14269064

fbshipit-source-id: cbab5a62fd62c5a98f8728c33c1a0dbfc6f454cc
2019-03-01 04:50:16 -08:00
Daniel Büchele
79124891a9 url handler downloads
Summary:
Adding support for downloading archived Flipper data using a URL handler.
A URL looks like `flipper://import/?url=` and will download the file specified in the url param. While downloading the file, a spinner is shown in the app's titlebar.

Reviewed By: jknoxville

Differential Revision: D14262763

fbshipit-source-id: 6538fc78c07a48cef7b71b3f7bdbcb712d054593
2019-03-01 04:30:22 -08:00
John Knox
3e336d2349 Print error when adb client creation fails
Summary:
It looks like the shell method of creating an adb client is failing almost all of the time: https://fburl.com/scuba/6ac2zhxn

Thankfully we have the adbkit fallback, but we don't have the error message to see why it's failing: https://our.intern.facebook.com/intern/logview/details/infinity_javascript/dab8d34562f0cdb835132f8825317942/

Reviewed By: danielbuechele

Differential Revision: D14260406

fbshipit-source-id: 6b21b5d9a4806780daa7ce692770788067364d12
2019-03-01 04:26:46 -08:00
Pritesh Nandgaonkar
be008fa18f Change Coldstart type to boolean
Summary: Updated the coldstart type to boolean, as number is not required, its a boolean value.

Differential Revision: D14260678

fbshipit-source-id: 236a38e04fd31cab4a561f5e0365bc43ad98adea
2019-02-28 13:31:16 -08:00
Pritesh Nandgaonkar
af317eed2b Export and import all the nodes
Summary:
This diff does the following

- Support to export the entire view hierarchy for iOS
- Android is not supported yet
- This diff adds a call `getAllNodes` to the client side of iOS, which returns the entire view hierarchy
- Currently the search doesn't work on the imported layout plugin data. Also the imported layout plugin data doesn't expand the way it does when component is mounted, reason being the client passed to the plugin is not functional for the archived case

I will work on fixing the last points in the next diffs stacked on the current one.

For Android:
- Currently the export function will export whatever is currently displayed on the Flipper app, not the entire view hierarchy

Support for Android will also come up in later diffs.

Reviewed By: jknoxville

Differential Revision: D14209157

fbshipit-source-id: 3ad3e39edfd994913dc19cc239bfbbe011a9757c
2019-02-28 09:40:50 -08:00
Daniel Büchele
99ea11b8e6 createPaste
Reviewed By: jknoxville

Differential Revision: D14224400

fbshipit-source-id: 9a9a8578de00d276d65a7928964eae619f5bc41f
2019-02-28 07:28:25 -08:00
Daniel Büchele
6118dee3e7 adding logged in user to sidebar
Summary: Adding UI that shows when a user is logged in and allows the user to log out.

Reviewed By: jknoxville

Differential Revision: D14224401

fbshipit-source-id: 314a1c2f9a1021258e724e824be7577eb85d4b9e
2019-02-28 07:28:25 -08:00
Daniel Büchele
ff0de8caaa user reducer
Reviewed By: jknoxville

Differential Revision: D14224403

fbshipit-source-id: 8341dd8af03148c4b1f648641bda522804acb22d
2019-02-28 07:28:25 -08:00
John Knox
0445a05e5b Add isMethodSupported to client
Summary: Allows plugins to check if extension commands or new features are enabled in the current app, by calling `this.client.supportsMethod('xxx')`.

Reviewed By: passy

Differential Revision: D14225961

fbshipit-source-id: c9f7f5b3091209f0ce9705d9d3a0ec173edf3e25
2019-02-27 10:10:02 -08:00
John Knox
6dc2215753 Reuse adb client in certificate provider
Summary: Avoid making duplicate clients, and this one uses a more reliable creation method.

Reviewed By: passy

Differential Revision: D14241448

fbshipit-source-id: 95846a373335818758c8c4a282ed4db26b62d986
2019-02-27 05:42:24 -08:00
John Knox
99bb43fe32 Move adb client creation into it's own file
Summary: Allows the created client to be reused.

Reviewed By: passy

Differential Revision: D14241449

fbshipit-source-id: 6bbb64eeb708dce9c24e4581e8480d19af998e47
2019-02-27 05:42:24 -08:00
Pascal Hartig
edbe2555fc Clear adb logcat when clearing Flipper logs
Summary: When using "Clear logs" in Flipper, also flush the native Android buffer.

Reviewed By: jknoxville

Differential Revision: D14225722

fbshipit-source-id: f41ff9013b95fc3271d3ae44910da18023708d2d
2019-02-26 16:33:19 -08:00
Manish Singhal
b8e6298df5 Added support for cold start in image perf plugin
Summary:
This diff adds support for cold start in image perf plugin. Now developer can see which images have been requested as part of cold start.

CC: Diego Sanchez Vivian Wehner Alexander Oprisnik Gaurav Nijhara

Reviewed By: jknoxville

Differential Revision: D14227065

fbshipit-source-id: 3347b460e491b218115d8572cb8b323de909ef1b
2019-02-26 16:01:20 -08:00
Pascal Hartig
dbb4fa1191 Fix typo
Summary: typo_gnome

Reviewed By: jknoxville

Differential Revision: D14224864

fbshipit-source-id: eab74df8fb7c48782a44b5284483ab67c205387e
2019-02-26 07:37:52 -08:00
Daniel Büchele
b8cb95ab0c toolbar
Summary: When there wasn't enough space for the text toolbar, the text was wrapped into multiple lines. Now it's truncated.

Reviewed By: jknoxville

Differential Revision: D14209813

fbshipit-source-id: 1971cd791daf345639993ed0632d718374a5f91b
2019-02-26 02:37:17 -08:00
Daniel Büchele
2e8394cb36 fix search
Summary: Layout search was throwing errors before, now it's working. The problem was, the event object used in the `setTimeout`-callback was released, before the timeout fired and therefore was null.

Reviewed By: jknoxville

Differential Revision: D14209811

fbshipit-source-id: 2465241c376d3e709155830e796aa3b991cbd7de
2019-02-26 02:37:17 -08:00
Daniel Büchele
385d74ef30 remove virtualization
Summary:
Removing the virtualization in the elements inspector. This didn't really make sense here, because usually the inspector renders 10-1000 rows, which can be easily done in the browser. Having virtualization here, caused some problems with icons flickering and scrolling being broken.

Let's make it less complex and just remove the virtualization!

Reviewed By: jknoxville

Differential Revision: D14209815

fbshipit-source-id: 115d3ed57a1ccdbc20108636ff4fc7fc68e6c9c0
2019-02-26 02:37:17 -08:00
Daniel Büchele
0d0da3df24 sidebar
Summary: Before, the a11y inspector was in a sidebar. This changes the actual view hierarchy to be in a sidebar on the left side. This doesn't make an actual difference for the user, but helps to fix the scrolling issues in D14209815

Reviewed By: jknoxville

Differential Revision: D14209812

fbshipit-source-id: 414e8fd34c889cdce2dd3776727dd4a3a59efeb5
2019-02-26 02:37:17 -08:00
Daniel Büchele
5f5a38f1fe element expanding
Summary:
Previously nodes were always marked as expanded, when they were loaded. In some cases this caused a node to be marked as expanded, but its children not being loaded.

This changes the behaviour to only mark a node as expanded, once its children are loaded.

Reviewed By: jknoxville

Differential Revision: D14209814

fbshipit-source-id: f825d6a066373be932e42b9612a1bf78877b12aa
2019-02-26 02:37:17 -08:00
John Knox
f12144be38 Fix CRASH: undefined undefined bug
Summary:
Display "crashes" as plugin errors when they don't include the expected crash attributes.

Plugins can respond to a `call()` with success or error. If error, then they can provide an arbitrary json object.
These errors go through the same code as crash reports for the crash reporter plugin, but they don't necessarily contain the expected attributes.

When they don't display them as a plugin error, and stringify the whole object.

It would be better to distinguish these properly and highlight that they aren't crashes, in the crash reporter, but that's a bigger task. This stops them being shown as "undefined undefined".

Reviewed By: xiphirx

Differential Revision: D14207907

fbshipit-source-id: 8ba357fbe681a40cd671510a187073e4cbfa2184
2019-02-25 09:33:01 -08:00
Daniel Büchele
f1d46caa2f remove console.log
Summary: as per title

Reviewed By: jknoxville

Differential Revision: D14207127

fbshipit-source-id: e6608382061f4c4a8aff3076810d7ab32be9e990
2019-02-25 03:01:30 -08:00