Commit Graph

206 Commits

Author SHA1 Message Date
Sara Valderrama
a646c4e2ff Update talkback output in flipper accessibility utils for password fields
Summary: Talkback prepends "password" on focus for password editText outputs. Flipper's AccessibilityUtil should include this case.

Reviewed By: blavalla

Differential Revision: D16427345

fbshipit-source-id: 28afdd196973539618b73824671ef02128a4e9ab
2019-07-23 11:29:22 -07:00
Mihaela Ogrezeanu
11198e003e Display data model in side panel
Summary:
This displays the data models passed to the Sections in the side panel when a data node is clicked. This does not change the collapse behaviour when a Section node is clicked.
To make it easier to associate a section with its changesets, appended the global indexes a Section is responsible for to the node label.

Reviewed By: passy

Differential Revision: D16283820

fbshipit-source-id: f1149f47dff448de05d919f7f8d16a2aba53bbb0
2019-07-17 06:29:22 -07:00
Mihaela Ogrezeanu
9c96545bbd Add Flipper plugin to Litho's sample apps
Summary: Add plugin to sample app.

Reviewed By: marco-cova

Differential Revision: D16181876

fbshipit-source-id: fe60fa9f593c16cb24d6901c98b6392a05c6d837
2019-07-16 10:57:24 -07:00
Mihaela Ogrezeanu
474cc1289e Add data model to tree and colour changeset operation
Summary:
This colours data model nodes in the tree to show how they were part of the current changeset: whether the data model caused an insert, update, remove etc.
This also adds phantom Section nodes for Sections that were completely removed from the tree; this is helpful for debugging cases where a section's key changes without intention, causing items to be completely removed and inserted.

Reviewed By: topwu

Differential Revision: D16165767

fbshipit-source-id: a011666dce33e4d757fb415e71ba163aa334f6e6
2019-07-11 09:56:18 -07:00
Mihaela Ogrezeanu
0d4e2e6eb3 Add changeset info in side panel
Summary: the side panel displays information with the changesets that were applied for each section

Reviewed By: adityasharat

Differential Revision: D16131069

fbshipit-source-id: d03547148e483e196600191291e58a13acf505c3
2019-07-11 09:56:17 -07:00
Mihaela Ogrezeanu
169836fc2f Create SectionTree in plugin
Summary: Create Sections hierarchy from data received when a changeset is applied and send it to the plugin to render it

Reviewed By: adityasharat

Differential Revision: D16120480

fbshipit-source-id: 30b824d8d6e65b537c3e98b7ee3438055f6f1ec2
2019-07-10 12:13:15 -07:00
Mihaela Ogrezeanu
a952f988d6 Generate and send bogus data to changeset plugin
Summary:
This hooks up the listeners that send events from the SectionTree to the desktop plugin. gradle build will fail until I release a new Litho version with D16120818
ChangesetDebug receives events on every valid changeset, it will parse the data into Flipper objects and pass it to the desktop client to render it.
Right now this just sends an event with empty data

Reviewed By: adityasharat

Differential Revision: D16121473

fbshipit-source-id: eeef92cea7dae836861d417ed6a00fcb11901e78
2019-07-10 12:13:15 -07:00
Pascal Hartig
dd7924c963 Move navigation tests into private folder
Summary: The corresponding implementation isn't open-sourced.

Reviewed By: danielbuechele

Differential Revision: D16121833

fbshipit-source-id: 91b2fd3bce79468321e49f7798ff54dbf5abd38f
2019-07-05 02:31:26 -07:00
Benjamin Elo
4d774ba252 Added navigation plugin
Summary: Adding the auto-genrated scarf files from creating the Flipper navigation plugin. GK for this plugin is flipper-navigation.

Reviewed By: jknoxville, danielbuechele

Differential Revision: D16119841

fbshipit-source-id: 74e19c82dc95e73fe2ae06d1eb8cef2456b81931
2019-07-04 05:20:51 -07:00
Mihaela Ogrezeanu
3ba71cea9c Added plugin for Sections Changesets in Android
Summary: just the skeleton for the android plugin

Reviewed By: passy

Differential Revision: D16006791

fbshipit-source-id: b0fe2143afeab6bc0671b7ad5a3ccfbccdd6e40a
2019-07-04 03:40:13 -07:00
Arnaud Frugier
f40ac0617c Add getTableInfo API to process incoming TableInfo queries
Summary: Getting the "definition" of the database was originally on the GetTableStructure endpoint. This diff moves it to a new GetTableInfo endpoint

Reviewed By: jknoxville

Differential Revision: D15902619

fbshipit-source-id: ac136d24ee577711366636801b5d74d83fbc523f
2019-06-20 08:29:53 -07:00
Sidharth Guglani
5a6d978536 Search with both name and id of the component in layout inspector and handle deeplinkpayload
Summary:
deepLinkPayload is passed as initialQuery to Search component and in componentDidMount we perform search if initially query is defined.

This does not handle the case if node is not present in the layout inspector tree.

Reviewed By: danielbuechele

Differential Revision: D15874343

fbshipit-source-id: c604baea16838f07e8f8bfc0f1e67c5e830dfe97
2019-06-19 09:08:10 -07:00
Pascal Hartig
71575ce7cf Hook up stacktraces to leak notification
Summary: Transfer it from the device, reformat the notification to make use of it.

Reviewed By: danielbuechele

Differential Revision: D15779267

fbshipit-source-id: 747dc7f895528618ff6a07c15b7f72bf6a1adde9
2019-06-13 11:18:03 -07:00
Pascal Hartig
6168b3c604 Upgrade to Fresco 2.0.0
Summary: Need a Fresco release including the previous diff first.

Reviewed By: danielbuechele

Differential Revision: D15762090

fbshipit-source-id: ec30778ffc1cd3e48dcfc4d514a9ba13fb26fd75
2019-06-13 10:18:20 -07:00
Pascal Hartig
fd89d73be5 Keep track of a Throwable if custom LeakTracker is set
Summary:
This makes it easier to track down leaks as we currently only have their class names. There are some limitations if this is creates on a separate thread, but that can be addressed separately.

This does require temporarily removing the Flipper integration as the interface changes in a backwards-incompatible manner. This will be restored with the next diff in the stack.

Reviewed By: oprisnik

Differential Revision: D15760947

fbshipit-source-id: 3a5c48f6244f1afc8b7e00230bd1ae2f197e6cdf
2019-06-13 04:12:41 -07:00
Jan Rabe
8dc9e5aee2 adding PreferenceManager.getDefaultSharedPreferencesName to default (#454)
Summary:
Adding context [PreferenceManager.getDefaultSharedPreferencesName](https://developer.android.com/reference/android/preference/PreferenceManager.html#getDefaultSharedPreferences(android.content.Context)) by default.

## Changelog

Adding context default shared preference by default.
Pull Request resolved: https://github.com/facebook/flipper/pull/454

Reviewed By: jknoxville

Differential Revision: D15759223

Pulled By: passy

fbshipit-source-id: d0770444ce2ea43e2c9bfdc9969532d330f71488
2019-06-11 08:56:25 -07:00
Pascal Hartig
151ad849cb Re-enable leak tracker
Summary: Restore the temporarily removed leak tracker setup.

Reviewed By: jknoxville

Differential Revision: D15713663

fbshipit-source-id: c98a90ee86173dad7131bfe5b05bb3488f27ae6d
2019-06-07 06:56:14 -07:00
Rain ⁣
aa649ff48f standardize C-like MIT copyright headers throughout fbsource
Summary:
`/*` is the standard throughout open source code. For example, Firefox uses single /*: https://hg.mozilla.org/mozilla-central/file/21d22b2f541258d3d1cf96c7ba5ad73e96e616b5/gfx/ipc/CompositorWidgetVsyncObserver.cpp#l3

In addition, Rust considers `/**` to be a doc comment (similar to Javadoc) and having such a comment at the beginning of the file causes `rustc` to barf.

Note that some JavaScript tooling requires `/**`. This is OK since JavaScript files were not covered by the linter in the first place, but it would be good to have that tooling fixed too.

Reviewed By: zertosh

Differential Revision: D15640366

fbshipit-source-id: b4ed4599071516364d6109720750d6a43304c089
2019-06-06 19:40:28 -07:00
Pascal Hartig
afe7c8bf25 Upgrade to Fresco 1.14.2
Summary: Includes the LeakTracker interface change. Restores the temporarily deleted tracker, wires it back up. Requires Fresco 0.14.2 being released which has yet to happen.

Reviewed By: oprisnik

Differential Revision: D15655667

fbshipit-source-id: ab4361be35101efe7564dfdd7a69cba93135eb7e
2019-06-06 08:02:46 -07:00
Pascal Hartig
dc41e2d778 Temporarily remove FlipperCloseableReferenceLeakTracker
Summary:
Ugh, this is the only way we can land the API-breaking next diff. Will
be reverted straight after.

Reviewed By: oprisnik

Differential Revision: D15655666

fbshipit-source-id: c9318e348c187de4562a9a636287cfa7b523356f
2019-06-06 04:54:32 -07:00
Pritesh Nandgaonkar
62c112c713 Fix the FlipperArray creation of events
Summary:
The FlipperArray creation from JSONArray used to create an array of `null`'s instead of the FlipperObject, which used to crash the Flipper. Thus added a check in the flipper to not crash in the case when it receives array of nulls. Also fixed the Fresco plugin in mobile to send the proper FlipperArray.

Bug:

{F160049909}

Reviewed By: passy

Differential Revision: D15608297

fbshipit-source-id: 625e017d3bce4135ac699ee5aee8d871db378749
2019-06-04 03:39:28 -07:00
Pascal Hartig
faf19452eb Send CloseableRef leaks to Flipper plugin (#455)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/455

Only logging to the console for now, but it's a good start.

Reviewed By: oprisnik

Differential Revision: D15535820

fbshipit-source-id: 8531ec5ef681d01b2428a1f016b2a1d9f1589a34
2019-05-31 16:58:16 -07:00
John Knox
f71d33586f Disable Databases plugin test until roboelectric is upgraded
Summary: This gradle flag is stopping the other tests from passing.

Reviewed By: quanturium

Differential Revision: D15558776

fbshipit-source-id: 54934c73271e1cbb041877fef0dfb2de21733424
2019-05-30 14:29:12 -07:00
Daniel Büchele
53b852dbe6 fix undefined colors on litho components
Summary:
When a color was changed on a litho component, the changes were made, but the display in Flipper's layout sidebar always showed `rgba(0,0,0,0)` as a color. This was because reading the color failed for `ComparableColorDrawable` and it sent `0` as fallback value.

This diff adds an additional check if the value is an instance of `ComparableColorDrawable` and reads the color from it.

Reviewed By: passy

Differential Revision: D15469093

fbshipit-source-id: 7f1aaf1c4981815605aca5ba735fa09e80deaa42
2019-05-29 09:19:29 -07:00
John Knox
a630b50a8f Add databases plugin v0 (android) (#441)
Summary:
Adds a plugin for listing the databases, tables and contents of those tables in an android app.
Right now, works with sqlite, but it should be generic enough to work with other db types.

## Changelog

Add initial version of android databases plugin

Creating a PR, I may need to do some cleaning up, but this is to kick off that process.
Pull Request resolved: https://github.com/facebook/flipper/pull/441

Reviewed By: danielbuechele

Differential Revision: D15288831

Pulled By: jknoxville

fbshipit-source-id: 6379ad60d640ea6b0a9473acc03dd6ea81a3a8d4
2019-05-28 10:17:56 -07:00
Sidharth Guglani
0d769aa1c2 using object tracking and creating flipper objects for debug components
Summary: Using ObjectTracker to track debug component nodes and creating flipper objects with debug component data

Reviewed By: davidaurelio

Differential Revision: D15462076

fbshipit-source-id: 5d0b28b6aea4729b85cc9de9ab35f2a07edbae1c
2019-05-23 20:41:20 -07:00
Pritesh Nandgaonkar
914cbf6ccd Request all metadata for Images plugin before export
Summary:
Fresco plugin on the desktop side used to ask for all the image list along with the metadata when it was mounted. The mobile side never sent the image list and other information if not requested from it. That means, although Fresco plugin is a background plugin, there weren't any messages sent from the mobile side. Thus there was no trace available for Images plugin when the trace was exported. This diff, adds a hook which gets called before the export, where we request all the metadata from the mobile SDK.

BUG:

{F159305887}

Reviewed By: passy

Differential Revision: D15407962

fbshipit-source-id: 0012de2ab29d0f62e92d00f4926b04b1e394b62a
2019-05-23 05:48:04 -07:00
Pascal Hartig
c6e60e1e0c Fix typo
Summary: Drive-by fix.

Reviewed By: danielbuechele

Differential Revision: D15353813

fbshipit-source-id: 34fa17d63d80daaea4d453c749f3a676b645d7a1
2019-05-15 10:26:37 -07:00
Pascal Hartig
71230b3f7b Move navigation test to right folder
Summary: Probably wrong default.

Reviewed By: danielbuechele

Differential Revision: D15353913

fbshipit-source-id: d2582b9356ff14a4503fab9b85566cc1a59f31e8
2019-05-15 10:26:37 -07:00
Pascal Hartig
6ea07c9e71 Move test to right directory
Summary: You're not supposed to be here.

Reviewed By: SidharthGuglani

Differential Revision: D15353936

fbshipit-source-id: f389aeaff71f940d96dfc0422694fb0020dee05c
2019-05-15 09:10:55 -07:00
Sidharth Guglani
3086a7262d Create yoga performance plugin initial files using scarf
Summary:
YogaPerformance flipper plugin initial files
Auto generated using scarf plugin

Reviewed By: davidaurelio

Differential Revision: D15317118

fbshipit-source-id: 30c5c93a8ad4312478ea85979bdf230aa9186596
2019-05-14 03:21:32 -07:00
Corey Wu
2badd4efea Add Flipper plugin for Navigation
Summary:
The main goal is to update visitation id for our targeted tabs requirements (https://fb.quip.com/2jZiA97DTATi). In doing so, we want an easier way to debug whether everything is working as expected.

I've been meaning to add something like this for a while since it's a pain to explain what the visitation id and HSM look like as you navigate the app, so this should help the other teams who're using visitation id as well.

Will probably also start adding navigation events and any other data that we feel is useful.

Run:
```
fbsource/xplat/sonar/scripts/facebook/create-plugin.py Navigation --android
```
Then clean a few things up and fix lints.

Differential Revision: D14759995

fbshipit-source-id: 066dcbf70eed7056f995053cc9ba80dcbbafdb03
2019-05-11 20:45:49 -07:00
Pascal Hartig
84e4b916ee Remove JS console plugin
Summary: This is to unblock our mobile lab build target that adds Flipper to a redex-able build. Redex currently crashes when it tries to optimise Rhino. This could probably be fixed but we don't have any real use-cases for the console plugin right now. It should be fairly easy to unland this even partially if we want to revive this in the future.

Reviewed By: danielbuechele

Differential Revision: D15044539

fbshipit-source-id: f0857274aa046f5be935a342cf91b6a390fcb3dc
2019-05-09 09:54:53 -07:00
Pascal Hartig
2cdcd9bad9 Fix inspector crash on null colors
Summary: Quick fix for layout plugin and export crashing when encountering nullable props for colors and drawables like `refreshProgressBarBackgroundColor` on `RecyclerSpec`. The rendered view in the inspector is not great right now, but better than a crash. Working on the correct representation next.

Reviewed By: jknoxville

Differential Revision: D15241151

fbshipit-source-id: 3754dee8861a442127a34d7c3211d223c5f390c1
2019-05-07 13:59:17 -07:00
Pascal Hartig
1c67540bf7 Fix javadoc typo
Summary: Drive-by fix.

Reviewed By: jknoxville

Differential Revision: D15241511

fbshipit-source-id: e87f31a9929c24aa56b8101303703342d2ae64c5
2019-05-07 10:27:57 -07:00
Pascal Hartig
f584eb05dd Another round of header updates
Summary: I hope that this takes care of all the android violations.

Reviewed By: danielbuechele

Differential Revision: D15199150

fbshipit-source-id: 0f5b4edc1bc9d38de0885f88bb2c3e43acfa09cd
2019-05-03 09:59:33 -07:00
Pascal Hartig
b7fff23700 Move example plugin out of core
Summary:
We should not ship this as part of our distribution.
Just meant we had to bifurcate our unit tests which
is a bit awkward, but it works now.

Reviewed By: jknoxville

Differential Revision: D15146980

fbshipit-source-id: 496b000630bbfcaa663cddacb00550e1499a1279
2019-05-01 08:38:22 -07:00
Pascal Hartig
608b9182ce Add version headers
Summary: Last big batch of adding license headers in Java code where they were missing.

Reviewed By: jknoxville

Differential Revision: D15164860

fbshipit-source-id: 4c0a61eec7b5659fdc674ebed85f2ade60dd0aa0
2019-05-01 08:14:55 -07:00
Pascal Hartig
356614e1c7 Small fixes for FlipperClientImpl
Summary: One unsafe assignment and an incorrect comment open.

Reviewed By: jknoxville

Differential Revision: D15146815

fbshipit-source-id: ec2186c82f60cacab91d286b4c68138a44e1ea27
2019-04-30 13:12:59 -07:00
Pascal Hartig
ef46dd7f91 Add missing @Nullable annotations
Summary: Native can return nullptr, so this should be annotated.

Reviewed By: jknoxville

Differential Revision: D15146700

fbshipit-source-id: 332e3a074d2e39cfff677f3d84e94f910563f992
2019-04-30 13:12:59 -07:00
John Knox
f00ff72211 Allow null TableRow sidebars
Summary: Makes the API a bit easier to use. Don't have to build an empty sidebar if you don't want one.

Reviewed By: passy

Differential Revision: D15064205

fbshipit-source-id: bd31c1aa97fd6d1c93717c10b268f49e44eb1299
2019-04-26 09:29:42 -07:00
Pritesh Nandgaonkar
5169d318de Fix the callstack sent from error reporting runnable
Summary:
The crash logged from `ErrorReporterRunnable` wasn't detailed. For example look at the following video.
Also for some reason the `FlipperConnection` interface doesn't have an argument for crash name. Thus I changed the js side of the plugin to accept `crash.name` to be undefined.

{F155526537}

Reviewed By: passy

Differential Revision: D14852561

fbshipit-source-id: 6daf9847535b4508fa312b4f940b014911aae2e5
2019-04-15 05:51:37 -07:00
John Knox
a27cd84d45 Add top and bottom toolbars to native plugins
Summary: I'm adding these in the table plugin for now, since it's the only native plugin, but it probably makes sense to have this ability in all native plugins.

Reviewed By: passy

Differential Revision: D14833326

fbshipit-source-id: 906190745091e02daccb9f6e84b95e0e13f2d8bd
2019-04-10 06:17:52 -07:00
John Knox
f21c9f1c61 Rename SidebarSection to UISection
Summary: These are full width blocks, and can be put anywhere, so calling them SidebarSections isn't very helpful.

Reviewed By: danielbuechele

Differential Revision: D14833465

fbshipit-source-id: 2433337f78b6bbcb951cd90b6925de1b9a304d42
2019-04-09 08:29:25 -07:00
John Knox
fb772d3f81 Move TableMetadata serialization into its class
Summary: Where it should be.

Reviewed By: danielbuechele

Differential Revision: D14833499

fbshipit-source-id: 7af951a402756ddde6d9672ca733a2c910d4ddb4
2019-04-08 11:42:33 -07:00
John Knox
e306ecda19 Fix Test
Summary: GitHub test failing because of this: https://travis-ci.org/facebook/flipper/jobs/517181150

Reviewed By: passy

Differential Revision: D14827468

fbshipit-source-id: e1d85747b39bd9fd781e8e6e8cb1827adb786482
2019-04-08 07:47:30 -07:00
John Knox
fa3dcdc5dd NativePlugins API update
Summary:
The main change is is changing from the inheritance model:
`FlipperPlugin > NativePlugin > TablePlugin > ConcretePlugin`

to a composition model where:
`NativePlugin > TablePlugin > ConcretePlugin`

And behind the scenes, there's a `FlipperPlugin` that has a `NativePlugin` reference.

Now your native plugin will call methods like (in the table case) `display.updateRows` instead of `super.updateRows()`

The reasons for this are:

* Testability: we can easily mock the display and assert output.
* Encapsulation: Previously, native plugins could call `mConnection.send(...)` and send completely unsupported messages to the desktop. Now they only have access to the display's public api, which is guaranteed to work.

I've also changed it so that on every row update, we send the latest table metadata along with it. This makes sure we can ensure that the right table schema is displayed for the current data.

QueryResponder interface also added, which will come in useful for queryable datasets.

Reviewed By: passy

Differential Revision: D14751885

fbshipit-source-id: ea0bbd25f7eaa60020f8866fe210d8bd1c22e90b
2019-04-05 10:06:14 -07:00
Dustin Bluck
825ecb8e23 SharedPreferencesPlugin -- Look for all shared pref files
Summary: Searches for all shared pref files instead of only the package name by default

Reviewed By: xiphirx

Differential Revision: D14763787

fbshipit-source-id: a3b7dfe8db078ac4f55e236b1516ed2de668f8d2
2019-04-03 18:16:05 -07:00
John Knox
ddd06971f1 NativePlugins: Implement sidebar sections in java
Summary:
Changes sidebar from just a bucket of json, to be a list of SidebarSections.
Currently implemented sections are Json, and Toolbar.

Reviewed By: passy

Differential Revision: D14620095

fbshipit-source-id: 6ba57f6f1ad954373c0bbb79570d779787e5d4db
2019-03-28 06:45:39 -07:00
John Knox
ff6988ddaf Java side of NativePlugins
Summary:
Adds abstract classes NativePlugin and TableNativePlugin.

Extend NativePlugin to implement a new NativePlugin type/template.

TableNativePlugin is an example of that. Extend TableNativePlugin to add a particular instance of a table plugin. See the stacked diff for an example of that (newsfeed inspector).

I think I'm going to change the NativePlugin implementation so it uses composition instead of inheriting from FlipperPlugin, so that the concrete subclasses don't get access to the FlipperPlugin primitive methods like onConnect etc. But I don't mind shipping this as is and changing it separately.

Reviewed By: passy

Differential Revision: D14505912

fbshipit-source-id: 0534147112aaf4c5a41d2d3e08de855767b2a010
2019-03-28 06:45:38 -07:00