Commit Graph

309 Commits

Author SHA1 Message Date
Nikita Pekin
e9d6d03c67
Cognito auth 3/7 - add registration (#5864)
3rd PR for IDE/Cloud authorization with cognito. This PR introduces registration templates + flows + amplify wrappers for registering & confirming user registration.

Login + Set Username + Forgot Password flows are to be added in next PRs to keep the changes reviewable.
2023-03-17 15:26:59 +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
somebody1234
e525d2322e
Fix #5963 (#5974)
Fixes #5963
2023-03-17 08:23:37 +00:00
Paweł Buchowski
25b57e5024
Set authentication default value to false (#5982)
Since authentication is partially merged, and it's still under development, we want to disable it by default.
2023-03-16 19:34:41 +01:00
Paweł Buchowski
126a466872
hotfix watch by removing tailwind.css dependency (#5977) 2023-03-16 15:49:35 +01:00
somebody1234
27639233c6
Fix #5969 (#5972)
Should fix #5969
The cause was the switch to `* as moduleName` namespace imports - `process.on` is missing from the namespace import, causing an error.
2023-03-16 14:09:31 +01: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
James Dunkerley
602541e4d3
Enable clipboard access. (#5958) 2023-03-15 19:21:29 +01: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
Paweł Buchowski
6f29262f90
Cognito auth 2/7 - add authorization app (#5798)
2nd PR for IDE/Cloud authorization with cognito. This PR introduces boilerplate react app + some amplify code to fetch the access token + username of the currently logged in user, if they are already authenticated.

Registration + Login + Set Username + Forgot Password flows are to be added in next PRs to keep the changes reviewable.
2023-03-15 11:54:16 +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
Nctdt
5c4660b5aa
Enable typescript-eslint (#5717)
implement [issue#5694](https://github.com/enso-org/enso/issues/5694)
2023-03-15 03:42:14 +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
Paweł Buchowski
998d5999a3
Cognito auth 1/2 - extracted electron logic (#5793)
Provides functionality necessary for:
- opening URLs in the system browser (so that we can handle OAuth flows outside of the app)
- handling deep links to the application (so that the OAuth flows can return the user to the app)

### Important Notes

- Modifies `preload.ts` to expose the ability to open the system browser to the sandboxed parts of the app.
- Modifies `election-builder-config.ts` to register a deep link URL protocol scheme with the OS.
- Modifies the client's `index.ts` to register a handler for Electron `open-url` events
2023-03-09 16:02:28 +01: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
Wojciech Daniło
60d8b8fcea
Fixing bug that input config was ignored (#5847) 2023-03-08 10:11:59 +01: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
Wojciech Daniło
43144e102e
Fixing incorrect Electron behavior. (#5764)
* Fixing --version command

* Showing frame on MacOS.

* Fix debug.info

---------

Co-authored-by: Adam Obuchowicz <adam.obuchowicz@enso.org>
2023-02-27 13:31:33 +01: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