Commit Graph

109 Commits

Author SHA1 Message Date
Pascal Hartig
b4b5ccdcd6 Add missing native targets (#248)
Summary:
Depends on #247.

Ensure that `libextra` is included when building sonar targets. My
cleanup was a bit too aggressive.

Fixes #246
Pull Request resolved: https://github.com/facebook/flipper/pull/248

Reviewed By: jknoxville

Differential Revision: D9420724

Pulled By: passy

fbshipit-source-id: f2d0625507a4897051840c95feefc534583b080f
2018-08-21 06:14:37 -07:00
Pascal Hartig
69cd889b71 Fix Litho plugin package (#247)
Summary:
The plugin was part of the wrong package based on its directory. This
confuses Gradle and I'm frankly a bit surprised this ever built before.
Pull Request resolved: https://github.com/facebook/flipper/pull/247

Reviewed By: danielbuechele

Differential Revision: D9420595

Pulled By: passy

fbshipit-source-id: fd8e47ff242c4535b36e379df93b672eb8bb840d
2018-08-21 04:29:08 -07:00
Sara Valderrama
c428de3948 Tooltips added on hover for AX sidebar
Summary: Adds on hover descriptions for some of the more esoteric properties in the accessibility sidebar panel such as accessibility-focused and all the talkback derived properties. Also change talkback-focusable and talkback-ignored to both be talkback-focusable.

Differential Revision: D9381676

fbshipit-source-id: 55ce854da24241a7c89b0c122c4c3ebd77438dbb
2018-08-20 09:41:46 -07:00
Pascal Hartig
02cf3a90a2 Fix build caching (#242)
Summary:
See https://github.com/facebook/flipper/issues/230 for a longer
explanation.

It turns out that many of the tasks in `native.gradle` (at least
`prepareGlog` which modifies files inside the source directory, but also
others) cause the cmake cache to invalidate.

Because we run those tasks unconditionally, we need to recompile all our
C++ code even when unmodified.

I fix this by adding a manual cache key to this which simply skips all
the tasks unless an up-to-date `external_cache_revision.txt` is found.
This is a bit hacky, but the alternatives are a) convincing cmake that
these modifications are not recompile-worthy which I have no idea how to
do and which might be impossible to do `mtime` on the files touches, or
b) having fine-grained `onlyIf` rules for every task which can easily
break. This seems the most straight-forward option.

Fixes #230.
Pull Request resolved: https://github.com/facebook/flipper/pull/242

Reviewed By: jknoxville

Differential Revision: D9381340

Pulled By: passy

fbshipit-source-id: a7db55aacac4a29076c29298d6c5b97d8bc91f66
2018-08-20 07:43:47 -07:00
Yuri Schimke
5eb986d598 Use UUID instead of new Random().nextInt(...) (#238)
Summary:
Minor simplification, mostly cleanup.  Arguably, better to avoid the birthday paradox e.g. collision with > a few thousand requests.

Tested via

$ ./gradlew :sample:installDebug
Pull Request resolved: https://github.com/facebook/flipper/pull/238

Reviewed By: danielbuechele

Differential Revision: D9359941

Pulled By: passy

fbshipit-source-id: d2988b58f41d84a52aca060b5c583e055b8b203a
2018-08-20 02:28:12 -07:00
Marco Cova
aedb9c0343 Unify Components and Sections StateContainer interface
Summary: Components and Sections has two different but equal interfaces for StateContainer. This diff create one unique StateContainer interface they can both use.

Reviewed By: passy

Differential Revision: D9359823

fbshipit-source-id: 288abefd53670d3c128b5d00b5c204f0c1ea3948
2018-08-17 02:27:32 -07:00
Pascal Hartig
4e943dbb36 Limit CMake targets to build
Summary:
This doesn't solve our build caching issue (GH230) but
helps a bit with build times as we can skip building all
sorts of test targets which are otherwise included.

The sonar target is the only thing we care about here.

Reviewed By: danielbuechele

Differential Revision: D9360117

fbshipit-source-id: 13a976243b48efbe0f69e9fe47780486f9688eb8
2018-08-16 08:27:21 -07:00
Pascal Hartig
cded1ceead Switch to Litho snapshot releases
Summary:
This allows breaking changes in Litho to be landed.
I'm also adding some helpers to determine if Flipper itself
is currently in a release or snapshot release train.

N.B. We don't publish snapshot releases for Flipper
right now, but will in the future where this will come in
handy.

Reviewed By: jknoxville

Differential Revision: D9359035

fbshipit-source-id: d21b607eca5d57caf4cc34234f6ba3cb0d8f307d
2018-08-16 06:56:30 -07:00
Sara Valderrama
6a746d744e Update AX sidebar properties - clarify focus vs accessibility-focus
Summary: Updated properties to be more specific about what type of focus they are describing (keyboard vs accessibility vs talkback). Also separates sidebar into 3 sections (View, Talkback, and AccessibilityNodeInfo) since this organization is clearer now that Talkback is more robust.

Reviewed By: blavalla

Differential Revision: D9338822

fbshipit-source-id: d110faa43822faa36a081832207c259cddec44f0
2018-08-15 20:49:09 -07:00
Sara Valderrama
e82808da6f Talkback properties update for AX sidebar
Summary: Talkback-description now called talkback-output to avoid confusion about content-description. Talkback-output now includes the state and role of the view as well so it is more accurate to Talkback's actual output. Talkback-hint also added as a property to show what talkback will append to the description if a user has hints turned on. This may not always be 100% accurate because talkback changes what it says based on certain events and global settings as well but is correct for most general-use cases.

Reviewed By: blavalla

Differential Revision: D9317270

fbshipit-source-id: df9b9b5ebef19f583cbf997e0cd3fac6450170bb
2018-08-15 20:49:08 -07:00
John Knox
292cb4107b Summarise state in diagnostic screen
Summary:
Display the summarised state of the sonar agent alongside the "log" view of it.
The log view contains every event, while the summarised view has just one entry for the latest attempt at each step.

Reviewed By: danielbuechele

Differential Revision: D9315502

fbshipit-source-id: 8767c3cce7d2765ef6ab09db5945248ddd6dcbce
2018-08-15 05:11:54 -07:00
John Knox
660da3f80e Add getStateSummary method for diagnostics
Summary:
Adds a more structured representation of state updates than a multiline string.
Also changes the string form to omit [started] records.

Reviewed By: danielbuechele

Differential Revision: D9315503

fbshipit-source-id: 55b8f9572091fd42fe852c8d26a8f2a53f76c82a
2018-08-15 05:11:54 -07:00
Pritesh Nandgaonkar
3a584d0f18 Update rsocket version (#225)
Summary:
Updates rsocket to latest version
Pull Request resolved: https://github.com/facebook/flipper/pull/225

Reviewed By: jknoxville

Differential Revision: D9313576

Pulled By: priteshrnandgaonkar

fbshipit-source-id: afd55eddfa79f0f9d2a36a6f0539d823161d1bed
2018-08-14 06:01:00 -07:00
Sara Valderrama
656044ce69 AX tree expands with main tree on search (cannot search ax tree yet)
Summary: AX tree will now stay in sync with the main tree when searching. Also allows user to completely erase search (previously had left one letter highlighted in the tree even if entire query was erased).

Reviewed By: danielbuechele

Differential Revision: D9276721

fbshipit-source-id: 5272bb9cf3400ad3eb9d16bf438b0e5d4b551c6a
2018-08-13 13:28:10 -07:00
Pascal Hartig
f400fcb99d Back out "[litho] Unify Components and Sections StateContainer interface"
Summary: Original commit changeset: fac09e914a17

Reviewed By: marco-cova

Differential Revision: D9295577

fbshipit-source-id: 6f79e6b9139b448726a6c3e049c8b3496f8e95b5
2018-08-13 06:56:36 -07:00
John Knox
89c89e219c Expose Diagnostic screen in sample app
Summary: Adds a link on MainActivitiy that opens the diagnostic screen

Reviewed By: danielbuechele

Differential Revision: D9267065

fbshipit-source-id: 1b44134de0e57f8021b19d76644dac6389c88b65
2018-08-13 03:58:53 -07:00
Marco Cova
4ae01fce6a Unify Components and Sections StateContainer interface
Summary: Components and Sections has two different but equal interfaces for StateContainer. This diff create one unique StateContainer interface they can both use.

Reviewed By: muraziz

Differential Revision: D9278661

fbshipit-source-id: fac09e914a17d82b5f1053c5d38787a69efdc1b3
2018-08-13 03:11:56 -07:00
Sara Valderrama
bf863c3922 Logging added for ax mode and updated to fix console warnings
Summary: Added logging for accessibility functionality (both usage and performance). Fix to prevent trackTimeSince calls from not matching up to the correct marks. Fix to prevent recursive onElementExpanded calls from mismatching also.

Reviewed By: danielbuechele

Differential Revision: D9229790

fbshipit-source-id: d20f08719d2c4f9a35c9c71a492619ce5538d204
2018-08-10 14:57:30 -07:00
Pascal Hartig
e50bbd861d Change OpenSSL source download URL
Summary:
I'm "mirroring" the tarball so we can download this from
Java. Even JDK 8 doesn't like LetsEncrypt yet.

Reviewed By: danielbuechele

Differential Revision: D9264373

fbshipit-source-id: abb91fb72d74dccde4775cc852a93d75dd5a48e5
2018-08-10 10:11:47 -07:00
Sara Valderrama
047b6ed7b7 Expand AX tree when clicking-to-inspect
Summary: Adds expanding functionality to ax tree when click-to-inspect is used. Highlight/selection priority is given to the ax tree if in ax mode and the main tree otherwise.

Reviewed By: danielbuechele

Differential Revision: D9206028

fbshipit-source-id: 364b3cfc2e68dbce6006c36002353295aa7cdd07
2018-08-08 09:11:55 -07:00
John Knox
b944f496dc Add javadoc to SonarStateUpdateListener
Summary: Documentation

Reviewed By: danielbuechele

Differential Revision: D9215929

fbshipit-source-id: 1c67fc2098aa0734d85524697f196a6b0ae4c721
2018-08-08 07:12:02 -07:00
John Knox
531a47535b Add SonarDiagnosticActivity to android
Summary:
Open the screen by running adb shell
am start -n com.facebook.samples.litho/com.facebook.sonar.android.diagnostics.SonarDiagnosticActivity

Reviewed By: danielbuechele

Differential Revision: D9150556

fbshipit-source-id: 534583cfa5e90af6fd0d2a50572e3763b8888da2
2018-08-07 09:59:27 -07:00
John Knox
91e94815b4 Add state tracking plumbing
Summary:
The plan is to get SonarState to take update events and aggregate them into an object, that can be displayed in the UI so you can see what sonar is currently trying to do, and what if anything is failing.
This is pretty rubbish right now, as it just uses a single string to represent state, this is just the initial version I'll iterate on.
I also need to pass the SonarState into the SonarWebSocketImpl, since that's where a lot of the heavy lifting is done, but as long as something is logging state updates here, it proves the concept.
SonarStateUpdateListener is the interface that will be implemented by android and iOS implementations. These implementations will notify an activity or screen that the state has changed and they should reflect that.

Reviewed By: danielbuechele

Differential Revision: D9150551

fbshipit-source-id: 8dd585ca503d32e684ff843d66a59a50a420b4c0
2018-08-07 09:59:26 -07:00
Sara Valderrama
c07d8c14a4 Add icon to show which elements in ax tree are talkback-focusable
Summary: Puts an accessibility icon next to any elements in the ax tree that may be focused on when talkback is running to show that they are "accessibility-focusable". When any sidebar values are changed, the icon will show up/disappear accordingly.

Reviewed By: danielbuechele

Differential Revision: D9171781

fbshipit-source-id: f3b42624988aaef22040ac3325d745a12f0622db
2018-08-07 09:42:27 -07:00
Sara Valderrama
1fb2c4ee76 Add focus option to context menu in the accessibility tree
Summary: Allow user to open the context menu on an element in the ax tree and request accessibility focus to that element. If the element is focusable (and talkback or another accessibility service is running), accessibility focus will change to that element, if not, it will not change anything.

Differential Revision: D9162382

fbshipit-source-id: 5dda9b87a2cc6eba4130e3feee978b5fa38ac9f1
2018-08-07 09:42:27 -07:00
John Knox
a92b6eaf80 Add AndroidSonarClient.getInstanceIfInitialized()
Summary:
Sometimes you want to get the sonar client without necessarily wanting to initialize it, for example if you don't have a context object, but still want to get hold of a particular plugin object.
Adds a getInstance method that returns null if not initialized.

Reviewed By: passy

Differential Revision: D9154423

fbshipit-source-id: 65cb46684bc35d9a953dbd958c7cf72aba0015e2
2018-08-07 06:29:09 -07:00
Sara Valderrama
fc7f949daf Click to inspect works with TalkBack
Summary: Allow click to inspect to work when Talkback is running (normal tree expands as usual although ax tree doesn't expand yet). Override onHover of Touchoverlay and onRequestSendAccessibilityEvent in viewRoot to prevent talkback focus when in Click to Inspect mode. Also update layout inspector to persist isSearchActive to prevent build up of TouchOverlayViews when navigating between plugins (which happened if leaving the layout inspector while in Click to Inspect mode).

Reviewed By: danielbuechele

Differential Revision: D9153446

fbshipit-source-id: f76982e8f8cea1e7b7e4c6b9bf73632d101222ef
2018-08-06 16:54:20 -07:00
Pascal Hartig
f59cafe25e Android v0.6.16
Summary:
Rename artifacts and release on Bintray. Public release
will be delayed by the manual review by JFrog.

Reviewed By: danielbuechele

Differential Revision: D9179646

fbshipit-source-id: 84c11d545940d1d52b9de9f87b4eb26901290108
2018-08-06 14:11:54 -07:00
Phoomraphee Luenam
2c48afdf04 Implement AlignmentMode in layoutplugin
Summary:
Add a Button to toggle alignment lines on Sonar interface.

Call sonar plugin in java, sending isAlignmentMode flag.

Changed API for setHighlighted to include alignment mode flag.

Button design to be added in future diffs by @[100003260904633:maximg]

Reviewed By: danielbuechele

Differential Revision: D9123749

fbshipit-source-id: 01c299f299be30dbb695bfb1d8007d63c27643d5
2018-08-06 07:41:48 -07:00
Pascal Hartig
4e5122d664 Fix RootComponentSpec formatting
Summary: pusheen_big_and_beautiful

Reviewed By: danielbuechele

Differential Revision: D9178922

fbshipit-source-id: 5d8e1b01086e337b9f9d3b714bb1e6c879a43f55
2018-08-06 04:41:29 -07:00
Phoomraphee Luenam
8ea2809742 Add Alignment Functionality for Sonar
Summary:
Part of a hackathon project. (https://fb.facebook.com/groups/230455004101832/permalink/454928784987785/)

We're adding an alignment mode for Sonar that shows the pixel level alignment.

Reviewed By: danielbuechele

Differential Revision: D9121197

fbshipit-source-id: 21af36fd7eeea631d580ccebff8e648fa276bf35
2018-08-06 04:13:00 -07:00
Pascal Hartig
0c536b3188 Set up LeakCanary plugin in sample app
Summary: Per title.

Reviewed By: danielbuechele

Differential Revision: D9178886

fbshipit-source-id: c48411cdd2a28d182644bf2278ee8414812d6034
2018-08-06 03:14:20 -07:00
Pascal Hartig
dedd953c28 Move leakcanary to open source and add build files
Summary:
Made sure it builds with both buck and Gradle.

Follow-up to D8865149.

Reviewed By: danielbuechele

Differential Revision: D9178885

fbshipit-source-id: 46efaa532efdc1d59ce76e04be6680e233084881
2018-08-06 03:14:20 -07:00
Daniel Abramowitz
410e6d14c8 Revert D8932114: [sonar] Add state tracking plumbing
Differential Revision:
D8932114

Original commit changeset: fb03babfe92b

fbshipit-source-id: a6a372a4115d69b5419a8c9924b333e7c163497b
2018-08-03 08:27:42 -07:00
Daniel Abramowitz
fadd392349 Revert D8954095: [sonar] Add SonarDiagnosticActivity to android
Differential Revision:
D8954095

Original commit changeset: b4a638bc0ba2

fbshipit-source-id: 6165b7429477e80520fb0e149da1c2ef893e1d90
2018-08-03 08:27:42 -07:00
John Knox
3237b60ff1 Add SonarDiagnosticActivity to android
Summary:
Open the screen by running adb shell
am start -n com.facebook.wakizashi/com.facebook.sonar.android.diagnostics.SonarDiagnosticActivity

Reviewed By: passy

Differential Revision: D8954095

fbshipit-source-id: b4a638bc0ba2f69a69c121c7c1c00fbe47476ee3
2018-08-03 07:42:17 -07:00
John Knox
fb447e4f84 Add state tracking plumbing
Summary:
The plan is to get SonarState to take update events and aggregate them into an object, that can be displayed in the UI so you can see what sonar is currently trying to do, and what if anything is failing.
This is pretty rubbish right now, as it just uses a single string to represent state, this is just the initial version I'll iterate on.
I also need to pass the SonarState into the SonarWebSocketImpl, since that's where a lot of the heavy lifting is done, but as long as something is logging state updates here, it proves the concept.
SonarStateUpdateListener is the interface that will be implemented by android and iOS implementations. These implementations will notify an activity or screen that the state has changed and they should reflect that.

Reviewed By: passy

Differential Revision: D8932114

fbshipit-source-id: fb03babfe92be53771eb4d8f10de7ecdc7f1a6d8
2018-08-03 07:42:16 -07:00
Sara Valderrama
ff0b045bde Allow for multiple view roots, include accessibility focus changing between view roots
Summary: Ax mode now works with multiple view roots/windows, accessibility focus is also updated when new windows are opened.

Reviewed By: danielbuechele

Differential Revision: D9121844

fbshipit-source-id: 1da9327f5d6a784793db8076c2ad2d84e860ac1c
2018-08-02 09:41:26 -07:00
John Knox
a6d8493330 Grammar fix in android sample app
Summary: Fixing grammar.

Reviewed By: passy

Differential Revision: D9082223

fbshipit-source-id: d3bf4e345f0fd13c5ef5c418c41e4a07620bd86f
2018-08-01 06:12:04 -07:00
John Knox
0729ce6959 Log error when sonar is missing required permissions
Summary:
Sonar won't work without the INTERNET permission, so it can talk TCP to the desktop, on localhost.
Also, for genymotion, we use the IP address, so we need ACCESS_WIFI_STATE.

Reviewed By: passy

Differential Revision: D8855239

fbshipit-source-id: 35d0b0bba91daeba35a5de90e5ef87e89ac6bb51
2018-08-01 04:56:23 -07:00
Pritesh Nandgaonkar
07d75ce848 Rename Sample app from Sonar to Flipper
Summary: Renamed sonar sample app with flipper

Reviewed By: passy

Differential Revision: D9050608

fbshipit-source-id: 4e76e4c6cc8febb997ce32b4f78a2fab9792310d
2018-07-31 14:02:58 -07:00
Sara Valderrama
33e6538477 Highlight the current talkback-focused element in the accessibility tree
Summary: Highlights the element corresponding to the view talkback is focused on in green in the ax tree (and updates live as talkback moves).

Reviewed By: blavalla

Differential Revision: D9021542

fbshipit-source-id: c3bf6f5625aacb0cd054032b33a50541b88b2eaf
2018-07-31 04:14:49 -07:00
Sara Valderrama
ffe53d1345 Small sidebar update
Summary: Added some props to sidebar for ax mode.

Differential Revision: D8983386

fbshipit-source-id: eaf414dc8ae5386744c66f1d43b6b9068b9593c1
2018-07-26 15:48:00 -07:00
Pascal Hartig
8482e80c27 Move javatests/
Summary: That one was a doozy.

Reviewed By: jknoxville

Differential Revision: D8974692

fbshipit-source-id: bbdca0d5c598a2d1ebcc03f1456a7b17be5ffcf2
2018-07-26 02:05:02 -07:00
Sara Valderrama
41f4478a74 Basic mutual highlighting for Litho components
Summary: Shows basic relationship between the AX and nonAX tree litho nodes. When a litho component is selected from the nonAX tree, it's corresponding hostView or lithoView (root of the component tree) is highlighted in the AX tree giving priority to the hostView if it exists. If a hostView is selected in the AX tree, it's corresponding component is selected in the non-AX tree. If a lithoView is selected from the AX tree, it's corresponding lithoView is highlighted in the non-AX tree. This means that each hostView has a one-to-one highlighting between the two trees but lithoViews will have many nodes in the main tree that map to one node in the AX tree (which is accurate to litho components rendering but we may need to change in the future if it is not clear).

Reviewed By: jknoxville

Differential Revision: D8972205

fbshipit-source-id: d136f5b594d0ac1b66a82b35dc7b085186829fc4
2018-07-25 10:19:37 -07:00
Sara Valderrama
c57e6e4396 Expand trees together - including fragments, not including litho components
Summary: When expanding one tree, the other tree also expands. This expanding jumps over fragments (which are not in the accessibility tree) so that the trees can stay in sync even when there are extra wrappers in the main tree. Need to figure out functionality for litho components (these simply don't expand together right now since the relationship between the trees at these nodes are less obvious).

Differential Revision: D8943229

fbshipit-source-id: 289c3511a6495508b45a62da13ae4c50209e6118
2018-07-25 10:19:37 -07:00
Pascal Hartig
16093222c0 Move Litho plugin to xplat//
Summary: Last one of the plugins.

Reviewed By: jknoxville

Differential Revision: D8966725

fbshipit-source-id: 1564042c45815d324f7dc0ef6d9d024307787b49
2018-07-25 06:33:29 -07:00
Thomson Thomas
65239838f2 Fix the crash from okhttp interceptor (#168)
Summary:
Add a null check before creating a new response
Fixes #166
Pull Request resolved: https://github.com/facebook/Sonar/pull/168

Reviewed By: jknoxville

Differential Revision: D8915871

Pulled By: passy

fbshipit-source-id: aa93273f6fe90a8160133331e0844f67ff7e620a
2018-07-24 08:33:14 -07:00
Pascal Hartig
5b38cbdf76 Move OSS plugins
Summary:
This is a big one. Moves all oss plugins to a new place and leaves
stub targets in place. No logic changes. Everything apart from
BUCK files should be unchanged.

Reviewed By: jknoxville

Differential Revision: D8951045

fbshipit-source-id: 8054fb4028181d5cc4a240b1908dab6471cf0a27
2018-07-24 07:22:27 -07:00
Pascal Hartig
fb2b9cfc9f Update android lib build paths
Summary: Move manifest to correct place, update build.gradle accordingly.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8931222

fbshipit-source-id: e2cf4b507de4ea984b5a2dce1bb9edee0c4e2558
2018-07-20 08:20:50 -07:00