Commit Graph

439 Commits

Author SHA1 Message Date
Michał Wawrzyniec Urbańczyk
ee8e9e5c60
Fix the Engine version check in GUI (#6570)
This PR fixes #6560.

The fix has a few elements:
1) Bumps the Engine requirement to the latest release, namely `2023.1.1`.
2) Changed the logic of checking whether a given version matches the requirement. Previously, we relied on `VersionReq` from `semver` crate which did not behave intuitively when the required version had a prerelease suffix. Now we rely directly on Semantic Versioning rules of precedence.
3) Code cleanups, including deduplicating 3 copies of the version-checking code, and moving some tests to more sensible places.
2023-05-08 14:13:53 +00:00
Stijn ("stain") Seghers
069fcf3928
Show error pop-up when failing to rename a project (#6366)
Closes #5065: when a project can't be renamed, it now shows an error pop-up and stays in edit mode.

https://user-images.githubusercontent.com/607786/234025360-6761f7d6-c13c-479c-a0ba-8af5d81f6e87.mp4
2023-05-08 10:12:26 +00:00
Kaz Wesley
c957581978
Catch 5813 and avoid crash (#6585) 2023-05-05 19:53:24 +02:00
Stijn ("stain") Seghers
0578196623
Fix #5075: stop panning on full-screen visualisation (#6530)
Closes #5075: dragging or scrolling while a visualisation is in full screen caused the camera to move in the graph editor.

The problem was that clicking on the visualisation triggered some FRP node that indicated that the project list should be closed, which then indicated that the navigator shouldn't be disabled. However, the FRP code in the graph editor interpreted "shouldn't be disabled" as "should be enabled", ignoring the fact that there's also a full-screen visualisation, which should always disable the navigator.

https://user-images.githubusercontent.com/607786/235908932-0b579d69-5fd8-438e-a82b-02678d8e6156.mp4
2023-05-05 09:04:07 +00:00
Michael Mauderer
1817da799c
Disregard visualisation for selection of nodes. (#6487) 2023-05-04 20:43:08 +02:00
Stijn ("stain") Seghers
7f9ed71ad9
Fix cut-off in text visualisations (#6421)
Closes #6196.

Three things were going wrong:
- Not directly contributing, but adding confusion was the fact that padding of 5px was added in two different places. Since the 10px we've had up until now looked better, especially given the size of the rounded corners, I've kept it at 10px, but only applied in one place.
- The main issue was that the length the scrollbars scroll over didn't take padding into account. At the same time, I changed the `max` and `thumb_size` variables to the coordinate system of the content. This is also how they're being used in `ScrollArea`, which is the only other place where `Scrollbar`s are being used.
- The line height of text grid entries was set to the default of 1.2. That's the default line height in browsers, which is great for multi-line text and elements whose height is greater than the line height. In this case, however, where the height and the font size are set to the same value, the default setting of 1.2 pushes the text below the allotted space.

https://user-images.githubusercontent.com/607786/234297411-8c0b3851-5977-4ca5-b3b4-5b0782510e14.mp4
2023-05-04 08:11:18 +00:00
Stijn ("stain") Seghers
cbda170126
Delete unused websocket dependency (#6535)
This unused crate is super old and has some old dependencies. Its old dependencies of `parking_lot` or `parking_lot_core` might be causing a wasm compilation bug we've been having (#6091), but it's not clear.
2023-05-04 07:34:51 +00:00
somebody1234
a1d48e7d0c
Cloud/desktop mode switcher (#6448)
This is a re-creation of #6308.
Creates buttons to switch between cloud and local backends for listing directories, opening projects etc.

# Important Notes
The desktop backend currently uses a hardcoded list of templates, mostly because they look better because they have background images. However, it can easily be changed to use `listSamples` endpoint and switched to the default grey background.
2023-05-02 17:48:07 +00:00
Ilya Bogdanov
42cc42c878
Fix doubled named arguments bug (#6422)
Fixes #6228

An annoying issue was hidden deep in the code for updating named arguments after input port disconnection.

Kudos to @Frizi for help with investigating it and the initial implementation of the fix.
2023-05-02 17:21:03 +00:00
Pavel Marek
3a42d0ce76
Reimplement enso_project as a proper builtin (#6352)
Remove the magical code generation of `enso_project` method from codegen phase and reimplement it as a proper builtin method.

The old behavior of `enso_project` was special, and violated the language semantics (regarding the `self` argument):
- It was implicitly declared in every module, so it could be called without a self argument.
- It can be called with explicit module as self argument, e.g. `Base.enso_project`, or `Visualizations.enso_project`.

Let's avoid implicit methods on modules and let's be explicit. Let's reimplement the `enso_project` as a builtin method. To comply with the language semantics, we will have to change the signature a bit:
- `enso_project` is a static method in the `Standard.Base.Meta.Enso_Project` module.
- It takes an optional `project` argument (instead of taking it as an explicit self argument).

Having the `enso_project` defined as a (shadowed) builtin method, we will automatically have suggestions created for it.

# Important Notes
- Truffle nodes are no longer generated in codegen phase for the `enso_project` method. It is a standard builtin now.
- The minimal import to use `enso_project` is now `from Standard.Base.Meta.Enso_Project import enso_project`.
- Tested implicitly by `org.enso.compiler.ExecCompilerTest#testInvalidEnsoProjectRef`.
2023-05-02 16:40:58 +00:00
Michael Mauderer
6dee75554b
Fix layer ordering between dropdown and breadcrumbs backgrounds. (#6483)
This PR fixes #6371.

# Important Notes
@kazcw @wdanilo I don't particularly like this solution, but I don't see any other good way to define the relationship between two instances of the same shape (`Rectangle`) used in different UI elements. If you are aware of a more elegant solution, I’d be happy to hear any suggestions.
2023-05-02 16:32:21 +00:00
Adam Obuchowicz
d6fa36d793
Finishing Vector Editor (#6470) 2023-05-02 11:24:20 +02:00
James Dunkerley
6b0c682b08
Add Execution Context control to Text.write (#6459)
- Adjusted `Context.is_enabled` to support default argument (moved built in so can have defaults).
- Made `environment` case-insensitive.
- Bug fix for play button.
- Short hand to execute within an enabled context.
- Forbid file writing if the Output context is disabled with a `Forbidden_Operation` error.
- Add temporary file support via `File.create_temporary_file` which is deleted on exit of JVM.
- Execution Context first pass in `Text.write`.
- Added dry run warning.
- Writes to a temporary file if disabled.
- Created a `DryRunFileManager` which will create and manage the temporary files.
- Added `format` dropdown to `File.read` and `Data.read`.
- Renamed `JSON_File` to `JSON_Format` to be consistent.

(still to unit test).
2023-04-29 08:39:18 +00:00
Stijn ("stain") Seghers
34e1c28d6b
Hide profile button behind a feature flag (#6430)
Closes #6413.
2023-04-28 15:12:06 +00:00
Ilya Bogdanov
4114368199
Unselect all nodes when the project name is edited (#6432)
Fixes #6373
2023-04-27 18:10:27 +00:00
Michael Mauderer
233bf86d2f
Execution environment integration fixes. (#6434)
Follow up to  https://github.com/enso-org/enso/pull/6341#issuecomment-1522341055 . Contains some refactoring and solves some left over to-dos in the code.
2023-04-27 17:30:26 +00:00
Michael Mauderer
00510de053
Implement workflow-level Play button business-logic (#6427)
Implements #6179

https://user-images.githubusercontent.com/1428930/234429549-2e25a8e2-a677-475c-a4b2-49f00421b9ad.mp4
2023-04-27 14:46:58 +00:00
Paweł Grabarz
a00efb28f3
Widgets integrated with graph nodes (#6347)
Rewrites node input component. Now the input is composed of multiple widget components arranged in a tree of views with automatic layout. That allows creating complex UI elements on top of the node itself, and further widget positions will be automatically adapted to that. The tree roughly follow the span tree, as it is built by consuming its nodes and eagerly creating widgets from them. The tree is rebuilt every time the expression changes, but that rebuild process reuses as much previously created widgets as possible, and only updates their configuration as needed. Each widget type can have its own configuration options that can be passed to it from the parent, or assigned based on configuration received from the language server.

<img width="773" alt="image" src="https://user-images.githubusercontent.com/919491/233439310-9c39ea88-19bc-43da-9baf-1bb176e2724e.png">

# Important Notes
For now, all span-tree updates are sent over to the shared Frp endpoint of the whole tree, so there is no mechanism for intercepting them by the parent widgets. One idea would be to use existing bubbling/capturing events on widget display objects for that purpose, but I think existing implementation is simpler and more convenient, and we can always easily change that if we have a use for it.

There are some issues with performance due to much more display objects being created on the graph. Expect it to be a little worse, especially at initialization time.
2023-04-26 19:37:54 +00:00
James Dunkerley
0e51131809
Table Visualization and display text changes. (#6382)
- Missing tests from number parsing.
- Fix type signature on some warning methods.
- Fix warnings on `Standard.Database.Data.Table.parse_values`.
- Added test for `Nothing` and empty string on `use_first_row_as_names`.
- New API for `Number.format` taking a simple format string and `Locale`.
- Add ellipsis to truncated `Text.to_display_text`.
- Adjusted built-in `to_display_text` for numbers to not include type (but also to display BigInteger as value).
- Remove `Noise.Generator` interface type.
- Json: Added `to_display_text` to `JS_Object`.
- Time: Added `to_display_text` for `Date`, `Time_Of_Day`, `Date_Time`, `Duration` and `Period`.
- Text: Added `to_display_text` to `Locale`, `Case_Sensitivity`, `Encoding`, `Text_Sub_Range`, `Span`, `Utf_16_Span`.
- System: Added `to_display_text` to `File`, `File_Permissions`, `Process_Result` and `Exit_Code`.
- Network: Added `to_display_text` to `URI`, `HTTP_Status_Code` and `Header`.
- Added `to_display_text` to `Maybe`, `Regression`, `Pair`, `Range`, `Filter_Condition`.
- Added support for `to_js_object` and `to_display_text` to `Random_Number_Generator`.
- Verified all error types have `to_display_text`.
- Removed `BigInt`, `Date`, `Date_Time` and `Time_Of_Day` JS based rendering as using `to_display_text` now.
- Added support for rendering nested structures in the table viz.
2023-04-26 18:15:48 +00:00
Michael Mauderer
0d84a601dd
Ability to change the execution environment between design and live. (#6341)
Integrate the UI for electing the Execution Environment with the Language Server and unify existing uses. Implements  #5930 + actual integration instead of just mocking it.

https://user-images.githubusercontent.com/1428930/232919438-6e1e295a-34fe-4756-86a4-5f5d8f718fa0.mp4

# Important Notes
The console output is only emitted as part of the `INFO` level. A better check would be to look at the messages sent to the backend in the developer console.
2023-04-25 20:28:15 +00:00
Adam Obuchowicz
952de24e79
Drop method exported from WASM + removing leaks. (#6365)
Fixes #6317

The `drop` method is available in the WASM object. This can be tested by typing `ensoglApp.wasm.drop()` in the dev console - all objects should be removed and all connections closed.

# Important Notes
* This PR fixed serveral leaks by this occasion
* A new tool for tracking leaks was added to prelude's `debug` module.
2023-04-25 15:38:29 +00:00
Kaz Wesley
d6828b5219
Exclude comparison operators from modifier logic (#6370)
* Exclude comparison operators from modifier logic

* CLI for SpanTree debug_print
2023-04-24 06:52:42 -07:00
Adam Obuchowicz
8b62deba7d
Vector Editor with List Editor and adding elements. (#6363)
Vector Editor widget is improved: replaced old simple widget with List Editor, and added integration for adding elements.

# Important Notes
The widget is still under feature flag: `--feature-preview.vector-editor`.
2023-04-24 09:17:25 +00:00
Ilya Bogdanov
719bd8cfa1
Forbid edits in read-only mode (#6342)
Closes #6182 

Implements read-only mode for relevant components of the IDE.

- [x]  Project Name renaming
- [x]  Nodes editing
- [x]  Editing code in the code editor
- [x]  Creating nodes
- [x]  Removing nodes
- [x]  Entering and leaving nodes
- [x]  Creating, dropping, and changing connections between nodes
- [x]  Buttons on nodes (except for visualization toggle button)
- [x]  Widgets on nodes


https://user-images.githubusercontent.com/6566674/232824737-bdd6f676-b20d-4218-af7d-4373e00cbe3e.mp4
2023-04-24 10:01:30 +02:00
Ilya Bogdanov
6aba602a34
Read-only mode for controllers (#6259)
Closes #6181

- Added a read-only flag for the project model (now controlled by a temporary shortcut).
- Renaming the project, editing the code, connecting and disconnecting nodes, and collapsing, and navigating through collapsed nodes are forbidden and will result in the error message in the console.
- Some of the above actions produce undesired effects on the IDE, which will be fixed later. This PR is focused on restricting actual AST modifications.
- Moving nodes (and updating metadata in general) no longer causes reevaluation


https://user-images.githubusercontent.com/6566674/231616408-4f334bb7-1985-43ba-9953-4c0998338a9b.mp4
2023-04-20 14:17:18 +00:00
Kaz Wesley
bc4ed96d71
Layer/Rectangle improvements (#6247)
* Use Rectangle for breadcrumbs background.

* Use Rectangle for status bar bg.

* Use Rectangle for dropdown bg.

* Dirty global_element_depth_order invalidates sublayers

* Setting new parent may invalidate depth order

* Support per-instance pointer_events_enabled

* Remove workaround for #6241
2023-04-19 09:06:20 -07:00
Stijn ("stain") Seghers
9ae77f4b6f
Make play button clickable and hide it when irrelevant (#6302) 2023-04-19 14:51:12 +02:00
Wojciech Daniło
fa995dd765
Vector Editor first visual implementation (#6245) 2023-04-19 04:26:01 +02:00
Ilya Bogdanov
84f64bec65
Use red color for context switch button (#6266) 2023-04-18 17:00:57 +02:00
Michael Mauderer
64043323e8
A drop-down that allows changing the execution mode. (#6130)
Implements https://github.com/enso-org/enso/issues/5931.

https://user-images.githubusercontent.com/1428930/228532453-2032b376-1aa5-4140-8331-be37e4e675d4.mp4

# Important Notes
Not functional yet, as it needs integration with the engine.
2023-04-18 10:26:17 +00:00
Dmitry Bushev
b020e7f97b
Fix stepping out of the function after renaming the project (#6285)
close #6138

Rename method pointers in existing execution contexts after the project is renamed.
2023-04-17 08:48:32 +00:00
Adam Obuchowicz
b72ab4aee3
Fix: when default visualization is displayed, its entry is not present in the chooser list. (#6209)
The visualization was blank because we set a new visualization instance with same data for attaching, so `VisualizationManager` skipped attaching (and thus the data for previous instance were not shared with the new one).

And the entry was visible, because we informed chooser about selected vis before the visualization list arrived.

Fixes #5992 may also fix some other issues with blank visualizations.
2023-04-12 10:24:06 +00:00
Stijn ("stain") Seghers
810127b887
Add node button to enable/disable output context (#6205)
Closes #5929: Adding a node button to enable and disable the output context for that particular node.

I also added a temporary shortcut (cmd-shift-c) to switch the execution environment so we can properly test it.


https://user-images.githubusercontent.com/607786/230036314-052b734a-1846-4057-93d8-2152e1e0cce6.mp4

# Important Notes
While we're waiting to integrate it with the language server, the execution environment is temporarily stored in the presenter. (Otherwise we'd have to define it in multiple places and the behaviour would look rather weird.)

I also fixed a bug where the view didn't get any updates when the context switch expression changed. I'll make a comment on the relevant part. I think the SKIP and FREEZE macros might have the same issue.
2023-04-11 17:05:37 +00:00
Michał Wawrzyniec Urbańczyk
e7668ebc3a
Project Sharing (#6077)
Enso will now associate with two file extensions:
* `.enso` — Enso source file.
  * If the source file belongs to a project under the Project Manager-managed directory, it will be opened.
  * If the source file belongs to a project located elsewhere, it will be imported into the PM-managed directory and opened;
  * Otherwise, opening the `.enseo` file will fail. (e.g., loose source file without any project)
* `.enso-project` — Enso project bundle, i.e., `tar.gz` archive containing a compressed Enso project directory.
  * it will be imported under the PM-managed directory; a unique directory name shall be generated if needed.

### Important Notes
On Windows, the NSIS installer is expected to handle the file associations.
On macOS, the file associations are expected to be set up after the first time Enso is started,
On Linux, the file associations are not supported yet.
2023-04-06 15:26:37 +02:00
Ilya Bogdanov
2531aeeece
Implement hiding context switch expression in graph editor (#6136)
Closes #5927

Now context switch expressions are not visible in the nodes.

No visual changes to the IDE, the screencast is recorded with code modifications.

https://user-images.githubusercontent.com/6566674/228579581-f6a4c214-af56-40f8-af8e-af102cf476b3.mp4

# Important Notes
I fixed an issue when the state of the buttons near nodes was not updated after loading a project. See https://github.com/enso-org/enso/pull/6136#discussion_r1156920052
2023-04-04 17:25:46 +00:00
Kaz Wesley
b3e54aeb54
Instance ordering (#6140) 2023-04-04 12:35:00 +02:00
James Dunkerley
f26bcf6ab6
Small issues from working with Ned (#6160)
- `Process.run` now returns a `Process_Result` allowing the easy capture of stdout and stderr.
- Joining a column with a column name does not warn if adding just the prefix.
- Stop the table viz from changing case and adding spaces to the headers.
2023-04-03 13:01:42 +00:00
Paweł Grabarz
3fcbef35cf
do not override default shape alignment in macro (#6170) 2023-04-03 12:34:27 +02:00
Ilya Bogdanov
49d9ae703b
Execution context switch expressions (#6121)
Closes #5926

Implements controllers side of adding and removing context switch expressions for the nodes.

Example using the `skip` button (while the actual context switch button is not ready).

https://user-images.githubusercontent.com/6566674/228373412-7da83b0c-6cdf-495d-b1ec-30c438c0f411.mp4


https://user-images.githubusercontent.com/6566674/228373426-7aa5699b-2aa1-4299-9d85-b22371c4a063.mp4

# Important Notes
No visual changes to the IDE were made.
2023-04-03 10:25:16 +00:00
Adam Obuchowicz
75df048f3e
A Stub for Vector Editor Widget. (#6142)
Fixes #5946

Adds a vector editor widget under the node. It reacts to code changes, but does not allow any editing: this will be continuously added in next tasks.

The position is often wrong due to limitations of the display object hierarchy. It should be changed anyway when [embedding into the node](#5923). But because it looks bad, it's shown only with `--featurePreview.vectorEditor` flag.

https://user-images.githubusercontent.com/3919101/227955735-f96fc23d-7e87-4042-8586-c1154523e871.mp4
2023-04-03 09:21:33 +00:00
Paweł Grabarz
08f28998ab
remove content_origin property from layout (#6155)
Simplified layout algorithm by removing `content_origin`, and instead treating `(0.0, 0.0)` as origin point in every layout object. This change allows overflowing containers that are within auto-layout. The parent element will no longer be moved within the grid cell when its children overflow it.

![image](https://user-images.githubusercontent.com/919491/228926310-b0117570-9f83-4687-8f8c-3fc778ff7d3c.png)

# Important Notes
When implementing this change, I have found that when object's size was modified without ever touching its position, that change was not being picked up in the "modified children" list, and `on_updated` was never triggered. Because some sprites now are bottom-left aligned, that is now a common case and was reproducible on the auto-layout example scene. I ended up fixing it by introducing another dirty flag for `computed_size` changes. Right now that flag is applied very broadly (on each layout update), but in the future we might make it more precise by actually checking if the size was changed in the process.

I believe that this might also be a fix for #5095, as I cannot reproduce it anymore with those changes.
2023-04-01 11:48:01 +00:00
Radosław Waśko
6f86115498
Proper implementation of Value Types in Table (#6073)
This is the first part of the #5158 umbrella task. It closes #5158, follow-up tasks are listed as a comment in the issue.

- Updates all prototype methods dealing with `Value_Type` with a proper implementation.
- Adds a more precise mapping from in-memory storage to `Value_Type`.
- Adds a dialect-dependent mapping between `SQL_Type` and `Value_Type`.
- Removes obsolete methods and constants on `SQL_Type` that were not portable.
- Ensures that in the Database backend, operation results are computed based on what the Database is meaning to return (by asking the Database about expected types of each operation).
- But also ensures that the result types are sane.
- While SQLite does not officially support a BOOLEAN affinity, we add a set of type overrides to our operations to ensure that Boolean operations will return Boolean values and will not be changed to integers as SQLite would suggest.
- Some methods in SQLite fallback to a NUMERIC affinity unnecessarily, so stuff like `max(text, text)` will keep the `text` type instead of falling back to numeric as SQLite would suggest.
- Adds ability to use custom fetch / builder logic for various types, so that we can support vendor specific types (for example, Postgres dates).

# Important Notes
- There are some TODOs left in the code. I'm still aligning follow-up tasks - once done I will try to add references to relevant tasks in them.
2023-03-31 16:16:18 +00:00
James Dunkerley
db87d534e9
Compute column widths based on content of column. (#6157)
Use the auto size feature of ag-grid to compute the widths of columns.

https://user-images.githubusercontent.com/4699705/228965126-a84dd45c-a037-4cf0-9135-a0d9eb19de8b.mp4
2023-03-31 10:53:46 +00:00
Nctdt
7f8230b62d
Fix: Make sure to correctly resize the table (#6031)
Fixes #5966;

https://user-images.githubusercontent.com/52877578/226659132-c6ffc40b-e495-4799-bd35-2c56b17086b0.mp4
2023-03-30 11:08:49 +00:00
Stijn ("stain") Seghers
72d0341f6f
Add icon for enabling re-evaluation (#6122)
Closes #6042. This just adds the icon to the `icons` demo scene, not to the actual product itself yet.

![arrowloops](https://user-images.githubusercontent.com/607786/228487555-1de02912-a891-40d9-9873-c1978c0c8be2.png)
2023-03-29 18:21:54 +00:00
Ilya Bogdanov
e7ba00252d
Fix crash when editing certain names in the CB (#6120)
Fixes #6119 #6117

The issue was caused by the usage of `slice::windows`, which panics if the input is `0`. After two modifications of the code that should never happen again. Technically any of the two would work fine without the other.
2023-03-29 16:29:04 +00:00
Paweł Grabarz
99a6f8f2f9
Decouple node edit mode from ports (#5983)
Implements #5919

Apart from some fixed glitches, no visual differences are present. This is mostly a refactor.

- Decoupled node edit mode code from existing port implementation, so ports can easily be replaced in the near future without affecting edit functionality.
- Connected ports and widgets are now always hidden in edit mode. Previously in some situations the colored shapes were incorrectly displayed at wrong positions during editing.
- When entering edit mode, the text cursor is placed at the correct location corresponding to clicked code, compensating for shift introduced by argument placeholders.

# Important Notes
There is a remaining known issue with incoming edges being placed at incorrect places during edit mode, sometimes even outside of the node. This issue is also present in develop. It doesn't make sense to resolve it now, as we are planning to rewrite the ports tree very soon. It will be fixed with that rewrite.
2023-03-29 11:16:31 +00:00
Ilya Bogdanov
5fd08f7554
Restore mistakenly removed unit test for named arguments (#6101)
The test was mistakenly removed during the merge with develop in #5770. The code is now restored from develop version without any modifications.

Thanks to @Frizi for heads up.
2023-03-28 11:32:00 +00:00
Wojciech Daniło
3f7c4a47da
Refactoring mouse events. (#6078) 2023-03-28 04:41:25 +02:00
Stijn ("stain") Seghers
b977b5ac01
Add tooltips to the action bar (#6035)
Implements #5933: adding tooltips to the buttons next to nodes.

To make the UI consistent, I've added tooltips to the `ToggleButton` class directly, since whenever you have an icon button, it seems helpful to have a tooltip.

`ToggleButton` is only used for the profiling button in the top-right corner and the buttons next to nodes. The output context switch button [isn't implemented yet](https://github.com/enso-org/enso/issues/5929), but once it is, adding a tooltip should be one-liner.

![Recording 2023-03-22 at 17 21 58](https://user-images.githubusercontent.com/607786/226972920-81033b37-001f-49eb-9fc6-453120f01760.gif)
2023-03-27 17:02:06 +00:00
Dmitry Bushev
4c62dc9061
Search suggestions by static attribute (#6036)
close #5874

Changelog:
- add: `isStatic` parameter to `search/completion` request to search by the `static` suggestion attribute
- update: search non-static suggestions when opening component browser

# Important Notes
Component browser doesn't show `Table.new` and `Table.from_rows` suggestions when a `Table` node is selected.

![2023-03-21-151117_1301x877_scrot](https://user-images.githubusercontent.com/357683/226874291-1ff99994-1bb6-41df-96b4-dc5c5178ba41.png)
2023-03-23 15:02:25 +00:00
Stijn ("stain") Seghers
0bdf44cba8
Use .node-version for pinning Node.js version (#6057)
Closes #6008: allowing Node.js to be used through Node version managers.
2023-03-23 12:00:08 +00:00
Ilya Bogdanov
de008eb2c2
Fix code generation for suggestion preview (#6054)
Fix a stupid typo introduced in #5770. It affected the code generated by CB while previewing suggestions.
2023-03-23 06:34:21 +00:00
James Dunkerley
dd009fd1af
Tidy up the public module level statics (#6032)
Tidies up a lot of PUBLIC module statics - marked some as PRIVATE, made some methods of types.
2023-03-22 18:02:37 +00:00
Ilya Bogdanov
1b30a5275f
Cursor aware Component Browser (#5770)
Closes #5220

This PR implements the cursor-aware behavior of the CB, as described in [pivotal issue](https://www.pivotaltracker.com/n/projects/2539304/stories/183521918)


https://user-images.githubusercontent.com/6566674/221807206-39f93cb4-8253-421d-a33a-33ac0aa56e54.mp4


https://user-images.githubusercontent.com/6566674/223124947-259153ca-e656-4349-87b5-47c06fd21af2.mp4

# Important Notes
- The `intended_method` of the node's metadata is marked as deprecated, and all usages are removed.
- It seems *all usages of Scala parser are removed from IDE*. We no longer use it to parse documentation for snippets.

This is how the snippets docs look now:

<img width="410" alt="Screenshot 2023-02-28 at 13 18 11" src="https://user-images.githubusercontent.com/6566674/221808028-d69c54e4-2842-4f1c-aa16-781d3f7765a1.png">
2023-03-22 17:10:37 +00:00
Wojciech Daniło
abb0b447d5
Improving Performance Monitor (#5895) 2023-03-21 09:17:54 +01:00
Kaz Wesley
c9806496ee
Rendering improvement/debugging support (#6019)
Some small improvements relating to rendering:

- Add a debug option: `-debug.pixel-read-period`. This can be used to measure the performance impact of checking the pointer location on different hardware. [On my development box, it makes no difference to performance.] (Closes #5490).
- Unbind pixel pack buffers after each use. This is recommended practice. It has no performance impact on my machine, and allows SpectorJS to run (`-debug.enable-spector`). (Closes #5941).

Also, simplify the profiling CLI: the `profile.load-profile` and `profile.save-profile` options have been renamed to `profile.load`/`profile.save`; `profile.save` now has a default filename, so you can capture a profile at any time in Electron with Ctrl+Alt+P and it will be written to `profile.json`.
2023-03-21 06:34:24 +00:00
Ilya Bogdanov
c7da4df742
Apply enso-formatter (#6006)
Somebody forgot to apply `./run fmt` before committing to develop, so now we have a lot of whitespace changes in files.

# Important Notes
See https://github.com/enso-org/enso/issues/5166
2023-03-20 21:45:28 +00:00
Stijn ("stain") Seghers
38861d91d9
Add icon to disable re-evalution (#5993)
Implements https://github.com/enso-org/enso/issues/5928.

This just adds the icon to the `icons` demo scene. No changes are made to the actual product yet.

![icon](https://user-images.githubusercontent.com/607786/225930459-2e8adac0-96b9-4f46-b518-6132670d8438.png)
![icons](https://user-images.githubusercontent.com/607786/225930464-67d06b8f-1ce4-41a2-b115-5127abadb6d3.png)
2023-03-20 13:31:37 +00:00
James Dunkerley
a668e3d434
Fix warnings from ag-grid. (#5988) 2023-03-17 22:28:28 +01:00
Michael Mauderer
7a40ccc3ea
Fix wrong placement of nodes created from dropped files. (#5906)
Right now, we use the cursor position to determine the target position for dropped items. However, it seems that during dragging of files, we do not always receive mouse events, thus cannot update the cursor position. To avoid this, this PR refactors the functionality to use the location of the drop event, instead of the last known cursor position.

Fixes #5237.

https://user-images.githubusercontent.com/1428930/224735951-9cd6ff62-a749-4ff3-8437-c0bee3c0dd05.mp4
2023-03-17 20:52:13 +00:00
Kaz Wesley
75fda33837
Fix precedence of -1.x (#5830)
Fixes #5826.

# Important Notes
- Change frontend representation of negation.
- Fix a precedence issue: The `.` operators in -1.x and -1.2 must have different precedences.
- Remove a no-longer-needed special case from backend translation.
- Add tests for this case after all translations.
2023-03-17 18:53:34 +00:00
Paweł Grabarz
9234d742cb
support custom widget entry labels (#5705)
Implements #5640 and #5650

It made sense for me to implement those two together, as I wanted to make sure that the necessary widget API changes will support custom entry values for both dynamic and static data.

- Added support for custom dropdown labels defined on the method annotations
- Added shortening of static dropdown values, which resolves

| dynamic dropdown - custom labels | static dropdown - automatic shortening |
|-|-|
|![image](https://user-images.githubusercontent.com/919491/220117241-8682736e-d750-4eeb-b9bb-cd6cfce42356.png)|![image](https://user-images.githubusercontent.com/919491/220117412-05ad7f4a-3ccf-468b-a976-c52395a497e2.png)|

# Important Notes
During implementation I had multiple data update order issues caused by FRP network forming a diamond shape. Two inputs that are often updated together were combined with `all` combinator, and that was further fed into the dropdown. This caused two updates to propagate through the whole network, and one of them was immediately outdated. To fix this and similar future scenarios, I've added an `next_tick` FRP node. It buffers the incoming events until the next browser microtask, preserving only the last received event. Currently if it is called inside a `requestAnimationFrame` callback, the effects of that processing will only be rendered in the next frame. Later this can be mitigated by delaying the rendering logic until the microtask queue is empty.
2023-03-17 10:06:32 +00:00
Michael Mauderer
5f1539d531
Better sorting after filtering items in the Component Browser (#4115)
Fixes #5849

Now, the filtering alters the groups' layout, so the group with the best match are placed first. Also, we ensure that the best match is selected after filter change.

![image](https://user-images.githubusercontent.com/3919101/224324736-0b4cdfb1-edb2-4d12-aab0-7cfb36207230.png)

# Important Notes
After all, I haven't taken the advices from [the task description](#5849): they turned out to require very difficult refactoring.
2023-03-16 11:23:40 +00:00
Paweł Buchowski
d77d08358e
remove package-lock.json from gitignore; add unitl-now ignored files (#5954) 2023-03-15 16:54:38 +01:00
Kaz Wesley
e171fba301
New documentation parser (#5917)
Implement new Enso documentation parser; remove old Scala Enso parser.

Performance: Total time parsing documentation is now ~2ms.

# Important Notes
- Doc parsing is now done only in the frontend.
- Some engine tests had never been switched to the new parser. We should investigate tests that don't pass after the switch: #5894.
- The option to run the old searcher has been removed, as it is obsolete and was already broken before this (see #5909).
- Some interfaces used only by the old searcher have been removed.
2023-03-15 15:43:51 +00:00
James Dunkerley
7394a1a4ec
Use AG Grid instead of the old table.js rendering (#5915)
![image](https://user-images.githubusercontent.com/4699705/225099111-2d51d414-7312-4862-a40b-32df5a173df2.png)

Expanded view:
![image](https://user-images.githubusercontent.com/4699705/224783583-8b6bf0a1-2003-4e3b-baca-842c4ff0828f.png)

Truncated view:
![image](https://user-images.githubusercontent.com/4699705/225092432-d8d70953-2da2-4922-8c15-b27cd677cc3c.png)

Replaces the code generating the JS Table visualization with AG Grid Community.
- Supports all of the inputs from the old table.js support.
- Consistently renders values regardless of source.
- **No support for nested tables - by design, we can assess value later.**
- Grid allows sorting and filtering.
- Pins the header row.
- Alternate row coloring.

# Important Notes
To switch to the Enterprise edition, we would need to solve the licensing issues. This would add:

- Filter with values in the grid (like Excel).
- Column auto-sizing.
- Column pining.
- Clipboard copy support (subject to solving the electron issue) - including with or without headers.
- Ability to export to Excel and CSV from the grid.
- Column selector.
- Better options for larger datasets (community only supports infinite scroll).
2023-03-15 11:09:02 +00:00
Paweł Grabarz
dd1144e9ab
Close dropdown widget after selection (#5938) 2023-03-14 23:49:17 +01:00
Michael Mauderer
8201c1c845
Change order of objects to avoid scrollbar over visualisation chooser (#5843)
Fixes the scrollbar of the text visualization overlaying the visualization chooser.  Fixes #5089
Also fixes the scrollbar not overlaying the visualization action bar.

https://user-images.githubusercontent.com/1428930/223997913-3a9c84ae-6675-4f8e-b2e2-99c9e9c98565.mp4
2023-03-14 13:27:37 +00:00
Paweł Grabarz
6c596f8760
triangle indicator for dropdowns (#5859)
Closes #5854

Switches dropdown activation indicator to a triangle shape, and moved it to the horizontal center of a port.
![image](https://user-images.githubusercontent.com/919491/223765985-ec2175b7-7b44-45fd-88ff-543e8c08538f.png)

# Important Notes
Modified triangle SDF to be exact. That way the grow operation behaves as expected, rounding the corners. Other than that, it produces the same bound shape at 0 distance.
2023-03-11 07:12:18 +00:00
Kaz Wesley
023d8ac239
Precompute MSDFs (#5811)
Precompute MSDFs for all ASCII glyphs; after this, we no longer spend any time on MSDF computations when loading or interacting with the example projects.

Also shader precompilation (during build) is now parallel; if you have many cores and an SSD, it's now practically instant.

Closes #5722.

# Important Notes
- The *dynamic-assets* mechanism now used for MSDF data and shaders is versatile, and could be used to pre-seed any other computation-intensive runtime caches.
2023-03-10 12:59:56 +00:00
Paweł Grabarz
73487adce9
Named arguments support in IDE (#5774)
Added support for named arguments in IDE.

https://user-images.githubusercontent.com/919491/223681303-4c716639-d06e-4e33-aa22-6ebca2801b01.mp4


Named arguments are now recognized in node expressions. The function argument placeholders are rendered around series of named arguments. Insertion and deletion of arguments either by connection dragging or by widget selection will cause arguments around to be rewritten into appropriate form, such that the meaning of the expression doesn't change. We no longer need to introduce any wildcards (`_`) in argument positions when editing an argument list of a resolved method.
![image](https://user-images.githubusercontent.com/919491/223682460-143eb6d7-5ac9-4732-9520-71216cbbe58f.png)

For unresolved function calls, the old behaviour remains, as we don't have data about argument names or their desired order.
2023-03-09 21:23:25 +00:00
Adam Obuchowicz
d3b247a2bc
Do not attach visualization on startup. (#5841)
@hubertp has reported in #5620 that sometimes enabling visualization does not send "attachVisualization" message to the engine.

The actual cause was simply because it was already attached. Updating the default visualizations (when receiving information about type) updated the preprocessors, what caused in turn attaching visualization.

That was a bug, of course. This PR fixes it: now we don't update any visualization if it's hidden.
2023-03-08 17:37:18 +00:00
Michael Mauderer
3c3d1f0b03
Implement fix for duplicate entries in visualisation list. (#5808)
Fixes duplicate entries in the visualization chooser. The issue was caused by entries added twice, once matching the `Any` type and once matching the concrete type. Closes #5708.
2023-03-07 23:28:48 +00:00
Adam Obuchowicz
1687dccda4
Retry IDE controller initialization. (#5802)
This mainly fixes #5627 in both scenarios: when the initProtocol method takes too long time and also when we run GUI before LS listens for new connections.

If the IDE initialization fails (e.g. due to above two reasons), it is retried 3 times, waiting some time.
2023-03-07 15:49:40 +00:00
Michał Wawrzyniec Urbańczyk
ee981d2052
Reworked ide watch and ide start commands (#5634)
This PR changes build script's `ide watch` and `ide start` commands, so they don't use `electron-builder` to package. Instead, they invoke `electron` directly, significantly reducing time overhead.

`ide watch` will now start Electron process, while continuously rebuilding gui and the client in the background. Changes can be puilled by reloading within the electron, or closing the electron and letting it start once again. To stop, the script should be interrupted with `Ctrl+C`.
2023-03-02 23:00:47 +01:00
Adam Obuchowicz
cfee9871c7
Fix "Following using a drop down, the last bracket on a node gets removed" (#5795)
Fixes #5789

This strange bug is caused by taking value for widget from visual code (which includes port placeholders) instead of the original code.

For example, having such code:
`operator1.filter 'a' (Filter_Condition.Equal)`
makes the visual code looks as follows
`operator1.filter 'a' (Filter_Condition.Equal value) other_argument_i_dont_remember`
And when we took the value to set on widget, we took `(Filter_Condition.Equal ` - mark space instead of `)`.
2023-03-02 18:16:38 +00:00
Adam Obuchowicz
0575c8d71a
Use cached icons in Component Browser (#5779)
Closes #5189

The component browser uses cached icons, both on the cached list and the navigator panel. It reduced the number of draw calls by 18.
2023-03-02 14:51:42 +00:00
Galin Bajlekov
b8ceaeccdc
Fix missing visualization preview in CB (#5757)
Closes #5639

This PR fixes a regression introduced in #4120, due to which new nodes that were being edited had an empty visualization preview. Now newly created visualization containers do get a default visualization set even before the visualization's input type is set.

https://user-images.githubusercontent.com/117099775/221256294-c87a50da-c8b0-4f00-bf84-f5ae551fca72.mp4
2023-02-27 20:10:23 +00:00
Adam Obuchowicz
d1a0f5a543
Filling cached shapes with a different color. (#5752)
Fixes #5188

Added a new method `ShapeOps::recolorize` which changes color depending on values on r, g, b channels. It should be explained more in the docs. It will allow us using colored cached icons in the Component Browser.
2023-02-27 10:38:47 +00:00
James Dunkerley
9ee21e8812
Stability improvements in visualizations. (#5760)
- Handle `WithWarnings` in `IndirectInvokeCallableNode`.
- Handle no RootNode in `ErrorResolver`.
- Allow table vizualisation to cope if no `data` passed.
- Add `Warning.has_warnings` to check if warnings present.
- Adjust `set_value` for `JS_Object` so creates a new object each time.
2023-02-24 21:04:50 +00:00
Galin Bajlekov
b8158d0af3
Match component browser entries by alias (#5678)
Closes #5340

This PR adds matching searched component browser entries by alias. Now the searcher input is also matched to the `ALIAS` tags of a component, and the best match is used for filtering and sorting the components in the component browser. The alias match scores are reduced by a factor to give them a lower priority when sorting filtered entries in the component browser.

Multiple aliases for a single entry can be obtained from either multiple `ALIAS` tags in the documentation, or comma-separated aliases inside one `ALIAS` tag.

When the searcher input matches one of the entry's aliases the entry in the component browser is displayed as `alias (label)`.

https://user-images.githubusercontent.com/117099775/220571385-d6c2aba6-f13b-4517-9cdf-fe146eeb751a.mp4
2023-02-23 15:40:38 +00:00
Adam Obuchowicz
625172a6d2
Cached Shape Parameter (#5685)
Fixes #5023

This PR adds the ability to add a parameter to shapes defined, with `shape!` macro being a reference to a cached shape.

The API and results may be read [in the example scene](33b6f5937e/lib/rust/ensogl/example/cached-shape/src/lib.rs)

It also contains many other changes, required to have it working:
* We render cached shapes to texture in a different mode than normal shapes: the alpha channel is replaced with information about signed distance. That allows us using cached shapes as normal shapes, i.e. translate them, add to other shapes etc.
* We initialize and arrange shapes as a part of Word initialization, not in pass.
* We keep and blend colors in RGBA instead of LCHA - this is preparation for replacing colors in the next task, and also speeds up our shaders a bit.

The code was refactored in the process: the cached-shape related things were moved to a single module.
2023-02-23 11:18:48 +00:00
Kaz Wesley
dd3ee76ce7
Eager shader compilation (#5606) 2023-02-22 00:29:48 +01:00
James Dunkerley
6dddc530b6
Adding JSON serialization for Map. Adding Table viz support for map. (#5702)
- Add `to_js_object` for `Map` allowing serialization.
- Set default viz to be a Table.
- Add serialization for Map in Table.
- Sort visualization of 2D vectors.

![image](https://user-images.githubusercontent.com/4699705/220112458-4734f126-3f04-4fb3-8c34-09bf11425d53.png)
2023-02-20 23:11:13 +00:00
Galin Bajlekov
4f11ad10fa
Add a shortcut to toggle the visibility of private components in the component browser (#5582)
Closes #4962

This PR adds the `cmd+alt+p` shortcut to toggle the visibility of components with a "PRIVATE" tag in the component browser. The default is to have these private components hidden.

https://user-images.githubusercontent.com/117099775/219106357-0b14a5b5-404f-44dd-b30c-5389054683a7.mp4
2023-02-20 21:24:51 +00:00
Ilya Bogdanov
19beb01cf3
Open Project Dialog (#5607)
Closes #5022

This is basically a reimplementation of the Open Project Dialog that was present in the IDE a while ago. Now it uses the modern shiny `grid-view` instead of the old rusty `list-view`.

https://user-images.githubusercontent.com/6566674/219052041-ff99aa37-249c-4a63-93a5-5acd6b221dc8.mp4
2023-02-20 14:47:48 +00:00
Paweł Grabarz
ccdfaca584
Support widgets and placeholders in more complex expressions (#5656)
Implements https://github.com/enso-org/enso/issues/5032

Added support for widgets in infix expressions (right now only used for file paths)
<img width="306" alt="image" src="https://user-images.githubusercontent.com/919491/218736181-98965cd4-2a8e-4f7a-bbf8-ab302ac5b22c.png">

Widgets and placeholders are handled for all chained methods within a node
<img width="292" alt="image" src="https://user-images.githubusercontent.com/919491/218736249-a0190115-623e-4e66-aff4-90eb2a50685d.png">

The qualified method call convention and static methods no longer confuse the argument placeholders
<img width="374" alt="image" src="https://user-images.githubusercontent.com/919491/218736628-24073f5c-0512-4b37-a271-0248bc954802.png">

Type constructor expressions now receive placeholder arguments. The placeholders work on nested expressions within a node.
<img width="405" alt="image" src="https://user-images.githubusercontent.com/919491/218737379-b53ff125-3910-48f3-bb9f-a0e7b1684ab9.png">
2023-02-20 06:39:39 +00:00
Wojciech Daniło
663ed1e07e
Fixing Electron runner (#5633) 2023-02-19 01:37:58 +01:00
Kaz Wesley
2acc61d0b1
Optimize opening dropdown (#5688)
* Profiling

* Defer rendering hidden Text
2023-02-18 11:31:57 -08:00
Adam Obuchowicz
84eaf2c63e
Bump supported engine version (#5676)
Bumped supported engine version to the first nightly after last breaking change.

Also made it not being fooled by year change.
2023-02-17 12:46:16 +00:00
Michael Mauderer
e81d1e3eea
Fix visualizations sometimes not opening with space bar. (#5624)
Visualizations closing right after opening was caused by the GUI being unresponsive during loading of some visualizations. This caused the timer for measuring the time between space bar press and space bar release to be inflated. The delayed events triggered the "visualization preview mode”, thus closing the visualization has it seemed that the space bar was held down, even though the events just arrived with some delay.

The problem is mitigated by considering the number of frames that have passed between the space and down and the space bar up event, instead of just the wall clock time. If the number of frames is too low, this indicates that frames were dropped to the time is inflated.

Fixes https://github.com/enso-org/enso/issues/5223
2023-02-17 11:33:21 +00:00
Michael Mauderer
0fd390de0c
Fix Match Scoring Algorithm (#5665)
Fixes an error in our scoring algorithm for computing match scores. It now correctly computes scores for patterns that are trailing the target text and ranks patterns at the end of the target text higher than patterns in the middle of the target text.

Closes  #4965 (for now).
See also Discussion https://github.com/enso-org/enso/discussions/5649
2023-02-17 09:25:25 +00:00
Galin Bajlekov
b771728701
Improve searching of component browser entries (#5645)
Closes #5102

This PR improves searching entries in the component browser. Now the searcher input is also matched to the code that a component would generate, and the best match of the two is used for filtering and sorting the components in the component browser.

https://user-images.githubusercontent.com/117099775/219328904-c7a067d5-4998-4ee5-8475-d4974cd7bff5.mp4

#### Entry name formatting

Additionally, the component entry's displayed name format is changed to show the method's name first, followed by the type name in parentheses. This formatting fits better in the narrow columns of the component browser.
2023-02-16 23:21:37 +00:00
Galin Bajlekov
725b3da486
Roll back last VCS snapshot (#4050)
Fixes #5001

This PR implements reverting the current project state to the last state saved into the VCS. This action is performed on `ctrl+r`.

https://user-images.githubusercontent.com/117099775/216645556-1bf34ee7-fdb4-4833-bcad-670d688a3199.mp4

# Important Notes
* Currently on `vcs/restore` all expressions are invalidated and all nodes are re-executed. This is tracked in [task](https://www.pivotaltracker.com/n/projects/2539304/stories/184368950).
2023-02-16 18:14:34 +00:00
Ilya Bogdanov
5a56d69fdf
Make font size in the documentation panel smaller (#5654)
Closes #5653

Make the font size in the documentation panel smaller, the same size as component browser entries.

<img width="1301" alt="Screenshot 2023-02-14 at 14 23 51" src="https://user-images.githubusercontent.com/6566674/218712728-1f233ebb-7b17-4f6d-92e3-2e60def626d3.png">
<img width="890" alt="Screenshot 2023-02-14 at 14 36 55" src="https://user-images.githubusercontent.com/6566674/218712753-72d1cd49-14f7-46c0-a5f5-f56f568219a5.png">
2023-02-14 11:41:09 +00:00
Galin Bajlekov
6967fb7d02
Exclude components with a "PRIVATE" tag from the component browser (#4085)
This PR removes components from the component browser if they contain a "PRIVATE" tag. Private components from the current module or project are not hidden.

![image](https://user-images.githubusercontent.com/117099775/214826165-9fe2cbee-1559-4602-80e0-5d3ce29d8cef.png)
2023-02-13 09:57:55 +00:00
Dmitry Bushev
6971dd0850
Fix links to dev documentation (#5617)
Closes #5555

Update all `dev.enso.org/docs` links.
2023-02-11 02:19:41 +00:00
Kaz Wesley
d1af25793a
Port graph editor to new AST (#4113)
Use the Rust parser rather than the Scala parser to parse Enso code in the IDE.

Implements:
- https://www.pivotaltracker.com/story/show/182975925
- https://www.pivotaltracker.com/story/show/182988419
- https://www.pivotaltracker.com/story/show/182970096
- https://www.pivotaltracker.com/story/show/182973659
- https://www.pivotaltracker.com/story/show/182974161
- https://www.pivotaltracker.com/story/show/182974205

There is additional functionality needed before the transition is fully-completed, however I think it's time for this to see review and testing, so I've opened separate issues. In rough order of urgency (these issues are also linked from the corresponding disabled tests):
- #5573
- #5571
- #5572
- #5574

# Important Notes
The implementation is based partly on translation, and partly on new analysis. Method- and operator-related shapes are translated to the old `Ast` variants, so that all the analysis applied to them doesn't need to be ported at this time. Everything else (mostly "macros" in the old AST) is implemented with new analysis.
2023-02-10 18:05:40 +00:00
Michael Mauderer
6181067d62
Remove duplicate entry in default visualisations. (#5597)
Fixes #5595.
2023-02-09 13:00:30 +00:00
Paweł Grabarz
4ddb2eca26
fix visualization debug scene (#5596)
Fixes #5553

Found a fix during triage, as I tried to reproduce the issue. For some reason the visualization UI component was never attached to the scene, and its size was never set. Adding that fixed the issue immediately.

<img width="287" alt="image" src="https://user-images.githubusercontent.com/919491/217581444-4d6463cd-ff7f-4292-9355-edee15221e40.png">
2023-02-09 09:32:04 +00:00
James Dunkerley
1c821e22cf
Some fixed form the Anagrams experiment. (#5592)
- Fixes the display of Date, Time_Of_Day and Date_Time so doesn't wrap.
- Adjust serialization of large integer values for JS and display within table.
- Workaround for issue with using `.lines` in the Table (new bug filed).
- Disabled warning on no specified `separator` on `Concatenate`.

Does not include fix for aggregation on integer values outside of `long` range.
2023-02-08 22:17:00 +00:00
Dmitry Bushev
53d5487f47
Lookup method pointers in IDE (#5578)
Closes #5036

Move the logic that looks up method pointers from the language server to IDE. This way we can keep the suggestion updates and expression updates async, otherwise it will hurt the initial startup time of LS.
Fixes the issue when some expression updates does not contain the method pointer.
2023-02-08 00:57:32 +00:00
Michael Mauderer
d3e46e9957
Ensure Table Visualisation is the Default Visualization for Tables (#4120)
Adds a mechanism for the GUI to choose an appropriate default visualization for a newly created node.

https://user-images.githubusercontent.com/1428930/216641714-2410d2c9-44d2-45f0-856d-1f995421c94b.mp4

# Important Notes
This is a workaround for [missing functionality](https://www.pivotaltracker.com/story/show/184390437) that would take much longer to implement.
2023-02-07 23:23:24 +00:00
Ilya Bogdanov
bedffdf856
Fix issue with reverting text edits on cmd-click (#4119)
Fixes #4963

We didn't ignore `start_editing` events for the nodes already being edited.

https://user-images.githubusercontent.com/6566674/216616037-3edcd48c-2557-466b-ba66-c0475ccbddbd.mp4
2023-02-07 18:11:08 +00:00
Paweł Grabarz
6b14ec5a63
Dynamic dropdown support (#4072)
Implementation of https://www.pivotaltracker.com/story/show/184012743

https://user-images.githubusercontent.com/919491/214082311-cf49e43c-1d1f-4654-903c-a4224cd954d8.mp4

This is also a step towards more general widget support. The widget metadata is queried using `Meta.get_annotation` method through a dedicated visualization. For now only `Single_Choice` case is handled, and always all suggestions are is returned.

# Important Notes
There are limitations as to which node segments receive a widget. Only chain method calls are supported now (`thing.method` syntax), and only outside of lambda scope. Widgets in lambdas will require support for visualisations of lambda subexpressions, which is currently missing in the engine. The IDE technically tries to place the widgets there, but the data never arrives. It should work once the engine support is added.

This PR includes a mock for `Meta.get_annotation` call that only supports `Table.at` method. Real implementation is a separate task that is already in progress.
2023-02-04 00:50:24 +00:00
Ilya Bogdanov
1a87e47729
Hide skip and freeze buttons behind feature flag (#4109)
[Task](https://www.pivotaltracker.com/story/show/184347909)

Skip and freeze buttons are no longer visible by default.
2023-02-03 13:52:51 +00:00
Michael Mauderer
349cc210e0
Bump rustc to nightly-2023-01-12 (#4053)
Bump rustc nightly-2022-08-30 and fix new errors and lints.
https://www.pivotaltracker.com/story/show/184229094
2023-02-02 23:05:25 +00:00
Ilya Bogdanov
89dc7a5726
Mark nodes with yellow stripes if their evaluation produced warnings (#4101)
[Task](https://www.pivotaltracker.com/story/show/184237388)

Nodes with warnings are highlighted with yellow stripes. Colors for dataflow errors and panics also changed.


https://user-images.githubusercontent.com/6566674/216285009-9d29eb84-f663-4f2e-a6c8-4c4f593bd1ef.mp4
2023-02-02 17:03:46 +00:00
Ilya Bogdanov
0a6e58fc99
Fix documentation locking while moving around with arrow keys (#4108)
Fixes [bug](https://www.pivotaltracker.com/story/show/184367981). It also sets the display delay to 0, as requested by @wdanilo


https://user-images.githubusercontent.com/6566674/215985281-e1abb094-a776-4863-b556-daca638cc5e1.mp4
2023-02-02 14:28:25 +00:00
James Dunkerley
0790ce494f
New set function, parse a column (#4097)
- New `set` function design - takes a `Column` and works with that more easily and supports control of `Set_Mode`.
- New simple `parse` API on `Column`.
- Separated expression support for `filter` to new `filter_by_expression` on `Table`.
- New `compute` function allowing creation of a column from an expression.
- Added case sensitivity argument to `Column` based on `starts_with`, `ends_with` and `contains`.
- Added case sensitivity argument to `Filter_Condition` for `Starts_With`, `Ends_With`, `Contains` and `Not_Contains`.
- Fixed the issue in JS Table visualisation where JavaScript date was incorrectly set.
- Some dynamic dropdown expressions - experimenting with ways to use them.
- Fixed issue with `.pretty` that wasn't escaping `\`.
- Changed default Postgres DB to `postgres`.
- Fixed SQLite support for starts_with, ends_with and contains to be consistent (using GLOB not LIKE).
2023-01-31 20:48:16 +00:00
Ilya Bogdanov
945aa2b2d7
Avoid relying on order of updates for hierarchy index (#4094)
[Task](https://www.pivotaltracker.com/story/show/184279344).

This PR fixes the hierarchy index of the suggestion database and removes a bunch of warnings from the console:

![image](https://user-images.githubusercontent.com/6566674/215051255-6cb22349-1e72-4717-96c0-66db9bf2020f.png)

Now we also correctly display documentation for all types. Previously some methods, namely for the `Text` type, were not present in the documentation. No visual changes to IDE were made.
2023-01-31 12:52:09 +00:00
Ilya Bogdanov
3ad4689dfa
Allow removing all nodes from the scene (#4084)
Fixes [bug](https://www.pivotaltracker.com/story/show/184272392).


https://user-images.githubusercontent.com/6566674/214796891-d0cd0bb3-28ce-41fc-b3a2-2bb93fd9d96c.mp4
2023-01-28 04:37:40 +00:00
Wojciech Daniło
ce5b078130
Dependency cleaning (#4092) 2023-01-27 23:39:37 +01:00
Ilya Bogdanov
9e4dd9d708
Documentation display delay and hovered item preview caption (#4075)
This PR adds a configurable delay before displaying documentation ([task](https://www.pivotaltracker.com/story/show/183970872)) and a "hovered item preview" caption on top of the panel when you hover some not-selected entry. ([task](https://www.pivotaltracker.com/story/show/183970838)). The caption design will be adjusted in a future PR with a style update.


https://user-images.githubusercontent.com/6566674/214233481-10550fcf-a106-4b11-b5a2-15283745cbbf.mp4
2023-01-27 01:34:35 +00:00
Wojciech Daniło
da84e34b9a
Shaders precompilation (#4003) 2023-01-27 01:09:09 +01:00
Ilya Bogdanov
366f231765
New documentation panel (#4066)
This PR implements HTML generation from documentation IR for all suggestion database entries and replaces the old documentation panel with a newer one.

Additional adjustments to the looks of the documentation would be applied separately in a future PR. This PR focuses on the fastest possible delivery of a usable documentation panel. We want to test it in real-world use cases and gather feedback for future improvements.

Documentation demo scene with mocked data:

https://user-images.githubusercontent.com/6566674/213436313-88753ed8-346f-423e-956e-7db39f5dc266.mp4


Component browser with actual engine-provided data:


https://user-images.githubusercontent.com/6566674/213436375-d0ec074b-f7a6-4deb-a7de-3adee999cc86.mp4

# Important Notes
- Fixed language protocol data structures.
- Scrolling to the selected method is also implemented here.
- Also, the selected item is highlighted with yellow.
- Only some pieces of information we have are displayed. For example, we don't display return types for methods or types of arguments.
- A bunch of code related to previous implementation is removed, but probably not all of it.
2023-01-25 01:10:10 +00:00
Michael Mauderer
38906b39da
Implement Lazy Text Visualisation. (#3910)
Implements [#183453466](https://www.pivotaltracker.com/story/show/183453466).

https://user-images.githubusercontent.com/1428930/203870063-dd9c3941-ce79-4ce9-a772-a2014e900b20.mp4

# Important Notes
* the best laziness is used for `Text` type, which makes use of its internal representation to send data
* any type will first compute its default string representation and then send the content of that lazy to the IDE
* special handling of files and their content will be implemented in the future
* size of the displayed text can be updated dynamically based on best effort information: if the backend does not yet know the full width/height of the text, it can update the IDE at any time and this will be handled gracefully by updating the scrollbar position and sizes.
2023-01-24 20:55:36 +00:00
Michael Mauderer
5b5a2be829
Use focus information to prevent new node creation on pressing enter in Project Name and Code Editor. (#4068)
This PR fixes the Component Browser opening when pressing enter while editing either the Project Name or the text in the Code Editor. This is achieved by using our focus management system to check whether something is focused. The Component Browser only appears if nothing else is focused.
2023-01-24 15:09:39 +00:00
Galin Bajlekov
aa995110e9
Separate component browser sections for every namespace libraries are imported from (#4044)
This PR adds new sections to the component browser section navigator bar. The sections are based on the namespaces from which libraries are imported. Selecting a namespace section from the navigator bar highlights the modules from that namespace. Selecting a module from a different namespace switches the navigator bar indicator to the correct namespace category. The currently selected namespace is also shown as the root of the breadcrumbs.

https://user-images.githubusercontent.com/117099775/212144719-2470a99d-8d8c-47ca-ab50-5bac65468090.mp4

For a new project where only the `Standard` namespace exists the only visible change is the breadcrumbs. Adding for example additional modules in the project `src` folder will create them in the `local` namespace, this namespace will show up as a separate navigator section.
2023-01-23 11:57:17 +00:00
Ilya Bogdanov
341b235fb1
Generate HTML for section headers and synopsis (#4038)
Two tasks:
- [Task link](https://www.pivotaltracker.com/story/show/184024127)
- [Task link](https://www.pivotaltracker.com/story/show/184024148)

This PR implements the generation of HTML from Documentation IR for section headers and the Synopsis section.
The synopsis contains documentation of the type/module + a list of the type's constructors.

https://user-images.githubusercontent.com/6566674/212684680-d999b525-56c7-4952-8ccc-192989acdf33.mp4

# Important Notes
- Paddings are removed from the documentation panel because they are now implemented in the HTML generator, but it doesn't affect the looks much (documentation still looks awful). All other changes do not affect the current look of the component browser and are only shown in the demo scene.


https://user-images.githubusercontent.com/6566674/212685347-addb9204-8441-44be-8d8e-3c2626d77f77.mp4
2023-01-18 13:18:26 +00:00
Adam Obuchowicz
503c680eb9
Fix CB making many frames for Undo-Redo (#4025)
The fix consists of two parts:
1. All the "review-apply" and "store temporary md" actions in the searcher controller are now guarded by an ignored transaction.
2. Because some of the temporary state may reach the UR frames assigned to other actions, added a bunch of code for removing all temporary expressions from the code and use it after restoring a frame. We may consider using it after project load as well.

### Important Notes

Added a useful method "log_err" to ResultOps (so every Result will have those).
2023-01-18 12:55:57 +01:00
Nikita Pekin
4ea1880dec
chore(183909391): Remove existing Cloud dashboard code (#4047)
* chore(183909391): Remove Cloud dashboard

* update changelog
2023-01-18 10:46:48 +03:00
Adam Obuchowicz
6c7c1c7d66
Additional shortcut for Redo (#4035)
Add a cmd+shift+z shortcut for redo while keeping alse the old one
2023-01-17 12:38:25 +00:00
Paweł Buchowski
8300d2f823
move hardcoded mixpanel token to the config (#3954)
Remove hardcoded mixpanel token and move it to the config class. This will allow for injection cloud's id and distinguish Enso Ide project from Enso Cloud in mixpanel.
2023-01-17 10:30:47 +00:00
Kaz Wesley
662992eb37
Replace tracing (#4017)
Logging: Replace tracing with an efficient logging implementation, with 0-runtime cost for disabled log levels. (https://www.pivotaltracker.com/story/show/183755412)

Profiling: Support submitting `profiler` events to the User Timing Web API, so that measurements can be viewed directly in the browser. (https://www.pivotaltracker.com/story/show/184003550)

# Important Notes
Logging interface:
- The macros (`warn!`, etc.) now take standard `format_args!` arguments (the tracing implementations accepted a broader syntax).
- Compile-time log levels can now be set through the CLI, like so:
`./run ide start --log-level=trace --uncollapsed-log-level=info`

Profiling:
- The hotkey Ctrl+Alt+Shift+P submits all `profiler` events logged since the application was loaded to the Web API, so that they can then be viewed with the browser's developer tools. Note that standard tools are not able to represent async task lifetimes or metadata; this is a convenient interface to a subset of `profiler` data.
- As an alternative interface, a runtime flag enables continuous measurement submission. In the browser it can be set through a URL parameter, like http://localhost:8080/?emit_user_timing_measurements=true. Note that this mode significantly impacts performance.
2023-01-16 20:31:01 +00:00
Paweł Grabarz
1578ed093a
Defer dropdown view initialization until opened and cache shaders between layers (#4046)
Fixes https://www.pivotaltracker.com/story/show/184216698

Reduced impact of node dropdown widgets on load times by deferring creation of grid views until each widget is opened. This also improves node editing time, as the dropdowns are not recreated immediately.

This approach of lazy initialization now caused a significant lag when opening the dropdown. Two major causes of the lag spike is glyph generation (msdfgen, `new_glyph`) and shader compilation (happened every time, because each dropdown has unique layer stack). To reduce the impact of that, the shader compiler now caches the shaders based on generated shader source. Glyph creation hasn't been changed and is still slow. The startup performance is now roughly where it was before introducing widgets.
2023-01-13 15:30:38 +00:00
James Dunkerley
ccde47e24e
Simple Warnings visualization. (#4043)
A simple first pass at showing warnings as a visualization.

![image](https://user-images.githubusercontent.com/4699705/212064721-6452d653-5421-4937-b70e-8ce58d92bff5.png)

Ideally, we would have a PayloadType which showed that the node had warnings attached to it, but that is significantly more work. So as a first pass to allow us to see the warnings, I have added a simple JS visualization.

Also update the file upload so puts valid code in.

https://user-images.githubusercontent.com/4699705/212096242-048b6301-6e7f-4c5b-a4e5-809640dbfb17.mp4
2023-01-13 11:28:57 +00:00
Ilya Bogdanov
6b8d8e9270
Implement documentation IR (#4024)
[Task link](https://www.pivotaltracker.com/story/show/184012434)

This PR implements Intermediate Representation for our documentation. Later these data structures would be used to generate HTML and CSS for the documentation panel. For now, we display it in the debug scene.


https://user-images.githubusercontent.com/6566674/210674850-480a3e6e-76c3-4f34-a235-15c44dc9ec01.mp4

# Important Notes
- `suggestion-database` now lives in a separate crate
- also, two utility crates were introduced for the `notification` and `executor` modules of enso-gui
- documentation debug scene is moved to a separate crate
- All refactorings are done in the last two commits
2023-01-12 14:50:33 +00:00
Adam Obuchowicz
fc62b3b60c
Fix for "When editing text if you Ctrl-Enter quickly it deletes some of the input" (#4040)
Fixes https://discord.com/channels/401396655599124480/1060273629729927180

The issue was caused by delay in refreshing component browser: if it did not pass when the user pressed enter or cmd+enter, the input was not refreshes in controller and thence in the edited/created node.
2023-01-12 10:24:41 +00:00
Paweł Grabarz
fe1cf9a9ce
Basic dropdown widget integration (#4013)
Implements https://www.pivotaltracker.com/n/projects/2539304/stories/184023445

Added a dropdown widget to graph node for all span tree nodes that have tag values present. When an option is selected, the controller receives a partial expression update, which targets specific crumbs of the expression (similar to how edge endpoint updates work).


https://user-images.githubusercontent.com/919491/210219931-8ae418fd-3ac4-44a5-abea-9e670f15cdf9.mp4

# Important Notes
Right now the dropdown widget is recreated every time the node is edited, including a dropdown option being selected. This causes it to close every time. I wanted to get around that by diffing span trees, but I wasn't able to do it in useful way. Additionally, current implementation of node input expression view heavily relies on being reinitialized from scratch every time. This led to more necessary changes than I was comfortable with for this task. I believe it will be easier to implement it as part of more complete widget support, especially after dynamic data support, as we will have proper widget type information.
2023-01-11 14:32:25 +00:00
Ilya Bogdanov
654a8351c8
Prune unused ids from metadata on loading file (#4033)
This PR fixes a bug reported in [Task](https://www.pivotaltracker.com/story/show/184159167).

To reproduce the issue, one can do the following steps:
1. Create a new project in the IDE.
2. Check the metadata section in the `Main.enso` file – `IdeMetadata` (a JSON object starting with `"ide":`) contains info for two nodes.
3. Edit the project in the external editor. For example, replace the expression of the second node.
4. Open a project in the IDE and observe the metadata. Now `IdeMetadata` contains three nodes – one unmodified, one added, and one no longer present. It leads to constantly growing metadata if you use an external editor.

This PR fixes the issue by pruning unused node metadata on loading.

No visual changes to the IDE were made.
2023-01-11 11:13:31 +00:00
Ilya Bogdanov
37af06b14d
Integrate Tailwind framework (#3999)
[Task link](https://www.pivotaltracker.com/story/show/183992025)

This PR moves the documentation visualization into a separate crate and sets up the Tailwind CSS framework for this new crate.

We would use Tailwind to style our HTML documentation.


https://user-images.githubusercontent.com/6566674/208719213-85f78f7e-8dc2-45d5-95a1-db4baad1bda1.mp4
2022-12-23 14:20:24 +00:00
Paweł Grabarz
4042b5b237
Grid-view based dropdown component (#3985)
Implements https://www.pivotaltracker.com/n/projects/2539304/stories/184023380

Dropdown component. Planned to be used in nodes as a single and multiple selection widget, both for static and dynamically loaded values. Initial support is focused on static data, with limited support for dynamic sources. Notably, loading states are not supported yet. Full support for that is planned to be added later with widget lazy-loading.

- Supports single and multiple selections.
- Dedicated API for providing a static list of all entries.
- Range-based query API for dynamically loading data as it is scrolled (only basic support - will need more work for proper async lazy-loading).
- Internal entry cache and query batching to avoid querying data one by one (the batching for now is very basic, will have to be improved for proper lazy-loading).
- Automatic dropdown width adjustment based on the entry label lengths, up to a set max allowed value.
- Open and close animation.
- Keyboard support for focusing and selecting entries.

![image](https://user-images.githubusercontent.com/919491/207866293-de2e3fef-c93b-48cc-8253-11c186d223fd.png)

# Important Notes
Implementing the dropdown on top of grid-view have uncovered some assumptions around grid-view layers. It was assumed to always be a part of the component browser. Removing that assumption required a mechanism for propagating camera update information through layer tree. This is now implemented using a `camera_parent` layer field. Ideally each layer should simply have at most a single parent, and camera inheritance would follow that. That refactor turned out to be quite involved, so right now the simpler temporary solution is introduced in order to not delay this PR further.
2022-12-22 18:19:40 +00:00
Dmitry Bushev
ee476eaf74
Clean restart on keypress (#3998)
A small adjustment to recompute shortcut. It makes sense to do a clean restart, instead of just re-executing the program.
2022-12-21 09:48:31 +00:00
Michał Wawrzyniec Urbańczyk
622c7ce326
Browser selection for wasm tests (#3994) 2022-12-21 05:35:42 +01:00
Wojciech Daniło
be17f31dbf
Fixing set_size regression. (#3995) 2022-12-20 12:42:31 +01:00
Ilya Bogdanov
0e8616e8d7
Demo scene & DocSections in suggestion database (#3980)
[Task link](https://www.pivotaltracker.com/story/show/184000483)
[Task link](https://www.pivotaltracker.com/story/show/184012363)

This PR adds a new `documentation` demo scene that would be used while developing a new documentation panel.

Also, entries in the Suggestion database now store `DocSection`s provided by the engine, and we can mock them for testing purposes using the new `doc_section!` macro.

No changes in the documentation panel were made.


https://user-images.githubusercontent.com/6566674/207567074-5c5682df-a0e8-435c-b393-6f02b2969614.mp4
2022-12-20 11:35:36 +00:00
Ilya Bogdanov
dbe60d2466
Implement hierarchy index in suggestion database (#3992)
[Task link](https://www.pivotaltracker.com/story/show/184012397).

This PR adds a hierarchy index to our suggestion database. The index will be used in the future when building documentation pages. E.g., documentation of the Module includes all the Types defined in this module; documentation of the Type includes documentation for every Method and Constructor defined for this type.

We could call this index "self-type index", but the Type-Module relation is not using self-type.

No visual changes to the IDE were made.

# Important Notes
We rely on the order of updates from the engine. In particular, the following scenario would lead to inconsistency in the DB:
1. Engine sends an update, changing the parent module of some type to "NonExistentModule"
2. Engine sends an update, adding a new entry "NonExistentModule"

I assume that the engine would never send the update with a non-existent qualified name used.
2022-12-20 02:16:19 +00:00
Galin Bajlekov
4b28f8f8f0
Visual indication of outdated VCS snapshot (#3950)
This PR provides a visual indication of whether the project's current state differs from the most recent snapshot saved in the VCS. The project name displayed in the IDE changes to a darker text to indicate that the VCS snapshot is outdated, and back to a lighter text when the current project state corresponds to the last saved VCS snapshot.

https://user-images.githubusercontent.com/117099775/208088438-20dfc2aa-2a7d-47bf-bc12-3d3dff7a4974.mp4

The outdated project snapshot indicator is set when:
* A node is moved.
* A node is added or removed.
* The text editor is used to edit the text.
* The project is auto-saved, and the auto-saved project state does not correspond to the last saved snapshot in the VCS.

The outdated project snapshot indicator is cleared when:
* A new project snapshot is successfully saved using `ctrl+s`.
* The project is auto-saved, and the auto-saved project state is confirmed to correspond to the last saved snapshot in the VCS. This occurs, for example, when a project change is undone and the project is reverted to the last saved snapshot state.

The auto-save events do not occur immediately after a project change but have a short delay, thus the VCS status update is affected by the same delay when triggered by an auto-save event.
2022-12-19 21:22:33 +00:00
Wojciech Daniło
06cfafca09
Auto Layouts (#3937) 2022-12-19 02:16:54 +01:00
Adam Obuchowicz
a6b5db9021
Update Component Browser only when user stops typing. (#3991)
Currently on every keystroke we try to refresh the Component Browser content. Due to some performance problems one refresh can take > 500 ms, so several keystrokes can hang our app for few seconts.

This PR mitigates this problem by refreshing the CB only when 200 ms passes since last keystroke. It should not be problematic for the user (actually many search engines, like this in IntelliJ do this), but we avoid choking our app with multiple CB refreshes at once.
2022-12-18 19:17:49 +00:00
Michał Wawrzyniec Urbańczyk
a2d8c1d0ab
Fix directing JSON data to JS visualizations. (#3984) 2022-12-15 11:29:09 +01:00
Dmitry Bushev
3e74afca51
misc: bump wasm-pack (#3983) 2022-12-14 18:45:39 +01:00
Ilya Bogdanov
285959835f
Scroll the documentation panel when it is hovered by the mouse (#3968)
[Task link](https://www.pivotaltracker.com/story/show/183970810).

Now documentation panel is being scrolled when only hovered by the cursor (you don't need to click on it beforehand).

Tested on macOS with both the touchpad and the mouse.

https://user-images.githubusercontent.com/6566674/206667769-04aae6b2-91ff-4877-bf10-8c0f0c4c5873.mp4
2022-12-14 16:37:04 +00:00
Michał Wawrzyniec Urbańczyk
965d1ff28b
Bump wasm-bindgen (#3971)
This PR brings wasm-bindgen (and related crates) to the latest version. I've also removed patching code, so future updates should be much easier.
2022-12-13 22:20:25 +01:00
Dmitry Bushev
957279153a
Add a shortcut for interrupting the program (#3967)
Add shortcuts for interrupting and restarting the program execution.
2022-12-12 17:48:42 +00:00
James Dunkerley
79de5eecd9
Move Create New Project button to top. (#3972)
- Moves the Create button to the top.
- Adjust default project to also bring in Table and Database.
2022-12-12 15:30:36 +00:00
James Dunkerley
6eb30c37a5
Small tweak to convert Date and Time objects to strings in Table viz. (#3953)
Currently, Date, Time_Of_Day and Date_Time are rendered as `[Object object]` in the table.
![image](https://user-images.githubusercontent.com/4699705/206166467-a08c8a78-af63-4b2e-93d7-4f4d4190f117.png)

This makes them render in simple text format.
2022-12-09 00:10:26 +00:00
Ilya Bogdanov
82dabd329d
Show default mouse cursor over documentation panel (#3951)
[Task link](https://www.pivotaltracker.com/story/show/183970777)

The default mouse cursor is now displayed over the documentation panel.


https://user-images.githubusercontent.com/6566674/205954491-177fcc01-7e15-4a5c-825e-c0b02be527cc.mp4
2022-12-08 18:50:19 +00:00