Commit Graph

331 Commits

Author SHA1 Message Date
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
Paweł Buchowski
e5fef2fef3
add tailwind.css file to alwaysCopiedFiles (#6040) 2023-03-22 12:14:37 +01:00
somebody1234
d38951d4e9
Fix #5975 (#5976)
Fixes issue with blank screen caused by missing `tailwind.css`.
2023-03-22 09:18:06 +01: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
Nikita Pekin
0fc8683108
Cognito auth 6/7 - add signout (#5867) 2023-03-21 03:41:57 +01:00
Ilya Bogdanov
210b5b7b3d
Fix passing custom options to Electron app in ./run ide watch (#6020) 2023-03-21 02:33:25 +01: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
Nikita Pekin
8c18d7c106
Cognito auth 5/7 - set username (#5866)
5th PR for IDE/Cloud authorization with cognito. This PR introduces user username templates + flows + backend wrappers for  setting username.
Forgot Password flows are to be added in next PRs to keep the changes reviewable.
2023-03-20 11:57:27 +00:00
somebody1234
fa23e800e5
Finish enabling ts-eslint (#5944)
- prefer `null`, `!= null` and `== null` instead of `undefined`
- disallow `as`, add comments for the existing usages of `as`
- make `tsconfig.json` a bit stricter
- minor fixes to other files that were missed

# Important Notes
N/A
2023-03-20 09:35:16 +00:00
Nikita Pekin
201358e5cc
Cognito auth 4/7 - add login (#5865)
4th PR for IDE/Cloud authorization with cognito. This PR introduces login templates + flows + amplify wrappers for logging in users w/ federated providers or with username/email.
Set Username + Forgot Password flows are to be added in next PRs to keep the changes reviewable.
2023-03-18 00:22:04 +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
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