Commit Graph

158 Commits

Author SHA1 Message Date
Michael Mauderer
fa2e42c4e7
Fix Regression: Node not selected after adding. (#3698)
Fixes nodes not being selected after creating a new node through the searcher.

https://user-images.githubusercontent.com/1428930/189626404-a1c34bd9-3341-4644-951d-578f29eaa4d9.mp4



[ci no changelog needed]
2022-09-12 22:36:11 +00:00
Dmitry Bushev
f233ea66b3
Use Mplus1 font (#3688)
Use Mplus1 font in the welcome screen.

# Important Notes
#### Before:
![ide-causten](https://user-images.githubusercontent.com/357683/188605189-b37d4545-7b35-469f-8497-b026d1ce2e75.png)

#### After
![ide-mplus1](https://user-images.githubusercontent.com/357683/188605262-b46597b8-a622-4740-9b78-17a2f71ddaa1.png)
2022-09-09 12:47:34 +00:00
Michał Wawrzyniec Urbańczyk
b8dd92e9dc
CI and build script update (#3677)
* added polyfill globals plugin to fix issue with missing types like Buffer that was affecting nightly releases;
* fixed exit code propagation for Windows build script wrapper;
* bumped the build script and refreshed the generated workflows.

Includes https://github.com/enso-org/ci-build/pull/8
2022-09-02 22:02:44 +02:00
Dmitry Bushev
de0a231417
IDE uses new visualization API (#3661) 2022-09-01 15:33:46 +03:00
Jaroslav Tulach
d4b4a31d89
Split long lines to 1024 long chunks (#3665)
Avoid long lines when using `dom().set_inner_text` - rather split the long lines to 1024 chunks and insert them as individual `<div>` elements.

# Important Notes
I was testing the behavior on following program:
```
from Standard.Base import all
import Standard.Base.Data.Statistics
import Standard.Visualization

main =
number1 = 200000
operator1 = 0.up_to number1 . to_vector . map .noise
operator2 = operator1.sort
operator3 = operator2.to_text
```
before my change the visualization of `operator3` was blank. With my change it gets filled with data.
2022-08-29 08:02:33 +00:00
Wojciech Daniło
4b96b4887c
Better fonts support. (#3616) 2022-08-27 00:25:34 +02:00
Michael Mauderer
14c516aff3
Add api for updating searcher with selected component (#3659)
Implements [#182593882](https://www.pivotaltracker.com/story/show/182633582).

Adds API for updating Searcher with the selected suggestion. To-dos are left in the places where this will be implemented in a subsequent PR for the next task.

**Example of the debug output generated by typing into the searcher.**

![ShowSearcherInputLog](https://user-images.githubusercontent.com/1428930/186120851-7292824c-7c6e-444e-8453-5f2d234f3244.png)

**Example of the debug output generated by selecting something in the searcher.**

![ShowSearcherSelectionLog](https://user-images.githubusercontent.com/1428930/186120857-d9610eba-04fd-4e65-bb9e-71ec7bfe361d.png)

# Important Notes
For testing/QA set the `app/gui/src/lib.rs:145` logging initialization to `DEBUG` to see the console output.

[ci no changelog needed]
2022-08-26 08:33:19 +00:00
Michał Wawrzyniec Urbańczyk
4537a4b57b
Adjusting CI / build configuration. (#3664)
* Downgrading the electron-builder to avoid https://github.com/electron-userland/electron-builder/issues/6865
* Removed "git clean" workaround from CI.
2022-08-25 00:46:36 +02:00
Adam Obuchowicz
610b128bfa
Component Panel List Layout structure. (#3662)
This PR does not add anything visual for the user: it's a first part of making efficient Component Browser using fresh Grid View implementation.

The Layout is an intermediate model, which keeps the information how the groups are laid out in the Component browser, and allows querying for group entry by location and location of specific group entry (or header).

The layout is meant for the new design, where there are no section separators and Local Scope section is below Favorites.

# Important Notes
The new structure is not used in action, but tested with unit tests.
2022-08-24 19:00:31 +00:00
Jaroslav Tulach
2b9352d2fc
Lazy scatterplot for Vector & Table (#3655)
First of all this PR demonstrates how to implement _lazy visualization_:
- one needs to write/enhance Enso visualization libraries - this PR adds two optional parameters (`bounds` and `limit`) to `process_to_json_text` function.
- the `process_to_json_text` can be tested by standard Enso test harness which this PR also does
- then one has to modify JavaScript on the IDE side to construct `setPreprocessor` expression using the optional parameters

The idea of _scatter plot lazy visualization_ is to limit the amount of points the IDE requests. Initially the limit is set to `limit=1024`. The `Scatter_Plot.enso` then processes the data and selects/generates the `limit` subset. Right now it includes `min`, `max` in both `x`, `y` axis plus randomly chosen points up to the `limit`.

![Zooming In](https://user-images.githubusercontent.com/26887752/185336126-f4fbd914-7fd8-4f0b-8377-178095401f46.png)

The D3 visualization widget is capable of _zooming in_. When that happens the JavaScript widget composes new expression with `bounds` set to the newly visible area. By calling `setPreprocessor` the engine recomputes the visualization data, filters out any data outside of the `bounds` and selects another `limit` points from the new data. The IDE visualization then updates itself to display these more detailed data. Users can zoom-in to see the smallest detail where the number of points gets bellow `limit` or they can select _Fit all_ to see all the data without any `bounds`.

# Important Notes
Randomly selecting `limit` samples from the dataset may be misleading. Probably implementing _k-means clustering_ (where `k=limit`) would generate more representative approximation.
2022-08-23 12:12:22 +00:00
Michał Wawrzyniec Urbańczyk
2507a2049b
Code Signing on Windows (#3654)
This PR reenables code signing on Windows.
Each Windows package built on CI should be now signed.
Additionally, some refactorings were done around electron-builder config, so it is easier to use outside the build script and offers more configuration options.
2022-08-23 00:49:23 +02:00
Michael Mauderer
58fb383791
Create new node when opening searcher and no node is selected. (#3645)
So far, when opening the searcher with no node selected, an empty input without an associated AST node was created. This input was manipulated by the user and the final expression from the input was used to create a new node when the user confirmed their input. This PR changes this, so that when the searcher is opened without a selected node, a new AST node is created right away with some placeholder content, and this node is updated when the user confirms their input.

The only change visible to the user, is that if the text editor is opened during editing, a new node will appear in the source when the searcher is opened to create a new node. All other behaviour should stay the same.
2022-08-22 15:32:44 +00:00
Mateusz Czapliński
fc089857d0
Filtering of Virtual Entries in Component Browser by input & return types. (#3652)
Filter the Virtual Entries displayed in the Component Browser based on the input type and the return type of the edited expression. Only the Virtual Entries with matching types are displayed.

https://www.pivotaltracker.com/story/show/182842444

#### Visuals

See below for two screenshots, showing the Component Browser with an empty expression and with the input port not connected. Two virtual entries are visible, with documentation.

<img width="871" alt="Screenshot 2022-08-16 at 15 19 55" src="https://user-images.githubusercontent.com/273837/184894042-0f64986d-2c89-4c94-90cf-215467e297c7.png">

<img width="866" alt="Screenshot 2022-08-16 at 15 20 04" src="https://user-images.githubusercontent.com/273837/184894059-5089414c-c1f3-407c-a6da-38fd9c3e7c81.png">

See below for a screenshot showing the Component Browser with `5.div ` expression entered. The `div` method expects an `Integer` argument. Only the `number input` virtual component is visible.

<img width="504" alt="Screenshot 2022-08-16 at 15 23 07" src="https://user-images.githubusercontent.com/273837/184894081-358ae780-cfca-4002-b7da-4be57f0357c1.png">

See below for a screenshot showing the Component Browser with `Geo.point ` expression entered. The `point` method expects a `Decimal` argument. Only the `number input` virtual component is visible.

<img width="500" alt="Screenshot 2022-08-16 at 15 24 37" src="https://user-images.githubusercontent.com/273837/184894119-d4f5e7e1-5948-4d8f-adc4-f94a2f4c7245.png">

See below for a screenshot showing the Component Browser with `5.format ` expression entered. The `format` method expects a `Text` argument. Only the `text input` virtual component is visible.


<img width="480" alt="Screenshot 2022-08-16 at 15 55 27" src="https://user-images.githubusercontent.com/273837/184897598-465569c8-8319-43ac-9589-4384ffdc33cc.png">

See below for a video showing that the Component Browser opened with the input port connected to a typed node. The Component Browser does not show virtual entries.

https://user-images.githubusercontent.com/273837/184914619-957a7369-1019-4636-989d-96d65954642f.mov

# Important Notes
- Unused code from the old `enso_gui::controller::searcher::action::hardcoded` module is removed. The `enso_gui::controller::searcher::component::hardcoded::Snippet` type is redefined to contain only the used fields from the old `action::hardcoded::Suggestion` type.
2022-08-18 09:40:41 +00:00
Mateusz Czapliński
3c12a8c0a2
Virtual Entries in Component Browser (#3621)
Add "text input" and "number input" virtual entries in the "Input" virtual component group in the Component Browser. The entries provide an easy way to put strings and numbers into a graph.

https://www.pivotaltracker.com/story/show/181870589

#### Visuals

See below for a video showing the "text input" and "number input" virtual entries in the "Input" component group in the "Favorites Data Science Tools" section of the Component Browser. Please note that the video also displays a few known issues that are present in the existing code and not introduced by this PR:

- "Opening the Component Browser 2nd or later time flashes its last contents from the previous time" - reported as [issue 15 in PR 3530](https://github.com/enso-org/enso/pull/3530#pullrequestreview-1035698205) (which is [expected](https://github.com/enso-org/enso/pull/3530#issuecomment-1187676313) to be fixed by https://www.pivotaltracker.com/story/show/182610422).
- The text of all the entries in the Component Browser does not show immediately, but the entries appear one by one instead (this is related to the performance of the current implementation of Component Browser and Text Area).
- Selection in the Component Browser can show half-way between entries - reported as https://www.pivotaltracker.com/story/show/182713338.

https://user-images.githubusercontent.com/273837/183472391-c14eeded-481f-492e-a1b8-b86f42faf0cd.mov

# Important Notes
- The virtual entries are not filtered by input type or return type. The filtering is expected to be implemented in https://www.pivotaltracker.com/story/show/182842444.
2022-08-17 13:28:07 +00:00
Michał W. Urbańczyk
146297a0a0 CR feedback 2022-08-16 15:38:10 +02:00
Michał Wawrzyniec Urbańczyk
6c82588972
Handling exceptions in IDE main to avoid entering "zombie process" state. (#3648)
This is meant to address https://www.pivotaltracker.com/story/show/182691027.
2022-08-16 12:56:08 +00:00
Ilya Bogdanov
973946d585
Fix zooming regression in demo scene & fix switching of the navigator in the component browser (#3646)
[ci no changelog needed]

This PR fixes a [regression](https://www.pivotaltracker.com/story/show/182972359) found in the `interface` debug the scene. It was caused by multiple `Navigator`s that were present in the demo scene and conflict with each other.

Also, this PR includes a fix for the invalid logic of the new component browser. We disable `Navigator` when the mouse hovers the component browser. Still, due to a mistake in the code, the component browser was considered visible at all times and therefore blocked the navigator in certain mouse positions.

To reproduce this bug (before this PR):
1. Open a default project
2. Place the mouse somewhere in the middle of the screen (near one of the nodes)
3. Try panning or zooming the scene (you won't be able because of this bug)
2022-08-12 14:22:37 +00:00
Michael Mauderer
3a6c558418
Implement reversion of nodes after editing via searcher. (#3613)
Add functionality to revert a node that was changed during editing through the searcher.
Note that currently, nodes are not edited by the searcher, except upon confirmation, Thus this functionality results in a no-op at the moment.

# Important Notes
[ci no changelog needed]
2022-08-12 07:55:54 +00:00
Michał Wawrzyniec Urbańczyk
bd3b778721
Replace webpack with esbuild (#3592)
This PR replaces webpack with esbuild, as our bundler.

The change leads to out-of-the-box ~5x improvement in bundling times, reducing the latency in watch-based workflows. 
Along with this a new development server (with live reload capacity) has been introduced to support watch command.

[ci no changelog needed]

### Important Notes
* workflow for checking docs has been removed because it was using outdated prettier version and caused troubles; while the same check is performed in a better way by the GUI/Lint job.
* introduced little more typescript in the scripts in place of js, usually with minimal changes.
2022-08-10 03:41:44 +02:00
Ilya Bogdanov
698a6a0674
Left align component browser to the edited node (#3636)
[ci no changelog needed]

[Task link](https://www.pivotaltracker.com/story/show/181870555)

This PR changes the relative position of the edited node in such a way that it is left-aligned to the component browser window. This change reflects the most recent version of the [design doc](https://github.com/enso-org/design/blob/main/epics/component-browser/design.md#overview)

<img width="1157" alt="Screenshot 2022-08-08 at 19 15 47" src="https://user-images.githubusercontent.com/6566674/183454192-81960e0a-ab69-43a4-b7df-d13320a9d16d.png">

As an additional change, the FRP implementation of the `Camera2d` was extended with a new output (screen dimensions) and fixed. With the old implementation, there was a possibility of panic at runtime because of non-exclusive borrows of `RefCell`. The FRP event for camera position was emited inside the scope with a mutable `RefCell` borrow. Any attempt to borrow the camera one more time (e.g., by calling one of the getters, such as `zoom()`) caused panic at runtime.
2022-08-09 23:03:54 +00:00
Ilya Bogdanov
7251b6379b
Fix: Selection does not follow mouse when scrolling and can show half-way between entries (#3604)
[ci no changelog needed]

[Task link](https://www.pivotaltracker.com/story/show/182713338).

This PR fixes the implementation of the entries highlight (selection box) in the component list panel of the component browser. The previous behavior was caused by the dumb implementation of keeping the selection inside the borders of the component list panel. Now the selection is correctly clipped and is hovering over entries at all times.

Screencasts:


https://user-images.githubusercontent.com/6566674/182196585-02ab5ec4-7d12-4d7a-8563-ac95aec3c9f4.mp4



https://user-images.githubusercontent.com/6566674/182196768-9d28e83d-6c77-4ef6-abb0-98d50c4e74b7.mp4

# Important Notes
- This PR does not change the fact that after opening the component browser, the selection hovers over a random entry. See a [dedicated task](#182729573) for that.
- The selection box shape was moved from the `component_group` module because it depends heavily on list panel view implementation.
- The selection was removed from the `component_group` demo scene. We have a `component_list_panel_view` demo scene instead.
2022-08-05 12:44:21 +00:00
Ilya Bogdanov
9f8829650a
Layouting algorithm for the Favorites section (#3625)
[ci no changelog needed]

[Task link](https://www.pivotaltracker.com/story/show/181431035)

This PR implements an algorithm that arranges component groups of the Favorites section into three columns, with the more important groups being accessible by fewer keystrokes. [The algorithm description](https://github.com/enso-org/design/blob/main/epics/component-browser/design.md#layouting-algorithm).


https://user-images.githubusercontent.com/6566674/181642100-62769419-66e0-4a82-8dd8-be10662745d6.mp4
2022-08-05 09:39:51 +00:00
Mateusz Czapliński
c6835d2de7
Show custom icons in Component Browser (#3606)
Show custom icons in Component Browser for entries that have a non-empty `Icon` section in their docs with the section's body containing a name of a predefined icon.

https://www.pivotaltracker.com/story/show/182584336

#### Visuals

A screenshot of a couple custom icons in the Component Browser:

<img width="346" alt="Screenshot 2022-07-27 at 15 55 33" src="https://user-images.githubusercontent.com/273837/181265249-d57f861f-8095-4933-9ef6-e62644e11da3.png">

# Important Notes
- The PR assigns icon names to four items in the standard library, but only three of them are shown in the Component Browser because of [a parsing bug in the Engine](https://www.pivotaltracker.com/story/show/182781673).
- Icon names are assigned only to four items in the standard library because only two currently predefined icons match entries in the currently defined Virtual Component Groups. Adjusting the definitions of icons and Virtual Component Groups is covered by [a different task](https://www.pivotaltracker.com/story/show/182584311).
- A bug in the documentation of the Enso protocol message `DocSection` is fixed. A `text` field in the `Tag` interface is renamed to `body` (this is the field name used in Engine).
2022-08-01 13:41:04 +00:00
Adam Obuchowicz
2aac511ac5
Component Browser: Add title with full component name to documentation (#3598)
This is a partial workaround for https://www.pivotaltracker.com/story/show/182713407

Because some entries' names are too long to be displayed inside the Component List Panel, the user may have no clue what the method is. Therefore, we add a title to each doc page.

There is also code introduced for displaying name of modules when submodule header is selected. However, it does not work, and it's hard to fix without significant changes in the Component List Panel API and implementation. Because those will be altered when implementing [Efficient Component List Panel](https://www.pivotaltracker.com/story/show/182561072), fixing is postponed until then.

![image](https://user-images.githubusercontent.com/3919101/179717147-00329637-1f87-42ae-b54a-63840766099f.png)

# Important Notes
The code contains some significant refactoring. Removed long functions obtaining entries from the component::List - instead you can get group, and then entry from group. They return an option, which is turned to Result in the presenter (where we actually take advantage of having Result instead of Option).
2022-07-29 08:26:07 +00:00
Mateusz Czapliński
5b4aac0138
Virtual Component Groups filtered by completion IDs (#3570)
Filter the Virtual Component Groups (a.k.a. "Favorites Data Science Tools") in the `component::List` (a.k.a. Hierarchical Action List) to only contain components with IDs listed in the Engine's response to a `search/completion` request.

This completes the "Virtual Component Groups filtered by input type" task (linked below) because the Engine's response to a `search/completion` request contains IDs of components filtered by input node type and `this` type.

https://www.pivotaltracker.com/story/show/182661634

#### Visuals

See below for a video showing the list of Favorites filtered by the type of the input node. Please note that the video also displays a few known issues that are present in the existing code and not introduced by this PR:
- "Opening the Component Browser 2nd or later time flashes its last contents from the previous time" - reported as [issue 15 in PR 3530](https://github.com/enso-org/enso/pull/3530#pullrequestreview-1035698205).
- The text of all the entries in the Component Browser does not show immediately, but the entries appear one by one instead (this is related to the performance of the current implementation of Component Browser and Text Area).

https://user-images.githubusercontent.com/273837/179000801-65ee7388-dde6-44b9-90fb-7453b4fb788c.mov


A screenshot showing the default, unfiltered list of Favorites when no input node is selected:

<img width="440" alt="Screenshot 2022-07-14 at 15 58 26" src="https://user-images.githubusercontent.com/273837/179000404-f14773a3-35a9-4e7a-877d-fcbb477b4769.png">
2022-07-22 01:18:44 +00:00
Mateusz Czapliński
07df7fabf2
Show default per-kind icons for all entries in Component Browser. (#3587)
Show default icons for all entries in the Component Browser. The icons are assigned to each entry depending on its kind.

https://www.pivotaltracker.com/story/show/182584326

#### Visuals

See below for a video showing entries of 5 different kinds in the Component Browser, each having a different icon. When watching the video, please note that the following are preexisting, known issues, not introduced by this PR:
- Selection is misaligned when hovering the mouse over the "new" component in the "Mcdbg Group 1" group - reported as issue 2 [in comments to PR 3530](https://github.com/enso-org/enso/pull/3530#pullrequestreview-1034223437).
- [Names of Modules and Atoms displayed in Component Browser start with a small letter.](https://www.pivotaltracker.com/story/show/182745386)




https://user-images.githubusercontent.com/273837/179016109-c3ebab5a-0205-4b44-85b8-df3129edd75d.mov

# Important Notes
- A new derive macro `ForEachVariant` is defined and added to the `enso-prelude` crate.
2022-07-21 23:57:41 +00:00
Mateusz Czapliński
f61849ce04
Fix behavior of "No Entries." text in Component Browser when zooming. (#3589)
Fix the behavior of the "No Entries." text while zooming with Component Browser open. Previously, the text changed size and moved around while zooming; after the fix, the text keeps constant size and stays in the expected place.

https://www.pivotaltracker.com/story/show/182713626

#### Visuals

The video below demonstrates the fixed behavior of the "No Entries." text while zooming with  Component Browser open.

https://user-images.githubusercontent.com/273837/179028254-812feabc-b3ed-4e20-8a06-7c37bf82f8ea.mov
2022-07-20 09:02:31 +00:00
Ilya Bogdanov
987333e1d3
Component Browser Section Navigator (left bar) (#3553)
[ci no changelog needed]
[Task link](https://www.pivotaltracker.com/story/show/181433641)

This PR adds a left bar with section navigation buttons to the Searcher List Panel. The buttons are implemented as a list view with an adjusted style.

https://user-images.githubusercontent.com/6566674/179517378-dba00f41-d32e-4ffb-a4d9-3cd376b3e781.mp4
2022-07-20 06:35:26 +00:00
Adam Obuchowicz
7fa4e5e369
Grid View with Scrolling (#3588)
**Note**: This PR also contains content of previous Grid View PR. We decided to discard the previous, because this one did some refactoring of old one, and it's not a big addition.

Added a scrollable::GridView component, which just embeds the GridView in ScrollArea. Also, re-worked the idea of text layers.

https://user-images.githubusercontent.com/3919101/179020359-512ee127-c333-4f86-bff5-f1cb4154e03c.mp4
2022-07-19 08:39:23 +00:00
Adam Obuchowicz
b0d627a797
Component list panel integration (#3530)
This PR contains all work for finishing integration of first Component List Panel in the IDE:
* It adds a stub for the whole Component Browser View. The documentation panel is re-used from the old searcher.
* It has the presenter implementation, integrating the view with Hierarchical Component List from the controller.
* It extends the View API, so the integration is possible, making use of Component Group Set wrapper.
* The selection integration was also merged into this PR, because it depended on the API extension mentioned above. However, we should avoid such practice in the future.

https://user-images.githubusercontent.com/3919101/177816427-8c4285b4-8941-4048-a400-52f4acf77a9f.mp4

# Important Notes
There are some known issues, to-be-fixed in the future.
* The performance is bad. It should be improved with new text::Area, and the decent one shall come with [GridView inside component browser](https://www.pivotaltracker.com/story/show/182561072)
* There is no keyboard navigation. It should also be delivered with [GridView](https://www.pivotaltracker.com/story/show/182561072).
* The Favorites section is not [filtered out by node source type](https://www.pivotaltracker.com/story/show/182661634).
2022-07-14 12:00:52 +00:00
Michael Mauderer
807d970d75
Implement saving of the pre-edit expression in the node metadata. (#3584)
Implements https://www.pivotaltracker.com/story/show/182633483

Adds functionality to the Searcher Controller to save the expression of a node to its metadata, while it is edited. In later PRs this will be used to restore the expression, if an edit is aborted. This will be needed, as the expression will be changed within the source while editing to allow the visualization preview to be shown. As of this PR, the information is only stored, not used yet.

Demo Video
------------------
Note how the metadata of the node includes a `edit_status` field, when the project is saved during editing, and how it is cleared when saving without an edit happening.

https://user-images.githubusercontent.com/1428930/178740111-d0bbaa43-00b0-42e3-9fbb-d9249f07ae35.mp4

# Important Notes
[ci no changelog needed]
2022-07-13 14:33:04 +00:00
James Dunkerley
73e9240a11
Remove here. from Javascript code. (#3577)
Visualization within the UI is no longer working since the removal of the `here` keyword.
This PR fixes the JavaScript calls.

# Important Notes
There are various lines of rust code which still have `here.` within them and these will need to be fixed at some point.
2022-07-12 13:34:37 +00:00
Michael Mauderer
ca034484b4
Component List Panel View Acceptance Fixes (#3576)
Updates the Component List Panel View to resolve issues spotted during acceptance review:
* order between "Local Scopes" and "Favourites Section" is switched.
* Headers in demo scenes now include a number indicating the index

https://user-images.githubusercontent.com/1428930/178252570-21405174-2a0f-4f58-8033-6a1a0055a16e.mp4

# Important Notes
[ci no changelog needed]
2022-07-12 10:06:36 +00:00
Mateusz Czapliński
ec5cd01dfa
Fix vertical alignment of short columns in Component Browser Local Scope (#3566)
Fix vertical alignment of columns in the Local Scope section of the Component Browser. All columns are now bottom-aligned and their entries align vertically. Previously, shorter columns were vertically centered and their entries did not align vertically with entries in longer columns.

https://www.pivotaltracker.com/story/show/180892146/comments/232101261 (see: *"Entries in the rightmost column of Local Scope is not vertically aligned with entries in other columns."*).

#### Visuals

Before:

<img width="626" alt="Screenshot 2022-07-06 at 18 14 18" src="https://user-images.githubusercontent.com/273837/177596439-cbe29a3a-2600-4b99-be20-955bf9fabd6e.png">


After:

<img width="626" alt="Screenshot 2022-07-06 at 18 08 27" src="https://user-images.githubusercontent.com/273837/177596072-1f3fd652-fe36-42c2-957c-4584b68539b4.png">
2022-07-07 22:59:51 +00:00
Mateusz Czapliński
dcd084eb07
Fix colors in Component List Panel View (#3565)
Fixes missing colors in the `component_list_panel_view` demo scene.

https://www.pivotaltracker.com/story/show/180892146/comments/232101261 (see: *"2. All groups in the demo scene look gray."*).

#### Visuals

Before:

<img width="450" alt="Screenshot 2022-07-06 at 16 07 29" src="https://user-images.githubusercontent.com/273837/177569995-e293ac58-69de-4fd3-bae6-22883047ae89.png">
<img width="441" alt="Screenshot 2022-07-06 at 16 08 06" src="https://user-images.githubusercontent.com/273837/177570026-e09c3b27-023d-4f56-9bd0-50ef3e8d225b.png">

After (the component groups are randomized in the demo scene, so the column heights may not align with the "before" screenshots):

<img width="445" alt="Screenshot 2022-07-06 at 16 02 04" src="https://user-images.githubusercontent.com/273837/177570107-accc94ed-42b3-465b-93d6-271914377e91.png">
<img width="459" alt="Screenshot 2022-07-06 at 16 02 28" src="https://user-images.githubusercontent.com/273837/177570213-18b94f7e-23d8-4d29-b15d-ccfdd9c41e07.png">
2022-07-07 08:29:55 +00:00
Mateusz Czapliński
d950499a90
Pan camera to created nodes. (#3552)
If a node created by the user gets placed off-screen, the screen's camera is panned to make the node visible.

https://www.pivotaltracker.com/story/show/181188687

#### Visuals

A screencast showing a number of node creation scenarios when the camera is panned to the newly created node, including when zoomed out.



https://user-images.githubusercontent.com/273837/177169716-50a12b0a-c742-4b01-9766-56206e7938b9.mov

# Important Notes
- Camera is panned also if the node is only partially visible, or if there's not enough free space visible around the node. The specific amount of free space that needs to be visible around a newly created node is configured in the theme.
- If the screen area is so small that the node cannot be fully fit in it (either horizontally or vertically), showing the left and top boundaries of the node's area takes priority over showing the corresponding opposite edges.
2022-07-06 10:33:35 +00:00
Mateusz Czapliński
2b2563a395
Implement trivial placeholder icons for all 5 Component Browser entry kinds. (#3557)
Implement simple placeholder icons for all entry kinds supported in the Suggestion Database. The icons are planned to be used in Component Browser as default icons for entries. This is intended to allow visually distinguishing different entry kinds.

The following additional fixes and tweaks are applied:
 - Icons previously using only 1 color from the theme now use the color provided through shape parameters instead.
 - The `data_science` and `network` icons now use only the 2 colors provided through shape parameters.
 - The `join` icon has its shape and colors modified and uses only the 2 colors provided through shape parameters.
 - The demo scene now parametrizes icon shapes using colors from the Component Browser Design Doc.

https://www.pivotaltracker.com/story/show/182584322

#### Visuals

Original contents of the demo scene before the PR:

<img width="2197" alt="x-orig" src="https://user-images.githubusercontent.com/273837/176669422-ee2e14c7-9ef4-42fd-acb7-ae3be6b68587.png">



Final contents of the demo scene after the PR:

<img width="2201" alt="x2-final" src="https://user-images.githubusercontent.com/273837/176668720-6f1685fd-f7e6-44d7-85f5-f6a6d6789644.png">
2022-07-04 16:36:27 +02:00
Michael Mauderer
e6b7d5b8fc
List Panel View Part 2 (#3537)
Design, integration and bugfix update for the List Panel View.

![image](https://user-images.githubusercontent.com/1428930/175554745-c4887d55-a885-4299-878b-4727f09a7520.png)

![image](https://user-images.githubusercontent.com/1428930/175554906-837db815-948d-4407-8233-10a15e4198b3.png)

![image](https://user-images.githubusercontent.com/1428930/175555165-bcbe5138-8e5c-416e-886b-c72df361d743.png)


[ci no changelog needed]
2022-07-04 14:08:31 +00:00
Michał Wawrzyniec Urbańczyk
43a893cae6
Bump the build script (#3535) 2022-07-01 03:58:14 +02:00
Mateusz Czapliński
d689777d7a
Local Scope entries in new Hierarchical Action List. (#3526)
Make the local scope components available to the Component Browser through `component::List` (previously known as "Hierarchical Action List"). (See the [Local Scope Section in the Design Doc](https://github.com/enso-org/design/blob/main/epics/component-browser/design.md#local-scope-section) for more details.)

https://www.pivotaltracker.com/story/show/181869186

# Important Notes
- Note: the PR description does not include a screencast due to the changes in this PR not having any visual effect at this moment. The result of this PR's changes would be only observed in the Component Browser, but the Component Browser is not merged yet. As described in the task's Acceptance Criteria, the changes in this PR are currently only covered by tests.
- The `component::group::Data::new_empty_visible` constructor was renamed to `from_name_and_id` and changed to set the `visible` field to a default value. All known code paths appear to call the `update_sorting_and_visibility` method before checking the value of the `visible` field, so setting the value to `true` when creating the object does not seem needed.

[ci no changelog needed]
2022-06-29 15:46:56 +00:00
Michael Mauderer
655793aa78
Component List Panel View (#3495) 2022-06-22 16:39:32 +01:00
Hubert Plociniczak
22a371a9c6
Substitute this with self (#3524)
A semi-manual s/this/self appied to the whole standard library.
Related to https://www.pivotaltracker.com/story/show/182328601

In the compiler promoted to use constants instead of hardcoded
`this`/`self` whenever possible.

# Important Notes
The PR **does not** require explicit `self` parameter declaration for methods as this part
of the design is still under consideration.
2022-06-21 10:53:52 +00:00
Ilya Bogdanov
71b3a9f40a
New selection box implementation for component groups (#3520)
[Task link](https://www.pivotaltracker.com/story/show/182194574).
[ci no changelog needed]

This PR implements a new selection box that will replace an old (not really working) one in the component browser. The old selection box wasn't working well with the headers of the component groups, so we were forced to make a much harder implementation.

The new implementation duplicates some visual components and places them in a separate layer. Then, a rectangular mask cuts off everything that is not "selected". This way:
- We have more control over what the selected entries should look like.
- We can easily support the multi-layer structure of the component groups with headers.
- We avoid problems with nested masks that our renderer doesn't support at the moment.

To be more precise, we duplicate the following:
- Background of the component group becomes the "fill" of the selection.
- Entries text and icons - we can alter them easily.
- Header background and header text. By placing them in separate scene layers we ensure correct rendering order.

https://user-images.githubusercontent.com/6566674/173657899-1067f538-4329-44f9-9dc2-78c8a4708b5a.mp4

# Important Notes
- This PR implements the base of our future selection mechanism, selecting entries with a mouse and keyboard still has several issues that will be fixed in the future tasks.
- The scrolling behavior will also be improved in future tasks. Right we only restrict the selection box position so that it never leaves the borders of the component group.
- I added a new function to `add` shapes to new layers in a non-exclusive way (we had only `add_exclusive`) before. I have no idea how we didn't use this feature before even though we mention it a lot in the docs.
- The demo scene restricts the position of the selection box for one-column component groups but does not for the wide component group.
2022-06-15 14:21:30 +00:00
Mateusz Czapliński
0c8b1a1e0b
Virtual Component Groups in the Hierarchical Action List (2/2) (#3510)
Put information about Virtual Component Groups in the Hierarchical Actions List.

https://www.pivotaltracker.com/story/show/181865548

# Important Notes
- This PR implements the subtask 2 of 2 in the ["Virtual Component Groups in the Hierarchical Action List" task](https://www.pivotaltracker.com/story/show/181865548).
- Note: the PR description does not include a screencast due to the changes in this PR not having any visual effect at this moment. The result of this PR's changes would be only observed in the Component Browser, but the Component Browser is not merged yet. As described in the task's Acceptance Criteria, the changes in this PR are currently only covered by tests.
- Manual integration testing with the Engine showed that a response to an `executionContext/getComponentGroups` request is non-empty only after an `executionContext/executionComplete` message is received by the IDE. (See also [a discussion on Discord](https://discord.com/channels/401396655599124480/983669600854106112).) This was not known by the IDE team or documented before, and the existing code was modified to take this into account. The protocol docs are expected to be updated by the Engine team.
- A list of component groups looked up in the suggestion database is cached in the node searcher as an optimization.

[ci no changelog needed]
2022-06-15 09:47:07 +00:00
Kaz Wesley
b756fc48d1
Symbol unregistration (#3507)
Remove a `Symbol`from the `SymbolRegistry` when its `SpriteSystem` is dropped.

This fixes the remaining buffer leak (after #3504) in https://www.pivotaltracker.com/story/show/181943457

# Important Notes
- The `SymbolRegistry` now assigns unique `SymbolId`s, so that we can tell if a `SymbolId` refers to a `Symbol` that has already been unregistered (this shouldn't happen, but it's not statically-obvious that it doesn't, so if it occurs we shouldn't misbehave).
- Also fix a bug in how `buffer_count` was tracked (we were decrementing more than incrementing!).
2022-06-15 03:54:59 +00:00
Kaz Wesley
a1bf0974ce
Better release build time; new maximum-performance production profile. (#3498)
### Pull Request Description

Using the new tooling (#3491), I investigated the **performance / compile-time tradeoff** of different codegen options for release mode builds. By scripting the testing procedure, I was able to explore many possible combinations of options, which is important because their interactions (on both application performance and build time) are complex. I found **two candidate profiles** that offer specific advantages over the current `release` settings (`baseline`):
- `thin16`: Supports incremental compiles in 1/3 the time of `baseline` in common cases. Application runs about 2% slower than `baseline`.
- `fat1-O4`: Application performs 13% better than `baseline`. Compile time is almost 3x `baseline`, and non-incremental.  
(See key in first chart for the settings defining these profiles.)

We can build faster or run faster, though not in the same build. Because the effect sizes are large enough to be impactful to developer and user experience, respectively, I think we should consider having it both ways. We could **split the `release` profile** into two profiles to serve different purposes:
- `release`: A profile that supports fast developer iteration, while offering realistic performance.
- `production`: A maximally-optimized profile, for nightly builds and actual releases.

Since `wasm-pack` doesn't currently support custom profiles (rustwasm/wasm-pack#1111), we can't use a Cargo profile for `production`; however, we can implement our own profile by overriding rustc flags.

### Performance details

![perf](https://user-images.githubusercontent.com/1047859/170788530-ab6d7910-5253-4a2b-b432-8bfa0b4735ba.png)

As you can see, `thin16` is slightly slower than `baseline`; `fat1-O4` is dramatically faster.

<details>
  <summary>Methodology (click to show)</summary>

I developed a procedure for benchmarking "whole application" performance, using the new "open project" workflow (which opens the IDE and loads a complex project), and some statistical analysis to account for variance. To gather this data:

Build the application with profiling:
`./run.sh ide build --profiling-level=debug`

Run the `open_project` workflow repeatedly:
`for i in $(seq 0 9); do dist/ide/linux-unpacked/enso --entry-point profile --workflow open_project --save-profile open_project_thin16_${i}.json; done`

For each profile recorded, take the new `total_self_time` output of the `intervals` tool; gather into CSV:
`echo $(for i in $(seq 0 9); do target/rust/debug/intervals < open_project_thin16_${i}.json | tail -n1 | awk '{print $2}'; do`
(Note that the output of intervals should not be considered stable; this command may need modification in the future. Eventually it would be nice to support formatted outputs...)

The data is ready to graph. I used the `boxplot` method of the [seaborn](https://seaborn.pydata.org/index.html) package, in order to show the distribution of data.
</details>

#### Build times
![thin16](https://user-images.githubusercontent.com/1047859/170788539-1578e41b-bc30-4f30-9b71-0b0181322fa5.png)

In the case of changing a file in `enso-prelude`, with the current `baseline` settings rebuilding takes over 3 minutes. With the `thin16` settings, the same rebuild completes in 40 seconds.

(To gather this data on different hardware or in the future, just run the new `bench-build.sh` script for each case to be measured.)
2022-06-11 00:09:54 +02:00
Ilya Bogdanov
c602404b1a
Multi Component Group Wrapper (#3473)
[ci no changelog needed]

This PR implements a new helper for the future Component Browser - `component_group::multi::Wrapper`. It propagates FRP events from multiple component groups and ensures that only a single component group is focused at all times.

See the updated component group demo scene (console logs shows propagated FRP events from all component groups):


https://user-images.githubusercontent.com/6566674/172359141-8ea6f1ba-e357-4c1b-852a-adb4d5207e03.mp4


- Fixed a `define_endpoints_2!` macro. FRP endpoints for `focus` events weren't connected properly.
- List View now uses an overlay shape to catch mouse events, it allows much easier implementation of `is_header_selected` in the component group.
2022-06-08 11:06:36 +00:00
Mateusz Czapliński
656d6e7660
Virtual Component Groups in the Hierarchical Action List (1/2) (#3488)
Parse the Engine's response containing Virtual Component Groups and store the results in a field of the Execution Context type.

https://www.pivotaltracker.com/story/show/181865548

# Important Notes
- This PR implements the subtask 1 of 2 in the ["Virtual Component Groups in the Hierarchical Action List" task](https://www.pivotaltracker.com/story/show/181865548).

[ci no changelog needed]
2022-06-03 17:18:20 +00:00
Adam Obuchowicz
66693ad642
Hierarchical Action List vel Component List. (#3501)
This PR introduces a new structure delivered by Searcher Controller: The Component List.

The Component list is hierarchical, and its structure reflects how the components are displayed in Component Browser - only "submodule" section at this point, other sections will be covered in next tasks.

This does not introduce anything visual; the structures are tested in unit tests.
2022-06-03 15:06:31 +00:00
Kaz Wesley
a5cd7dcab6
Fix leaks in input/output areas by partial revert of #3451. (#3504)
Fix a memory leak introduced by #3451. Found this to be part of the cause of [the buffer leaks](https://www.pivotaltracker.com/story/show/181943457/comments/231558434).

The problem with this use of `define_endpoints_2` is,
- The FRP network contains (strong) references to the `Model`.
- The `Model` has a strong reference to `api::Private`, which owns the FRP network.

Thus we never free the `Model`.
2022-06-02 18:33:36 +00:00