Commit Graph

346 Commits

Author SHA1 Message Date
somebody1234
f5d5e846c3
Add JSON-RPC endpoints (#6004)
- Adds JSON-RPC endpoints
- Adds typings, copied from corresponding Rust typings

# Important Notes
Has *not* been tested since it is not currently used. It will be used (and tested) in future PRs.
2023-04-03 11:50:11 +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
somebody1234
5a100ea79b
Convert dashboard to use esbuild (#6034)
* Switch dashboard to esbuild

* Minor fixes; move Tailwind generation into esbuild-config

* Fix watching `content/` and `client/`

* Bump esbuild binary versions; minor dependency list fixes

* Fixes; rename "npm run dev" to "npm run watch-dashboard"

* Avoid writing esbuild outputs to disk for `dashboard/`

* Convert watch-dashboard to be fully in-memory; rebuild css files on change

* Remove obsolete FIXME

* Remove unused constants

* Run prettier

* add missing styles

* Fixes

* Fix the fixes

* Run prettier

* Fixes; use nesting plugin to wrap tailwind preflight

* Remove testing flag from client/watch

* Minor fixes

* Run prettier

* Make css rebuild when tailwind config changes

* Fix bundling for dashboard

* Fix dashboard/bundle.ts erroring when build directory does not exist

* Fix esbuild binary package names

* Remove redundant "npx" prefix from build scripts

* Remove unused dependency

* workaround for mac freeze

* add missing sections

* Address review issue

* Fix live-reload of `npm run watch-dashboard`

* Fix service worker for client-side routing

* Fix GL crash

* Revert "Fix GL crash"

This reverts commit 612136bc1a.

* Implement suggested fix

* prettier

---------

Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
2023-03-31 16:19:07 +02:00
somebody1234
0aa7d7ee4d
Fix prettier config; run prettier (#6132)
* Fix prettier config; run prettier

* add workaround for double re-render

* add missing fixme

---------

Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
Co-authored-by: Nikita Pekin <nikita@frecency.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-03-31 14:49:34 +02: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ł Buchowski
1a569223aa
Revert "Cognito auth 8/7 - fix prettier config; run prettier (#6003)" (#6127)
This reverts commit a9dbebf3f3.
2023-03-29 13:20:46 +02: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
somebody1234
a9dbebf3f3
Cognito auth 8/7 - fix prettier config; run prettier (#6003)
- Fixes prettier config to include `.tsx`
- `prettier -w .` has been run in `app/ide-desktop`
- `prettier -w .` has also been run in `pack/js`, however there were no changes.

# Important Notes
After this is merged, a PR SHOULD be created to add the following file to the root directory:
`.git-blame-ignore-revs`
```
# <name of the commit for this PR>
<hash of the commit for this PR>
```
This makes `git blame` ignore the commit, which is a good idea since this PR only does formatting changes.
2023-03-29 10:24:32 +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
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