Commit Graph

905 Commits

Author SHA1 Message Date
somebody1234
9fb3d9a2fa
Cleanup @/util folder (#8501)
- Partially addresses #8228
- Moves several files into `@/util/vue` and `@/util/data`
- Makes imports more consistent:
- Remove redundant trailing `.ts`
- Convert *some* imports to use `@/` rather than `./`
- Ideally it should be all imports other than the ones outside of `src/`, but I can't be sure I've found all of them
- Merge *some* duplicated imports (caused by one being an `import type`)

# Important Notes
None
2023-12-13 22:27:31 +00:00
somebody1234
f5c3713f87
Fixes for Enso Font in GUI2 (#8508)
- Fixes issue reported in Discord.

# Important Notes
None
2023-12-13 22:17:12 +00:00
Adam Obuchowicz
af50d32553
Small GUI improvements (#8535)
Minor improvements requested by @jdunkerley recently:
* Removed system cursor
* Changed shortcut for Code Editor
* Added `import Standard.Visualization` as a workaround allowing visualization previews. See https://github.com/orgs/enso-org/discussions/6832#discussioncomment-7789804

https://github.com/enso-org/enso/assets/3919101/38d822ac-28df-4a9c-a2dc-dee7adbd58ea
2023-12-13 16:26:13 +00:00
Adam Obuchowicz
ab938e896b
Some CB fixes (#8507)
Partially addresses #8495

* Delete key not working in CB and in Code Editor
* Cursor not placed at the end when adding new node with source node
* Garbage added when edited node while having another one selected.
* Closing CB when navigating.
* Too eager selecting component after filtering update.
* Premature node creation when dropping edges
* Discarding changes when clicking-off CB
2023-12-13 12:15:53 +00:00
somebody1234
857e87430d
Dashboard improvements (#8449)
- Closes https://github.com/enso-org/cloud-v2/issues/799
- Pressing return in the label name input creates a label with a color defaulting the color used by the fewest number of tags
- Right click on a label brings up a context menu
- If you drag into a folder the folder should be expanded - this should work for all kinds of drag, including labels and assets
- ⚠️ Drag & drop in Mac likely still does not work - I currently cannot test on macOS
- Closes https://github.com/enso-org/cloud-v2/issues/800
- Hide likes and the views on homepage view
- Hide "New Project" (and other items that are not applicable) in context menu when on local backend
- Download context menu option implemented for local mode
- ⚠️ Copy not implemented as backend functionality does not yet exist.

# Important Notes
None
2023-12-13 10:23:28 +00:00
Kaz Wesley
ce6c770fd7
Parse inline function signatures (#8470)
Implements #6166.

# Important Notes
- More consistent handling of `default` arguments. `default` is a valid identifier, and only has special meaning when it isn't bound in scope. Since distinguishing the builtin `default` from an identifier called `default` cannot be done until alias analysis has been performed, `default` is now represented in the AST as a regular identifier.
- `TreeToIr`: Remove `insideTypeAscription`. It was only used for bug-for-bug compatibility with the old parser during the transition.
2023-12-12 14:48:44 +00:00
Adam Obuchowicz
be2ae3279c
E2E Tests in CI (#8462)
Fixes #8433 

* Adds E2E test to `test` script in gui2 (without server)
* Add options to `run` script to specify what test should be run: `unit` (default), `e2e`, or `ci` (which runs both unit and e2e without watching/spawning report server).
* The CI test step now checks e2e tests.

### Important Notes

~~One of e2e tests was disabled because it caught the regression on develop: #8476 ~~
2023-12-12 15:27:40 +01:00
somebody1234
56a6dcc875
Hide GUI2 when not in Editor tab (#8445)
Fixes #8443

# Important Notes
None
2023-12-12 12:18:10 +00:00
somebody1234
3d76459ba7
Fix missing edges (#8461)
- Closes #8420
- Fix missing edges
- Fix displayed output type of node
- Verify that undos properly restore edges

# Important Notes
None
2023-12-11 22:36:34 +00:00
somebody1234
0974d5ff1e
Add new magnet axes (#8506)
- Closes #8460
- Add new magnet axes 32px below the bottom of the previous node, and 32px above the top of the next node

- Fix a bug where magnet alignment and "zoom to all" take into account nodes that no longer exist
- Fix a bug where "zoom to all" breaks completely right after deleting a node

# Important Notes
- Snapping with bounded cross axes were discussed during refinement, but are out of scope of this PR.
2023-12-11 17:55:37 +00:00
Michael Mauderer
b89d1b692a
Entering and leaving nodes (#8492)
Implements #8068

[Peek 2023-12-07 13-28.webm](https://github.com/enso-org/enso/assets/1428930/85da0dd6-0c08-4bef-b8e1-ba9573a3e6cd)
2023-12-10 23:48:10 +00:00
somebody1234
777ae9a047
Use Enso font (#8499)
- Closes #8485

# Important Notes
None
2023-12-08 18:45:42 +00:00
somebody1234
e562f65b99
Read file directly from location (#8490)
- Closes #6263

# Important Notes
- Still needs to be tested on Windows and macOS
- Currently does not check whether <kbd>Ctrl</kbd> is pressed to forcibly upload the file
2023-12-07 15:21:29 +00:00
Ilya Bogdanov
3d63272345
Sync presenter state not only on abort, but also on commit (#8464) 2023-12-07 18:57:31 +04:00
somebody1234
f6cf8271ca
Fix node output type (#8488)
- Partially fixes #8420

# Important Notes
- Extracted out from #8461 as the other issue may need further investigation to fix.
2023-12-07 14:35:48 +00:00
Michael Mauderer
0ec3277695
Selection widget improvements (#8477) 2023-12-07 13:26:20 +00:00
Adam Obuchowicz
32f68b7ac2
Fix visualizations (#8479)
closes #8476
2023-12-07 12:31:00 +00:00
Ilya Bogdanov
503d3d86ce
Small fixes for GUI2 (#8478)
Includes the following fixes:

1. Closes #8472
Adding animation when hovering entries, align them to the left, improve vertical alignment, make sure the currently selected entry is marked with rounded background shape.


https://github.com/enso-org/enso/assets/6566674/322748de-1321-4b32-8eef-a80a07cf8215

2. <kbd>Backspace</kbd> is now used on MacOS for deleting nodes, instead of awkward combination <kbd>Fn+Backspace</kbd>.
3. Fixed layout for vector editor.

Before:
<img width="529" alt="Screenshot 2023-12-06 at 3 23 39 PM" src="https://github.com/enso-org/enso/assets/6566674/f3d3573c-c2c0-41c4-aba3-d7350b585c8d">
After:
<img width="509" alt="Screenshot 2023-12-06 at 6 21 56 PM" src="https://github.com/enso-org/enso/assets/6566674/b4581097-e555-4d07-a812-5c6d0e7a7f62">

Also includes the fix for dynamic dropdowns from #8474. Closes #8473
2023-12-06 20:28:39 +00:00
Ilya Bogdanov
c5a6859654
Reading widget configuration from the engine (#8400)
Closes #8260

<img width="846" alt="Screenshot 2023-11-27 at 5 24 57 PM" src="https://github.com/enso-org/enso/assets/6566674/da1ba325-8e9a-43e9-9e56-c672b4987e1e">

Parsed information is not used anywhere at the moment, on the screenshot you can see a temporary debug logging not included in the PR.
2023-12-06 08:04:57 +00:00
Adam Obuchowicz
c814e5efbc
Component Browser Preview Panel (#8451)
Add CB preview panel, using engine's `executeExpression` method to get input's evaluation result without changing actual code. Also, visualization evaluation failures are reported.

![image](https://github.com/enso-org/enso/assets/3919101/1c364a7e-2f90-4397-801d-e05927762658)

# Important Notes
* **The preview does not work yet due to engine issues**.
* The full screen preview does not work properly (it closes Component Browser). Will make a separate issue for that.
* The evaluated expression calls the visualization preprocessor in such a way it handles built-in visualizations properly, but not in general case. Will start discussion with engine how to fix that.
2023-12-06 08:01:52 +00:00
somebody1234
496822b564
Add button to toggle whether passwords are visible (#8414)
- Closes https://github.com/enso-org/cloud-v2/issues/785

# Important Notes
- Added to (and hence should be tested on):
- Login screen
- Registration screen
- "Change password" modal
- Reset password screen
2023-12-06 07:50:44 +00:00
somebody1234
0fbb467507
Use MIME type parameter for drag instead of a unique MIME type (#8444)
# Important Notes
None
2023-12-06 07:47:46 +00:00
Adam Obuchowicz
6b837c31c5
Quickfix for editing problem (#8456)
I can edit nodes after this fix. ~~However, the cursor always lands at the end.~~ - this is also fixed.
2023-12-05 18:10:39 +00:00
Kaz Wesley
98988e8145
New AST types (#8263)
Introduce new AST type; use it to replace current uses of AstExtended; for now edits and synchronization are implemented on the old mechanisms (text edits / RelativeRange id map).

# Important Notes
- Edit-related code is commented out until the next PR because it is incompatible with the transitional IdMap-based synchronization.
2023-12-05 17:59:52 +00:00
somebody1234
71659882c6
Zoom to all/zoom to selected (#8459)
- Closes #6206
- Zoom to all/zoom to selected in visualizations, are now both `Mod+A`
- Implement Zoom to all/zoom to selected for the graph - shortcut is `Mod+Shift+A`, as `Mod+A` is "select all nodes"
- Animate zoom+pan

# Important Notes
None
2023-12-05 15:20:16 +00:00
Adam Obuchowicz
ee519e979b
Fix package (#8458)
Fixes #8457
2023-12-05 14:40:51 +00:00
Pavel Marek
a67297aebf
Add graalpy packages to the component directory (#8351)
Adds these JAR modules to the `component` directory inside Engine distribution:
- `graal-language-23.1.0`
- `org.bouncycastle.*` - these need to be added for graalpy language

# Important Notes
- Remove `org.bouncycastle.*` packages from `runtime.jar` fat jar.
- Make sure that the `./run` script preinstalls GraalPy standalone distribution before starting engine tests
- Note that using `python -m venv` is only possible from standalone distribution, we cannot distribute `graalpython-launcher`.
- Make sure that installation of `numpy` and its polyglot execution example works.
- Convert `Text` to `TruffleString` before passing to GraalPy - 8ee9a2816f
2023-12-04 11:50:59 +00:00
somebody1234
c60bf6e892
Fallback to default visualization based on type, when no viz has been explicitly set (#8389)
- Closes #8386
- Attempts to execute `<expr>.default_visualization` to query the engine for the *correct* fallback type
- If that is not possible, falls back to checking `inputType` - first for an exact match, then falling back to `Any` (i.e. the text/JSON visualization)
- Does not decide fallback based on the shape of the returned JSON

# Important Notes
Contains pretty significant refactors of `VisualizationMetadata` to allow it to be unset.
2023-12-01 12:41:24 +00:00
somebody1234
731fd11a74
Fix node not being draggable (#8435)
Minor regression caused by #8361.

# Important Notes
None
2023-12-01 12:40:56 +00:00
somebody1234
27072622f7
Vector editor widget (#8361)
- Closes #8261
- Add vector editor widget
- Adding element to end
- Dragging elements
- Removing elements by dragging away

# Important Notes
- Both <kbd>Left Click</kbd> and <kbd>Ctrl</kbd> + <kbd>Left Click</kbd> are supported to begin a drag.
- Just <kbd>Left Click</kbd> alone is not sufficient as some widgets interact via left click
2023-11-30 20:27:04 +00:00
somebody1234
2d35be96b4
Fix GUI2 not being interactable (#8434)
- Broken by #7612, which restructured the JSX markup for the main Dashboard component.
- Should affect (and be reproducible) on GUI1 as well.

# Important Notes
None
2023-11-30 19:34:32 +00:00
somebody1234
19ea8243b9
Fix Tailwind config for gui2 (#8427)
Fixes broken Tailwind config caused by recent dashboard changes.

# Important Notes
None
2023-11-30 13:20:09 +00:00
somebody1234
405f4be605
Project Description/Settings sidebar (#7612)
- Closes https://github.com/enso-org/cloud-v2/issues/629
- Project Description/Settings sidebar

# Important Notes
⚠️ This is blocked by backend support for asset descriptions.

When the sidebar is opening, there is one jumpy animation:
- The search bar switches from being centered in the screen, to having an equal gap between itself and its siblings
2023-11-30 12:40:01 +00:00
somebody1234
3de37bd7d3
Minor QoL improvements (#8422)
- Minor fixes for CodeMirror highlighting (the `!` to stop recursion was making the entire import line purple, and preventing strings inside operators from being highlighted)
- Change some icons that contain dark blue, to use `currentColor` instead
- Add execution time to hover tooltip (the LS is sending it, so might as well display it)

# Important Notes
None
2023-11-30 11:58:08 +00:00
Michael Mauderer
2014c88254
Implement Dropdown Widgets. (#8411)
Closes #8259

[Peek 2023-11-28 12-22.webm](https://github.com/enso-org/enso/assets/1428930/8696bb0f-15de-46a6-9664-a30da931d6df)

# Important Notes
Some TODOs left for after the AST refactoring:
* Updating the AST with the elected value.
* Getting the Expr ID from the parent node to determine the correct color.
2023-11-30 11:56:23 +00:00
somebody1234
1e93e69523
Improve label interactions (#8417)
- Fixes https://github.com/enso-org/cloud-v2/issues/781
- Implement parser for search query
- Change all UI (labels column, labels side panel, searcher in top bar) to use search query parser
- Change "remove label from asset" to right click
- Also add a tooltip to notify user that right click removes the label
- Change click action on label on asset, to toggle the label from the search
- Stop sending the list of labels for filtering on the server side

Unrelated changes:
- Switch dashboard dev server to use Vite. All other servers should be unaffected.
- `ide watch` works
- `ide build` works
- `gui watch` works
- `dashboard build` works

# Important Notes
There are quite a lot of new interactions with the search bar which should probably all be tested.
2023-11-29 17:29:25 +00:00
somebody1234
dff1c0c88b
Errors on nodes (#8409)
- Closes #8288
- Show both `Panic`s and `DataflowError`s on nodes
- Update Code Editor diagnostics to use the same functionality to properly display `DataflowError`s

# Important Notes
- Does not include warnings
- ✔️ Done basic testing to ensure that errors *should* disappear and reappear as appropriate
2023-11-29 14:34:07 +00:00
somebody1234
5216b8c0cb
Make node expand to visualization width (#8394)
- Closes #8234
- Make node expand to full width of visualization
- Have a fixed minimum width for visualizations, to be able to show at least the toolbar
- Clip viz-defined toolbars to the width visualization (don't let them overflow)
- We can consider wrapping viz-defined toolbars onto a separate line, later down the line

# Important Notes
None
2023-11-29 04:40:51 +00:00
somebody1234
195faed9e4
Avoid placing a new node over a visualization (#8412)
- Closes #8368

# Important Notes
Could not repro the leftwards drift of new nodes. It is possible that this has already been fixed by another PR.
2023-11-29 03:22:50 +00:00
somebody1234
05d613fdc9
Download latest release instead of nightly (#8402)
The download button previously pointed to the latest nightly, instead of the latest stable release. This is bad, because (like now) the nightlies may be broken.

# Important Notes
None
2023-11-28 16:02:05 +00:00
somebody1234
93a4937cc4
Add profiling shortcuts to GUI2 (#8406)
- Closes #8404

# Important Notes
- All relevant documentation has already been updated in #8358.
- I've tested that the keyboard shortcuts send appropriate messages over the LS connection, and have confirmed that a non-error response is received, but I'm not sure that the profiling actually works.
- There seem to be no entries in `~/.enso/`, nor in `~/enso/`
2023-11-28 14:44:46 +00:00
Adam Obuchowicz
a38680adf4
CB Fixes and Improvements (#8385)
* The "main view" (when no self type/module nor pattern is specified) contains all methods defined in top modules of every library
* Entries defined inside any "Internal" module from stdlib will be hidden by default; they will be visible only when self type is specified or the module path leading to such module internals.
* Fixed an issue with missing groups sometimes - we must wait with asking for groups for first executionComplete message.
* Modules and local variables have different default icon.

![image](https://github.com/enso-org/enso/assets/3919101/cb33691e-222b-413e-a92e-2cf84e9fe4bb)

![image](https://github.com/enso-org/enso/assets/3919101/beab202d-4feb-4b00-ba0c-c141862da53c)
2023-11-28 10:38:28 +00:00
Paweł Grabarz
1ad7a4bf5a
fix edge dragging and method argument assignment (#8388)
Fixed broken edge dragging and creating nodes from ports. Added basic support for multiple output ports, driven by already existing analysis of the port binding structure. Those constructs are not yet supported by the engine (hence the error in code), but the IDE has easier time already dealing with ports as individual binding expressions, not whole nodes.

<img width="865" alt="image" src="https://github.com/enso-org/enso/assets/919491/73126593-05c0-4553-ba6d-dad97d083c48">

Also improved the ability to interpret applied method arguments. Different cases of dynamic, static calls or partially applied functions are now properly supported.

<img width="961" alt="image" src="https://github.com/enso-org/enso/assets/919491/ffe02d79-841c-411d-a218-de89c2522f7b">
2023-11-27 16:34:34 +00:00
somebody1234
9b7e3d0f16
E2E tests (#8239)
- Closes #8179

# Important Notes
- ⚠️ These tests are currently *not run* on any CI workflow.
- There is some unused code for mocking the PM. This has been intentionally kept, as this may be useful in the future.
Note that this may be useful for testing the dashboard, however the dashboard is currently only tested in cloud mode
- that is, without the backend switcher, and with only the remote backend available. As such, currently it uses HTTP API mocks, and no PM mock.
2023-11-27 15:48:37 +00:00
Michał Wawrzyniec Urbańczyk
b51dfe5a5b
macOS notarization fix (#8392) 2023-11-27 16:05:09 +01:00
Ilya Bogdanov
8516ed5cbb
Imports in CB (#8315)
Closes #8066


https://github.com/enso-org/enso/assets/6566674/ecd3d032-286b-4bfa-8dc6-96e178f595f3
2023-11-24 14:22:26 +00:00
somebody1234
b33285c634
Fix auto layout (#8345)
So it turns out auto-layout was broken if there were existing, already positioned nodes

# Important Notes
None
2023-11-24 10:49:15 +00:00
Paweł Grabarz
ec5c60b74d
fix incorrect byte array comparison (#8379)
Fixes an exception when opening the code editor. `indexedDB.cmp` doesn't accept `undefined` values. Moved its usage to a separate function to guard against that.
2023-11-24 08:54:23 +00:00
Michał Wawrzyniec Urbańczyk
8021109d8c
Build script fixes & improvements (#8285) 2023-11-23 21:19:31 +01:00
Michael Mauderer
76fb9f5c4b
All ways of creating node (+ button, dragging out edges) (#8341)
Closes #8054

[Peek 2023-11-20 13-50.webm](https://github.com/enso-org/enso/assets/1428930/064ad921-25dc-44f4-bed4-10b4f0ec0242)
2023-11-23 17:47:53 +00:00
Adam Obuchowicz
ce584862ff
Fix a set of issues in Component Browser (#8377)
Part of #8372

* Sorting was broken (sort's argument was removed)
* searching by initials now does not skip words
* icons: now we use same logic as existing nodes.
* local entities has worse score if "showLocals" option is toggled off.

# Important Notes
Please be aware that there is still an important issue with groups; sometimes they're not loaded. Reported [here](8376)
2023-11-23 15:53:59 +00:00
Dmitry Bushev
4b3ba78b52
Add shortcuts to start and stop the backend profiling (#8358)
close #8329

Changelog:
- add: `cmd`+`shift`+`,` and `cmd`+`shift`+`.` shortcuts to start and stop the backend profiling. Profiling data is stored on disk.
2023-11-23 15:31:17 +00:00
somebody1234
87dfb57f53
Show diagnostics in Code Editor (#8375)
As suggested by @JaroslavTulach.

- Shows diagnostics sent by `executionContext/executionStatus`
- Shows `Panic`s and `DataflowError`s sent by `executionContext/expressionUpdates`

# Important Notes
None
2023-11-23 14:15:48 +00:00
Adam Obuchowicz
2ddcaad6fe
Fix startup in the electron package (#8365)
Fixes #8334

There were two issues: one is bad code generated by vite. I needed to rephrase Rect.Zero definition. The second were missing widgets - that was caused by the fact that Vue components have a bit different properties than on test builds, apparently.
2023-11-23 11:03:23 +00:00
Adam Obuchowicz
fbe4221c46
Edges from alias analysis (#8316)
Fixes #8252

As we use proper alias analysis, we no longer display connections to overshadowed identifiers.

![Screenshot from 2023-11-16 15-50-27](https://github.com/enso-org/enso/assets/3919101/691aac6c-1951-4988-a338-4449c0413ef7)

# Important Notes
I've changed the meaning of edge's "source" - now it's expression ID of the constituted identifier, not the node ID. This will allow proper handling nodes like `[x, y] = Main.get_point` once the engine will support them.
2023-11-23 10:54:35 +00:00
James Dunkerley
ed9e71c4eb
Make ICON section work consistently between old and new GUI. (#8369)
- Handle name mismatch in icons between old and new IDE.
- Set the default icon for a few types.
- If can't find and icon use the Enso logo.

![image](https://github.com/enso-org/enso/assets/4699705/43d828b4-58cf-429e-b659-b1c389953b23)
2023-11-23 09:03:34 +00:00
somebody1234
1cf5ea96d6
More consistent reactive indices (#8353)
- Renames all `ReactiveIndex` and `ReactiveDb`s into the format `<key>To<value>`
- `ReactiveMapping`s (in `graphDatabase.ts`) currently have not been renamed - I'm not sure they need to be
- Removes various methods that have been made unnecessary by this change
- Simplifies some other methods
- Changes `SuggestionDb` to extend `ReactiveDb`

# Important Notes
None
2023-11-23 04:48:12 +00:00
Paweł Grabarz
e492d3f260
[GUI2] Render widget arguments (#8339)
Fixes #8256 #8257

Implemented displaying node argument placeholders. Refactored widgets to allow arbitrary input types, and split widget matching into two phases, separating input type validation step and allowing it to influence the derived TypeScript type of widget component props.

Connecting an edge to the placeholder is not implemented yet. Only connections to existing arguments are supported for now.

https://github.com/enso-org/enso/assets/919491/ad3bf254-5f56-4f2f-8c0d-616a7195c6d8


Nested argument lists are also supported:
<img width="396" alt="image" src="https://github.com/enso-org/enso/assets/919491/b61f6870-0f01-48c3-9b45-c7c6bc464638">
2023-11-22 14:43:58 +00:00
somebody1234
d136c8e40c
Fix dashboard issues (#8347)
- Fixes https://github.com/enso-org/cloud-v2/issues/770
- Fixes https://github.com/enso-org/cloud-v2/issues/772
- Fixes https://github.com/enso-org/cloud-v2/issues/775
- Fixes #8335

# Important Notes
The fix for "Reopening cloud projects" has not been tested, as opening projects on the cloud are currently broken - *however*, the logic change is very small - the only thing it does is make the reopening conditional. This means that, at the very least, it should not be a regression.
2023-11-21 10:37:45 +00:00
somebody1234
feb59be0a1
Fix styles for confirm delete modal (#8312)
The background for the "confirm delete" modal was offset - the fix is to add `inset-0`.

# Important Notes
None
2023-11-21 06:51:15 +00:00
somebody1234
5e1a3124dc
Download and upgrade buttons (#8265)
- Adds a download button in the user menu

# Important Notes
- The "upgrade to" button will be absent when the user already has a plan, as the only place where an "upgrade to" button shows up is the cloud view, when the user's account has not yet been enabled.
- The upgrade button currently links to https://enso.org/pricing - which does not yet exist. This is intentional, as another PR would be required to switch the URL, if we were to initially point to the one at https://enso-org.github.io.
- The pricing page would still not work, as that requires payment functionality, which is not yet complete
2023-11-21 06:34:46 +00:00
somebody1234
375e610660
Layout nodes without position (#8326)
- Closes #8071

# Important Notes
There is currently no way to predict the width a node, taking into account the width of widgets.
This should probably be done in another task.
2023-11-20 14:17:34 +00:00
somebody1234
062992bb8b
Fixes for GUI2 (#8310)
Addresses several issues found during book club.
- Add placeholder icons for visualizations (see screenshot)
- Also add the corresponding export to visualizations, and relevant support in the visualization store and visualization metadata DB.
- Show icon both on the visualization selector button, and in each visualization selector entry
- Adjust gaps between visualization selector entries
- Port table viz fixes (#8102) to Vue
- Fix height of table rows to avoid cutting off descenders on letters like `y` and `g`
- Make the space and enter keys work on visualization toolbar buttons, if they are selected
- `.blur()` code editor when clicking outside of it
- And similarly `.blur()` visualization selector
- Move selection brush on scroll by scaling the delta of `scrollTop` and `scrollLeft`
- Note that mouse position is technically still incorrect when scrolling past the end. I think this is fine - the new behavior is less broken, plus I am not aware of any way to fix this.

# Important Notes
None
2023-11-20 13:23:50 +00:00
somebody1234
9edc94afa0
Unify GUI2 headers (#8327)
- Closes #8304

# Important Notes
- A better long-term solution may be to remove COOP/COEP/CORP headers instead, but that is out of scope of this PR.
- Feel free to create a new issue, or discuss elsewhere, if this is something we want to do eventually
2023-11-20 11:32:40 +00:00
somebody1234
078260d8e7
Fix Geo Map visualization (#8311)
- Fixes #8300
- Fixes Geo Map visualization being completely broken
- Fixes Mapbox attribution icon in bottom right being invisible
- Fixes Mapbox attribution button being unclickable

# Important Notes
None
2023-11-20 11:25:23 +00:00
Michael Mauderer
85e2c72204
Fix component browser interactions. (#8303)
Fixes: #8064

Fixes broken interactions with of the component browser.
2023-11-17 15:28:45 +00:00
Michael Mauderer
aef3a4ffc0
enso-8194 Copy and pasting a single node (#8298)
Implements  #8194

[Peek 2023-11-13 14-15.webm](https://github.com/enso-org/enso/assets/1428930/22882487-7288-4eb7-af08-6539060b4967)
2023-11-17 03:57:30 +00:00
Michał Wawrzyniec Urbańczyk
4b181c38d0
Bump electron-builder on CI macOS runners. (#8284)
This PR avoids #8119 by selectively bumping the `electron-builder` on macOS CI runners. We do this only on macOS, as we do not want to trigger https://github.com/electron-userland/electron-builder/issues/6865 on Windows.
2023-11-16 19:07:29 +00:00
Paweł Grabarz
febce5dad7
[GUI2] Selection and rendering of basic node widgets (#8253) 2023-11-15 16:26:18 +00:00
Adam Obuchowicz
dc4de729b6
Fix CORS problems on built package (#8301)
Fixes #8297

Some external resources were failing due to CORS policies. This is the simplest fix.
2023-11-14 17:31:11 +00:00
Michael Mauderer
198fdece0b
Opening searcher with source node (#8279)
Implements #8065.
2023-11-14 14:42:33 +00:00
somebody1234
85a1bda213
Fix build-dashboard (#8292) 2023-11-14 15:34:33 +01:00
somebody1234
3046e152dc
Add Google Analytics (#8278)
- Add Google Analytics
- Add cross-domain linking between website homepage and cloud dashboard
- Highlight buttons on authentication flows on hover
- Save logged in state as `logged_in` cookie
- Remove saved access token from disk when signing out
- Support `redirect_to` parameter on `/register` page

# Important Notes
None
2023-11-14 12:28:10 +00:00
Adam Obuchowicz
5baec46466
Fix node placement (#8277)
Fixes: #8230

Fixes some rare cases caught by property tests, involving nodes with 0 width. `MultiRange` does not handle those. The thing is fixed by not using MultiRange, but by sorting nodes by the axis along which we're searching for free place.

All three reported seeds seem to be fixed.

# Important Notes
`MultiRange` is not used now, but I decided to spare it, violating YAGNI rule, as it is tested, and I feel it's a structure which may be useful.
2023-11-14 08:53:07 +00:00
Ilya Bogdanov
876cbd7b5d
Displaying progress for file uploads (#8227)
Closes #8182

Also, improved handling of multiple files – they are placed with a small vertical gap now.

The design for uploading files is non-existent, so I implemented something simple and good-looking. We can easily adjust it at any time.

You can’t move or otherwise interact with nodes while they are uploading.

https://github.com/enso-org/enso/assets/6566674/c0709d8f-3b95-4913-a6eb-caae225b6598
2023-11-13 13:50:57 +00:00
somebody1234
be413b5c5e
Fix dropzone conditions; disable creating assets when on "Recent" category (#8155)
- Closes https://github.com/enso-org/cloud-v2/issues/742

Other fixes:
- Fixes another bug I found while testing, with an obscure trigger condition: specifically, dragging a file when the app is initializing
- Removes CSS property transition on hover - I could swear it was working at some point, but seems to no longer work

# Important Notes
None
2023-11-13 13:16:33 +00:00
Adam Obuchowicz
c01ba83a3a
Use alias analysis to handle internal variables in CB input. (#8268)
Fixes #7926

See the new test cases to see what is the improvement.

The self still will be not ideal, but it's because it uses same logic as edges discovery. [When it will be improved](https://github.com/enso-org/enso/pull/8252) this should be improved as well.

https://github.com/enso-org/enso/assets/3919101/25efd56d-5aaa-4f10-957d-8ed6a40f3d9b

# Important Notes
It contains part of #8250. That PR may be reviewed, or here both PRs may be reviewed at once.
2023-11-13 12:59:15 +00:00
somebody1234
6cf75daea9
Add 404.html for static hosting (#8276)
Adds a `404.html` to allow client-side routing to work when using static hosting.

# Important Notes
- The routing uses the existing logic to infer the base path. This means that if the user accesses an invalid path, the invalid path will be used as the base path.
2023-11-13 09:09:01 +00:00
Michael Mauderer
148f34f778
Adding a new node with searcher (#8241)
Implements #8064 /

@kazcw Could you double-check that this plays well with your edge dragging implementation. Some of the code seemed a work in progress, and I want to avoid any issues with what you had planned there.
2023-11-10 14:10:44 +00:00
somebody1234
ce1ef7df03
Make UI for authentication flow match the rest of the dashboard (#8211)
- Changes all authentication screens to look similar to the rest of the dashboard
- Greatly simplifies HTML structure

# Important Notes
- This is being added before the official design is ready, *but* it should be useful anyway, because it greatly simplifies the HTML, which should make it easier to implement the new design
- The auth screens have a larger border-radius than all other elements in the app. This is intentional, to make them look like they continue naturally from the fully rounded submit buttons.
- Basic testing done:
- Logging in should still work
- Signing up should still work
- Setting username should still work
- Changing password should still work
- Forgot password should still work
- Password reset should still work
2023-11-09 10:48:41 +00:00
Kaz Wesley
ce042569b0
line:col positions in parser (#8203)
Add `line:column` information to source code references produced by the parser. This information will be used by GUI2 as part of the solution to #8134.

# Important Notes
- `parse_all_enso_files.sh` has been used to ensure this doesn't affect tree structures.
- `parse_all_enso_files.sh` now checks emitted locations for consistency, and has been used to verify that all line:col references match the values found by an independent scan of the source up to the given UTF8 position.
2023-11-08 16:53:39 +00:00
Hubert Plociniczak
1388fe1cf9
More fine grained initialization for resources (#8242)
A long running initialization of the component blocks the execution significantly. Removed the `BlockingInitialization` and replaced it with a more fine grained locking.

# Important Notes
Added a simple workaround for potential slow initialization of backend - more retries. We should have a better UX in that case anyway, but due to absence of work on that in old GUI, this will have to do.
The main should be problem should be addressed already by other backend changes. Changes in `app` should only be treated as _just in case something bad happens_.
2023-11-08 08:57:31 +00:00
Michał Wawrzyniec Urbańczyk
2c04b1424e
Alias Analysis for the New GUI (#8189) 2023-11-08 02:44:22 +01:00
Adam Obuchowicz
3b12b6e17b
Refactor Input class to be composable (#8244)
Part of #7926

I found myself wanting to use graph store in the `Input` class. As I learned about composables recently, I decided to refactor the class into a composable, to be more vue-like. Putting it in a separate PR because [other task may wanting to do the same](8066)

Also contains some preparations for my actual implementation.
2023-11-07 17:07:44 +00:00
Adam Obuchowicz
579d83a450
Magnet algorithm when dragging nodes. (#8224)
Fixes #8070

When dragging a node, it is snapped to any axis being an extension to another node's boundary. This helps user keeping their nodes neatly aligned.

https://github.com/enso-org/enso/assets/3919101/36dd4d5f-55d3-4f3c-ba49-e8425fae8270

# Important Notes
* Now the position is saved to Yjs doc only when drag is finished.
* Node structure in graph store has two position fields: one representing what is currently stored in the node's metadata, and where the node is displayed. `nodeRects` use the visible rectangles.
2023-11-07 15:51:30 +00:00
Michael Mauderer
faf8cb715a
Added editable node functionality integrated with the Component Browser. (#8183)
Fixes #7786

[Peek 2023-10-30 14-21.webm](https://github.com/enso-org/enso/assets/1428930/9acca794-4b08-4c8a-a9f3-4bdbfdbf66e5)
2023-11-06 15:02:44 +00:00
somebody1234
168e222fcc
Read custom visualizations (#8180)
- Closes #8077

# Important Notes
Tests are still WIP
2023-11-03 20:09:45 +00:00
somebody1234
a7dba72b84
Rename tsx files without JSX to ts files (#8085)
This makes it clearer which files contain React components, and which do not.

# Important Notes
The main things that should be tested to confirm that this did not break anything is the two files containing Tailwind classes:
- Shortcuts ("delete" in context menu should still be red. `text-delete` is used elsewhere though, so this should not be broken either way)
- Indentation of directory contents (multiple levels)
Many of the others should more or less be self-testing:
- `index.tsx` -> `index.ts` would break the entire app if not handled properly
- `hooks.tsx` contains `useNavigate` which would break routing if absent, and `useToastAndLog` which would break most  toast notifications.
- `http.tsx` contains the HTTP client which would break all backend requests
- `useRefresh.tsx` would... break login and logout if it was broken I guess
2023-11-03 00:39:08 +00:00
somebody1234
8e20fc66dc
Sentry React integration (#8086)
- Closes https://github.com/enso-org/cloud-v2/issues/720
- Integrate Sentry with React and React Router.

# Important Notes
This is currently BROKEN as it requires the Sentry DSN, otherwise no requests are part of a transaction. Not sure how feasible this is unfortunately, especially as (I'm assuming) it will be different for each backend...
... I guess worst case it can be configured via an environment variable like some other build-time defines.

Also the sampling rates should be checked.
2023-11-03 00:38:30 +00:00
somebody1234
00341cd89b
Add loading screen when page is opened (#8167)
Adds a loading screen when the page is opened, for users with high latency

# Important Notes
None
2023-11-02 23:53:32 +00:00
somebody1234
5fb887a563
Fix cloud project toast message not appearing (#8165)
- Closes https://github.com/enso-org/cloud-v2/issues/744

# Important Notes
None
2023-11-02 23:51:24 +00:00
Ilya Bogdanov
fb3d65df2d
Upload files by drag and drop (#8214)
The first part of #8158. No progress indication for the user implemented.


https://github.com/enso-org/enso/assets/6566674/2d8157d4-748f-4442-a9c3-a96ba0029056

# Important Notes
A few notable changes:
- A fix for `DataServer/writeBytes`
- Using `@noble/hashes` instead of `sha3` because the latter only works with node. I also tried using `js-sha3`, but it does not work well with Vite (see https://github.com/emn178/js-sha3/issues/36)
- Fixed initialization of the ID map for new nodes. Also, all new nodes are prepended by four spaces to have proper indentation inside the `main` function.
- Fixed random pattern name generation because the previous approach sometimes produces identifiers starting with a number.
2023-11-02 15:32:14 +00:00
Michał Wawrzyniec Urbańczyk
a9118ee0c3
Use the new notarization tool from Apple (#8192) 2023-11-01 20:58:28 +01:00
somebody1234
8bc17bd370
Fix flaky partitionPoint test (#8198)
The tests for `partitionPoint` were previously failing when `NaN` or duplicates were present in the array.

# Important Notes
None
2023-11-01 13:07:18 +00:00
Ilya Bogdanov
f37ec96149
Avoid crash when new directory created in project root (#8199)
While working on #8158, I noticed a crash when the `data` directory is created at the project root. Turns out it is the issue in the `ydoc-server`, which thinks every filesystem event is about files. Unfortunately, we don‘t have the needed info available, so we need to make the `file/info` request.
2023-11-01 12:22:49 +00:00
Ilya Bogdanov
660f4b35ce
Preserve error code in the error message from RPC (#8191)
Needed for #8158
2023-10-31 15:01:54 +00:00
Kaz Wesley
487241317b
Synchronize execution mode (#8157)
Implements #8073.
2023-10-30 15:08:08 +00:00
somebody1234
ad4f738b02
Fix node color (#8177)
The qualified name for nodes was incorrect, resulting in the suggestion entry never being found.

# Important Notes
Should double-check that the issue is present on develop but not this PR. I've checked locally but it doesn't hurt to be extra sure.
2023-10-30 15:05:56 +00:00
Ilya Bogdanov
4de51b25ff
Navigating documentation panel with breadcrumbs (#8176)
Closes #8131

https://github.com/enso-org/enso/assets/6566674/69609307-d5f5-4185-af65-aed1f6b85978
2023-10-30 12:31:33 +00:00
somebody1234
7019de70b7
New node placement (#8112)
- Closes #8069

# Important Notes
None
2023-10-30 08:08:29 +00:00
Ilya Bogdanov
523a32471e
Documentation Panel (#8118)
Implementing most parts of the Documentation Panel in the new GUI.

Known issues:
- Links do not work (yet, covered by #7992)
- Some pages are entirely empty – I’m investigating. Missing doc sections likely cause this, so we probably want to add some placeholder.
- Tags do not look as in design. I tried implementing them correctly but didn't have enough time to finish everything. Some initial implementation is in place, though. I will create a separate task for them.


https://github.com/enso-org/enso/assets/6566674/a656ae78-5d4c-45f4-a0a5-e07fa573253e
2023-10-30 00:27:40 +00:00
somebody1234
f2651d58e4
[gui2] Component demos (#7945)
- Closes #7916

# Important Notes
None
2023-10-29 19:02:07 +00:00
Michael Mauderer
53ecaf44ae
Hook up Play Button and Execution Mode selector to Language Server. (#8037)
Implements #7990
2023-10-25 17:34:37 +00:00
Kaz Wesley
ea487a9b1b
Edge interactions and rendering (#8138)
[vokoscreenNG-2023-10-23_06-35-31.webm](https://github.com/enso-org/enso/assets/1047859/d8a5ffc5-4677-4264-a246-8def4418505a)

- Implement disconnected edges and edge interactions (#7864).
- Port edge layout from Rust.
- Implement output ports, hover extensions, backward-edge arrows, hover-splitting.

# Important Notes
- A new `currentInteraction` API supports mutually-exclusive interactions; this is used to cancel edge creation when the CB is opened. We can use it more generally to ensure only one major interaction is ongoing at a time.
- Remaining details to reach parity with gui1 edges: #8139
2023-10-25 15:36:16 +00:00
Paweł Grabarz
10f44b52e9
Use Enso AST in graph editor (#8123)
The graph is now properly constructed only from the main function body, and rendered nodes are using real Enso AST.

<img width="459" alt="image" src="https://github.com/enso-org/enso/assets/919491/e0106ee7-aaea-40aa-a42b-fc91c9d8740e">
2023-10-24 14:05:12 +00:00
somebody1234
03b7613e3c
Remove Playwright tests from Lint CI action (#8108)
Disables visual tests, because they are occasionally flaky (e.g. the recent issues with lint CI action).
This is very bad as it would cause every PR to (potentially) cause other PRs to fail, if the flaky test is not caught in the CI runs in the offending PR.

# Important Notes
None
2023-10-23 12:11:10 +00:00
Adam Obuchowicz
675fff07de
Local scope filtering (#8109)
The "Local scope filtering" button works now.

![image](https://github.com/enso-org/enso/assets/3919101/6cf6858f-0fdb-4f39-925d-9973e1ef9659)
2023-10-23 10:18:10 +02:00
somebody1234
2b671a16e1
Drag and drop for labels (#8097)
- Closes https://github.com/enso-org/cloud-v2/issues/721
  - Drag-n-drop for adding labels to an asset
    - Adds to a single asset when hovering over an asset that is not selected
    - Adds to all selected assets when hovering over an asset that is selected

### Important Notes
- The backend endpoint for associating labels with assets is currently broken - specifically, it errors when the new list of assets is empty.
2023-10-23 09:13:03 +02:00
somebody1234
8fc720a1a2
Move Rect to util/ (#8121)
`rect.ts` is not a store, and hence does not belong in `stores/`

# Important Notes
None
2023-10-20 15:20:09 +00:00
Adam Obuchowicz
1391dd93f4
Applying suggestions in the Component Browser (#8036)
Fixes #7993 

Added code for applying selected suggestion.

https://github.com/enso-org/enso/assets/3919101/c5ff116c-3fa9-4a98-ba03-cba404e96c82

### Important Notes

Found one issue in reading AST children and fixed it.

---------

Co-authored-by: Paweł Grabarz <frizi09@gmail.com>
2023-10-20 13:08:35 +02:00
somebody1234
a9387cd051
Remove flaky screenshot for labels VRT (#8106)
Removes a test that is causing issues in CI

# Important Notes
None
2023-10-20 05:33:26 +00:00
somebody1234
895326d4ed
Highlight matches in CB (#8098)
- Closes #8062

# Important Notes
- This PR uses a completely separate implementation from the regexes used for the existing filtering. AFAICT, this is unavoidable, since this needs to retrieve matched text.
- I've come across a couple minor bugs related to the Component Browser:
- When deleting text (backspacing), the full list of unfiltered entries momentarily reappear because the filtering is reset.
- Things like `h.m` match `HTTP_Method` - if this is not intentional, it seems like it might be more difficult to fix, unfortunately.
- Note that highlighting (I assume correctly?) *does not* highlight any part of `HTTP_Method`.
2023-10-19 15:08:56 +00:00
Kaz Wesley
2edd2bd7ff
Ensure all spans have document offsets (#8039)
- Validate spans during existing lexer and parser unit tests, and in `enso_parser_debug`.
- Fix lost span info causing failures of updated tests.

# Important Notes
- [x] Output of `parse_all_enso_files.sh` is unchanged since before #7881 (modulo libs changes since then).
- When the parser encounters an input with the first line indented, it now creates a sub-block for lines at than indent level, and emits a syntax error (every indented block must have a parent).
- When the parser encounters a number with a base but no digits (e.g. `0x`), it now emits a `Number` with `None` in the digits field rather than a 0-length digits token.
2023-10-19 12:36:42 +00:00
Adam Obuchowicz
24b9a1179e
Fix (#8099)
A bug was discovered during my development of a (later discarded) branch.
2023-10-19 12:28:36 +00:00
Kaz Wesley
1a5437d388
Tree traversal API (#8096)
Implements #8025: `LazyObject` now has a `visitChildren` method that observes each direct-child `LazyObject`. `childrenAstNodes` is now a simple function that flattens non-Tree nodes out of the hierarchy; `validateSpans` visits both `Tree`s and `Token`s the same way we would use the `ItemVisitor` Rust API.
2023-10-19 11:08:07 +00:00
James Dunkerley
ad95dc9815
Fixes for Table viz (#8102)
- Fixes issue with `to_display_text` on `Date_Time`. Now a reversible format.
- Adjusted the auto width code on table so it works.
- Manually sized columns should remain fixed size.
- Enable Excel range style selection in table.
- Removed page support as not implemented yet.

# Important Notes
Will need to apply to Vue based viz at some point as well.
2023-10-19 08:22:23 +00:00
Ilya Bogdanov
cec115d25b
Snap CB position to pixel boundary (#8095)
* Snap CB position to pixel boundary

* Apply review comments
2023-10-18 14:33:45 +02:00
somebody1234
9e9860d0e7
Disable remote logging (#8087)
- Closes https://github.com/enso-org/cloud-v2/issues/722
- Completely disables remote logging

# Important Notes
This is a temporary fix - GUI2 should have remote logging, but it may need a reimplemented entrypoint anyway.
2023-10-18 09:36:49 +00:00
somebody1234
b039f92598
Fix issue with circular import (#8078)
A recent PR introduced issues with circular imports in `categorySwitcher.ts` - the reason why this wasn't found before merge is because bundlers work fine with circular imports - it's just GUI2's dev mode that doesn't do well with them

# Important Notes
None
2023-10-17 09:17:08 +00:00
somebody1234
c5825719e9
Labels (#8008)
- Closes https://github.com/enso-org/cloud-v2/issues/676
- Adds labels to the dashboard:
- Filtering assets by label
- Creating new labels
- Displaying labels in "Labels" column
- Adding a new label to an existing asset (multi-select)

# Important Notes
WIP: Use a color picker with pre-defined colors, instead of randomly generated colors
2023-10-17 06:53:47 +00:00
somebody1234
1fd3a037ad
Avoid relative imports whenever possible (#8074)
- Change imports from `'./'` relative imports to `@/` or `shared/` whenever possible
- Imports in `shared/` and `ydoc-server` have been avoided for now in case they don't work with `@/` imports.
- Deduplicate `events.ts`, remove `useDocumentEvent` in favor of `useEvent(document,` (and same for `useDocumentEventConditional`
- Replace incorrect doc comments (`//*` and `///`) with correct doc comments (`/**`)

# Important Notes
None
2023-10-16 15:56:24 +00:00
somebody1234
209f4deb3e
CodeMirror highlighting (#8075)
- Closes #8041
- Integrates parser with CodeMirror
- Adds extensions builtin to CodeMirror
- Highlight text matching the selection
- Adds PoC CodeMirror extensions
- Basic syntax highlighting
- Code folding
- Hover tooltips

# Important Notes
As there is currently no way to get the corresponding node based on a position, the hover tooltip currently iterates through every node in `graphSotre.nodes`. This is potentially VERY SLOW and should be changed eventually, or disabled completely until an efficient implementation is possible.
2023-10-16 14:04:43 +00:00
Ilya Bogdanov
67bcf6ae07
ReactiveDb and ReactiveIndex (#8052)
SuggestionDb refactoring to facilitate documentation panel development and other features.

Now SuggestionDb uses `ReactiveDb` + `ReactiveIndex`es under the hood. There are no visual changes to the IDE. Everything still works the same.

You can now use two reactive indexes built on top of the SuggestionDb:
1. `db.nameToId` is a `QualifiedName→SuggestionId` relation. Reverse lookup allows you to get the qualified name by ID.
2. `db.parent` is a `SuggestionId→SuggestionId` relation, representing parent-children relations between entries. The rules are the following:
- If the `memberOf` field is present, it is used as a parent.
- Otherwise, a parent’s qualified name is used (through the `qnParent` function)
You can use reverse lookup to get the children of the entry.

You can easily add your own indexes if needed.
2023-10-16 13:35:16 +00:00
somebody1234
2df2b50f4d
Drag and drop (#7987)
- Closes https://github.com/enso-org/cloud-v2/issues/697
- Adds infrastructure to support drag-and-drop
- Implements drag-and-drop for deleting and undeleting assets
- Implements drag-and-drop for moving assets to a new directory (or the root directory)
- Also implements "cut" and "paste" context menu actions (and keyboard shortcuts) using the new endpoint for moving files
- "Copy" and "duplicate" actions are *not* implemented, as I don't think there are backend endpoints for those yet.
- Fades items out when cutting (Cmd+X), fades them back in when cancelling (Esc)
- Fixes bug where keyboard shortcut handlers were not registered for table-wide shortcuts (delete all, restore all, cut all)

# Important Notes
Drag-and-drop for more situations are planned but intentionally not yet implemented:
- Labels (backend is WIP, and blocked on the corresponding frontend PR)
- Moving assets between folders (backend functionality does not yet exist)
2023-10-16 12:07:30 +00:00
somebody1234
79d8354848
Fixed node icons and colors, derived from suggestions DB groups (#8031)
- Closes #8015
- Note that the (few) fallback icons are still present, as most CB entries are still missing icons. *However*, now the `iconName` from the libraries take priority over the fallback icon names.
- Also fixes a minor regression, where nodes pending execution were no longer faded out. This was introduced in #7988 because the wrong CSS variable was set.

# Important Notes
None
2023-10-13 00:54:06 +00:00
Adam Obuchowicz
0783618276
Interpreting CB input using AST. (#8022)
Fixes #7784

Instead of some heuristic, we now parse the CB's input and get the pattern and qualified name. Also we keep the "context" structure which may be used to apply suggestions properly.

# Important Notes
I created several helpers for AST. One of them is very hacky: we traverse AST tree by reading all getters in JS. Instead, we could generate it basing on schema.
2023-10-12 14:00:48 +00:00
Paweł Grabarz
bf76be6e6b
[GUI2] use DataView directly in generated parser code (#8028)
- Removed `Cursor` and moved all accessors to standalone functions, reducing the generated code size significantly (especially after minification).
- Removed unnecessary `seek`s from everywhere. Now the offseting is part of each `read` implementation.
- Removed unnecessary differences between `read`s on abstract and concrete types. Now abstract types do the pointer access internally in their `read`.
2023-10-11 21:28:29 +00:00
somebody1234
62019f6334
Filter visualization types based on node type (#8004)
- Closes #7925

# Important Notes
The type -> matching visualization lookup is populated using a `Promise`, so there is a race condition where the selector will incorrectly show the full list of visualizations if it is opened before the `Promise` resolves.
2023-10-11 15:27:03 +00:00
somebody1234
b64a7d392f
Node icons and colors (#7988)
Adds node icons and colors.

# Important Notes
None
2023-10-11 13:25:38 +00:00
Kaz Wesley
9fd1ab9092
Parser TS bindings (#7881)
Generate TS bindings and lazy deserialization for the parser types.

# Important Notes
- The new API is imported into `ffi.ts`, but not yet used.
- I have tested the generated code in isolation, but cannot commit tests as we are not currently able to load WASM modules when running in `vitest`.
2023-10-11 13:04:38 +00:00
somebody1234
3c31155fe9
Dashboard tests (#7656)
- Implements https://github.com/enso-org/cloud-v2/issues/631
- Tests for dashboard (`app/ide-desktop/lib/dashboard/`):
- End-to-end tests
- Unit tests
- Component tests

The purpose of this PR is to introduce the testing framework - more tests can be added later in separate PRs.

# Important Notes
To test, run `npm run test` in `app/ide-desktop`, or `app/ide-desktop/lib/dashboard/`. All tests should pass.

Individual test types can be run using `npm run test-unit`, `npm run test-component` and `npm run test-e2e` in `app/ide-desktop/lib/dashboard/`.
Individual end-to-end tests can be run using `npx playwright test -c playwright-e2e.config.ts test-e2e/<file name>.spec.ts` in `app/ide-desktop/lib/dashboard/`.

End-to-end tests require internet access to pass (for things like fonts).

This PR *does* check in screenshots to guard against visual regessions (and/or to make visual changes obvious)
2023-10-11 10:24:33 +00:00
somebody1234
94d3a05905
Check asset name uniqueness (#8018)
- Implements frontend component of https://github.com/enso-org/cloud-v2/issues/702
- Ensures that the new name is not already present in a sibling in the directory
- Only compares between directories when renaming a directory
- Only compares between files/projects/connectors when renaming one of those

# Important Notes
- This has not been implemented for connectors and files as currently there is no backend endpoint to rename those.
- Secrets are also not implemented yet, AFAIK, so there is no behavior related to secrets.
2023-10-11 10:17:33 +00:00
Dmitry Bushev
11997e9344
Fix opening projects with arbitrary name (#8012)
related #7973

Fixes opening the projects with names that are not in Upper_Snake_Case.

# Important Notes
https://github.com/enso-org/enso/assets/357683/ea820658-5dee-474a-9dce-201d09796af7
2023-10-10 01:15:21 +00:00
somebody1234
6a127c501b
Make engine version optional (#7975)
Fixes this issue:
- #7917

This is caused by the dashboard expecting `engineVersion` to be present, whereas it is actually optional.

# Important Notes
This may have been fixed on the Project Manager side, so the bug may not be reproducible. To properly test that this fix works, an older `project-manager` (e.g `2023.2.1-nightly.2023.9.30`) should be used.
2023-10-09 08:21:47 +00:00
somebody1234
8125200571
Read groups from LS (#7986)
- Closes #7928

# Important Notes
Instead of omitting color, a fallback color is generated using `colorFromString`.
2023-10-09 07:10:21 +00:00
Michael Mauderer
10a95e43d6
Add functionality to handle Expression Updates to GUI2 (#7982)
Implements #7783. Adds functionality to handle and store expression updates, as well as show the output type of node.



https://github.com/enso-org/enso/assets/1428930/31ffff78-ff2c-4e0b-bcde-ddc507cc0226
2023-10-09 05:55:12 +00:00
somebody1234
44f2f425c0
[gui2] Language Server binary protocol, and loading of visualization data (#7873)
- Depends on #7773.

- Implements binary WebSocket protocol (data protocol)
- Performs some editor initialization (the bare minimum so that visualizations work)
- Adds event handlers to receive visualization data updates

# Important Notes
None
2023-10-07 20:57:47 +00:00
Ilya Bogdanov
3b6f13c7b9
Create and edit nodes in temporary ast nodes with execution context disabled (#7779)
Closes #6417

Creating and editing nodes with a component browser does not edit the node in place but creates a temporary AST node with the execution context switch. When the node is committed, the original AST is replaced by the new one, and the temporary node is removed.

This solves several issues:
1. Previewing suggestions or editing nodes should no longer produce unwanted side effects, as the edited node expression is always evaluated with the output context being disabled.
2. Errors no longer propagate down the graph when you edit the node. The edited node has no outputs connected. Inputs behave normally, though.
3. Undo-redo and editing abort is much simpler. To abort editing, remove the temporary node.

https://github.com/enso-org/enso/assets/6566674/8d38e6bc-a4de-4e69-8d48-52d9b45b6554

# Important Notes
The code is a bit awkward in a few places. This is the consequence of previous architecture.
2023-10-06 14:56:09 +00:00
Dmitry Bushev
5a1aaed952
Remove extra dot in error messages (#7974) 2023-10-05 15:06:07 +03:00
Ilya Bogdanov
022a5b0d1b
Make the code editor editable again (#7844)
Fixes #7474

Again, a quite complicated issue. The code editor was broken by https://github.com/enso-org/enso/pull/7167 for a few reasons:
1. The text component's shortcuts depend on the `focused` FRP endpoint, which is controlled by `deprecated_(de)focus` inputs. `focused` output was not changed by the code editor `model.focus()` call. (we still use `deprecated_focus` for all other components)
2. `focus()` FRP input was added to the text component but never triggered. It's too easy to confuse it with the `focus()` method of the `object::Instance` (Deref is evil!)
3. The graph editor handles clicks on the background by `blur_tree()`, effectively blurring any focused element in the application. But clicking on code editor (to focus it) also causes a click on the background! So we focus the code editor, and then handle the background click, defocusing it from the graph editor's point of view. It allows graph editor to open CB on <kbd>Enter</kbd> while the code editor is still active.

I solved (3) by disallowing CB opening while code editor is visible. Not ideal, but I guess it solves the issue.

Do you think the other solution is possible – to add some overlay for the code editor and avoid triggering `blur_tree` when clicking on it? That won't work because you still can't defocus the code editor using the new API, so it will always be focused.

So we have a situation when half of the app uses the new focus system, another half uses the old one, and none works properly.


https://github.com/enso-org/enso/assets/6566674/3a0d36ed-4d50-4606-9486-272fbd5d9cb7
2023-10-05 08:40:52 +00:00
Ilya Bogdanov
2cd3912402
Add automatic generation of missing group colors (#7902)
Closes #7823

We set fallback color for components without an assigned group, use a color defined in the group, or otherwise derive the color from the group name.

All group colors are available in the graph editor as CSS variables so that they can be dynamically edited and debugged via dev tools.

For deriving the color, we use [murmurhash](https://www.npmjs.com/package/murmurhash), which quickly produces sufficiently uniformly distributed 32-bit values and [oklch](https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl) colorspace. We will still have *some* hash collisions between different groups, but it shouldn't matter that much. I have also tried a few other hashes (namely `cybr53` and Java's string hashing), and the results were more or less similar.

`oklch` is rather a new thing in CSS, but it is available starting with Chrome 111, which is exactly the version we're using in Electron.


https://github.com/enso-org/enso/assets/6566674/7177f041-93e9-4536-b19f-6b67a2da8b7e
2023-10-04 11:24:10 +00:00
Paweł Grabarz
ad0c1bc188
[GUI2] Fix and add tests for delta format translation. (#7968)
Fixes #7967

The text updates should no longer be rejected after applying edits containing newlines. The tricky update translation logic was also covered with property-based unit tests.

https://github.com/enso-org/enso/assets/919491/0bfb6181-7244-4eff-8d72-5b1a4630b9a6
2023-10-04 10:53:54 +00:00
somebody1234
0228022809
Fix lint error when running compile-server (#7969) 2023-10-04 05:11:17 +02:00
somebody1234
7e7b0f8c43
Hotfix code editor focus (#7965)
This fixes not being able to click the code editor.
This is a regression introduced by:
- #7893

# Important Notes
None
2023-10-03 20:56:40 +00:00
Michał Wawrzyniec Urbańczyk
2d39e644b8
New GUI/IDE build script support (#7832)
This PR adds support for the new Vue-based GUI (aka `gui2`).

The user-facing changes are primarily:
* support for `./run gui2` and `./run ide2` commands (that build just the new GUI and the whole IDE package with new GUI embedded — respectively);
* the top-level `test` and `lint` commands will now invoke the relevant commands on the new GUI

---------

Co-authored-by: Paweł Grabarz <frizi09@gmail.com>
2023-10-03 20:07:20 +02:00
Michał Wawrzyniec Urbańczyk
8d8c0b62d6
Disable broken lints (#7961) 2023-10-03 19:30:24 +02:00
Adam Obuchowicz
608ff2da09
Loading suggestion db (#7940)
PR adds initialization of suggestion db from the language sever (instead of fetching some mock). Also support for applying updates.

---------

Co-authored-by: Paweł Grabarz <frizi09@gmail.com>
2023-10-02 15:15:22 +02:00
Paweł Grabarz
af050f522b
[GUI2] Module contents editing and synchronization (#7938)
Added bidirectional synchronization of module edits with language server. All document edits made by any of the Yjs peers are sent to language server to apply to the file. Any local file changes cause reload, which is synchronized back to Yjs by finding a diff.
2023-10-02 12:01:03 +00:00
somebody1234
3a010a00a7
Implement connector button and context menu action. (#7891)
- Closes https://github.com/enso-org/cloud-v2/issues/686

# Important Notes
For now they use the backend endpoints for secrets.
2023-10-02 10:52:26 +00:00
somebody1234
b59e7c088e
[gui2] Shortcut manager + shortcuts for selecting nodes (#7893)
- Closes #7874
- Chosen solution: Use the dashboard's shortcut manager to register keybinds and match mouse shortcuts
- Switch existing shortcuts to shortcut manager as well
- Switch visualizations to use the shortcut manager too
- Closes #7865
- Implements all shortcuts for node selection, *except* the arrow key shortcut
- Adds circle cursor selection brush
- The fade out from inactivity (which is present in the Rust source code) is currently missing

Other changes:
- Change everything to use `pointerdown` as appropriate, to ensure the event handlers are called in the right order

# Important Notes
The arrow key shortcut to navigate to the nearest node in that direction *has not* been implemented.
This may need discussion on how it should work

The implementation in general is pretty inefficient - this is intentional, performance can be optimized in the future
2023-10-02 09:03:47 +00:00