Commit Graph

11 Commits

Author SHA1 Message Date
Lorenzo Blasa
7fcaf52c71 Show error in box if one is available
Summary: Add a check to prevent the odd error when the box is no longer available to display an error.

Reviewed By: antonk52

Differential Revision: D46763634

fbshipit-source-id: 6ac2c404c842ff989b037c991b5f085baacd2f9a
2023-06-15 08:53:16 -07:00
Andrey Goncharov
d3d2e189d0 Consume changed plugins message in the UI
Summary: Relay message to the React app via postmessage. Later, we will subscribe to these messages and update the plugins

Reviewed By: lblasa

Differential Revision: D39539590

fbshipit-source-id: c6742e45330e71b63c135c0267e6e9c5817fc9ff
2022-09-15 10:02:19 -07:00
Pascal Hartig
af924b1c6a Format html files
Summary: Using the built-in VSCode formatter to make them all a little more consistent before making changes to them.

Reviewed By: antonk52, nikoant

Differential Revision: D34897393

fbshipit-source-id: 270e575a4e8b15ff31887a356516af7409315618
2022-03-16 09:41:36 -07:00
Michel Weststrate
bca169df73 Move settings, launcherSettings, GKs to app / flipper-server-core
Summary:
This diff moves a lot of stuff from the client to the server. This diff is fairly large, as a lot of concept closely relate, although some things have split off to the earlier diffs in the stack, or are still to follow (like making intern requests).

This diff primarily moves reading and storing settings and GKs from client to server (both flipper and launcher settings). This means that settings are no longer persisted by Redux (which only exists on client). Most other changes are fallout from that. For now settings are just one big object, although we might need to separate settings that are only make sense in an Electron context. For example launcher settings.

Reviewed By: passy, aigoncharov

Differential Revision: D32498649

fbshipit-source-id: d842faf7a7f03774b621c7656e53a9127afc6192
2021-12-08 04:30:54 -08: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
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
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
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
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
Michel Weststrate
908a8bab1e Setup Ant.design
Summary:
allow-large-files

This makes the Ant.design component library available to Flipper

The CSS setup is unconventional, in the sense that the normal way to do this is to use a webpack loader to dynamically load the right less files, and a babel transform to automatically import the style sheets.

Since we use Metro, which is not very suitable for transforming non-JS(like) files, I figured that the simplest thing is to pre-compile the entire less theme. Which should be fine since we shouldn't be changing the less files very often, and since we don't ship a website, it is probably not too bad to have the full ANT theme for now in there, even though we don't use all components. It is 600 K of css. In the next diff the CSS is loaded conditionally, only if Sandy is enabled.

If the CSS turns out to be too big we can optimise this later to only import CSS for components we use by doing some Metro magic, but it doesn't seem to be trivial (that is, I couldn't get in to work in < 2 hours).

Reviewed By: cekkaewnumchai

Differential Revision: D23625855

fbshipit-source-id: 3ba810b2221dc0c7b719f66310e590c7748cf239
2020-09-17 04:05:08 -07:00
Anton Nikolaev
85c13bb1f3 Move desktop-related code to "desktop" subfolder (#872)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/872
Move all the JS code related to desktop app to "desktop" subfolder.

The structure of "desktop" folder:
- `src` - JS code of Flipper desktop app executing in Electron Renderer (Chrome) process. This folder also contains all the Flipper plugins in subfolder "src/plugins".
- `static` - JS code of Flipper desktop app bootstrapping executing in Electron Main (Node.js) process
- `pkg` - Flipper packaging lib and CLI tool
- `doctor` - Flipper diagnostics lib and CLI tool
- `scripts` - Build scripts for Flipper desktop app
- `headless` - Headless version of Flipper app
- `headless-tests` - Integration tests running agains Flipper headless version

Reviewed By: passy

Differential Revision: D20249304

fbshipit-source-id: 9a51c63b51b92b758a02fc8ebf7d3d116770efe9
2020-03-14 14:35:17 -07:00