Commit Graph

2925 Commits

Author SHA1 Message Date
GregoryTravis
255edda146
Add parse extensions to Text type. #6330 (#6404)
Add type-specific parse stubs to Text, e.g.:
Text.parse_json self -> Json =
Text.parse_url self -> Url =
Text.parse_number self -> Number =
2023-04-26 15:37:09 +00:00
somebody1234
400cdbe893
Cloud/desktop mode switcher (#6308)
* fixmes

* fixmes

* fixmes

* fixmes

* fixmes

* fixes for e-hern's comments

* use abortcontroller

* add docs

* fixes

* revert craco, fix windows build

* remove from gitignore

* remove unnecessary check

* tmp

* augment window

* tmptmp

* split errors back up

* tmp

* tmp

* prettier

* fix

* Fix lints

* Prepare for addition for `as T` lint

* Add lint for early returns

* Address review issues

* Fix lints

* remove withrouter

* fix file length

* fixes

* fixes

* remove dashboard

* fix

* use switch

* prettier

* fixes

* prettier

* fixes

* run prettier

* run prettier

* run prettier

* fix main page url

* allow node.js debugging

* fix lints

* change not equal

* prettier

* Remove references to withRouter; fix lints

* Run prettier

* Add cloud endpoints

* Add JSON-RPC endpoints

* Add dashboard skeleton

* Add components and edit dashboard

* Run prettier

* (WIP) Add cloud endpoints

* Add rpc endpoints

* Address review issues

* Formatting and minor fixes for `newtype.ts`

* Address review issues

* Rename `Brand` to `NewtypeVariant`

* Rename `Brand` to `NewtypeVariant`

* Fix formatting in `newtype.ts`

* 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

* Add dashboard skeleton

* Run prettier

* 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

* Export newtypes

* Make css rebuild when tailwind config changes

* Fix endpoints

* Finish copying changes over

* Remove duplicate type definitions

* Feat: top-bar styles and changePassword feature

* Fix: remove eslint disable comments

* Fix bundling for dashboard

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

* Move CSS to Tailwind config

* Run prettier

* Copy changes from old branch

* Update endpoints

* Fix esbuild binary package names

* Remove redundant "npx" prefix from build scripts

* Remove unused dependency

* workaround for mac freeze

* Fix bug

* add missing sections

* Fix: bug

* Address review issue

* Fix prettier config; run prettier

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

* Fix service worker for client-side routing

* Remove workaround for backend bug when listing directories

* Fix sizing

* Fix spacing, add fixed paths

* Address review issues; minor fixes

* Fix authentication on desktop IDE

* Run prettier

* Allow unused locals and parameters in tsconfig.json

* Run prettier

* Fix TypeScript errors

* Run prettier

* Fix eslint errors, restructure code

* Minor fixes and other changes

* Revert incorrect change to `cognito/changePassword`

* Remove unused file

* Run prettier

* Merge with top bar; implement switching between IDE and dashboard

* Animate project switcher (WIP)

* Fix IDE and project switcher animation

* Fix eslint errors

* Change `#dashboard` to `.dashboard` for Tailwind

* Split `-authentication` option into `-cloud.authentication` and `-cloud.dashboard`

* Address review issues

* Add description for cloud option group

* Extract custom CSS values into Tailwind config; use ModalProvider

* Hide topbar in IDE view

* Add project manager backend service

* Begin fixing IDE open

* (WIP)

* Clean up unused code

* Minor fixes

* Fix

* Fix local backend's usage of project manager (WIP)

* WIP

* Minor fixes

* Fix scrollbar showing because of margins

* Expose `runProject` instead of `main`

* Keep persistent websocket to Project Manager

* Fix spinner state bug

* Fix race condition when switching between backends

* Fix loading local projects

* Make switching local projects work

* Fix opening cloud projects

* Add shortcut to switch back to dashboard

* Fix templates for desktop; other fixes

* Fix status check polling in `ProjectActionButton` not being stopped

* Run prettier

* Retry reconnecting to Project Manager

* fix back to dashboard shortcut on macOS

* Fixes

* More fixes

* Rename `backendModule` to `cloudService`

---------

Co-authored-by: Nikita Pekin <nikita@frecency.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
Co-authored-by: Nctdtman <137032445@qq.com>
2023-04-26 16:59:39 +02:00
GregoryTravis
dcfbf841b3
Replace Table should_equal with should_equal_verbose (#6405)
Table.should_equal_verbose shows the contents of the tables on failure; let's make this the standard comparison.
2023-04-26 14:01:49 +00:00
Ilya Bogdanov
72f83c2dd5
Rollback event handling changes for the mouse (#6396)
Fixes #6385

Partial rollback of #6364

It turns out that preventing default for mouse events is a bad idea in general. It shouldn't affect other fixed bugs because (afaik) all of them were caused by keyboard events.

We're still preventing default for keyboard events.
2023-04-26 12:26:51 +00:00
somebody1234
3d045a7ceb
Dashboard directory interactivity (#6279)
* turn object into var

* add todo

* fix style

* fixes

* remove forgot password + reset password

* remove signout

* remove setusername

* remove login

* remove registration

* fix comments

* re-enable flag

* rename div

* add comment

* fix lints

* remove tailwind conf

* Revert "remove registration"

This reverts commit 02439c9b70.

* Revert "remove login"

This reverts commit 8e6f9c1112.

* Revert "remove setusername"

This reverts commit 84721bcccd.

* Revert "remove signout"

This reverts commit 08a96d3796.

* Revert "remove forgot password + reset password"

This reverts commit e52f51a762.

* remove opener

* move opener

* tmp

* prettier

* expand docs

* tmp

* replace react-scripts with craco

* add tailwindcss

* switch to brands

* tmp

* tmp

* tmp

* fixmes

* fixmes

* fixmes

* fixmes

* fixmes

* fixes for e-hern's comments

* use abortcontroller

* add docs

* fixes

* revert craco, fix windows build

* remove from gitignore

* remove unnecessary check

* tmp

* augment window

* tmptmp

* split errors back up

* tmp

* tmp

* prettier

* fix

* Fix lints

* Prepare for addition for `as T` lint

* Add lint for early returns

* Address review issues

* Fix lints

* remove withrouter

* fix file length

* fixes

* fixes

* remove dashboard

* fix

* use switch

* prettier

* fixes

* prettier

* fixes

* run prettier

* run prettier

* run prettier

* fix main page url

* allow node.js debugging

* fix lints

* change not equal

* prettier

* Remove references to withRouter; fix lints

* Run prettier

* Add cloud endpoints

* Add JSON-RPC endpoints

* Add dashboard skeleton

* Add components and edit dashboard

* Run prettier

* (WIP) Add cloud endpoints

* Add rpc endpoints

* Address review issues

* Formatting and minor fixes for `newtype.ts`

* Address review issues

* Rename `Brand` to `NewtypeVariant`

* Rename `Brand` to `NewtypeVariant`

* Fix formatting in `newtype.ts`

* 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

* Add dashboard skeleton

* Run prettier

* 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

* Export newtypes

* Make css rebuild when tailwind config changes

* Fix endpoints

* Finish copying changes over

* Remove duplicate type definitions

* Fix bundling for dashboard

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

* Move CSS to Tailwind config

* Run prettier

* Update endpoints

* Fix esbuild binary package names

* Remove redundant "npx" prefix from build scripts

* Remove unused dependency

* Begin adding interactivity

* workaround for mac freeze

* Fix modal bugs

* Begin implementing forms, split forms and modals into new files

* Get form UI working

* add missing sections

* Minor fixes, save current directory to localStorage

* Fixes for drop-to-upload

Note: currently it is opening in a new tab instead of actually uploading

* Address review issue

* Fix prettier config; run prettier

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

* (WIP)

* Fix service worker for client-side routing

* Add close button to asset creation forms; fix saving directory to localStorage

* Remove workaround for backend bug when listing directories

* Fix drop-to-upload

* Fix sizing

* Fix spacing, add fixed paths

* WIP: fix toast notification styles, begin adding context menu

* WIP: Add context menu, minor fixes

* Fix authentication on desktop IDE

* Allow unused locals and parameters in tsconfig.json

* Run prettier

* Fix TypeScript errors

* Fix modals; minor refactor

* Implement context menus for labels; fixes

* Add modal provider and switch all modals to provider; fixes

* Fix modals and user icon size

* Fixes

* Remove obsolete files from incorrect merge

* Address review issues

* Fix type error

* Stop removing `#root`

* Fixes for cloud

* Implement search on frontend side

* Fix race condition related to `directoryId`

* Hide directories, files and secrets tables on desktop IDE

* Fix lint errors

* Properly update visible projects when a project is created

* Pass directory id to create project

* Hide column display switcher; remove placeholder column data

---------

Co-authored-by: Nikita Pekin <nikita@frecency.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
2023-04-26 11:52:13 +02: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
Wojciech Daniło
115e9b4ffd
Implementation of elements adding to List Editor and a lot of internal API (#6390) 2023-04-25 18:06:11 +02: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
Jaroslav Tulach
63de18e367
Turn null into UnexpectedExpression when Union type is incomplete (#6415)
Test and fix for #6401.
2023-04-25 14:49:26 +00:00
Radosław Waśko
b8f075a178
Ensure that IO.println does not fail if to_text returned a non-Text value. (#6223) 2023-04-25 10:55:39 +00:00
Jaroslav Tulach
8e08a3b634
Improve inlining of <| on (GraalVM EE) (#6384) 2023-04-25 12:02:51 +02:00
Nctdt
2e7f99b38e
Feat: update templates styles and feature (#6071)
Recreate #5858;
The style and project creation features of Templates have been implemented.
![image](https://user-images.githubusercontent.com/52877578/227537458-ebb9fa24-ce2b-4235-8f34-1a371a8d1f64.png)
2023-04-24 16:48:51 +00:00
GregoryTravis
afd804d529
5127 Add Table.parse_to_columns to parse a single column to a set of columns. (#6383)
Implement Table.parse_to_columns
2023-04-24 15:21:38 +00:00
Michał Wawrzyniec Urbańczyk
19203427e0
URL handling (#6243)
This PR fixes #5239 by supporting the Windows-style of URL handling to support deep linking.

Windows spawns a new process for each URL, rather than sending a 'open-url' event to the existing process. Now the differences between the two platforms should be abstracted away.
2023-04-24 16:12:30 +02: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
Dmitry Bushev
2d168308af
Better cleanup of project management test suite (#6392)
Address some arbitrary failures of the `ProjectManagementApiSpec` test suite.
2023-04-24 13:11:27 +00:00
somebody1234
3e5a3dc468
Fix all eslint errors (#6267)
Fixes all eslint errors - now `npx eslint .` in `app/ide-desktop` should show no errors and no warnings.
Also fixes an incorrect lint rule (the rule to catch early returns (?) did not work properly for `try-catch`)

# Important Notes
This changes quite a few files (unfortunately) so QA should be done to check all affected files
2023-04-24 12:56:26 +00:00
Radosław Waśko
f3873f9768
Infer SQLite types locally (#6381)
Closes #6208
2023-04-24 10:55:12 +00: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
Radosław Waśko
a43d524336
Add typechecks to Aggregate and Cross Tab (#6380)
Follow up of #6298 as it grew too much. Adds the needed typechecks to aggregate operations. Ensures that the DB operations report `Floating_Point_Equality` warning consistently with in-memory.
2023-04-24 08:55:54 +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
GregoryTravis
22f820feb7
Add Table.parse_text_to_table to convert Text to a Table. (#6294) 2023-04-21 17:43:19 +00:00
Radosław Waśko
8db2ad51a1
Adding typechecks to Column Operations (#6298)
Closes #6106
2023-04-21 12:20:12 +00:00
Paweł Buchowski
27be43204c
Rollback cloud options groups (#6331)
* rollback cloud options groups; fix ide rendering regression

* fix new dashboard option description

* pr changes

* improve authentication description
2023-04-20 19:55:55 +02:00
Dmitry Bushev
74c0718604
Project folder not renamed after project name change (#6369)
close #6254

Changelog:
- fix: race when the actor system may be stopped before the shutdown hooks are executed
- fix: project management spec
- fix: recover from `readLine` failure during the shutdown
2023-04-20 16:57:37 +00:00
James Dunkerley
0350762386
Add replace, trim to Column. Better number parsing. (#6253)
- Add `replace` with same syntax as on `Text` to an in-memory `Column`.
- Add `trim` with same syntax as on `Text` to an in-memory `Column`.
- Add `trim` to in-database `Column`.
- Added `is_supported` to dialects and exposed the dialect consistently on the `Connection`.
- Add `write_table` support to `JSON_File` allowing `Table.write` to write JSON.
- Updated the parsing for integers and decimals:
- Support for currency symbols.
- Support for brackets for negative numbers.
- Automatic detection of decimal points and thousand separators.
- Tighter rules for scientific and thousand separated numbers.
- Remove `replace_text` from `Table`.
- Remove `write_json` from `Table`.
2023-04-20 16:04:59 +00: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
Ilya Bogdanov
68119ad6bb
Prevent default for all events, fixing multiple IDE bugs (#6364) 2023-04-20 15:58:26 +02:00
Kaz Wesley
824d18ddc1
Fix render issues, re-enable buffer compaction (#6358) 2023-04-20 13:41:08 +02:00
Jaroslav Tulach
e47eb49ea8
Removing need for asynchronous thread to execute ResourceManager finalizers (#6335)
While Enso runs single-threaded, its `ResourceManager` required additional asynchronous thread to execute its _"finalizers"_. What has been necessary back then is no longer needed since _GraalVM 21.1_. GraalVM now provides support for submitting `ThreadLocalAction` that gets then picked and executed via `TruffleSafepoint` locations. This PR uses such mechanism to _"inject"_ finalizer execution into already running Enso evaluation thread.

Requiring more than one thread has complicated Enso's co-existence with other Truffle language. For example Graal.js is strictly singlethreaded and used to refuse (simple) co-existence with Enso. By allowing Enso to perform all its actions in a single thread, the synergy with Graal.js becomes better.
2023-04-20 13:33:45 +02:00
Pavel Marek
4076a64f33
NaN can be used as a key in Map (#6301)
`Number.nan` can be used as a key in `Map`. This PR basically implements the support for [JavaScript's Same Value Zero Equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value-zero_equality) so that `Number.nan` can be used as a key in `Map`.

# Important Notes
- For NaN, it holds that `Meta.is_same_object Number.nan Number.nan`, and `Number.nan != Number.nan` - inspired by JS spec.
- `Meta.is_same_object x y` implies `Any.== x y`, except for `Number.nan`.
2023-04-20 09:25:36 +00:00
Hubert Plociniczak
6d3151f32d
UnresolvedSymbol is now accepted by Vector.sort (#6334)
`Vector.sort` does some custom method dispatch logic which always expected a function as `by` and `on` arguments. At the same time, `UnresolvedSymbol` is treated like a (to be resolved) `Function` and under normal circumstances there would be no difference between `_.foo` and `.foo` provided as arguments.

Rather than adding an additional phase that does some form of eta-expansion, to accomodate for this custom dispatch, this change only fixes the problem locally. We accept `Function` and `UnresolvedSymbol` and perform the resolution on the fly. Ideally, we would have a specialization on the latter but again, it would be dependent on the contents of the `Vector` so unclear if that is better.

Closes #6276,

# Important Notes
There was a suggestion to somehow modify our codegen to accomodate for this scenario but I went against it. In fact a lot of name literals have `isMethod` flag and that information is used in the passes but it should not control how (late) codegen is done. If we were to make this more generic, I would suggest maybe to add separate eta-expansion pass. But it could affect other things and could be potentially a significant change with limited potential initially, so potential future work item.
2023-04-20 07:58:58 +00:00
Kaz Wesley
dd4dce2c3f
Reduce borrow scope (#6359)
Reduce the scope of a borrow, to prevent `BorrowError`s.
2023-04-19 22:33:46 +02:00
Dmitry Bushev
fe0c8fd9a3
Increase the stack size (#6355)
close #6319
2023-04-19 19:09:05 +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
Dmitry Bushev
8c9c2d79cd
Keep scheduled execution job on text edit (#6354)
close #6346

Changelog:
- fix: keep scheduled execution job in the queue when applying a text edit
2023-04-19 14:18:36 +00:00
Hubert Plociniczak
f288198b4b
Change order of arguments when controlling context (#6357)
https://github.com/orgs/enso-org/discussions/6344 requested to change the order of arguments when controlling context permissions.

# Important Notes
The change brings it closer to the design doc but IMHO also a bit cumbersome to use (see changed tests) - applications involving default arguments don't play well when the last argument is not the default 🤷 .`
2023-04-19 14:00:27 +00:00
Stijn ("stain") Seghers
9ae77f4b6f
Make play button clickable and hide it when irrelevant (#6302) 2023-04-19 14:51:12 +02:00
Hubert Plociniczak
4c1e73c864
Don't propagate warnings on suspended arguments (#6345)
* Don't propagate warnings on suspended arguments

In the current implementation, application of arguments with warnings
first extracts warnings, does the application and appends the warnings
to the result.
This process was however too eager if the suspended argument was a
literal (we don't know if it will be executed after all).

The change modifies method processor to take into account the
`@Suspend` annotation and not gather warnings before the application
takes place.

* PR review
2023-04-19 11:55:23 +02:00
Hubert Plociniczak
0088672f9b
Simplify test for 6248 (#6343)
As per suggestion https://github.com/enso-org/enso/pull/6275#discussion_r1167388449
2023-04-19 11:43:52 +02:00
somebody1234
d14e57b2ff
Fix uncaught sign up error; minor code style changes (#6313)
* Fix uncaught sign up error; minor code style changes

* Run prettier

* Fix bugs
2023-04-19 11:29:13 +02:00
Jaroslav Tulach
f52ef08be5
Avoid double WithWarnings wrapping (#6348) 2023-04-19 10:43:29 +02:00
Wojciech Daniło
fa995dd765
Vector Editor first visual implementation (#6245) 2023-04-19 04:26:01 +02:00
Dmitry Bushev
7733b9bdac
Async Language Server resources initialization (#6336)
close #6306

Changelog:
- add: `AsyncResourceInitialization` component
- update: initialize language server resources asynchronously

# Important Notes
Speeds up `session/InitProtocolConnection` request by ~300ms (~10%) 3051ms (before) vs 2740ms (after) on my machine.
2023-04-18 15:55:44 +00:00
Kaz Wesley
912556853f
Disable buffer compaction (#6339)
Fixes #6320.
2023-04-18 15:17:17 +00:00
Ilya Bogdanov
84f64bec65
Use red color for context switch button (#6266) 2023-04-18 17:00:57 +02:00
Hubert Plociniczak
117fab4f3a
Nit - fix typo in issue template (#6338) 2023-04-18 15:14:15 +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
Jaroslav Tulach
e5a96b9782
Avoid NullPointerException in --dumpGraphs & test & docs (#6304) 2023-04-18 06:58:06 +02:00
Kaz Wesley
db3db975a6
Tests: Use debug-info level 1 instead of 2. (#6316) 2023-04-17 23:27:34 +02:00