Commit Graph

101 Commits

Author SHA1 Message Date
Michel Weststrate
75df79a248 Factored out ipcRender.send
Summary: Delegate sending events over IPC from the render process to the main process over the RenderHost interface. This basically removes all our direct usages of `ipcRenderer`.

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D31828580

fbshipit-source-id: 9c1333ae55620d36c2af70aa7abc5403c2f4907c
2021-10-22 09:21:18 -07:00
Michel Weststrate
ecf2e32722 Factored out ipcRenderer.on
Summary:
Delegate receiving events from the Electron host process to the RenderHost interface.

Typed them as well while at it.

Reviewed By: timur-valiev

Differential Revision: D31828130

fbshipit-source-id: 920055de6f48512b91a433b229dbacd611c6f139
2021-10-22 09:21:18 -07:00
Michel Weststrate
27549ac5eb Move first pieces of functionality of Electron
Summary: Started abstraction some Electron specific APIs away, like process id, select directory dialogs etc.

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D31827016

fbshipit-source-id: e835ac9095e63d7ea79dd0eaf7f2918ac8d09994
2021-10-22 09:21:18 -07:00
Michel Weststrate
d88b28330a Move app/server to flipper-server-core
Summary: moved `app/src/server` to `flipper-server-core/src` and fixed any fallout from that (aka integration points I missed on the preparing diffs).

Reviewed By: passy

Differential Revision: D31541378

fbshipit-source-id: 8a7e0169ebefa515781f6e5e0f7b926415d4b7e9
2021-10-12 16:00:52 -07:00
Michel Weststrate
3e7a6b1b4b Move metrics / tracking / error analysis to flipper-common package
Summary:
what else can I say

move_complexity

Reviewed By: passy

Differential Revision: D31483414

fbshipit-source-id: 1692c792121a3aae0843eb238040cae0445cdf54
2021-10-12 16:00:52 -07:00
Michel Weststrate
51bfc8f05d Cleanup logger
Summary: Some cleanup around Logger, like renaming `getInstance` -> `getLogger`

Reviewed By: aigoncharov

Differential Revision: D31480828

fbshipit-source-id: d2fa9dc2b45bc34d846d45e396a74b80906d3ad5
2021-10-12 16:00:52 -07:00
Michel Weststrate
c3ff0ff355 Set up Flipper decapitated packages
Summary:
This diff introduces the packages necessary for Flipper decapitated.

* flipper-common: utilities & types shared between client, server, flipper-plugin
* flipper-server-core: all device & client management goes in here. Basically flipper's backend
* flipper-ui-core: all UI goes in here, as far as it doesn't depend on Electron
* desktop: the Electron app, will load server-core and ui-core, and glue them together, providing implementations for some electron specific stuff like dialgos
* flipper-server: A node process hosting flipper-server-core, that can be connected to over websockets. And probably can serve a browser version of the UI as well.
* flipper-ui-browser: thin wrapper around flipper-ui-core, providing some browser specific behavior / stubs.
* flipper-dump: (might remove later), but want to hack a quick and dirt flipper dump in here, as alternative way to test flipper-server-core.

This diff just creates the packages, but doesn't move any code, so it can be summarized as:

restoftheowl

Reviewed By: nikoant

Differential Revision: D30218646

fbshipit-source-id: 735598a1261a98e584f52504b5eba01ec0afa162
2021-10-08 01:33:03 -07:00
Pascal Hartig
9ce424adf7 Allowlist some remote usages
Summary: Some drive-by changes as I'm working on other stuff.

Reviewed By: mweststrate

Differential Revision: D31337500

fbshipit-source-id: 8f348af06b7c4b159703d7adf160a7380ba57b22
2021-10-01 08:08:36 -07:00
Michel Weststrate
f9c8bf8941 Fix dark mode startup error
Summary:
Changelog: Fixed startup error when loading default theme

The theme defaulted to `auto`, instead of `system`, causing an startup exception. Fixed by adding types and having a more defensive startup check.

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

Reviewed By: jknoxville

Differential Revision: D30866648

fbshipit-source-id: 83b6d9fc235eaa0a7e959df4276d3f378eed7d1f
2021-09-10 07:04:43 -07:00
Michel Weststrate
9f7b7885e3 Move interaction logs from info to debug
Summary: per title, the logs (e.g. `[interaction] "clear" clicked in 3ms.`) are not super interesting, unless you're trying to build some scuba graphs

Reviewed By: timur-valiev

Differential Revision: D30839590

fbshipit-source-id: d22deec130f947d2d440d499b8e2e146c1b44b68
2021-09-09 07:01:04 -07:00
ZHANG Qichuan
9a4d94c971 Add option for automatic dark theme (#2759)
Summary:
Add an setting option to allow automatic dark theme

A feature requested by swrobel https://github.com/facebook/flipper/issues/2708

## Changelog

### UI change
Replace the `Enable Dark Theme` Toggle button with a Radio group containing three Radio buttons.

The available options are `Dark`, `Light` and `Use System Default`, of which `Use System Default` is the default value

<img width="548" alt="Screenshot 2021-08-31 at 3 32 44 PM" src="https://user-images.githubusercontent.com/410850/131462798-4e74f757-41fc-4a3f-ba28-53d00fc1cf03.png">

### Data structure change

The `darkMode` property of [Settings](c0cd32564a/desktop/app/src/reducers/settings.tsx (L20)) is changed from `boolean` to `string`, the available values are `dark`, `light` and `auto`

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

Test Plan:
### Test 1
- Step: Choose `Dark` in the Settings page and click on `Apply and Restart` button
- Expect: The application is displayed in Dark mode
### Test 2
- Step: Choose `Light` in the Settings page and click on `Apply and Restart` button
- Expect: The application is displayed in Light mode
### Test 3
- Step: Choose `Use System Default` in the Settings page and click on `Apply and Restart` button
- Expect: The application is displayed in System Default mode

Reviewed By: mweststrate

Differential Revision: D30666966

Pulled By: passy

fbshipit-source-id: a63e91f2d0dbff96890e267062cb75bffd0007f4
2021-09-08 03:28:35 -07:00
Michel Weststrate
5dbd3bd414 Make getFlipperLib generally available, and use it to decouple opening links from Electron
Summary:
This stack reduces our direct dependency on Electron, for example by exposing our own API to open links.

Also exposing `getFlipperLib` as API from `flipper-plugin`, so that these utility methods are available outside plugin contexts as well.

Reviewed By: timur-valiev

Differential Revision: D29661689

fbshipit-source-id: 0c0523326eeb0d9d8fbe3e03c4609327bb53596b
2021-07-15 01:54:20 -07:00
Michel Weststrate
8e0d3cf779 Removed some old ui/ components
Summary: Removing old components that are no longer used, and cleaning up index.tsx to prevent future for some of those

Reviewed By: nikoant

Differential Revision: D29428621

fbshipit-source-id: 78ae51c09510738cf2d75982fdae35b9ef6d2d7e
2021-06-30 10:42:32 -07:00
Michel Weststrate
014e571f74 Start application in the right theme
Summary:
Changelog: Improved dark mode support!

This diff makes sure that the dark mode preference is written to the Flipper config, and applied during startup, so that the ugly light/dark flash when starting Flipper in dark mode disappears

Reviewed By: passy

Differential Revision: D29436059

fbshipit-source-id: 0f762149848298512026fbd216d9a9e0bf4276db
2021-06-29 08:39:34 -07:00
Michel Weststrate
617f8a928c Use dark scrollbar and system elements
Summary:
This diff adds OS support for dark mode (at least on Mac), by making sure system elements are styled according to system dark theme.

For some unknown reason, this does apply to all system dialogs, titlebars etc, but not for scrollbars, so they got custom themed.

Differential Revision: D29436058

fbshipit-source-id: bac649b6cd81f0142c607ed567eeb00f41625041
2021-06-29 08:39:34 -07:00
Anton Nikolaev
bbf1aeaa55 Delay app loading until persisted state loaded
Summary: This diff fixes the issue when some Flipper persisted state is required just after startup, but is loaded too late. This is easy to notice with a flag indicating whether Welcome window should be shown. Even if the flag is disabled, Flipper will still show the window on the next launch because it loads the state later than needed.

Differential Revision: D29426004

fbshipit-source-id: 011b5890034a6e254ce9ab834f098f1a2ab62a70
2021-06-28 04:02:29 -07:00
Michel Weststrate
6fb28df855 Make Store initialization independent of module order
Summary: Changed some imports, and again the Flipper initialisation broke. Refactored the store initialization to create nowhere module local constants, which prevents generally against module loading issues, making it possible to load all code first, and then intialise things through the `init()` method, which should make Flipper initialisation a lot more robust to changes

Reviewed By: passy

Differential Revision: D29233603

fbshipit-source-id: 322cb87cba23228b1d7a88634b7b3995e27cc277
2021-06-21 08:37:20 -07:00
Anton Nikolaev
8bbf9c46a3 Keep promise rejections unhandled after catching them for logging
Summary: Tracked component catches rejected promises under it to log them. After catching promises become "handled". This might hide potential promise error handling mistakes, so it's better to ensure we keep promises unhandled after catching them for tracking, so they are properly catched by the unhandled promise handler after that. The easiest solution seems to just make new rejected promise and return it instead of the catched one.

Reviewed By: passy

Differential Revision: D28466570

fbshipit-source-id: 26c1e7af3d6e4f7067b95f20e646462d808bb497
2021-05-18 08:08:30 -07:00
dependabot[bot]
674f71a426 Bump prettier from 2.2.1 to 2.3.0 in /desktop (#2300)
Summary:
Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/prettier/prettier/releases">prettier's releases</a>.</em></p>
<blockquote>
<h2>2.3.0</h2>
<p><a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">diff</a></p>
<p>{emoji:1f517} <a href="https://prettier.io/blog/2021/05/09/2.3.0.html">Release Notes</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's changelog</a>.</em></p>
<blockquote>
<h1>2.3.0</h1>
<p><a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">diff</a></p>
<p>{emoji:1f517} <a href="https://prettier.io/blog/2021/05/09/2.3.0.html">Release Notes</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="2afc3b9ae6"><code>2afc3b9</code></a> Release 2.3.0</li>
<li><a href="7cfa9aa89b"><code>7cfa9aa</code></a> Fix pre-commit hook setup command (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10710">#10710</a>)</li>
<li><a href="c8c02b4753"><code>c8c02b4</code></a> Build(deps-dev): Bump concurrently from 6.0.2 to 6.1.0 in /website (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10834">#10834</a>)</li>
<li><a href="6506e0f50e"><code>6506e0f</code></a> Build(deps-dev): Bump webpack-cli from 4.6.0 to 4.7.0 in /website (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10836">#10836</a>)</li>
<li><a href="69fae9c291"><code>69fae9c</code></a> Build(deps): Bump flow-parser from 0.150.0 to 0.150.1 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10839">#10839</a>)</li>
<li><a href="164a6e2351"><code>164a6e2</code></a> Switch CLI to async (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10804">#10804</a>)</li>
<li><a href="d3e7e2f634"><code>d3e7e2f</code></a> Build(deps): Bump codecov/codecov-action from v1.4.1 to v1.5.0 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10833">#10833</a>)</li>
<li><a href="9e09845da0"><code>9e09845</code></a> Build(deps): Bump <code>@​angular/compiler</code> from 11.2.12 to 11.2.13 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10838">#10838</a>)</li>
<li><a href="1bfab3d045"><code>1bfab3d</code></a> Build(deps-dev): Bump eslint from 7.25.0 to 7.26.0 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10840">#10840</a>)</li>
<li><a href="387fce4ed8"><code>387fce4</code></a> Minor formatting tweaks (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10807">#10807</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prettier&package-manager=npm_and_yarn&previous-version=2.2.1&new-version=2.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

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

Reviewed By: passy

Differential Revision: D28323849

Pulled By: cekkaewnumchai

fbshipit-source-id: 1842877ccc9a9587af7f0d9ff9432c2075c8ee22
2021-05-11 05:51:56 -07:00
Mykyta Sikriier
c9b6f6c7d9 ANDROID_SDK_ROOT support (#2106)
Summary:
According to Google, ANDROID_HOME is deprecated.
This means, that having only ANDROID_SDK_ROOT as environment variable leading to Android SDK is enough.
Flipper supports only ANDROID_HOME, so I would like to add ANDROID_SDK_ROOT support.
However, there is a set of rules of ANDROID_HOME and ANDROID_SDK_ROOT priority.
Everything is mentioned on a this page: https://developer.android.com/studio/command-line/variables

## Changelog
Added ANDROID_SDK_ROOT environment variable support

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

Test Plan: Probably I would need a help with this

Reviewed By: mweststrate

Differential Revision: D27505024

Pulled By: passy

fbshipit-source-id: 8bdc66a9652c673fd44944d87af1efc9e93d0f1b
2021-04-07 03:19:34 -07:00
Michel Weststrate
525e079284 Implement deeplink, creating pastes, log deduplication
Summary:
This diff implements the remaining features in the logs plugin:

- deeplinking
- merging duplicate rows

The logs plugin source code has now been reduced from originally `935` to `285` LoC. All optimisation code has been removed from the plugin:

* debouncing data processing
* pre-rendering (and storing!) all rows

Finally applied some further styling tweaks and applied some renames to DataTable / DataSource + types finetuning. Some more will follow.
Fixed a emotion warning in unit tests which was pretty annoying.

Reviewed By: passy

Differential Revision: D26666190

fbshipit-source-id: e45e289b4422ebeb46cad927cfc0cfcc9566834f
2021-03-16 15:03:45 -07:00
Michel Weststrate
05a7451173 Killed pluginStateRecorder
Summary: The state recorder was never updated for Sandy, nor is that really needed since Sandy offers better testing abstractions, and this was a stop gap with potential privacy concerns (due to recording real data). The feature didn't result in any actual test cases, so it seems we won't be missing out with this :)

Reviewed By: passy

Differential Revision: D26813798

fbshipit-source-id: 48ec11516fbc1a47a349a5799713ad05a7e1c73a
2021-03-04 06:01:48 -08:00
Michel Weststrate
90ac5f55a2 Add version number to error message
Summary: Minimal tweak to the soft crash error reporting: include the version number

Reviewed By: passy

Differential Revision: D26754416

fbshipit-source-id: d517d0bdb6bcf5c58b492c60b5bb8cc5f6b288f6
2021-03-03 03:17:34 -08:00
Michel Weststrate
4964966b91 Fix Flipper crashing to an empty screen
Summary:
Changelog: Fixed issue where a Flipper crash would result in an entirely blank screen, rather than a useful error message.

While debugging another issue, discovered that React errors that happen outside a Plugin aren't caught at all, resulting in the infamous gray screen of deaths. This was the case because no error boundary has been set up for our Chrome, and since React 16 the default error handling has becoming rendering blank, rather than freezing. See https://reactjs.org/docs/error-boundaries.html#new-behavior-for-uncaught-errors.

Thanks to ant.design styling this decently was trivial :). But sadly involved a component class since error boundaries are not yet available as hook.

With these changes the errors should also end up more readably in our monitoring.

Reviewed By: nikoant

Differential Revision: D26422666

fbshipit-source-id: 6c0f8611c80a4a5e0d7e61d58afcf5eabe410e57
2021-02-12 06:44:58 -08:00
Michel Weststrate
12e59afdc6 Remove non-Sandy UI
Summary:
This removes the Non-Sandy UI from the Flipper codebase. It is a pretty rough scan for unused components, over time when converting more advanced components to Ant design probably even more code can be removed.

Partially used `npx ts-purge` to reveal never imported source files.

Changelog: It is no longer possible to opt out of the new Sandy UI

Reviewed By: jknoxville

Differential Revision: D25825282

fbshipit-source-id: 9041dbc7e03bce0760c9a0a34f1877851b5f06cf
2021-01-25 04:48:45 -08:00
Michel Weststrate
7a1717fa87 Clean up App duplication
Summary: fb/App didn't really have a difference with fb-stubs/App, except that one checks for employee presence. However, since that is already controlled by config.checkFbEmployee, de-duped this to a single `<AppWrapper>` component, making the code a bit more easy to follow

Reviewed By: priteshrnandgaonkar

Differential Revision: D25824521

fbshipit-source-id: 8e16f0b29ec5d12475eaf14acd9dbc7df91191a2
2021-01-18 06:48:03 -08:00
Anton Nikolaev
bd01b58566 Sandy-based plugin auto-update UI
Summary:
New UX/UI for plugin auto-updates based on Sandy:
- disabled plugins auto-updated silently without any notifications as there is no active state for them so there is nothing to loose.
- enabled plugins can have some state and user can actually work with them, so we cannot reload them automatically. Instead, we show notification in the top of the plugin container asking user to reload the plugin when she is ready.
- if the auto-updated plugin failed to reload - show error notification.
- for non-sandy we continue using notifications as before.

Reviewed By: mweststrate

Differential Revision: D25530384

fbshipit-source-id: de3d0565ef0b930c9343b9e0ed07a4acb51885be
2020-12-15 09:31:57 -08:00
Michel Weststrate
4aff8c1bcf Introduce useLogger hook
Summary: In the Flipper chrome there is a lot of `logger={logger}` prop drilling. Let's not do that anymore in the future by using a proper hook, which is exposed from `flipper-plugin`.

Reviewed By: passy

Differential Revision: D25421304

fbshipit-source-id: 01ec8563c67f7e2fac359c2f8216eba722bff8d9
2020-12-09 05:33:08 -08:00
Anton Nikolaev
56361debb2 Differentiate insider builds from stable builds
Summary: Each build will have an embedded file specifying the target release channel for the build. This allows us to do some customisations, e.g. show "Insiders" label in the title and enable Sandy by default for insiders builds.

Reviewed By: jknoxville

Differential Revision: D25399045

fbshipit-source-id: 8e26d0754d0713ced823f86b30b54491d55b4d97
2020-12-08 12:38:02 -08:00
Michel Weststrate
3394f85fc7 Wire up usage tracking to Flipper core
Summary: Connect usage tracking to the Flipper core, individual elements will be wrapped in a next diff

Reviewed By: passy

Differential Revision: D25196284

fbshipit-source-id: 103e1d21d2f23fbbc21975fa85082811f6f53348
2020-12-03 04:15:44 -08:00
Michel Weststrate
f7c40c315c Update to Emotion 11
Summary: Per title

Reviewed By: passy

Differential Revision: D24994086

fbshipit-source-id: 84d83638ec518a39ea2d80f56b8c794c8b86a9d4
2020-11-18 06:52:03 -08:00
Michel Weststrate
45db64f0d0 Make sure that limited top-level exports are exposed from flipper-plugin
Summary: This prefixes APIs of `flipper-plugin`, that are used by Flipper, but should not be used by plugins directly, with `_`. Also added tests to make sure we are always intentional when extending the exposed APIs

Reviewed By: passy

Differential Revision: D24991700

fbshipit-source-id: ed3700efa188fca7f5a14d5c68250598cf011e42
2020-11-16 13:10:33 -08:00
John Knox
9d101263a0 Put PopoverProvider inside scope of Store Provider
Summary:
Many UI components (such as Button) rely on the redux store being present in the context.

So to use these components freely in popovers, the popover provider has to be within the store provider, not outside of it.

This moves it, along with the context menu and tooltip providers for the same reason.

Has the effect of fixing the ITSR dialog, which had a button inside a popover.

Reviewed By: mweststrate

Differential Revision: D24922493

fbshipit-source-id: e15540ac49795875b1cf86d6c66ec0591dc374ef
2020-11-12 10:03:59 -08:00
Michel Weststrate
c02d5341f9 Enable Sandy by default if part of GK
Summary:
Inverted the condition of checking if Sandy is enabled, so by default it is enabled if user is part of the GK.

This will make it more frictionless for people joining the dogfooding group and increases the chances we receive feedback :)

Reviewed By: jknoxville

Differential Revision: D24830075

fbshipit-source-id: d20dacd9e6c2dd2387a94b8a972252f29d0dab0e
2020-11-09 08:24:28 -08:00
Michel Weststrate
2b0e93a063 Introduce NUX element
Summary:
allow-large-files

This diff introces the `NUX` element that can be wrapped around any other element to give a first-time usage hint.

Hint dismissal is stored by taking a hash of the hint contents, and scoped per plugin.

Users can reset the 'read' status in the settings page

Example usage:

```
<NUX
  title="Use bookmarks to directly navigate to a location in the app."
  placement="right">
  <Input addonAfter={<SettingOutlined />} defaultValue="mysite" />
</NUX>
```

Reviewed By: nikoant

Differential Revision: D24622276

fbshipit-source-id: 0265634f9ab50c32214b74f033f59482cd986f23
2020-11-06 08:23:42 -08:00
Edward Yerburgh
8a31e984b3 Use QPL-managed QPLCore and PigeonClient (#1612)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1612

* Use the QPL-managed QPLCore and PigeonClient.

**Facebook:**

js-shared/qpl and js-shared/pigeon-client are maintained by QPL in xplat/js-shared. I've updated the Metro config and tsconfig to allow the packages to be imported without breaking the open-source version.

Reviewed By: passy

Differential Revision: D24358369

fbshipit-source-id: 7f13d6c99d8ca6ebcd0e66bf0e5f25069370cce7
2020-10-26 02:29:09 -07:00
Michel Weststrate
02570136ce Fix ANT line-height leaking into legacy design
Summary:
Fixes layout issue that was caused by ANT line-heights leaking into the old design.

Introduced a `.flipperlegacy_design ` class at the `root` element of Flipper, so that it is easier in the future to bail out / add overrides for certain features in the old design.

Reviewed By: priteshrnandgaonkar

Differential Revision: D24135482

fbshipit-source-id: 40091ebbde71662f2ebea66577f7b727009ca9c6
2020-10-06 04:58:18 -07:00
Michel Weststrate
4e6ecac43e Load ant theme in classic Flipper as well
Summary: If a new code path uses some Ant design based components in classic flipper, they are unstyled before this diff. By making sure that the ant stylesheet is loaded we can safely 'leak' new UI elements into the old UI. For example when we use toasters, dialogs etc.

Reviewed By: cekkaewnumchai

Differential Revision: D24021751

fbshipit-source-id: 3b42d28f1c75e4df441170660027562264e879dd
2020-10-01 05:35:10 -07:00
Pritesh Nandgaonkar
7358711e07 Enable screenshot for physical devices
Summary: Uses idb to get screenshot for physical devices.

Reviewed By: jknoxville

Differential Revision: D24017656

fbshipit-source-id: 89ffd17259d6f94d03a1442ffb341b79797f260b
2020-09-30 10:10:27 -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
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
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
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
9c202a4a10 Introduce menu entry support
Summary:
[interesting] since it shows how Flipper APIs are exposed through sandy. However, the next diff is a much simpler example of that

This diff adds support for adding menu entries for sandy plugin (renamed keyboard actions to menus, as it always creates a menu entry, but not necessarily a keyboard shortcut)

```

  client.addMenuEntry(
    // custom entry
    {
      label: 'Reset Selection',
      topLevelMenu: 'Edit',
      handler: () => {
        selectedID.set(null);
      },
    },
    // based on built-in action (sets standard label, shortcut)
    {
      action: 'createPaste',
      handler: () => {
        console.log('creating paste');
      },
    },
  );
```

Most of this diff is introducing the concept of FlipperUtils, a set of static Flipper methods (not related to a device or client) that can be used from Sandy. This will for example be used to implement things as `createPaste` as well

Reviewed By: nikoant

Differential Revision: D22766990

fbshipit-source-id: ce90af3b700e6c3d9a779a3bab4673ba356f3933
2020-08-04 07:47:14 -07:00
Nicole Stiliyan Vukadinova
a37d48d67e Fix the inconsistency in the timestamps for markerStart and markerEnd
Summary: There was in inconsistency in the timestamps used for markerStart and markerEnd, resulting in negative duration being reported in the Scuba table.

Reviewed By: nubbel

Differential Revision: D22791255

fbshipit-source-id: a4a16c6583974a0423b12805fb8d1a22af44cf5c
2020-07-28 07:22:38 -07:00
John Knox
9ada27526c Change RatingButton to use Popover2
Summary:
The original Popover component doesn't work when the popover goes out of bounds of the current container, and overflow is not visible, which is the case in the title bar.

This changes it to use a new absolutely positioned one instead.

Reviewed By: mweststrate

Differential Revision: D22724110

fbshipit-source-id: f41b6d154ccb66a94b63533fe9c30d2a2c49f1db
2020-07-24 07:13:28 -07:00
Nicole Stiliyan Vukadinova
7d06571cfa Add marker start and end to App to measure the startup time for Flipper (#1398)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1398

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

Reviewed By: nubbel

Differential Revision: D22549700

fbshipit-source-id: 7553ba075e45f1a515922012d7db4fdefefcaa24
2020-07-23 07:32:53 -07:00
Anton Nikolaev
91d5c6c130 Import MacOS CA when Flipper running in dev mode
Summary:
By default Node.JS has its internal certificate storage and doesn't use the system store. Because of this, it's impossible to access ondemand / devserver which are signed using some internal self-issued FB certificates. These internal certificates are automatically installed to MacOS system store on FB machines, so here we're using "mac-ca" library to load them into Node.JS when Flipper is running in dev mode.

For production version of Flipper we don't need to do this, because production certs are issued by DigiCert which is already trusted by node.js.

Reviewed By: passy

Differential Revision: D21862620

fbshipit-source-id: f7276e255fae1c208cb68af6632a303661af883e
2020-06-03 11:58:13 -07:00
Pascal Hartig
1011042bdb Remove bugnub
Summary:
Good bye, sweet prince.
We've decided to remove the internal bugnub as its usage is quite low
and the experience is subpar. In the future, we'd rather reuse the
support form v2 and integrate it with our group.

Reviewed By: mweststrate

Differential Revision: D21300627

fbshipit-source-id: d3c7271efcee4ad22ec76394870902f2712e392d
2020-04-30 06:05:46 -07:00
Pascal Hartig
fc9ed65762 prettier 2
Summary:
Quick notes:

- This looks worse than it is. It adds mandatory parentheses to single argument lambdas. Lots of outrage on Twitter about it, personally I'm {emoji:1f937_200d_2642} about it.
- Space before function, e.g. `a = function ()` is now enforced. I like this because both were fine before.
- I added `eslint-config-prettier` to the config because otherwise a ton of rules conflict with eslint itself.

Close https://github.com/facebook/flipper/pull/915

Reviewed By: jknoxville

Differential Revision: D20594929

fbshipit-source-id: ca1c65376b90e009550dd6d1f4e0831d32cbff03
2020-03-24 09:38:11 -07:00