Commit Graph

315 Commits

Author SHA1 Message Date
Chaiwat Ekkaewnumchai
31bafadaa3 Rewrite ContextMenu and ContextMenuProvider to Use Modern Context
Summary: per title

Reviewed By: mweststrate

Differential Revision: D20197959

fbshipit-source-id: 395eba0f1e2f4606a70067a63aa91a2f2a732afd
2020-03-03 12:58:42 -08:00
Anton Nikolaev
2bd61bca87 Typescriptify the main process code (13/N)
Summary: Converted src/utils/icons.js to typescript

Reviewed By: passy

Differential Revision: D20076060

fbshipit-source-id: fa6309033f5de7183de7f85ac8318eec36b6bb69
2020-02-27 05:45:24 -08:00
Pritesh Nandgaonkar
abb2dc72ee Fix the broken notification click
Summary:
This diff fixes the broken deeplink to the notifications hub when one clicks on the macos native notification. See the bug reported [here](https://fb.workplace.com/groups/220760072184928/permalink/532998544294411/)

This [post](https://fb.workplace.com/groups/220760072184928/permalink/532998544294411/) reports the bug.

Reviewed By: passy

Differential Revision: D20089749

fbshipit-source-id: 8061ae07c450fd674795af4c5be53ce77402c063
2020-02-25 08:09:59 -08:00
John Knox
20db85adf4 Add archived device visualizer
Summary:
Adds a visual indicator of layout nodes when using an archived device.

The "device" window isn't movable for some reason. I've tried the movable and draggable attributes but with no luck. It would obviously be good to fix that but I think its probably shippable as is, and I don't have any more ideas about how to do it.

Reviewed By: passy

Differential Revision: D19885719

fbshipit-source-id: 186ba38c85afee18ce111e30187bdccd9b919025
2020-02-21 07:19:13 -08:00
Michel Weststrate
2dad8809c4 Fix performance issues [1/N]
Summary:
This issue fixes a bunch of performance issues:

* The introduction of a context menu around every _row_ in D18808544 breaks the internal contract between lists and rows that react-window has, causing empty element to appear during scrolling, and some optimizations not working. Fixed by wrapping the context menu at the right level
* Every time a new row is created for the listview, it gets fresh event handlers and column configurations. THis has been fixed by precomputing the column configuration and avoiding the need to close over the row data in the event handlers
* Added some stricter immutable typings to make sure we don't break the immutable contract somewhere
* Fix the introduction of on the fly styling generation, which isn't needed

Reviewed By: passy

Differential Revision: D19853595

fbshipit-source-id: dc82b6586889f4e8c7a437cfdc27a50dc33ba2a2
2020-02-20 04:39:35 -08:00
Michel Weststrate
97f9b2494d Fix tooltips causing entire app to rerender
Summary:
Hovering a tooltip container would cause the full application to re-render. (Even if there isn't an actual tooltip!).

Fixed it by killing legacy context code, and using proper fragments rather than returning arrays.

Reviewed By: priteshrnandgaonkar

Differential Revision: D19969775

fbshipit-source-id: 59f6470d03b6c476305681fde7bbe3f0dca063aa
2020-02-19 22:17:24 -08:00
Jonathan Thomas
014524ec26 Introduce way to clear SearchableTable search term on mount
Summary:
In order to link to this plugin multiple times, we want to be able to clear the existing search term on entry.

This change adds a check to the `componentDidMount` section of `Searchable` to see if we want to update the existing search term from the saved state, or use the one inherited from props.

We call it from the Network tab depending on if an explicit default search term has been set, so normal navigation to and from the plugin still preserves the default behavior -- only when we enter from a `selectPlugin` call does this overwrite the existing term.

Reviewed By: mweststrate

Differential Revision: D19794860

fbshipit-source-id: 4a2b1221acc0732ffc321a16a5eee8348da019f5
2020-02-11 07:22:18 -08:00
Anton Nikolaev
b9e7f5d6d1 Install plugin from package file
Summary:
Adding a way to install plugins directly from package files. This is required for testing after packaging format changes.

Stage 3: Implemented installation of plugins directly from package file.

Reviewed By: jknoxville

Differential Revision: D19765619

fbshipit-source-id: 57f36c87d3cf5d4e1c9a1f8f9f9f32b14a18bc8b
2020-02-06 09:43:27 -08:00
Anton Nikolaev
984cdbfb67 Install plugin from package file
Summary:
Adding a way to install plugins directly from package files. This is required for testing after packaging format changes.

Stage 2: Added new component for file selection and implemented UI required for plugin installation from package file

Reviewed By: priteshrnandgaonkar

Differential Revision: D19743998

fbshipit-source-id: 1112d5afca9a649df11e33eb6ac15c0e06747d47
2020-02-06 08:01:36 -08:00
Michel Weststrate
c33dbce242 Fix styling of listview disabled items
Summary: Also improved some paddings

Reviewed By: passy

Differential Revision: D19640179

fbshipit-source-id: 44aa91d452fc857533c638e00d4fe9648592b6f2
2020-01-30 07:06:06 -08:00
Pritesh Nandgaonkar
40359a9b68 Added a radio button when Listview is used for single select
Summary: Added radio buttons when the listview enforces single selection

Reviewed By: mweststrate

Differential Revision: D19626710

fbshipit-source-id: 9220fad7b0825cac5ba39def4d5e85d671c61da7
2020-01-30 05:58:41 -08:00
Robin Giese
9699691eb6 Flipper: Fix exception in popup menus
Summary: When JavaScript fiction meets native interop reality, things get weird. Apparently some coordinates must be integer values.

Reviewed By: mweststrate

Differential Revision: D19606677

fbshipit-source-id: 88a6e8c465e59078b070b56b37eee571274c494a
2020-01-28 15:38:06 -08:00
Michel Weststrate
23625f7a89 Change star concept to enabled
Summary:
The 'starring' concept of plugins no longer covers the meaning of 'starring', as unstarred plugins will no longer receive data from background plugins, not be available in support request forms due to a lack of data etc. So this diff renames the feature to 'enabled'.

Also fixed an issue where selecting a non-enabled plugin wouldn't show it in the sidebar if the additional plugins are collapsed.

To make disabled plugins more clear, they are . now always rendered in gray.

The toggle button now delays its effect for better visual feedback

- [x] update side bar styling
- [x] remove bottom bar warning
- [x] details screen
- [ ] only open connection for active plugins (will be done in a next diff)
- [x] check archived / imported devices
- [x] make sure device plugins work correctly
- [x] check without GK's

Reviewed By: jknoxville

Differential Revision: D19470326

fbshipit-source-id: 9160a3434287561f56b1b741d5ba282ab6063ea8
2020-01-27 04:04:19 -08:00
Carmi Grushko
cbb8d97d86 Apply word-wrap:break-word; to detail values
Reviewed By: timur-valiev

Differential Revision: D19554394

fbshipit-source-id: c513c10c77420e74e8f8361440d4753bfc889248
2020-01-24 06:46:38 -08:00
Timur Valiev
ff26deedd7 Add default search term in Searchable
Summary: Add a way to provide default search term; similar to default filters

Reviewed By: mweststrate

Differential Revision: D19449561

fbshipit-source-id: 6845ae5d2e058fe68974ac7aa8fd7b45814c2002
2020-01-20 10:19:38 -08:00
Michel Weststrate
c8ebb7caaf Fix layout of clear icon
Summary:
Flipper clear icon was hidden, this fixes it

Also fixed a null pointer exception that would occur when clearing search with the keyboard, and no filters were active

Reviewed By: passy

Differential Revision: D19445833

fbshipit-source-id: 213c28dc8c1e295018e6318f86604d96d2a9b75c
2020-01-17 06:30:10 -08:00
John Knox
2f3b9e1be9 Increase line height of markdown text
Summary: Lines were a bit squashed together. Taken the value from workplace, as that's the style we've been copying so far.

Reviewed By: priteshrnandgaonkar

Differential Revision: D19430279

fbshipit-source-id: 52cc8167d6acaa6af42caaa67a693b5fda492701
2020-01-16 09:39:52 -08:00
Michel Weststrate
e7780530df Fixed #647, urls are not editable in shared preferences
Summary:
As reported in https://github.com/facebook/flipper/issues/647 urls are not editable in our generic data inspector, as clicking an url will immediately open it, rather than going to edit mode.

This diff fixes that by appending an edit icon to URL previews.

Reviewed By: jknoxville

Differential Revision: D19428925

fbshipit-source-id: 428e8e4c10fb472792b61986d915658f7581c38d
2020-01-16 06:53:15 -08:00
Timur Valiev
11e134e87c Pick colors in mscreen from pallet
Summary:
{F226170897}
Color picker based on Lite's color table
We can't use standard color picker because of FB Lite's limitation: color set is predefined and sent from the server
'extra' field and 'color-lite' type are added to field description

Reviewed By: jknoxville

Differential Revision: D19330480

fbshipit-source-id: 695d288b4b8409e8b63a9e461a41914379d75a8c
2020-01-13 15:10:59 -08:00
Pascal Hartig
b2c3125a1a Upgrade invariant types
Summary: The new type defs make use of TypeScript 3.7 assertion functions which means they actually have a semantic effect on the rest of the lexical unit, which is quite neat.

Reviewed By: mweststrate

Differential Revision: D19348035

fbshipit-source-id: 3c7a21b5bece091c32f8879fed12d8e46e205ea4
2020-01-13 07:45:12 -08:00
Chaiwat Ekkaewnumchai
2f0f694cf5 Fix Unselected Enum Filters Showing up
Summary:
Filter type enum works differently than what I understood; its value is not inside the column.

Move the enum checking to before others because text matching relies on column value.

In addition, change the behavior when there is no column (from ignoring the search to causing all row to disappear due to mismatch ing)

Reviewed By: mweststrate

Differential Revision: D19345758

fbshipit-source-id: d49bc0e29d7a3d36f3aad20213791211c2c3065b
2020-01-10 08:50:01 -08:00
Michel Weststrate
59c9a10a73 Fix random warnings in several plugins
Summary: Click through plugins and fix warnings until tired.

Reviewed By: jknoxville

Differential Revision: D19253740

fbshipit-source-id: 87b6d6b103ee51c7b5579a128a15c3bb9d71b432
2020-01-02 08:22:31 -08:00
Chaiwat Ekkaewnumchai
9b84de0c0a Ignore Non-existed Key in Searchable to Prevent Flipper from Crashing
Summary: per title

Reviewed By: mweststrate

Differential Revision: D19143735

fbshipit-source-id: 67cb65a98760a82fd71073621bcbca819ebb1e5f
2019-12-18 07:30:14 -08:00
Chaiwat Ekkaewnumchai
db721e94a6 Clear Search Input After Entering It
Summary: per title

Reviewed By: nikoant

Differential Revision: D19143025

fbshipit-source-id: b371a55584b255b8f0a704eaa46e6a3eebad4a79
2019-12-18 05:00:46 -08:00
Alexander Putilin
c7af0b53e6 KaiOS device plugin for recording memory allocations
Summary:
This adds basic plugin for recording memory allocations.
{F224005997}

Reviewed By: passy

Differential Revision: D18837209

fbshipit-source-id: aa29680b3a44c51135b760fe4ee76edc6d0ec109
2019-12-12 08:12:52 -08:00
Anton Nikolaev
c0f902f81a Upgrade to emotion v10
Summary: React 16 is not compatible with react-emotion 9 (it prints warnings, see also https://github.com/emotion-js/emotion/issues/644). So we should upgrade to 10.

Reviewed By: mweststrate

Differential Revision: D18905889

fbshipit-source-id: c00d2dbbadb1c08544632cb9bfcd63f2b1818a25
2019-12-11 09:43:24 -08:00
Pritesh Nandgaonkar
0c13943139 Allow user to copy the row attributes in the layour inspector
Summary: Allows user to copy the row attributes.

Reviewed By: passy

Differential Revision: D18811929

fbshipit-source-id: 62335a7c0b5f1557704c0d8d9ea258b4c7cbfdcf
2019-12-09 05:10:06 -08:00
Pritesh Nandgaonkar
e1e2978b19 Add copy cell option in network plugin
Summary: Puts a context menu in the sidebar for the network plugin. Before, user was not able to select the text from sidebar

Reviewed By: passy

Differential Revision: D18808544

fbshipit-source-id: bdbc86972cd1d508e9b7d96da9df5c8e53bec991
2019-12-04 08:12:05 -08:00
Michel Weststrate
c16625c278 Add explanation banner
Summary: Add a quick banner to give some more context on the bug report feature

Reviewed By: jknoxville

Differential Revision: D18807556

fbshipit-source-id: b2de614ccfd30a22f418b60d6f08066c57759deb
2019-12-04 02:55:39 -08:00
Michel Weststrate
c332f4145a Stop using deprecated lifecycle methods
Summary:
Some lifecycle methods are deprecated now. Where they can be replaced easily I replaced them. Where they can't be updated easily I marked them as unsafe, as if a bigger refactoring is required for those components, we'd better convert them to function components instead.

Didn't update the plugins as they are ideally updated by their owners.

Didn't update styled components, there is a separate task for that.

Reviewed By: jknoxville

Differential Revision: D18780579

fbshipit-source-id: 132a3789875ab6a3caee582b0e5f7feb7dc4a4c1
2019-12-03 06:50:43 -08:00
John Knox
8a616b2d88 Delete comma from popover
Summary: Looks like this got accidentally added here: https://our.intern.facebook.com/intern/diff/D18397950/

Reviewed By: mweststrate

Differential Revision: D18779992

fbshipit-source-id: 7a61cda4a9a4287ebc56acb5d2b85fce8e3381e3
2019-12-03 06:28:50 -08:00
Michel Weststrate
b1fb67c9c4 Improve error handling / roundtrip behavior
Summary:
Slightly improves the support form interactions / code flow:
* When uploading, input fields are hidden
* WHen upload succeeded: Show link to final post
* When upload succeeded: be able to start a new bug report
* Styled error messages, and unified error flow
* Don't support report if errors occurred

Reviewed By: priteshrnandgaonkar

Differential Revision: D18779791

fbshipit-source-id: 28e873d0509865c66d861fe9cedb62a31f0e8bae
2019-12-03 03:59:24 -08:00
John Knox
d791814dfa Validate input fields
Summary: Adds basic non-empty validation to title and description.

Reviewed By: mweststrate

Differential Revision: D18762778

fbshipit-source-id: 4bdbb550f4e740d399fbeaa9fb8170b801fc500e
2019-12-02 10:22:51 -08:00
Michel Weststrate
da14b6ac56 Fix App name prefilling, improve markdown layout
Summary:
Make sure appname is prefilled
Slightly improved layout of markdown

Reviewed By: jknoxville

Differential Revision: D18761477

fbshipit-source-id: 00184a0a4c6d1b5a779c3d3168f587e75e363433
2019-12-02 08:37:26 -08:00
John Knox
beff2c4cac Display post preview before submitting support request
Summary:
The Markdown component wasn't rendering a single component, so I put it in a container.
Also added a margin bottom so it didn't look out of place. There's probably a nicer way to do that.

Reviewed By: mweststrate

Differential Revision: D18749381

fbshipit-source-id: ea7827dc7e6141fb0dbd5886356736da4b50f5dc
2019-12-02 04:28:10 -08:00
Michel Weststrate
2bee9ec9e7 Fixed circular dependency warnings
Summary:
Nobody moves the hackathon!

Fixed some circular deps warnings while waiting for another Diff to land

Reviewed By: priteshrnandgaonkar

Differential Revision: D18749645

fbshipit-source-id: 225fbea428dca02f0f4c920ee47b4ece3c3e370b
2019-12-02 02:05:38 -08:00
Michel Weststrate
ac8879c503 Add clear diff button, style recording button
Summary:
* Added a button to clear Diff selection
* Added icons and color to the recording button
* Made App input field readonly

Reviewed By: priteshrnandgaonkar

Differential Revision: D18748538

fbshipit-source-id: 00ffb5d5c36f8f5394a353602f182aabd8237ee7
2019-11-29 08:28:25 -08:00
Michel Weststrate
2bd87a8100 Improve layout of screenshots and videos
Summary: The previous table was ugly, and weirdly interactive. This diff changes it to a static layout

Reviewed By: priteshrnandgaonkar

Differential Revision: D18744712

fbshipit-source-id: 9060da07eae836a94ce6d8bb2ebb8a6a54470daa
2019-11-29 06:21:56 -08:00
Michel Weststrate
e99f2bcd8b Apply styling to support details form
Summary:
Applies some additional styling to the support details form, and implemented the screenshot / video styling.

Probably needs some more fixes in the future, once we have a real report to import :)

Reviewed By: jknoxville

Differential Revision: D18658388

fbshipit-source-id: dc9207ec08b3f4360c96d8d14980710c57d6b5ec
2019-11-26 09:37:57 -08:00
Michel Weststrate
a66501d7a6 style video recording section
Summary: style video recording section

Reviewed By: jknoxville

Differential Revision: D18658103

fbshipit-source-id: 450ed1e3a1ee4330183f14b2c00486649087c3bb
2019-11-22 09:47:51 -08:00
John Knox
3f7fa0eb1a Use workplace markdown style
Summary: Mimicking the workplace markdown style so people feel more familiar with it and don't get surprises when posting.

Reviewed By: passy

Differential Revision: D18639041

fbshipit-source-id: 0097087b8ae4da8e29609604eeffd5b349ebe7ab
2019-11-22 07:02:49 -08:00
John Knox
018ed212bc Improve markdown header spacing
Summary:
The spacing above headings didn't look right.

Also workplace purposely limits the different heading sizes to 2 to encourage using notes for large posts. So I'm changing this to match. If we need to have arbitrary depth in future, we can add a `workplaceMode` toggle, but so far that's the only use case we have.

Reviewed By: mweststrate

Differential Revision: D18638861

fbshipit-source-id: 3949a37515e4282bb8435c2740ef45a55e5a97cc
2019-11-22 07:02:49 -08:00
John Knox
d7cfefb2bd Add markdown preview to support request composer
Summary:
Adds a side-by-side markdown preview to the support form.
No time spent on UI because it makes sense to do it all together.

There also seems to be a problem with state updates not propagating when values are changed, so currently it never gets updated.

Reviewed By: passy

Differential Revision: D18638025

fbshipit-source-id: c4a49286434c7e2e85d532aef3a36924e02a4467
2019-11-22 07:02:48 -08:00
Michel Weststrate
fef8d5a50f style support request form
Summary:
Styles the create support request form similarly to the details form, using the standard UI components.

N.B. Video section styling will be a separate diff

Reviewed By: jknoxville

Differential Revision: D18637989

fbshipit-source-id: f1cc6967b6841a55e770043f330e1a87ac7bfb50
2019-11-21 11:16:41 -08:00
Michel Weststrate
f33666a4b9 Diff and update mobile configs
Summary:
This diff makes it possible to apply MC's to a currently running as part of the support form process.

Things _NOT_ done in the diff:

* make sure getUniverses and getGatekeepers returns valid configs (this broke since somewhere last week, opened T57918601 for that. However, before that this worked correctly
* provide a more interactive UI when applying MC's, such as beeing able to see a diff preview, ask confirmation before overriding current config, etc

Reviewed By: jknoxville

Differential Revision: D18452172

fbshipit-source-id: da3f24bccf88260282f86e2564e983a9ee217c2f
2019-11-21 08:01:49 -08:00
Michel Weststrate
5589a1b77b Introduce Info / VBox / HBox / Labeled for more consistent layouting
Summary:
This diff introduces a set of components:

VBox: use this to group things vertically, it little more than a container that fills the full width and adds bottom margin (see screenshot: creating distance between the boxes)

HBox: use to divide a space horizontal in two, and distribute it over two children, supports growing the right side, left side or both equally. In the image used to reserve the necessary width for the image, and give the remaining space to the text

Info: A component that shows a message, prestyled with one of the four types: info, error, warning, pending.

{F222993480}

Reviewed By: jknoxville

Differential Revision: D18595291

fbshipit-source-id: 1957db1b606b2e44e3104b10d32ad8ce75af6adc
2019-11-21 06:30:09 -08:00
Anton Nikolaev
ddb135ac39 Basic Doctor UI
Summary:
- Basic Doctor UI showing issues with installation
- Run healthchecks in background on startup and show warning message if something is wrong

Reviewed By: jknoxville

Differential Revision: D18502599

fbshipit-source-id: 194939a080ba7412ed3293d95c533bfad7031d3b
2019-11-21 03:10:36 -08:00
John Knox
352d9c82cb Add Markdown component to render markdown
Summary:
Adds a Markdown component to the component library.

The react-markdown library doesn't work out of the box because elements it outputs don't have any styles, e.g. h1, h2, p, em, etc.

So I've added a custom renderer to give styles to each of these that workplace markdown uses.
The only one I haven't done at the moment that I'm aware of is numbered-lists.

There's probably a way to get back the original styling of these elements so we don't need a custom renderer, but this works for now, and also allows us to customise their appearance.

Reviewed By: passy

Differential Revision: D18533085

fbshipit-source-id: a4332a11d34d577a6300074e4dde126362d46a6b
2019-11-19 05:52:51 -08:00
Michel Weststrate
f22e373136 Improve support request details import form
Summary:
Created as standard layout that can be used for both the import and export form

Standardized components used, so that we work towards a Design Framework that is consistent. Took inspiration from some existing plugins.

Also fixed weird sidebar transparency.

Reviewed By: passy

Differential Revision: D18504078

fbshipit-source-id: 7649abf7aa3eba8ba635337a41274bba93738e81
2019-11-18 02:21:15 -08:00
Michel Weststrate
0a8222410c Fix React devtools experience
Summary:
Currently most components are shown anonymously in the component tree, because using `styled` creates unnamed components, shown as the HTML elements they result in.

This has two downsides:
1. React errors / warnings are really vague and it is hard to locate where they are coming from
2. The React Devtools don't show which components are rendering.
3. The effect of the latter it is hard to copy-from-example when developing plugins. This leads to a lot of inconsitency and duplication in the layouts of components

Reviewed By: jknoxville

Differential Revision: D18503675

fbshipit-source-id: 5a9ea1765346fb4c6a49e37ffa4d0b4bbcd86587
2019-11-15 02:09:32 -08:00