Commit Graph

12 Commits

Author SHA1 Message Date
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
94eaaf5dca killed the concept of customizable column sets per device in device logs
Summary:
No device was using this feature, so doesn't look like there is a reason to keep it.

...if somebody was about to use this feature, let me know :). But probably, if we need this, a much more simple solution is to determine the visible columns with a simple switch on device type in the logs plugin, even though that is strictly speaking less scalable. But the current solution feels a bit over-engineered for something that is not really used.

Marked [interesting] as I might be missing some background concept which would make this relevant as well.

Reviewed By: jknoxville, nikoant

Differential Revision: D22763507

fbshipit-source-id: ecdbc779cbbfa3b0b72c80b459b12c1a25bf3fc4
2020-08-04 07:47:14 -07:00
Michel Weststrate
fbb1c78184 Separated index file into smaller files
Summary: More is more. Just moving code, no further changes.

Reviewed By: nikoant

Differential Revision: D22374891

fbshipit-source-id: 65c9af8b4b34ee8e16aeae5705528093e1c800cc
2020-08-04 07:47:13 -07:00
Michel Weststrate
006bf5357f Remove unused field from Logs plugin state
Summary: Didn't understand what that field meant. Turns out, it was never used.

Reviewed By: nikoant

Differential Revision: D22374893

fbshipit-source-id: c36d8f0c1be1b27306347d1c8c8a763c621720a5
2020-08-04 07:08:32 -07:00
Michel Weststrate
b9c9e89b53 Support activate and deactivate in normal plugins
Summary:
Device plugins have an activate and deactivate hook, that reflects the plugin being selected in the UI. Added these same hooks to client plugins as well. In practice they are called at the same times as `onConnect` and `onDisconnect`, except for background plugins, which connect only once, so it is pretty useful to be still able to make the distinction.

Since there is now quite some common functionality between plugins and device plugins, will clean things a bit up in a next diff

[Interesting] as it explains the difference between the different lifecycle methods of plugins, and the impact of being a background plugin

LIfecycle summary:

1. app connects
2. for background plugins: connect them (`onConnect`)
3. user selects a plugin, triggers `onActivate`. will also trigger `onConnect` the plugin if it _isnt_ a bg plugin
4. user selects a different plugin, triggers `onDeactivate`. will also trigger `onDisconnect` if it isn't a bg plugin.
5. app is unloaded. Triggers `onDisconnect` for bg plugins. Triggers `onDestroy` for all plugins,

Reviewed By: jknoxville

Differential Revision: D22724791

fbshipit-source-id: 9fe2e666eb37fa2e0bd00fa61d78d2d4b1080137
2020-08-04 07:08:31 -07:00
Michel Weststrate
c802215dd2 Make most text selectable
Summary:
Fix long standing issue where text by default in Flipper is not selectable. Which is super annoying when working with tables, trying to copy error messages, etc etc. Wanted to fix it with ant.design, but got so annoyed by not being able to select an error I needed, that I fixed it now :-P.

This diff makes all text selectable by default, and then bails out for specific elements, like section headers, button captions, the left toolbar (navigation) and top toolbar to preserve the desktop app look & feel.

Fixes a popular papercut issue

Changelog: All text is now selectable by default in Flipper.

Reviewed By: passy

Differential Revision: D22897793

fbshipit-source-id: 7bc50a987e012595956c07d1997959a5480790aa
2020-08-04 03:06:13 -07:00
Michel Weststrate
f0c54667e0 Support handling deeplinks in plugins
Summary:
This adds support for handling incoming deeplinks in a Sandy plugin, which can be done by using a `client.onDeepLink(deepLink => { } )` listener

Also generalized deeplinks to not just support strings, but also richer objects, which is beneficial to plugin to plugin linking.

Reviewed By: jknoxville

Differential Revision: D22524749

fbshipit-source-id: 2cbe8d52f6eac91a1c1c8c8494706952920b9181
2020-07-22 04:13:59 -07:00
Chaiwat Ekkaewnumchai
993249ed86 Add Sorting Log by Time
Summary:
This is a discussion on Github about reversing log. This diff tries to do that.

Changelog: Add ability to reverse log by time

Reviewed By: mweststrate

Differential Revision: D22047276

fbshipit-source-id: 6100a5ca40db223d1989be2746c7190cce7ffc53
2020-06-16 03:55:56 -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
Anton Nikolaev
863f89351e Yarn workspaces
Summary:
1) moved "sonar/desktop/src" to "sonar/desktop/app/src", so "app" is now a separate package containing the core Flipper app code
2) Configured yarn workspaces with the root in "sonar/desktop": app, static, pkg, doctor, headless-tests. Plugins are not included for now, I plan to do this later.

Reviewed By: jknoxville

Differential Revision: D20535782

fbshipit-source-id: 600b2301960f37c7d72166e0d04eba462bec9fc1
2020-03-20 13:37:41 -07:00
John Knox
be5c76d27c Disable logs plugin for physical iOS devices
Summary:
This has never worked due to historic problems with idb log: https://fb.workplace.com/groups/idb.users/permalink/875711589527983/

It sounds like they have been fixed though, so I'll look into getting it going. But for now, disabling it until it's working to hide a broken experience.

Reviewed By: passy

Differential Revision: D20534205

fbshipit-source-id: 3a39c9930fa195562d946bcfe9fd3388e3329be3
2020-03-19 14:30:00 -07:00
Anton Nikolaev
10d990c32c Move plugins to "sonar/desktop/plugins"
Summary:
Plugins moved from "sonar/desktop/src/plugins" to "sonar/desktop/plugins".

Fixed all the paths after moving.

New "desktop" folder structure:
- `src` - Flipper desktop app JS code executing in Electron Renderer (Chrome) process.
- `static` - Flipper desktop app JS code executing in Electron Main (Node.js) process.
- `plugins` - Flipper desktop JS plugins.
- `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 desktop app.
- `headless-tests` - Integration tests running agains Flipper headless version.

Reviewed By: mweststrate

Differential Revision: D20344186

fbshipit-source-id: d020da970b2ea1e001f9061a8782bfeb54e31ba0
2020-03-14 14:35:18 -07:00