Commit Graph

283 Commits

Author SHA1 Message Date
Michel Weststrate
5bf9541e05 Standardize CodeBlock component
Summary:
Code blocks are quite common in Flipper, and a bit verbose in Ant, so let's standardize!

Changelog: Standardize CodeBlock component

Reviewed By: passy

Differential Revision: D28117560

fbshipit-source-id: 5a5538a49b59ef40c814d22055fac56e7598cbbb
2021-05-04 13:50:31 -07:00
Michel Weststrate
dd7a9f5195 introduce onReady life-cycle
Summary: Flipper Sandy plugins didn't have an event to hook into that is run _after_ any state snapshot is loaded, which was needed by the graphQL plugin, as they do some post processing when a data snapshot is restored.

Reviewed By: passy

Differential Revision: D28189573

fbshipit-source-id: 4ef992f3fafc32787eab3bc235059f2c41396c80
2021-05-04 12:52:26 -07:00
dependabot[bot]
574e902a34 Bump jest-mock-console from 1.0.1 to 1.1.0 in /desktop (#2265)
Summary:
Bumps [jest-mock-console](https://github.com/bpedersen/jest-mock-console) from 1.0.1 to 1.1.0.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/bpedersen/jest-mock-console/commits">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=jest-mock-console&package-manager=npm_and_yarn&previous-version=1.0.1&new-version=1.1.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/2265

Reviewed By: mweststrate

Differential Revision: D28181903

Pulled By: passy

fbshipit-source-id: 40b305d3a90a01adfb7e21b3cbd5a8e75ce5de04
2021-05-04 11:49:56 -07:00
Pascal Hartig
bf571065f9 Allow copying from whole row
Summary:
Increase the mouse target for copying values from the the tree in a data inspector to the full row, not just the text.

Not sure if bringing reversing the order here has any unintended side-effects, but in testing it seems to work fine.

Reviewed By: mweststrate

Differential Revision: D28185064

fbshipit-source-id: b9b86a7e181bfd0083f2a3bcb24c571b5ec4647e
2021-05-04 10:35:36 -07:00
Michel Weststrate
699343a9ca Fix bug causing archived devices trying to connect
Reviewed By: nikoant

Differential Revision: D28064540

fbshipit-source-id: 43f05c4348a33e9633751bb9f69cd8d17ddd13c4
2021-04-29 12:12:57 -07:00
Anthony Dubis
8a3ba8615d Extend Atom's update interface
Summary:
This help handle updates to objects containing JSONObject type (generates typescript errors around infinite recursion:

> Type instantiation is excessively deep and possibly infinite.ts(2589)

Reviewed By: mweststrate

Differential Revision: D28098502

fbshipit-source-id: a8e7f785b03bce7c8e1c0b355e2eca2e087b1881
2021-04-29 12:06:21 -07:00
Michel Weststrate
1a8943e903 Fix autoscroll issue
Summary:
Noticed a regression in sticky scrolling not being sticky. I suspect this is caused by pixel inaccuracy + rounding, but our offset from bottom calculation consistently now reports `1` when being at the end of the scrollable region.

Too bad it is really hard to protect against these kind of regressions automated.

Reviewed By: passy

Differential Revision: D28095803

fbshipit-source-id: 1dbd57d84fb308023c2300c543aca344bf27ec28
2021-04-29 11:45:14 -07:00
Pascal Hartig
c3f3b35a31 Mass-bump deps
Summary:
Trying to get ahead of dependabot by bumping a bunch of things at once
that are minor or patch level bumps.

Reviewed By: muraziz

Differential Revision: D28094201

fbshipit-source-id: b6b53ae2d582686201124b82fed4f436a60b3172
2021-04-29 11:33:57 -07:00
Michel Weststrate
e3cb16d870 Fixed layout issue with undefined column widths
Summary: This fixes an earlier reported issue with Messages plugin, if no column widths are set values can jump around per row

Reviewed By: passy

Differential Revision: D28090807

fbshipit-source-id: be124b94f507584cf177710816035cd280a5ef01
2021-04-29 07:31:54 -07:00
Michel Weststrate
e26a8c5ad0 Provide standardised MasterDetail
Summary:
Noticed in reviews during the convertathon there is still quite some boilerplate in things that happen on the boundary of UI and plugin state, such as setting up menu entries and providing common functionality like clear, master/detail layout, etc.

This diff introduces the `MasterDetail` component, which takes a higher level approach by merely needing to provide the state atoms and desired features, and taking care of the wiring.

Applied it to createTablePlugin, to prove that going from `createTablePlugin` to `MasterDetail` will be a much smaller step now.

Verified on the funnel logger plugin

Reviewed By: passy

Differential Revision: D28090362

fbshipit-source-id: 146f8c315fea903901ad4e3e46711642f16cf0e6
2021-04-29 07:31:54 -07:00
Michel Weststrate
05bf55419f Introduce createTablePlugin
Summary: This diff exposes the createTablePlugin from flipper-plugin, so that createTablePlugin based plugins can be converted to Sandy as well

Reviewed By: jknoxville

Differential Revision: D28031227

fbshipit-source-id: 8e9c82da08a83fddab740b46be9917b6a1023117
2021-04-28 12:28:37 -07:00
Michel Weststrate
bbcb16d8fb Make DataTable / DataInspector unit tests predictable
Summary: Having time / async / non-blocking behavior in components in unit tests is really annoying, as it makes unit tests async without an easy way to determine 'done'. This diff makes sure that DataTable & DataInspector don't break down their work in smaller tasks, but do everything block if they are running in a unit test.

Reviewed By: nikoant

Differential Revision: D28054487

fbshipit-source-id: 72c3b519e092ad69ed71eb1731e1fed80022f91f
2021-04-28 06:33:04 -07:00
Michel Weststrate
39be769bab DataInspector renames
Summary:
Two minor renames:
* `DataInspector` => `DataInspectorNode`
* `ManagedDataInspector` => `DataInspector`

This aligns the internal and public name of the component, and better captures the meaning of the original `DataInspector` class.

The diff looks quite hefty, but that seems to be a phabricator issue caused by the filename swap; barely a thing changed :)

Reviewed By: jknoxville

Differential Revision: D28028554

fbshipit-source-id: d3d61fcb50abffaeae4bd1d26966604cece37b03
2021-04-28 06:33:04 -07:00
Michel Weststrate
8e02b2ec10 Expose Toolbar from Sandy
Summary: Moved Toolbar to flipper-plugin. No further changes.

Reviewed By: nikoant

Differential Revision: D28027334

fbshipit-source-id: 35de13d87734ae3a8af037166945b1a669106274
2021-04-28 05:48:20 -07:00
Michel Weststrate
d6c74c4e2f Support natural sizing
Summary:
Introduced the `scrollable={false}` option to DataTable, that gives the table its natural size, while still having all the other gimmicks of DataTable, like search, filter, etc etc.

To implement this, a non-virtualizing rendering is needed, which is handled by the `StaticDataSourceRenderer`

Also introduced the option to hide the searchbar.

Reviewed By: nikoant

Differential Revision: D28036469

fbshipit-source-id: 633c4f7f3fabfa99efa2839059aaa59b0a407ada
2021-04-28 05:48:20 -07:00
Michel Weststrate
00e4d2440d Support providing records directly to DataTable
Summary: This diff allows using a DataTable without setting up a full datasource, which is simpler in case the dataset is small and/or fixed. For an continuously growing dataset a DataSource should still be set up.

Reviewed By: jknoxville

Differential Revision: D28037897

fbshipit-source-id: 2e56b1970e19f967c3752a78737b8f7a3f934b87
2021-04-27 14:53:40 -07:00
Michel Weststrate
d26ea5fa46 Allow onExport handler to return nothing
Summary:
In many cases, the onExport handler doesn't try to customise the format, but merely fetch some additional information before creating an export.

By allowing the `onExport` handler to also return nothing, and instead merely update existing state, this case will be easier to express now;

Reviewed By: nikoant

Differential Revision: D28026558

fbshipit-source-id: 2b90b3e1ced6a6a5b42938b6f6b74b0eb9ceafc0
2021-04-27 14:53:40 -07:00
Anton Nikolaev
140cf38ffd Expose subscribe / unsubscribe functions from Atom
Summary: Allow subscribing to Atom state changes

Reviewed By: mweststrate

Differential Revision: D28027692

fbshipit-source-id: 24fd7ea16b013c364bbb1d25b30c48bc698db014
2021-04-27 09:31:11 -07:00
Michel Weststrate
37a7b16774 Introduce Tabs
Summary:
Ant'd tabs didn't allow for vertical fill out. Introduced our own tiny wrapper that has `grow` by default.

Also made sure the users last selection is remembered.

Reviewed By: cekkaewnumchai

Differential Revision: D28026345

fbshipit-source-id: 7703bc241cd1427336b7c917bdb5be9f56bba9b9
2021-04-27 08:13:16 -07:00
Michel Weststrate
34e5e3a11a Fine tuning and docs for Panel
Summary: Better documentation for Panel. Fixes styling issue for uncollapsible panels

Reviewed By: passy

Differential Revision: D28025557

fbshipit-source-id: db0f9fd44f501fa36be3fc31ebbe7917d7c0a88c
2021-04-27 08:13:16 -07:00
dependabot[bot]
1842674d00 Bump react-virtual from 2.6.1 to 2.7.1 in /desktop (#2235)
Summary:
Bumps [react-virtual](https://github.com/tannerlinsley/react-virtual) from 2.6.1 to 2.7.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/tannerlinsley/react-virtual/releases">react-virtual's releases</a>.</em></p>
<blockquote>
<h2>v2.7.1</h2>
<h2><a href="https://github.com/tannerlinsley/react-virtual/compare/v2.7.0...v2.7.1">2.7.1</a> (2021-04-16)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>replace Object.assign with property assignment (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/117">https://github.com/facebook/flipper/issues/117</a>) (<a href="6b241fddef">6b241fd</a>)</li>
</ul>
<h2>v2.7.0</h2>
<h1><a href="https://github.com/tannerlinsley/react-virtual/compare/v2.6.2...v2.7.0">2.7.0</a> (2021-04-15)</h1>
<h3>Features</h3>
<ul>
<li>use binary search to calculate range (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/114">https://github.com/facebook/flipper/issues/114</a>) (<a href="55356390d9">5535639</a>)</li>
</ul>
<h2>v2.6.2</h2>
<h2><a href="https://github.com/tannerlinsley/react-virtual/compare/v2.6.1...v2.6.2">2.6.2</a> (2021-04-13)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>measureRef type in VirtualItem, add missing onScrollElement, scrollOffsetFn (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/110">https://github.com/facebook/flipper/issues/110</a>) (<a href="08920a8f36">08920a8</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="80dba579dc"><code>80dba57</code></a> chore: remove ts-toolbelt (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/118">https://github.com/facebook/flipper/issues/118</a>)</li>
<li><a href="6b241fddef"><code>6b241fd</code></a> fix: replace Object.assign with property assignment (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/117">https://github.com/facebook/flipper/issues/117</a>)</li>
<li><a href="55356390d9"><code>5535639</code></a> feat: use binary search to calculate range (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/114">https://github.com/facebook/flipper/issues/114</a>)</li>
<li><a href="4e08b8018c"><code>4e08b80</code></a> fix:scrollOffsetFn not included in effect dependency list (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/111">https://github.com/facebook/flipper/issues/111</a>)</li>
<li><a href="08920a8f36"><code>08920a8</code></a> fix: measureRef type in VirtualItem, add missing onScrollElement, scrollOffse...</li>
<li>See full diff in <a href="https://github.com/tannerlinsley/react-virtual/compare/v2.6.1...v2.7.1">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=react-virtual&package-manager=npm_and_yarn&previous-version=2.6.1&new-version=2.7.1)](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/2235

Reviewed By: passy

Differential Revision: D27999982

Pulled By: priteshrnandgaonkar

fbshipit-source-id: abff7d19fa682f5f3d00bbc5009d2446a4fa26b7
2021-04-27 03:51:35 -07:00
Michel Weststrate
844abca78c Expose logger from client
Summary: The `logger` was currently only available in a React context, and not directly exposed from the `client` API as well. This diff fixes it. The infrastructure including test stubs were present already, so the change is minimal.

Reviewed By: nikoant

Differential Revision: D28010120

fbshipit-source-id: cdd09ed236f5d92d07005d4e5a699360596281e4
2021-04-27 01:43:42 -07:00
Michel Weststrate
c89d18fd68 Introduce DataList
Summary: Introduce the DataList component. Not feature complete yet, but core functionality is present so that people can use it during the convertathon. It is used to implement the route list in the network mock dialog

Reviewed By: priteshrnandgaonkar

Differential Revision: D27046716

fbshipit-source-id: a247ce7032b350b31bf55962ca4268e30f43471a
2021-04-27 01:43:42 -07:00
Michel Weststrate
c005753018 Expose Panel and useLocalStorageState
Summary: Expose a Panel api from Sandy, which is quite similar to the old one, except that it uses Antd, and it will remember the users closed / open preference through sessions, a much requested feature.

Reviewed By: nikoant

Differential Revision: D27966607

fbshipit-source-id: 9b18df377215c1e6c5844d0bf972058c8c574cbb
2021-04-23 09:29:59 -07:00
Michel Weststrate
faf8588097 Minor improvements
Summary:
Some styling fixes and minor improvements in DataTable, used by network plugin:

- be able to customise the context menu
- be able to customise how entire rows are copied and presented on the clipboard to be able to deviate from the standard JSON
- deeplink handling was made async, this gives the plugin the opportunity to first handle initial setup and rendering before trying to jump somewhere which is a typical use case for deeplinking

Reviewed By: passy

Differential Revision: D27947186

fbshipit-source-id: a56f081d60520c4bc2ad3c547a8ca5b9357e71a1
2021-04-23 09:29:59 -07:00
Michel Weststrate
18491dac11 Fixed issue where split container with null elems woudn't use remaining size
Summary:
This fixes an issue where `Layout.Top/Right/Left/Bottom` would not render its secondary child in the remaining size, if the primary child is empty (`null`). This is caused by React not rendering anything for null children, and as a result the CSS rules for the primary child would then match the second child.

In the example below making the component tree invisible if there are no bundles in the NT/Bloks plugin. Fixed by rendering a zero sized element instead.

Reviewed By: jknoxville

Differential Revision: D27793382

fbshipit-source-id: 1e76b51986c30a6a0d98e9356fcad4dd8d5d5f91
2021-04-15 07:48:33 -07:00
Michel Weststrate
0fe879c838 Improve multiple element selector UI
Summary:
Layer selection is pretty easy to miss, as reported in for example: https://fb.workplace.com/groups/flippersupport/permalink/1098169193997071/

Moved the layer selection to the top of the view and gave it some highlighting + dynamic height. The section is no longer collapsible.

Changelog: [Layout] Make the layer selection more prominent

Reviewed By: priteshrnandgaonkar

Differential Revision: D27708650

fbshipit-source-id: c86a55c3a20794aee86e64b6766b2ca4dd6b563f
2021-04-15 07:48:33 -07:00
Michel Weststrate
5db2ef1275 Perf fixes
Summary:
This diff fixes some more perf bottlenecks in the layout inspector (see the diffs earlier in the stack for the total picture). Mostly:

1. Pass down stable refs from the root for callbacks and configuration
2. Remove the deep-equality check in the sidebar section rendering, which has a pretty significant constant overhead, especially if the selection didn't change
3. If the selection changes, the correct semantics is to reset the sidebar rather than trying to reconcile the elements. (A consequence of this is that Panel collapse state isn't preserved atm after changing selection, will address that in a later diff)

This reduces average render time for sidebar from ~20 to ~2 ms.

Reviewed By: priteshrnandgaonkar

Differential Revision: D27677353

fbshipit-source-id: ba183b7e3d778c0b3c8e7ca0d51535ce99a097ca
2021-04-15 07:48:33 -07:00
Michel Weststrate
7d9495027b Fix layout inspector re-rendering all elements on all changes
Summary:
Changelog: [Layout] Addressed several performance issues in the layout plugin

This diff and a few of the next stuff fix some performance issues in the Layout plugin. This diff fixes an issue where computing the context menu will cause all rows to render at all times, make the responiveness of the plugin quite slugish.

The fix in this case is to build up the context menu lazily, and pass a stable ref to the function through the tree, rather than a new menu every time the root component renders.

The changes in this diff and the next ones in total reduces the time (in prod builds) to draw a frame from ~200ms to ~5ms.

Reviewed By: cekkaewnumchai

Differential Revision: D27685983

fbshipit-source-id: a48b2ce2cdd1db31bb13122924617cbc3b6c198a
2021-04-15 07:48:33 -07:00
Michel Weststrate
69de9bc92d Initial move to flipper-plugin
Summary:
This diff moves the core of ElementsInspector to flipper-plugin and decouples it from legacy design system and Electron, without any significant improvements or API changes yet, which will follow later.

Colors and docs will be added later in this stack.

Reviewed By: passy

Differential Revision: D27660300

fbshipit-source-id: 96abfa3b3174fa852cf04ae119c23c3d629fee74
2021-04-15 07:48:33 -07:00
Michel Weststrate
53c557f923 Move DataInspector to flipper-plugin
Summary:
This diff moves the rest of the DataInspector jungle to flipper-plugin. No actual improvements are made yet, but the code is decoupled from Electron and the legacy theming. For example by using Antd based context menus.

Note that `ManagedDataInspector` is now rebranded `DataInspector`, as that is the only variation that should (and is) used publicly.

For the interactionTracker removal, see next diff.

SearchableDataInspector will be addressed in a next diff

Reviewed By: passy

Differential Revision: D27603125

fbshipit-source-id: 188bd000260e4e4704202ce02c7fc98319f0bc22
2021-04-07 07:55:13 -07:00
Michel Weststrate
9030a98c6e Move DataDescription utility to flipper-plugin
Summary:
Another utility component used by DataInspector.

Colors have been hardcoded for now, to decouple from the classic Flipper color palette. Will organize this better later in this stack, and when addressing / adding support for dark mode.

Buttons, checkboxes, selects have been replaced by Antd's counterpart.

Unlike ManagedDataTable, the DataInspector is primarily moved rather than copied & adapted, as the underlying abstraction / API won't change significantly. So the changes here will immediately affect all plugins in Flipper using this component.

Reviewed By: passy

Differential Revision: D27603126

fbshipit-source-id: bacd48c9af2b591033e7f2352627f11acb4df589
2021-04-07 07:55:13 -07:00
Michel Weststrate
b6674bf96b Move highlighter to flipper-plugin
Summary: This stack moves the DataInspector component to flipper-plugin. The first diffs will move some utility abstractions to turn this into smaller steps

Reviewed By: passy

Differential Revision: D27591890

fbshipit-source-id: d0285ca31b6c9b334000dd15c722b9bda7638d73
2021-04-07 07:55:12 -07:00
Michel Weststrate
cd27e4c010 Folder rename datatable -> data-table
Summary: just a rename, as we will have `data-inspector` folder as well in next diffs.

Reviewed By: passy

Differential Revision: D27591891

fbshipit-source-id: b1fe92cbf4be1633e623e59b694efc3f687c3413
2021-04-07 07:55:12 -07:00
Michel Weststrate
1060ea6e9e Fix message truncating failing in production builds
Summary: Message truncated worked in devs build, but failed in production build, as it JSON formatted React elements in prod build (incorreclty), while it didn't do so in Dev builds, as in dev that generates an exception (undesired) meaning the serialisation gets skipped (desired).

Reviewed By: passy, nikoant, priteshrnandgaonkar

Differential Revision: D27467280

fbshipit-source-id: 1f8e0ca4750464c778c33b69a8cf13d05f019143
2021-03-31 09:24:32 -07:00
Michel Weststrate
220ebbc601 Make autoScrolling explicit
Summary:
Changelog: Added an explicit autoscroll indicator in logs and fixed snapping

We got several reports that auto scrolling was to aggressive, so revisited the implementation and the new one is a lot more reliable. Also added an explicit indicator / button to toggle tailing.

Exposed ant's active color as well in our theme, as it gives better contrast on the buttons than Flipper purple.

Reviewed By: passy

Differential Revision: D27397506

fbshipit-source-id: 5e82939de4b2f8b89380bd55009e3fa2a7c10ec9
2021-03-31 03:44:34 -07:00
Michel Weststrate
8cd38a6b49 Fix redraw after resizing elements
Summary:
Fixed a longer standing issue where after a horizontal resize the rows wouldn't redraw until new data arrives (or the user scrolls), resulting in rendering artefacts.

Also introduced a hook to force a reflow of contents if the contents of a hook changes. It's a bit leaky abstraction, but does keep the virtualization performant if dynamic heights are used.

Reviewed By: passy

Differential Revision: D27395516

fbshipit-source-id: 1691af3ec64f1a476969a318553d83e22239997c
2021-03-31 03:44:34 -07:00
Michel Weststrate
b597da01e7 Introduce row truncation
Summary:
Changelog: Logs plugin will now automatically truncate long lines

...for a more pleasant experience where long messages don't distort things to much. (Made the buttons purple in a next diff for better contrast)

Reviewed By: passy

Differential Revision: D27395517

fbshipit-source-id: 733cd6329b979453ef3b428693be8c47c37adf4d
2021-03-31 03:44:34 -07:00
Michel Weststrate
8dadf28125 Fix layout regression in sidebar
Summary: D27233899 (dd1f2fdeaa) caused a layouting regressions. Fixed in this diff. Fixes https://fb.workplace.com/groups/flippersupport/permalink/1104019500078707/

Reviewed By: passy, fabiomassimo

Differential Revision: D27394188

fbshipit-source-id: d928c9da82beb850ff512393cbb589f625889442
2021-03-29 03:38:28 -07:00
Pascal Hartig
e4a814502a Mass bump deps
Summary:
Bumping everything that's just a patch version behind or safe-looking minor change.

Just hoping to get ahead of dependabot's next run.

Reviewed By: fabiomassimo

Differential Revision: D27367567

fbshipit-source-id: 1bf8bad02e5a9f07f5982466254f9906581230cf
2021-03-27 04:25:57 -07:00
Pascal Hartig
8c85da5bc8 Bump deps
Summary: Just trying to get ahead of dependabot and bump some easy dependencies all at once.

Reviewed By: fabiomassimo

Differential Revision: D27326687

fbshipit-source-id: 0c724c8e3a688aa9777945fcd46061284fd77969
2021-03-25 12:28:29 -07:00
Michel Weststrate
c7c75a082f Fix failing perf test
Summary: made a typescript booboo, and broke the test thereby. Also reduced the test set to avoid OOMs

Reviewed By: passy

Differential Revision: D27261187

fbshipit-source-id: bcb61bf95419421d9c33e7e0a944717797f96dfe
2021-03-23 12:56:17 -07:00
Michel Weststrate
ba8232f30d Move DetailSidebar to flipper-plugin
Summary: This moves `<DetailSidebar>` component to `flipper-plugin` and documents it. No semantic changes.

Reviewed By: passy

Differential Revision: D27234575

fbshipit-source-id: 74640602d718f84ad999f5dac0420089796ed7fb
2021-03-23 12:56:17 -07:00
Michel Weststrate
dd1f2fdeaa Move Sidebar to flipper-plugin
Summary:
This diff deprecates the Sidebar concept, and copies the implementation to Sandy (tried moving first, but since existing plugins use the Sidebar in non-flex (Layout) contexts, that the layout of several plugins, so rather deprecated the old implementation.

Instead of exposing `Sidebar` explicitly, one can now put the `resizable` flag on a Layout.Top/Left/Bottom/Right, which makes building layouts even simpler, see demo.

The gutter logic was moved to the new implementation, since that was only used by the Sandy chrome anyway.

Changelog: Layout.Top / Left / Bottom / Right now support a resizable option

Reviewed By: passy

Differential Revision: D27233899

fbshipit-source-id: fbbdeb2ebf30d49d0837705a00ea86bb07fc2ba2
2021-03-23 12:56:17 -07:00
Michel Weststrate
ea0cc7f15b Update to Immer 9 for better type inference
Summary: Per title

Reviewed By: passy

Differential Revision: D27202660

fbshipit-source-id: 074c44275a93c3fb35d2f491b51d82aa9792dd70
2021-03-22 06:25:04 -07:00
Michel Weststrate
8f90deda55 Minor UI improvements
Summary:
Addresses feedback from: https://github.com/facebook/flipper/issues/2076

- fix filtering non-string columns
- fix overflow in filter dropdown
- hide app column on all devices
- show pid column on android, to simplify filtering per app

Reviewed By: passy

Differential Revision: D27188458

fbshipit-source-id: b6180fb5a8d0a47e50dd5dc3533da3ff1b0a1a2e
2021-03-19 08:59:12 -07:00
Michel Weststrate
c648c58825 Support RegEx search
Summary:
Changelog: Restored the possibility to use Regex in logs search

Fixes:
https://github.com/facebook/flipper/issues/2076
https://fb.workplace.com/groups/flipperfyi/permalink/912753022824327/

Reviewed By: passy

Differential Revision: D27188241

fbshipit-source-id: 38ae2972c7dd3dd5cf24df87535d5ad74598cd88
2021-03-19 08:59:11 -07:00
Anton Nikolaev
f468f0e07d Produce tsc typings for "flipper" package
Summary: This diffs refactors tsc projects structure and structure of our custom typings to allow producing typescript typings for "flipper" package. In next diffs I'm going to use the produced typings to check compatibility of plugins with certain versions of Flipper, e.g. to check whether plugin is compatible with current "stable" and "insiders" version.

Reviewed By: passy

Differential Revision: D26997158

fbshipit-source-id: a0416c7139bf08ec9d175730da4c4c2a8768eeb7
2021-03-17 14:03:38 -07:00
Michel Weststrate
9d3c48fd84 Logs2 -> Logs
Summary:
Use Logs2 plugin now as the default logs plugin (by overwriting it).

See the rest of this stack

Changelog: The device logs plugin has been fully rewritten. It is faster and more reponsive, formats urls and json, and supports line wrapping and text selection. Beyond that it is now possible to sort and filter on all columns and pause and resume the log stream.

Reviewed By: nikoant

Differential Revision: D27048528

fbshipit-source-id: e18386fec6846ac3568f33a3578f4742213ecaca
2021-03-16 15:03:49 -07:00
Michel Weststrate
de92495f04 Table optimizations
Summary:
Performance fine tuning.

Did some performance fine-tuning primarily by creating a production build, and verifying the responsiveness of searching, tailing etc in the logs plugin while generating a lot of load, and finetuned based on that. For example stopped using requestAnimationFrame which is too sensitive of starving Flipper under high load, as it doesn't leave room for other events to be processed. Also made scrolling smoother by making an append 'high prio' update while taililng.

Also debounced changing the (search) filters, as that is an expensive operation we don't want to trigger on every key press

Reviewed By: passy

Differential Revision: D27046726

fbshipit-source-id: c3efe59eb26e2d9e518325d85531a0e4a6b245ca
2021-03-16 15:03:48 -07:00