Commit Graph

359 Commits

Author SHA1 Message Date
Anna Murawska
5e979403a0 Show FB-internal announcements only in internal changelog (#1544)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1544

Added Facebook changelog file

Reviewed By: nikoant

Differential Revision: D23930322

fbshipit-source-id: bb6be359d36188f142d342604e50010170086610
2020-09-28 02:42:00 -07:00
Michel Weststrate
ecf4cff7cf Fix most lint warnings
Summary:
I noticed that after the typescript upgrade, I got several weird positives from ESLint (like unused parameters in a type definition, which are obviously always unused, e.g. `type onClick = (e: Event) => void`). After some investigation, it turned out these warnings are generated by eslint, but that those rules should be performaned by typescript/eslint instead. For future reference to which rules this applies:

https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/README.md#extension-rules

Updated the config, and while at it, fixed all warnings in our codebase, except for `react-hooks/exhaustive-deps` warnings, since those require semantic changes.

This reduces the amount of eslint warnings from 86 to 39.

Reviewed By: passy

Differential Revision: D23905630

fbshipit-source-id: 0557708fd9ec6b17840a3c191e7d3baf225bdf23
2020-09-28 01:42:48 -07:00
Michel Weststrate
aaabe1cc82 Introduce AppInspect
Summary:
This diff introduces the AppInspect pane.

I didn't get very fare, and it is markup only, but while at it made a bunch of other improvement in the component lib, so figured to prematurely submit to don't make the diffs too big.

Improvements
- Separated sidebar and Layout.X, as it was to much responsibility for one component, and made customization hard. Also caused state loss when switching between resizable and not.
- Setup a basic top level selection. Maybe will move it into redux in the future, but for now it suffices.
- Introduced Layout.Horizontal and `Layout.Vertical` as alternative to Ant design's space. The reason is that the latter can't stretching children, which we use quite frequently. (that is because they use wrappers to create spacing, but since we run on Electron, we can use CSS `gap` instead, which handles that much more elegantly).
- Fixed issue where gutter handle could disappear when dragging to far.

Reviewed By: cekkaewnumchai

Differential Revision: D23867265

fbshipit-source-id: e872b7f48b868e255f2c34d45e811b8ed93d0b00
2020-09-28 01:42:48 -07:00
John Knox
2cbcbd1480 Include os version in metrics
Summary: May be useful for stability signals, or general bug correlation down the line.

Reviewed By: nikoant

Differential Revision: D23904843

fbshipit-source-id: ca31722b58d4657a9600fe5ce16ea3b5efd2c870
2020-09-25 09:52:05 -07:00
John Knox
359f7ad639 Fix system app detection regex
Summary:
Previously system apps have given "... is not an application" messages.
But now we can see others: https://android.googlesource.com/platform/system/core/+/master/run-as/run-as.cpp#226

So expanding the regex to catch both.
Context: https://fb.workplace.com/groups/flippersupport/permalink/970770066736985/

Reviewed By: passy

Differential Revision: D23930268

fbshipit-source-id: 1b85018da3e468563198d64af607d1129273c0d6
2020-09-25 06:21:29 -07:00
Michel Weststrate
aea04dd0cf Add Flipper logs to leftrail
Summary:
This adds support for flipper logs in Sandy, including some theme adjustments.

Did remove storage and showing of debug messages, as I noticed it tends to crash Flipper after a while since there are so many. Also added a fixed limit of only remembering last 1000

Also converted Toolbar and button with dropdown items to Sandy.

Reviewed By: cekkaewnumchai

Differential Revision: D23824528

fbshipit-source-id: b89d1182d4f14682251dbb482d93c2c009ddc7a4
2020-09-24 05:58:29 -07:00
Michel Weststrate
191df465b7 Updated to typescript 4
Summary:
allow-large-files

Updated to typescript 4. Note that this is no new major, the way TS numbers is that 4.0 is simply the number after 3.9 (so they refuse to use 3.10).

Primarily reason is that it allows us to use `/** deprecated */`. although there are definitely more interesting improvements

Reviewed By: passy, nikoant

Differential Revision: D23869445

fbshipit-source-id: 54e251b398b8698d9b18898ce66c3203b32aa356
2020-09-24 05:58:29 -07:00
Chaiwat Ekkaewnumchai
bfe76e54fe Introduce Sandy Welcome Screen
Summary:
Per title

~~Note: `useStore.tsx` is copied from D23783500 (e7fdd8332d). This should be merged correctly in case the diff is landed before.~~

Reviewed By: mweststrate

Differential Revision: D23784302

fbshipit-source-id: adb5678c1b2614e3af4278889529c3fa79335bef
2020-09-23 17:59:46 -07:00
Chaiwat Ekkaewnumchai
93c897820b Change Typography Size
Summary:
Typography on Sandy! The designed typography is [here in Figma](https://www.figma.com/file/4e6BMdm2SuZ1L7FSuOPQVC/Flipper?node-id=238%3A172)

Current deflects
- cannot find component for 'body - small' and 'meta'
- don't know how to set 'link secondary hover' as designed

Reviewed By: mweststrate

Differential Revision: D23869256

fbshipit-source-id: efb1475749cebad529b502458d1b15bd445bb346
2020-09-23 17:59:46 -07:00
John Knox
390df577ae Print out CSR mismatches when no matching one can be found
Summary:
We're seeing some CSR mismatches when they aren't expected. Adding logging to print out what is being found, to see if it's any OS-specific encoding issues or something like that, or completely different CSRs, etc.

URL encoded in case there are differences in non printable characters.

Reviewed By: nikoant

Differential Revision: D23867267

fbshipit-source-id: f406a396c808687b6b84561eb1def61b565aee34
2020-09-23 08:39:40 -07:00
Michel Weststrate
a0d46bbb53 Use Ant design for buttons if Sandy is enabled
Summary: The Flipper `Button` component now uses Ant.design under the hood if available. This is detected using context

Reviewed By: cekkaewnumchai

Differential Revision: D23813166

fbshipit-source-id: 489a34d55c0b69d7b5bcd30f4275b89d0bb22c0d
2020-09-22 12:03:40 -07:00
Michel Weststrate
b256bc68fa convert buttons to React hooks
Summary: Converted Buttons to hooks, to make it easier to use context in the future. No further changes.

Reviewed By: cekkaewnumchai

Differential Revision: D23812921

fbshipit-source-id: 3739ad49e734dbe4d903a23d58da7cc267f6e109
2020-09-22 12:03:40 -07:00
Michel Weststrate
fdd2151532 Settings panel
Summary:
This enables opening the settings panel from Sandy. Created a small code switch in layouting to make sure it looks ok in both sandy and native dialog. Inside the settings no new components are used yet, which will be done in next diffs.

Also removed the close button from temporarily titlebar as settings are now accessible from Sandy chrome

Reviewed By: cekkaewnumchai

Differential Revision: D23812321

fbshipit-source-id: f8888373632786bb75f6dad635d300729b5086dc
2020-09-22 12:03:39 -07:00
Michel Weststrate
1c3df6ed8e Copied utilities to temporarily toolbar
Summary: This copies several utilities from the old title bar to the new one. We will have to revisit this in the future as it will eventually disappear. But in the mean time it makes sure version info and performance graphs are shown

Reviewed By: cekkaewnumchai

Differential Revision: D23824366

fbshipit-source-id: 0e495cd6d70db6a38da6df52b47ffee4bcb6f69f
2020-09-22 12:03:39 -07:00
Anton Nikolaev
dfbf66408a Fix search by query in Plugin Manager
Summary: I accidently broke search by query in a previous diff, so fixing it here

Reviewed By: passy

Differential Revision: D23842187

fbshipit-source-id: 9fcc7a46048ff99e1bf26c8a70ef0240b38018cb
2020-09-22 10:35:55 -07:00
Michel Weststrate
e7fdd8332d Made sidebars toggleable
Summary:
Implemented a first button: make main menu collapsible.

Also introduced some additional utilities and hooked up startup performance logging

Reviewed By: cekkaewnumchai

Differential Revision: D23783500

fbshipit-source-id: 2456fd781a52d497facbaccfabe885e4f8c408c5
2020-09-21 11:53:21 -07:00
Michel Weststrate
95638af321 Build main layout
Summary: This diff introduces the. main sections and restyled resizable panes according to the Figma design

Reviewed By: cekkaewnumchai

Differential Revision: D23758349

fbshipit-source-id: 7f09574f6b5fb54551141c13667c664e1769f09a
2020-09-21 11:53:21 -07:00
Pascal Hartig
7aaf5585a2 Fix Android device connection for Kitkat
Summary:
Probably more than just KitKat, but we got a specific report in
https://fburl.com/f88cvz4c for 4.4. ABI lists are not included
in the probs and unfortunately TS doesn't resolve this to a
`string | undefined` as it should.

{F336605489}

Reviewed By: jknoxville

Differential Revision: D23815568

fbshipit-source-id: b6af928f85549d0c973feb0d83a324252ce0f654
2020-09-21 09:24:37 -07:00
Michel Weststrate
54d36876b6 Upgrade to Electron 10 (#1532)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1532

Upgrade to Electron 10, in an attempt to fix random hard Electron crashes. Didn't fix it, but given the changelog of Electron with all the bug fixes, seems to be a good idea nonetheless :)

Changelog: Flipper now uses Electron 10

Reviewed By: nikoant

Differential Revision: D23565000

fbshipit-source-id: 3f07b8cf8c438147bde5314698d20046ac9f94cf
2020-09-17 09:44:27 -07:00
Paco Estevez Garcia
7307ed7014 Add 'Copy expanded child elements' to Layout Inspector
Summary:
As requested in https://fburl.com/dpuz2cew

This diff adds a new popup menu option to copy the info of all the expanded elements in a view/component tree.

It does it by moving the copy function to the layer where all elements are available.

The diff also replaces `Copy` to a call to the same function.

Reviewed By: muraziz

Differential Revision: D23757826

fbshipit-source-id: 3f70c85267f928f7153db75ed8f4eaa3fac669e7
2020-09-17 09:44:27 -07:00
Michel Weststrate
694d4e0e33 Expose theme from JavaScript
Summary:
This diff fixes two problems when further theming Flipper:

1. All shades of gray where defined in terms of black/white + transparency. Converted all colors to non transparent to make sure they stack well.
2. The color theme defined in less aren't available as javascript colors. It is possible to achieve that through setting up a babel parser that parses the less files and exposes them to JS. But since we have modern stack, figured that exposing all theme variables as CSS variables as well is a much simpler setup.

Reviewed By: passy

Differential Revision: D23756558

fbshipit-source-id: e92be1f66b11c2c9c400fc1622cb8a493cc4c2a5
2020-09-17 04:05:09 -07:00
Michel Weststrate
ef4379e847 Implemented basic Flipper theme, [Flipper] Setup initial layout and siderail
Summary:
This setups the first bits of the Sandy Layout, and has a styled siderail according to the design, that does absolutely nothing.

{gif:0sa60r8c}

Reviewed By: cekkaewnumchai

Differential Revision: D23655313

fbshipit-source-id: e30278aeae0913e231ad105a9afb55c74c6a3370
2020-09-17 04:05:09 -07:00
Michel Weststrate
2d2a8bd675 Introduce dark theme
Summary: Adds support for switching dark mode on the fly. Also added the option to apply certain settings without restarting Flipper, as that isn't needed in all cases.

Reviewed By: cekkaewnumchai

Differential Revision: D23625854

fbshipit-source-id: 82175ba10524daf1b48a65feec8c610460df9418
2020-09-17 04:05:09 -07:00
Anton Nikolaev
16a640b7ee Reload instead of restart to apply plugin changes
Summary:
Now full restart is not required for applying plugin changes (install/uninstall/update). So this diff changes the behavior to use reload instead of restart in Plugin Manager and Auto Update Manager. It is much faster than full restart.

Changelog: faster reload after plugin install/uninstall/update.

Reviewed By: jknoxville

Differential Revision: D23706701

fbshipit-source-id: b2dcaf7768a5d47b3c967c17e090fa74884b3850
2020-09-17 03:07:14 -07:00
Anton Nikolaev
f03d5d94ed Remove plugin compilation and loading from startup hot path
Summary:
- Removed compilation on startup which is not required anymore after switching to plugin spec v2.
- Removed from Node process ("static" package) all the dependencies which are not required anymore:  e.g. metro, babel etc.
- Plugin loading code from node process moved to browser process and made asyncronous.

Some expected benefits after these changes:
1) Reduced size of Flipper bundle (~4.5MB reduction for lzma package in my tests) as well as startup time. It's hard to say the exact startup time difference as it is very machine-dependent, and on my machine it was already fast ~1500ms (vs 5500ms for p95) and decreased by just 100ms. But I think we should definitely see some improvements on "launch time" analytics graph for p95/p99.
2) Plugin loading is async now and happens when UI is already shown, so perceptive startup time should be also better now.
3) All plugin loading code is now consolidated in "app/dispatcher/plugins.tsx" instead of being splitted between Node and Browser processes as before. So it will be easier to debug plugin loading.
4) Now it is possible to apply updates of plugins by simple refresh of browser window instead of full Electron process restart as before.
5) 60% less code in Node process. This is good because it is harder to debug changes in Node process than in Browser process, especially taking in account differences between dev/release builds. Because of this Node process often ended up broken after changes. Hopefully now it will be more stable.

Changelog: changed the way of plugin loading, and removed obsolete dependencies, which should reduce bundle size and startup time.

Reviewed By: passy

Differential Revision: D23682756

fbshipit-source-id: 8445c877234b41c73853cebe585e2fdb1638b2c9
2020-09-16 06:32:58 -07:00
Anton Nikolaev
75e7261d1e Remove support for plugin format v1
Summary:
Do not list plugins packaged with format v1 in Plugin Manager.

Changelog: removed support for plugins packaged using legacy format (v1), so they won't appear in Plugin Manager anymore.

Reviewed By: passy

Differential Revision: D23681402

fbshipit-source-id: 1c9496ba6b739069d67228a0f4250f2f01aabd4d
2020-09-16 06:32:58 -07:00
Anton Nikolaev
e48707151a Move the code related to plugin loading / installation to "flipper-plugin-lib"
Summary:
Sorry for so long diff, but actually there are no functional changes, just refactoring to make further changes of Plugin Manager easier to understand.

I've de-coupled the code related to plugin management from UI code and moved it from PluginInstaller UI component (which will be replaced soon by new UI) to "flipper-plugin-lib".  So pretty much everything related to plugin discovery and installation now consolidated in this package.

Additionally, this refactoring enables re-using of plugin management code in "flipper-pkg", e.g. to create CLI command for plugin installation from NPM, e.g.: `flipper-pkg install flipper-plugin-reactotron`.

Reviewed By: passy

Differential Revision: D23679346

fbshipit-source-id: 82e7b9de9afa08c508c1b228c2038b4ba423571c
2020-09-16 06:32:58 -07:00
Timur Valiev
2b13899782 websocket connection - make it work with new js sdk
Summary:
we used to send plugins list with connect command, now we can respond to getPlugins request with new api.
we still support old clients

Reviewed By: jknoxville

Differential Revision: D23625139

fbshipit-source-id: 37a24d0c83cd879d93287dd3a3d4d5d2f9477b34
2020-09-10 08:18:14 -07:00
Michel Weststrate
0e6546b93a Lazily build copyText and deserialize request bodies
Summary:
This diff tries to address T74467181, where Flipper (Electron) crash hard with a segfault. Although I failed to find the root issue, I noticed that this typically happened when switching to the network plugin after a long time.

Switching the network plugin causes all rows to be rebuild, and during the process all request and response bodies are deserialized which can take very long and fully blocks Flipper making it totally unresponsive.

This diff fixes that issue, by making sure the lately added lazy evaluation of copyText is used, and that requests aren't deserialized during row generation, which is only needed for full body search purposes, by making that lazily as well.

While at it fixed D21929666 (which I never finished) as well, which is a Sandy prerequisite, since it coupled the generic search table to hardcoded networking concepts like request and response. "body" search, has now been rebranded "contents" search. That is generic and makes sense in both the network and qpl plugin. Probably will make these labelings better customisable when revisiting the grids in Sandy

N.B. I thought the issue might maybe that during the blocking process the garbage collector can't run, and the process would OOM. But that doesn't seem the case (or at least not without some other factor contribution as well), as in a quick test I can trivally allocate 30 GB of memory (making the system swap), but still the process runs stably. So even with this diff I can't satisfactory explain the crash, but at least it avoids a common circumstance in which they happen, and it significantly improves the user experience.

changelog: [Network] Fixed issue where Flipper would hang for seconds or even crash when opening the Network plugin

Reviewed By: jknoxville

Differential Revision: D23599338

fbshipit-source-id: 52164fe6997b879c91907e0afe42e08ca3f315b4
2020-09-10 05:55:54 -07:00
Noa Leibman
4f2f02d4e6 Adding custoum zebra-color to TableRow
Summary: When using TableRow, you can define both backgroudColor & zebraBackgroudColor to get a cusomized zebra look to your table.

Reviewed By: jknoxville

Differential Revision: D23623221

fbshipit-source-id: df68fa015c0cd99b5f44baedb56e952c20b2dd68
2020-09-10 05:26:06 -07:00
Chaiwat Ekkaewnumchai
1efb682737 Add Opt-in Switch to Sandy UI
Summary:
With the new design from vpileggi, this diff separated a new app UI to the current one.

This diffs show the toggle switch to enable Sandy UI for devs who are in `flipper_sandy` GK. When toggled, it will bring Sandy UI up.

Reviewed By: mweststrate

Differential Revision: D23599398

fbshipit-source-id: d85c707e0fe7726a418b3551cedb36e455fb7d14
2020-09-10 02:13:04 -07:00
Rakha Kanz Kautsar
1b80877f1a Implement requestResponse for websocket connection (#1510)
Summary:
This allow websocket client to receive and reply messages from desktop client.

## Changelog

Implement requestResponse for websocket connection, allowing websocket client to receive and reply messages from desktop client

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

Test Plan:
Tested with custom websocket client, allow communicating getPlugins, init, deinit, etc.
But I think it's better to have dedicated unit tests for this (currently there's none?), let me know what you think.

Reviewed By: passy

Differential Revision: D23499396

Pulled By: jknoxville

fbshipit-source-id: fb445c0634afd46a525fc52da33b487da4e591fe
2020-09-09 06:43:53 -07:00
Michel Weststrate
9785a03ebd Summary:
See D23051239

Since the crash reporter endpoint does not exist anymore, and no data was reported there, removing the corresponding code from Flipper as well.

This also fixes the last remaining startup warning as well :)

Reviewed By: priteshrnandgaonkar

Differential Revision: D23472612

fbshipit-source-id: 7ce9f6a0261cdfe197a7da9b28a86407299effec
2020-09-02 04:27:17 -07:00
Pritesh Nandgaonkar
cf29bee5fa Add analytics for cert exchange step
Summary: This diff adds analytics for events like uploading certs, zipping certs.Also logs the payload data received in trusted and untrusted request handlers. It will be helpful to debug the issues through this events.

Reviewed By: jknoxville

Differential Revision: D23374024

fbshipit-source-id: 6fa709bbf05e1b99ed1882be953abbd968eefc6e
2020-08-28 07:18:42 -07:00
Paco Estevez Garcia
d2ceb1238c Add picker for string values in the Layout Editor
Summary: This diff adds a new PoC widget for the Layout Editor to select a string from a picker. It takes a Set of values and uses them as representation. One of them is considered selected.

Reviewed By: muraziz

Differential Revision: D23374681

fbshipit-source-id: 324a3dd74a6b16edb77b862345d5288dd714fea1
2020-08-28 05:26:21 -07:00
Pritesh Nandgaonkar
be641441d9 Add access token as a param in cdn link and minor improvements
Summary:
This fixes two issues. One issue where the recent change of cdn to lookaside hostname broke our build download process. More about this can be found [here](https://fb.workplace.com/groups/flipperfyi/permalink/772986153467682/).
It also fixes a bug which occurred on a retry when an error happened. Recently I made changes where, if the build is downloaded then retrying shouldn't redownload it. But we used to remove the downloaded builds after install phase, so this diff just removes the build when the download is successfull.

Reviewed By: nikoant

Differential Revision: D23372251

fbshipit-source-id: b57e69f65a20fc123191962d60165a62859d4ef7
2020-08-27 08:54:17 -07:00
Pritesh Nandgaonkar
dc4e224bfb Show possible remediation steps for known errors in a notification
Summary: This diff fires a notification with a remediation suggestion when the client takes a long time to connect back, for both WW and FS_ACCESS case

Reviewed By: mweststrate

Differential Revision: D23321067

fbshipit-source-id: 17ab93974e9571a0ba78af05c624eeb0522637c6
2020-08-26 07:56:58 -07:00
Timur Valiev
ce12c4e3df Make self inspection available for all devs - internal and open source
Summary:
Flipper self inspection is being used by internal devs for a month now and peeple seems happy with it :) Let's make it available to open source devs!

changelog: Flipper Self inspection - Flipper Messages plugin added to dev builds to show messages sent/received from clients

Reviewed By: jknoxville

Differential Revision: D23345560

fbshipit-source-id: 95bac52b966a78fbfa8e4d4c4e15d9d45ca960f7
2020-08-26 07:54:06 -07:00
Pritesh Nandgaonkar
73e3cfe4a1 Minor Bug fixes
Summary: With this change, I verified that our enterprise wilde app is able to connect to Flipper.

Reviewed By: jknoxville

Differential Revision: D23318335

fbshipit-source-id: cc952297ead1e8afcb1d9f5062e593e51e8ce893
2020-08-25 09:37:45 -07:00
John Knox
39a465b8b8 Use idb to poll for devices, if it is installed
Summary:
Bringing the pkd CPU usage fix to open source releases.

Now when idb is installed, Flipper will always use it to check for devices, and only fallback to instruments if not.

Fixes https://github.com/facebook/flipper/issues/1028

Reviewed By: passy

Differential Revision: D23293675

fbshipit-source-id: 6ff3e89167f5f6d4130f197b2a675202334d0e7d
2020-08-24 07:53:00 -07:00
Chaiwat Ekkaewnumchai
ecc3a280cf Fix Scroll to Left on When Element Inspected in Middle
Summary:
`scrollTo` used there caused the window to scroll to the most left when a user was inspecting an element which horizontal scroll wasn't in the most left position.

This diff removes the horizontal constrain and only scroll vertically.

Reviewed By: mweststrate

Differential Revision: D23284227

fbshipit-source-id: 7c19cac7496927c631572e222cb1d635dd1f8ea4
2020-08-24 03:36:57 -07:00
Michel Weststrate
223f4ac2c5 Remove startup errors (#1484)
Summary:
This diff removes some irrelevant error messages that are always logged in the OSS build, and got even reported a few times.

The yarn lock file somehow got in a state where emotion/core was included twice (probably due to having a really old yarn version here), causing the logs view to crash. So fixed that manually.

P.S. the fact that the warning in the screenshot does not take the full width is an issue in console-feed component itself, I opened https://github.com/samdenty/console-feed/pull/50 for that

## Changelog

changelog: Removed some irrelevant errors from startup flow

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

Test Plan:
Before

![Screenshot from 2020-08-19 14-18-51](https://user-images.githubusercontent.com/1820292/90639856-33454100-e227-11ea-8d34-94ec4e7ea61d.png)

After

![Screenshot from 2020-08-19 14-11-52](https://user-images.githubusercontent.com/1820292/90639881-3b9d7c00-e227-11ea-9cef-e3a96a89ba9d.png)

Reviewed By: jknoxville

Differential Revision: D23220937

Pulled By: mweststrate

fbshipit-source-id: 5f7b28adfbf99c938ad3abba75f26c6917463510
2020-08-21 10:08:22 -07:00
Michel Weststrate
81eb09e7b0 Unify error notifications (#1483)
Summary:
Note: this is to be stacked upon https://github.com/facebook/flipper/pull/1479

Note: this PR will probably not succeed against FB internal flipper, as I'm pretty sure there are more call sites that need to be updated. So consider this WIP

Currently connection errors are managed in the connection reducers, and are displayed through their own means, the error bar. Showing console.errors is also hooked up to this mechanism in FB internal flipper, but not at all in the OSS version, which means that some connection errors are never shown to the user.

Besides that there is a notification system that is used by for example the crash reporter and plugin updater.

Having effectively (at least) two notifications mechanisms is confusing and error prone. This PR unifies both approaches, and rather than having the connection reducer manage it's own errors, it leverages the more generic notifications reducer. Since, in the previous PR, console errors and warnings have become user facing (even in OSS and production builds, which wasn't the case before), there is no need anymore for a separate error bar.

I left the notifications mechanism itself as-is, but as discussed in the Sandy project the notification screen will probably be overhauled, and the system wide notifications will become in-app notifications.

## Changelog

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

Test Plan: Only updated the unit tests at this point. Manual tests still need to be done.

Reviewed By: passy

Differential Revision: D23220896

Pulled By: mweststrate

fbshipit-source-id: 8ea37cf69ce9605dc232ca90afe9e2f70da26652
2020-08-21 10:08:21 -07:00
Michel Weststrate
76b72f3d77 Fix condition on processing message queues for sandy plugins
Summary:
While converting Bloks-Script plugin, Timur found a bug where the message queue wasn't processed.

Although queue processing was unit tested, the integration into the rendering lifecycle wasn't explicitly tested and missed a TODO that already signalled this should have been implemented.

Added a unit test to verify the bug and fix. Also tested in a running Flipper instance with the converted plugin (next diff)

Reviewed By: jknoxville

Differential Revision: D23263909

fbshipit-source-id: 63783c980247bdf6c93d00a46881d7d0eb291d09
2020-08-21 09:09:34 -07:00
Dominik Wielgórski
6c7748238d Update 'open in ide' menu only if the path for a class is resolved
Summary: If myles is taking too long users might experience issues with multiple tabs open for 'open in diffusion' functionality. This diff addresses this problem by displaying 'open in ide' menu only if the path is already resolved.

Reviewed By: mweststrate

Differential Revision: D23242199

fbshipit-source-id: ffa698110d4c5e0c0e0686fbc56a7eea6b5782e6
2020-08-21 08:57:22 -07:00
Michel Weststrate
744fe01922 Some renames
Summary:
Some non-semantic changes. Mostly an earlier rename that was accidentally done only locally rather than across the codebase

Also support `.spec` test extension, which is more idiomatic Jest, since we don't use the `.node` and `.electron` distinction anymore anyway.

Reviewed By: jknoxville

Differential Revision: D22976438

fbshipit-source-id: f3abedb36cbac1e835295177117ccbca492a67a1
2020-08-20 13:32:47 -07:00
Michel Weststrate
bce3d48e71 Better handle no (valid) plugin selection
Summary: Little ux tweak, there are some rare scenarios where you can end up in an empty plugin screen, made a small message.

Reviewed By: jknoxville

Differential Revision: D22846396

fbshipit-source-id: 0ad19f1c252112d78a5587e6633fee2d9542d5e1
2020-08-20 13:32:47 -07:00
Michel Weststrate
685cc09b3b DeviceLogs plugin to Sandy
Summary:
Converted the DeviceLogs plugin to sandy.

Kept logic and UI the same (so same batching, localstorage mechanisms etc). But used sandy api's for log subscribing, state, and separating the logical part of the component from the UI.

Note that some mechanisms work slightly different, like deeplinking and scrollToBottom handling, to reflect the fact that plugins are now long lived

Reviewed By: jknoxville

Differential Revision: D22845466

fbshipit-source-id: 7c98b2ddd9121dc730768ee1bece7e71bb5bec16
2020-08-20 13:32:47 -07:00
Michel Weststrate
dd15cffa64 Introduced first class console to help users debugging issues (#1479)
Summary:
Handling issues typically start with: did you look at the Electron logs? Since Flipper is such an extensible tool, running in varying environments I think the console should be support as first class concept. Many errors are currently not shown to the user. This PR is a first attempt to fix that.

The implementation is based on https://github.com/samdenty/console-feed, which is used by quite some web based IDE like tools (like codesandbox), and offers a lot of goodies out of the box, like collapsing errors, objects, etc.

Edit: also added a counter keeping track of the amount of errors

N.B. no need to immediately review this diff, I'll import it to phabricator as soon as I can :)

## Changelog

changelog: Introduce 'Debug Logs' section to help users to troubleshoot issues or to provide more accurate reports.

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

Test Plan: ![Screenshot from 2020-08-18 15-29-55](https://user-images.githubusercontent.com/1820292/90526011-c9b22d80-e167-11ea-88cf-7b4e07918a96.png)

Reviewed By: jknoxville

Differential Revision: D23198103

Pulled By: passy

fbshipit-source-id: a2505f9fa59e10676a44ffa33312efe83c7be55d
2020-08-20 13:27:48 -07:00
Michel Weststrate
f342561196 Better error handling (#1478)
Summary:
Show a notification if device connect failed, or if USB debugging hasn't been authorized

When trying to run Flipper on my linux device, it didn't connect to my phone ootb. `adb devices` showed the device, and the flipper console did show an error, which, correctly stated that the device isn't authorized, but I missed the popup on my phone. This hopefully removes one hindrance for others in the future when connecting Flipper to Android.

## Changelog

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

Test Plan:
Before (no hint in Flipper UI):

![Screenshot from 2020-08-18 12-11-27](https://user-images.githubusercontent.com/1820292/90509026-9ca65080-e150-11ea-9119-2ba68633566a.png)

After:
Desktop notification + notification in notifications section

![Screenshot from 2020-08-18 12-47-10](https://user-images.githubusercontent.com/1820292/90509353-1b02f280-e151-11ea-899a-47d59ec93dcc.png)
![Screenshot from 2020-08-18 12-47-40](https://user-images.githubusercontent.com/1820292/90509358-1d654c80-e151-11ea-82c0-e86c5c34390d.png)

(sorry, had a movie, but can't access paste and GH doesn't allow them)

Reviewed By: passy

Differential Revision: D23220915

Pulled By: mweststrate

fbshipit-source-id: 4f4bc8023612301191ece62b9bc2bd008f3bb3cb
2020-08-20 02:58:07 -07:00