Commit Graph

140 Commits

Author SHA1 Message Date
Daniel Büchele
f4822143bd plugin reselection
Summary: When relaunching Flipper/refreshing it while developing, where was a case, where the App Client connected, before the device was registered in Flipper. In this case, we didn't select the previously selected plugin

Reviewed By: jknoxville

Differential Revision: D9359779

fbshipit-source-id: 9c6f8e6bf65a46dc84c9781242b23df0ed539810
2018-08-16 08:12:16 -07:00
Daniel Büchele
11ba553ab8 tracking for large frame drops
Summary:
`largeFrameDrops` are added to the usage tracking.
Similar to our other apps, we are considering a drop of 4 or more frames as a large frame drop. While a single frame drop might not be relevant to the user, large frame drops are a more relevant number to optimize for.

Reviewed By: passy

Differential Revision: D9358795

fbshipit-source-id: d9354695c816ba6c40676df6f3c6f3f070e28269
2018-08-16 05:12:27 -07:00
Anamaria Cotirlea
e51b8c0742 Add Hardware Details to CPU Info Plugin.
Summary: Added an additional field which contains hardware information regarding the chipset manufacturer and model.

Reviewed By: danielbuechele

Differential Revision: D9294547

fbshipit-source-id: 45c577475f156ee4a83140f506df161cd4ed4330
2018-08-15 02:57:18 -07:00
Daniel Büchele
6f2a7dcb05 clean up console
Summary: The console was pretty spammy. This fixes some issues that were logged and changes many log statements to `console.debug` which are not shown by default.

Reviewed By: passy

Differential Revision: D9303011

fbshipit-source-id: 1102f4f8814152a45f155cb43488a515c2d4eee4
2018-08-14 03:12:54 -07:00
Daniel Büchele
eb316be4e4 fixing tracking metrics
Summary:
- fixing dropped frames calculation
- fixing plugin activation time

Reviewed By: passy

Differential Revision: D9301759

fbshipit-source-id: 872e4d2edcafdbc67668f3d0b713dfbf55f068f5
2018-08-13 15:27:29 -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
Aaron Brady
b552dc6f52 Make WindowsDevice for Sonar
Summary:
This diff adds the ability for a windows desktop app to be a selectable device for Sonar.

just to over-communicate what I'm thinking regarding the logging: windows system logs don't have a lot of valuable information in my experience, and there is a ton of garbage, but there is probably a way to tap into that if we want.

however, I was thinking that redirecting stderr/stdout from every connected process would be useful. i.e. OVRServer could register a log plugin and it would write to the device's log output. not sure if this would be better than just having a logger plugin. This is probably a pretty naive question and this probably isn't the place to have this conversation...but here we are :)

Reviewed By: jknoxville

Differential Revision: D8861986

fbshipit-source-id: f6ccba28729692ae4566dd24302268ad54d437eb
2018-08-13 11:29:59 -07:00
Aaron Brady
1a7ef4fc85 Generalize client OS filtering by device and move logic to Device class itself
Summary: Adding support for a WindowsDevice (in following diff) that relies on this behavior, also seems reasonable that the logic for what client os' a device supports should be in the device class.

Reviewed By: jknoxville

Differential Revision: D8861698

fbshipit-source-id: 2907f616baa04eb71a9e4ef3b6704980acbafaf5
2018-08-13 11:29:59 -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
Daniel Büchele
8b8ffaa7a0 missing UI renames
Summary: Rename app title and update notification to "Flipper"

Reviewed By: passy

Differential Revision: D9270088

fbshipit-source-id: 4e49e8d553fdd6b98da599be3ce18b4daf412cb6
2018-08-10 09:57:38 -07:00
Daniel Büchele
faf8afe9cd Track plugin activation time
Summary: Track the time from when the plugin is selected until its `init()` function finishes.

Reviewed By: passy

Differential Revision: D9239750

fbshipit-source-id: 569f236c9d58f70548f1ba6bf31a96047dcc8245
2018-08-10 09:41:47 -07:00
Daniel Büchele
a9b8c3d2c9 startup time tracking
Summary: Adds tracking from opening the application to the interface being shown.

Reviewed By: passy

Differential Revision: D9239037

fbshipit-source-id: eba60a9e839f9cc2b7a3c8706c6b9d63acb854b4
2018-08-10 09:13:27 -07:00
Daniel Büchele
2b98f05d03 add tracking for dropped frames
Summary: Adding dropped frames counter to usage events. This will allow us to track performance improvements.

Reviewed By: passy

Differential Revision: D9238608

fbshipit-source-id: d9adbb0ed72aaf13802f5eef39606970b64c8e36
2018-08-10 09:13:27 -07:00
Daniel Büchele
aace545ba6 move WelcomeScreen
Summary: The sidebar is now shown, even if no device is connected. This prevents the jumping layout when Flipper launches, but still has not connected to devices.

Reviewed By: passy

Differential Revision: D9263892

fbshipit-source-id: d5b96a8619393ee4002863a83d9024f00c6cb396
2018-08-10 08:57:09 -07:00
Daniel Büchele
7107efcc88 catch setFeedURL for non-codesigned apps
Summary: see title

Reviewed By: jknoxville

Differential Revision: D9264748

fbshipit-source-id: 6675a27d899361e12dd752eb5feea0f85c5c8d07
2018-08-10 08:57:09 -07:00
John Knox
286a88e3f2 Grammar updates in welcome screen
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/219

Reviewed By: passy

Differential Revision: D9239245

Pulled By: jknoxville

fbshipit-source-id: 5715738db5b7edbf8f5757447bd562f53d942b99
2018-08-09 07:27:50 -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
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
f73c28ba6b Prepare desktop app for requestResponse CSR change
Summary:
[Step 1 of a protocol change between desktop app and flipper agent]

The flipper agent periodically tries to connect.
When it doesn't have the required certs, instead of trying to connect, it requests them from the desktop.
After requesting, it just continues the loop, trying to request.

The problem with that is
a) the desktop can take longer than one cycle to generate and provide the certs, meaning the agent will make overlapping requests, causing confusion and it to take longer than necessary.
b) the desktop can take less time than a retry cycle, but the agent will still wait before trying to connect.

Fixing a) by making the agent wait for a response from the desktop before continuing attempting to reconnect.
This means on the next connection attempt, it's guaranteed that the desktop is finished processing the CSR.

b) remains unfixed for now, but can be dealt with separately.

This is step 1 which adds an extra responder to the desktop app. It won't change anything until the agent starts
sending requestResponse messages instead of fireAndForgets. The plan is to leave this in place for a while to give users time to update, after that, we'll roll out the change to the agent.

Reviewed By: passy

Differential Revision: D9179392

fbshipit-source-id: 9a8021253dcd28c15cceeec23630a67aec219fd5
2018-08-07 06:41:38 -07:00
Pascal Hartig
b8c568e3e4 Fix avd device name resolution with GNU netcat
Summary:
Device connection didn't work on Linux due to netcat behaving differently.
I also played around with the `nc` and `node-netcat` packages, but they would
either crash the node stack or fail to compile with Babel. Oh glorious
JavaScript world.

Reviewed By: danielbuechele

Differential Revision: D9194591

fbshipit-source-id: 58e5b8d6b4a66e791e750de2f1449dcb8fc338ae
2018-08-07 06:12:03 -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
Daniel Büchele
134a0d96c5 renaming app to Flipper
Summary: rename all visible references of Sonar to Flipper. Changes endpoint URLs to the new repo address.

Reviewed By: passy

Differential Revision: D9082100

fbshipit-source-id: 2ab8b680a19c23d80050e8e768379c29d66acfca
2018-08-06 10:44:33 -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
Daniel Büchele
764ad440cb Make sidebar scrollable
Summary: Sidebar is now scrollable, when showing too many plugins.

Reviewed By: jknoxville

Differential Revision: D9179312

fbshipit-source-id: bfcd4655a0fbbe91424b88378db3713e68e2cb7f
2018-08-06 06:27:18 -07:00
Daniel Büchele
de800fee37 check for action type in application reducer
Summary: Previously, accidentally all action payloads have been written to the application reducer, because it didn't check the action type. Now, this diff makes sure, the application reducer checks for the action type and only writes actions to the store which are meant for the reducer.

Reviewed By: jknoxville

Differential Revision: D9179305

fbshipit-source-id: 833776468ed32e0385058571130e81eff06c370e
2018-08-06 06:27:18 -07:00
Daniel Büchele
5fd1ebba2e show sidebar in logs plugin
Summary: Logs plugin was not showing sidebar after switching to new sidebar API.

Reviewed By: jknoxville

Differential Revision: D9179249

fbshipit-source-id: 922be402dbbb1096343489f6027cd543010b694f
2018-08-06 06:27:18 -07:00
Daniel Büchele
1b3e3468a3 fix scrollbars in logs
Summary: Some columns in logs plugin where showing scrollbars since the update to electron 3. This hides scrollbars on all columns

Reviewed By: passy

Differential Revision: D9179242

fbshipit-source-id: bdf2e1a6f77d2a7e25cb34792b980afe7571e643
2018-08-06 06:27:17 -07:00
John Knox
5c81aefe9a Use unlinkSync instead of unlink
Summary:
fs.unlink() requires a callback and we weren't passing one.
Using synchronous version instead.

Reviewed By: passy

Differential Revision: D9148214

fbshipit-source-id: 8a3c1103d93fced5e3c25c38775badb72c23e48a
2018-08-03 08:57:49 -07:00
Benjamin Pankow
1008dbb283 Create open source LeakCanary plugin
Summary: Adds a new plugin to support [LeakCanary](https://github.com/square/leakcanary), displaying memory leaks as they are detected. Each leak shows a hierarchical path from the GC root to the leaked object, and allows inspection of these objects' fields.

Reviewed By: jknoxville

Differential Revision: D8865149

fbshipit-source-id: 99bcf216578b9d6660ead7d48b9bafe0d20a6c08
2018-08-02 10:27:11 -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
Daniel Büchele
75dfbf51f8 electron flow type definitions
Summary: Adding a flowtype library definition for electron 3 and fixing related type errors

Reviewed By: passy

Differential Revision: D9124758

fbshipit-source-id: e09cb5b05ba952e7f95f68f9043edc586f81ae83
2018-08-02 03:57:52 -07:00
Sara Valderrama
30a19901ee Cleanup js in layout inspector, add check for ios
Summary: Clean up javascript. Add a check to remove ax mode toggle if using ios. Add safety check for extraInfo where it hasn't been added yet.

Reviewed By: danielbuechele

Differential Revision: D9070574

fbshipit-source-id: 49ac781c01ea47239d6c24089976497371973726
2018-08-01 13:41:43 -07:00
Daniel Büchele
06e70a1555 Screen capture unique file names and location
Summary: Screen captures now have unique names, so they don't get overwritten. By default they are saved to the desktop, but the path can be overwritten by setting `screenCapturePath` in `~/.sonar/config.js`

Reviewed By: jknoxville

Differential Revision: D9120822

fbshipit-source-id: ab6880eac475da3839f08c6e644c16bdc8693647
2018-08-01 11:29:05 -07:00
Benjamin Pankow
a4638033b7 Improve styling of Hprof Analysis for Memory Tools plugin
Summary:
Improves the look of analyzed Hprof data for the Memory Tools plugin. Adds an expandable/collapsable tree using ElementsInspector and groups large objects/leaked objects.
https://pxl.cl/fxNs

Reviewed By: danielbuechele

Differential Revision: D8721141

fbshipit-source-id: f78fe32bd2ca1f11ce39b9e696f48a56dc5c9bff
2018-07-31 14:56:28 -07:00
Daniel Büchele
37425e7ae8 persist state over reload
Summary: The selected device, app and plugin are not persisted over a reload using `redux-persist`.

Reviewed By: jknoxville

Differential Revision: D8836481

fbshipit-source-id: 3ace1a950a200255d5daf77791d706ede0ff2138
2018-07-31 07:58:33 -07:00
Daniel Büchele
1f977f4844 Store use selected plugin after reconnect
Summary:
Deselect plugin when app disconnects, but store the information that the users had the app selected. When the app conencts again, restore the user's selection.
This also stores the device seleced by the user and reselects the device if it connects.

Reviewed By: xiphirx

Differential Revision: D8833948

fbshipit-source-id: ad3ef54681550ae674bdd4e695d677aea5c14588
2018-07-31 07:58:33 -07:00
Hilal Alsibai
a8138984f9 Fix undefined references
Summary: If the app youre inspecting doesnt have extra ax info then the layout inspector has a bad time

Reviewed By: sjkirby

Differential Revision: D9038286

fbshipit-source-id: e3c1736cba13b870cf7ff648377c822fba4446d0
2018-07-31 04:14:49 -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
Aurelien Fredouelle
5714ce08c9 Added export for the DataDescription component
Reviewed By: jknoxville

Differential Revision: D8896383

fbshipit-source-id: f4873c251046be5983ef1e7377a9a269a087261a
2018-07-26 04:34:46 -07:00
John Knox
b68d802fae Sort plugins alphabetically
Summary: Show plugins in alphabetical order in the main sidebar, so you can more easily find the one you're insterested in.

Reviewed By: passy

Differential Revision: D8995900

fbshipit-source-id: 2ce4a4f4ac7491378e09da8b6ada3f60102a36cb
2018-07-26 03:32:58 -07:00
Benjamin Pankow
e223595941 Add 'depressed' param to Button
Summary: Adds an optional 'depressed' param to Button. If set to true, displays the Button as if it was depressed. Used to add a set of togglable buttons in which all or none can be selected.

Reviewed By: jknoxville

Differential Revision: D8903854

fbshipit-source-id: ff39bed91514e420b49cb75fe57e490fa641b810
2018-07-25 10:33:36 -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
a876f90b68 Fix lint error
Summary: Per title. CI is unhappy.

Reviewed By: jknoxville

Differential Revision: D8991974

fbshipit-source-id: db7b9161b814fbbae0849d3ee3d551a7a8588985
2018-07-25 09:19:38 -07:00
Pascal Hartig
6a7a580db3 Import "Fix some typos (it's vs its)" (#175)
Summary:
Original author: noahsark769

Closes https://github.com/facebook/Sonar/pull/175

Reviewed By: jknoxville

Differential Revision: D8989724

fbshipit-source-id: 8e1c09196b0c6c0d0fb0446a2a4a595d09f21652
2018-07-25 07:18:54 -07:00
Pritesh Nandgaonkar
02cd3ba560 Add warning if plugin is ignored due to gatekeeper
Summary: Adds warning if plugin is ignored due to user not being the part of gatekeeper. As it will help us to better support our users

Reviewed By: passy

Differential Revision: D8952074

fbshipit-source-id: a5b995c778989deb08972081b19313303f8bfabb
2018-07-24 07:48:37 -07:00
Barney Huang
fcfa0409e4 fix null device reference
Summary:
Force device type from BaseDevice to AndroidDevice, because we need to access adb inside AndroidDevice.
In long term, we should use DeviceShell from BaseDevice, but that need much more changes.

Differential Revision: D8876082

fbshipit-source-id: 0772a0ac361c5e3eca9c7a590281ffa786501e15
2018-07-20 03:32:54 -07:00
John Knox
e83c8d31a2 Display warning to user when a physical iOS device is connected
Summary: At the moment sonar doesn't work with physical iOS devices. Until we add that feature, to avoid confusion, tell the user that it won't work.

Reviewed By: passy

Differential Revision: D8859223

fbshipit-source-id: 318777406877e0f769c6d0dc5bbe745ca0565f55
2018-07-16 11:03:53 -07:00
Aaron Brady
d34aba9e21 Allow filesystem to decide path validity for cert dest folder (sonarCA.cert failing to write on windows)
Summary:
On windows when I used a more complicated path for the sonar directory (e.g. for writing sonarCA.cert to), it failed this regex but succeeded the node fs.writeFile call.

Unless I'm missing something else this regex does, we should just let the authority of the fs module decide if it can write something.

Reviewed By: jknoxville

Differential Revision: D8822094

fbshipit-source-id: 294c9a7b70080fefcfffdddd239d321ff7faa4e1
2018-07-16 08:33:37 -07:00