Commit Graph

321 Commits

Author SHA1 Message Date
Kaz Wesley
b027a7ee92
Display comments (#9218)
Introduce basic display of node documentation-comments.

![image](https://github.com/enso-org/enso/assets/1047859/b1960097-d265-4d77-a924-fd3c309dc3fd)

Part of #9162.

# Important Notes
- Add synchronization of `documentation` updates to the GraphDB; add a type assertion that ensures `Node` synchronization is updated when new fields are added to `Node`.
- Introduce read-only comment rendering.
2024-02-29 15:42:11 +00:00
Adam Obuchowicz
874e9efe74
Add workaround for huge idmap diffs (#9207)
Fixes probably #9198 See [this comment](https://github.com/enso-org/enso/issues/9198#issuecomment-1968484269) for justification. TLDR: the diff algorithm is too slow for our huge idmap.

The proper fix would be to reduce idmap size. Expect tasks for that soon.
2024-02-29 14:42:59 +00:00
Kaz Wesley
97033a2ff4
Represent documentation in AST, load into Node (#9205)
Part of #9162.

- Add support for representing and interpreting the full text-literal/documentation syntax (escape codes, platform-independent newlines, string interpolations); build on generalized operations for structured-fields that will simplify future representation of other types like `Vector`.
- Load parsed and interpreted node documentation into `Node`s.
2024-02-28 20:43:23 +01:00
somebody1234
fecdd534b1
Fix Component Browser aliases (#9163)
- Fix #9107
- Allow matching initials of aliases
- Allow matching spaces instead of underscores (aliases use spaces, not underscores)
- Fix only the first alias being detected. This is due to incorrect docs parsing keeping the leading space - `foo, bar` turns into `["foo", " bar"]`

# Important Notes
None
2024-02-28 15:33:22 +00:00
Adam Obuchowicz
c69ba4ee70
Fix area select regression (#9197)
Fixes #9182

Now we are careful when to handle events - before or after updating intersected set.

Added general E2E and detailed unit tests for selecting.

Also discovered, that sometimes the test are running while nodes are not yet in right positions. Added an instruction ensuring the position is right.
2024-02-28 13:14:48 +00:00
somebody1234
d232b9252c
Re-enable vibrancy and add support for Linux (#9003)
- Fixes support for vibrancy
- Disable background when vibrancy is enabled
- Minor refactors to pass the relevant config option to dashboard, so that the dashboard knows whether vibrancy is enabled
- Enable vibrancy on Linux if a special environment variable is set

# Important Notes
- MUST be tested on macOS
- Windows *does not support resizing* when vibrancy is enabled. This is a limitation of Windows - see [this issue](https://github.com/electron/electron/issues/6107).
2024-02-28 13:01:03 +00:00
Kaz Wesley
edb349f8fc
Allow setting CB viz type; determine default from suggestion type info. (#9196)
Fixes #8570.

- Visualization type can be set per suggestion entry.
- Default visualization type for each suggestion is determined by suggestion type info.

# Important Notes
Previewing non-default visualizations seems to be broken (#9194), but this PR updates the GUI to select visualization types appropriately.
2024-02-27 15:49:56 +00:00
somebody1234
207f6a06e5
Fix E2E tests (#9185)
- Fix #9184
- It turns out the logic for handling macOS was already present elsewhere - and even *in the same file*! It seems like this was an oversight

# Important Notes
None
2024-02-26 15:34:43 +00:00
Kaz Wesley
92624126ba
Fix minor visual glitch in record-control background (#9170)
Before:
![image](https://github.com/enso-org/enso/assets/1047859/dcf083b2-c169-42a9-a120-4aa730f05962)

After:
![image](https://github.com/enso-org/enso/assets/1047859/7d9b774a-1ccd-4225-9a2d-a313e40e0c4f)
2024-02-26 08:38:43 +00:00
Kaz Wesley
245ec7afe8
Replace execution context controls with record mode controls (#9133)
Closes #8673. Stacked on #9132.

Before:
![image](https://github.com/enso-org/enso/assets/1047859/1b1ca9f4-eda9-45fd-bec1-cd7e255112fa)
![image](https://github.com/enso-org/enso/assets/1047859/b8cf6de1-d75c-48d0-ac0d-9e6e0c659dd4)

After:
![image](https://github.com/enso-org/enso/assets/1047859/91d13862-96e7-4175-a61e-40aecd6d62b0)
![image](https://github.com/enso-org/enso/assets/1047859/ef20511f-00f2-4042-b4d4-97728817500b)

# Important Notes
- The model has been refactored from execution-modes (live/design) to record-mode (on/off) up to the point of the project store, where it's translated (since the backend still uses the live/design concepts).
2024-02-23 20:10:43 +00:00
James Dunkerley
880562a503
Add comment, warning, error icons. (#9169)
Add some state icons.
![image](https://github.com/enso-org/enso/assets/4699705/ab4060f5-7814-4a0d-a0af-bb775235ff98)
2024-02-23 17:25:17 +00:00
Kaz Wesley
9c872c653e
Checkbox shows argument name if not already shown (#9146)
Fixes #9002. This is not a great solution; doing this properly would require some refactoring of widget selection. Proposal:  #9145.
2024-02-23 15:48:10 +00:00
Adam Obuchowicz
8c286da21b
Proper fix for editing node (#9153)
The replacement for https://github.com/enso-org/enso/pull/9144

We try to match bindings using "buttons" field, but it in fact does not contain the just-released buttons.

# Important Notes
I added tests for editing node. Also, I decided that the cursor position should be at the end of line when starting editing by clicking at "edit" icon.
2024-02-23 14:54:34 +00:00
Kaz Wesley
bc99941736
Move project name (#9132)
Closes #8672.

Before:
![image](https://github.com/enso-org/enso/assets/1047859/9d95178f-24c1-4e82-bf90-a37c3d1ca450)

After:
![image](https://github.com/enso-org/enso/assets/1047859/84e6dae9-e309-46c5-9be8-6b82dcb9ddc4)

# Important Notes
- The execution context controls are no longer aligned nicely, but we are about to make major changes to their display anyway: #8673
2024-02-23 13:48:33 +00:00
Kaz Wesley
990ba2fc64
Fix flickering when resizing visualization (#9147) 2024-02-23 08:47:57 -05:00
Kaz Wesley
d650798898
Display alias when searching by alias (#9148)
* Display alias when searching by alias

* Fix tests
2024-02-23 08:47:11 -05:00
somebody1234
bdebe904b3
Make alt key keep dropdown open (#9157)
- Fix #9083

# Important Notes
None
2024-02-23 13:41:58 +00:00
Adam Obuchowicz
e7a9221618
Fix escaping \ (#9155)
Fixes #9151

In one of my previous PRs I merged two `escape` implementations having exactly the same documentation. However, one of it missed escaping `\` character.

# Important Notes
One test even expected that `\` are _not_ escaped, but I doubt it should, given the above bug report?
2024-02-23 12:10:45 +00:00
Michael Mauderer
a900fb5c43
Add docs to highlight order of processing dirty nodes in readFunctionAst. (#9141) 2024-02-23 11:19:35 +00:00
Adam Obuchowicz
7f5b2edbf5
Fix interfering click handlers (#9127)
Fixes one failure in #8942 which caught a real issue: clicks at various panels were triggering many handlers at once, often unexpectedly - for example quick clicking at breadcrumbs (and automatic tests always click fast) we could also trigger getting out the current node.

Therefore, I added `stopPropagation` for all mouse events on "panel" level + where I think the event should be considered "handled" and no longer bother anyone. Also, to unify things, most actions are for `click` event.

Additionally I spotted and fixed some issues:
* When "clicking-off" Component Browser, it creates new node only if anything was actually typed in (no more dangling `operatorX.` nodes)
* Filtering now works for operators
* When, after opening CB with source node, user starts typing operator, we replace dot with space
* Fixed our shortcut handler, so it works properly with `click` event.
* Fixed problems with defocusing input in CB when clicking at links.

# Important Notes
I removed `PointerMain` binding for deselectAll, because it was triggered every time did the area selection.
2024-02-22 15:18:28 +00:00
Kaz Wesley
323d46ec4e
Add property test for textChangeToEdits and applyTextEdits. (#9131)
Add a test for some functionality introduced in #9055.
2024-02-21 21:48:37 +00:00
Kaz Wesley
fdec1d0671
Self-arrows: Distinguish self arguments (#9116)
Distinguish self arguments; render edges to them as arrows, and use icons for their widgets.
2024-02-21 08:40:08 -08:00
Kaz Wesley
01fc65eec5
Self-argument arrows: New edge rendering mode (#9099)
Self-argument arrow rendering
2024-02-21 09:43:22 -05:00
somebody1234
c60d1ba36d
Fix bug in map visualization (#9119)
- Fix a bug where longitude was used as both latitude and longitude, due to a typo....

# Important Notes
- As our Mapbox token is no longer valid, the map visualization no longer works, even with this fix. As a result, this cannot be tested properly.
- However, this can still be tested somewhat, by seeing that the error is no longer present in the repro:
- Open the `Colorado COVID` template
- Open the viz on this node (at the bottom right of graph. it may help to zoom out using Ctrl+Shift+A.):
![image](https://github.com/enso-org/enso/assets/4046547/54849e5f-8a53-4f5b-8bdf-f08fe8ca51f0)
- Compare the errors logged in the console between `develop`, and this branch. This branch should not have the error about `lat` (latitude) being out of range.
2024-02-21 12:21:20 +00:00
Michael Mauderer
6c4c791d87
Display warnings on components (#9108)
Closes #8678

[Peek 2024-02-20 12-45.webm](https://github.com/enso-org/enso/assets/1428930/6bb6c4ad-5507-4b11-b2c9-b295bf10c745)
2024-02-21 11:40:07 +00:00
Paweł Grabarz
d415d133bb
Fix node edits (#9111)
* Prevent duplication of external IDs in syncTree

* trim component browser accepted value

* use flush post for visualization data watcher

* do not create empty nodes when closing component browser

* Lint

---------

Co-authored-by: Kaz <kaz@lambdaverse.org>
2024-02-20 16:40:50 -05:00
Michael Mauderer
e264189f6a
New ... menu in the top bar with zoom controls (#9073)
Closes #8614

https://github.com/enso-org/enso/assets/1428930/8b5b47e4-5ce5-4bf0-a42f-0b6c3d7d9323
2024-02-20 15:44:49 +00:00
Kaz Wesley
c811a5ae8b
Enable the Code Editor, with new apply-text-edits algo. (#9055)
- Fix the UI problems with our CodeMirror integration (Fixed view stability; Fixed a focus bug; Fixed errors caused by diagnostics range exceptions; Fixed linter invalidation--see https://discuss.codemirror.net/t/problem-trying-to-force-linting/5823; Implemented edit-coalescing for performance).
- Introduce an algorithm for applying text edits to an AST. Compared to the GUI1 approach, the new algorithm supports deeper identity-stability for expressions (which is important for subexpression metadata and Y.Js sync), as well as reordered-subtree identification.
- Enable the code editor.
2024-02-19 23:57:42 +00:00
Kaz Wesley
d75523b46f
Render target attachment bit as part of port. (#9068)
Fixes one issue from #8139.

Before:
![image](https://github.com/enso-org/enso/assets/1047859/1db71cda-7f9e-4d15-ac0f-14cb3c0b7c09)

After:
![image](https://github.com/enso-org/enso/assets/1047859/c5aafc56-d81d-447e-b725-fcb2e30b3c4e)
2024-02-19 20:02:29 +00:00
AdRiley
27ec236c19
rename database Table to DB_Table (#9067)
Rename database.Table to database.DB_Table to avoid name collisions as part of https://github.com/enso-org/enso/issues/8981
2024-02-19 17:31:58 +00:00
Kaz Wesley
760afbc7f4
Render unconnected edges above nodes. (#9069)
Fixes one issue from #8139.

Before:
![image](https://github.com/enso-org/enso/assets/1047859/b6d05734-f186-4213-b943-81fd868cf565)

After:
![image](https://github.com/enso-org/enso/assets/1047859/4e42907f-8579-4869-99a3-74aac920e65b)
2024-02-19 15:12:15 +00:00
Adam Obuchowicz
fddfa1150a
Fix for adding node in collapsed functions (#9060)
Fixes #9049

There were still some stubs left in node creation code.

# Important Notes
I haven't added any tests, as unit testing the graph store is very difficult - it has much tangled logic there. I'm going to try to untangle it a bit, but in a separate PR.
2024-02-19 09:14:46 +00:00
Michael Mauderer
6746bdc148
Implement full wheel component menu (#9029)
Closes #8612.


[Peek 2024-02-12 14-11.webm](https://github.com/enso-org/enso/assets/1428930/504a0e17-9d75-46b2-b5e9-d23ec09d6613)

# Important Notes
The `...` menu was added at the top of the menu as there is less visual interference with an opened visualisation.
2024-02-15 14:01:38 +00:00
Adam Obuchowicz
8489316d83
WidgetFunction: merge dynamic config for a call with inherited one (#9042)
Fixes #9008

Now, even if we inherit FunctionCall config from parent widget (e.g. drop down), we still ask for config of the current call and try to merge them (preferring the inherited parameters).
2024-02-14 23:05:45 +00:00
Adam Obuchowicz
ee381369b0
Remove vite-plugin-top-level-await plugin (#9038)
We've used the vite-plugin-top-level-await to support top level await. But most of them were removed anyway, because the ide-desktop/lib/client is bundled as CJS and use some of gui2 code. And the plugin [is causing problems](https://github.com/Menci/vite-plugin-top-level-await/issues/25), [also in our CI](https://github.com/enso-org/enso/actions/runs/7842841953/job/21402194728?pr=9013#step:8:458)
2024-02-14 09:42:37 +00:00
AdRiley
5c7947ce60
Rename database column to DB_Column (#9046)
Rename database column to DB_Column to avoid name collisions as part of https://github.com/enso-org/enso/issues/8981
2024-02-14 09:11:52 +00:00
Adam Obuchowicz
36722eaf55
Retry E2E tests on CI (#9040)
To guard us from flaky tests, CI will run every test three times and fail if _any_ of the run fails.

This way we hope most flakiness will be catch before merging PR.

Configured dashboard in the same way.
2024-02-13 11:43:56 +00:00
Adam Obuchowicz
a0029f2451
Small boolean widget tweaks (#8994)
Fixes #8962
2024-02-12 11:33:03 +00:00
Ilya Bogdanov
e1943bdd49
Properly propagate dynamic configuration inside dropdown widget (#8983)
Closes #8932

Now we use a bit more robust mechanism for passing dynamic configuration down the widget tree inside dropdowns, no longer relying on the `label`s used for dropdown items.

Curiously, we still need to use a hotfix implemented earlier, as we won’t have info about the currently selected item otherwise. Highlight for the currently selected item is not crucial as proper dynamic config, so we can leave with the current solution in the meantime.

No visual changes to the IDE, apart from fixed highlight for currently selected item.

# Important Notes
Target branch: #8950, for easier testing.
2024-02-12 10:17:29 +00:00
James Dunkerley
aed59d316d
Text Editor shows up for Text only parameters. (#9014)
- Fix type name so that Text Editor shows for parameters.
- Following on from #9010, now show the default text values.
![image](https://github.com/enso-org/enso/assets/4699705/da68fec4-25b9-4e04-ba13-a2d112cf67c9)
2024-02-09 17:26:15 +00:00
Ilya Bogdanov
6881bc844e
Fix eslints in the project (#9005)
When using `npm run lint`, there are a lot of warnings for the last couple of weeks, and it is really annoying because I keep skipping important warnings for my files.
2024-02-09 11:22:33 +01:00
Adam Obuchowicz
1c46eecd90
Dispose ydocs provider when closing app (#8990) 2024-02-08 18:39:05 +04:00
Michael Mauderer
1619b2d64f
New scenarios for e2 e tests: Loading Table Visualization & Fullscreen Vis (#8989)
Adds e2e test for table visualisation and full-screen visualisaiton.
2024-02-08 12:17:56 +00:00
James Dunkerley
93f2a44633
Add some ICON tags and a few new Icons. (#8996)
- Apply @Cassandra-Clark's ICON tags to the library code.

- Fix bug with Table viz not showing row count in dropdown list. **Doesn't fix defect with dropdown not changing data.**
![image](https://github.com/enso-org/enso/assets/4699705/dfbdba91-5f4f-4c89-8ae8-f30156047162)

- Added missing icons.
![image](https://github.com/enso-org/enso/assets/4699705/145191cd-d31a-45f1-8bb2-fcc3cf0f1207)
![image](https://github.com/enso-org/enso/assets/4699705/2a8e0530-2470-4ec8-b836-57bed8520c28)
2024-02-08 09:56:57 +00:00
Ilya Bogdanov
851791183d
Add a small arrow for dropdowns (#8950)
A **temporary** solution for #8949. Not pretty, but it solves the issue for now.

https://github.com/enso-org/enso/assets/6566674/d8b28c60-b210-486f-8c93-c6041a2062e3
2024-02-07 14:59:02 +00:00
Kaz Wesley
e0ba39ed3e
Introduce SourceDocument for text edit support (#8957)
Introduce `SourceDocument`, a reactive source code representation that can be synced from a `MutableModule`. `SourceDocument` replaces various logic for tracking source code and spans--most importantly, `ReactiveModule`. There is no longer any reactively-tracked `Module`, per-se: Changes to the `MutableModule` attached to the synchronized `ydoc` are pushed as Y.Js events to the `SourceDocument` and `GraphDb`, which are reactively tracked. This avoids a problem in the upcoming text-synchronization (next PR) that was caused by a reactive back channel bypassing the `GraphDb` and resulting in observation of inconsistent states.

Stacked on #8956. Part of #8238.
2024-02-06 16:44:24 +00:00
Michael Mauderer
678270ac69
New scenarios for E2E tests - Interactions with Edges (#8917)
Adds e2e test for interactions with edges.
2024-02-06 16:15:00 +00:00
Kaz Wesley
06f18864f4
Refactoring before text edits (#8956)
Changes in preparation for #8238 features.

# Important Notes
Changed edit APIs:
- **`graph.astModule` is deprecated.** It will be removed in my next PR.
- Prefer `graph.edit` to start and commit an edit.
- Use `graph.startEdit` / `graph.commitEdit` if the edit can't be confined to one scope.
2024-02-06 14:43:17 +00:00
Adam Obuchowicz
6517384bbb
Interpret documented nodes properly (#8978)
When a node has documentation, it becomes a special "Documented" AST node.
2024-02-06 10:45:16 +00:00
Adam Obuchowicz
e88d8d8756
Fix vector widget in non-argument literal (#8972)
Fix vector widget not appearing in non-argument list literals. Added tests for showing widgets for various literals.
2024-02-06 09:43:38 +00:00
Paweł Grabarz
d418a02014
Update icon definitions to new figma export format (#8860)
Related to #8387

Updated icons file to match the export format of figma plugin.
2024-02-05 15:29:45 +00:00
Adam Obuchowicz
fa4b980d67
Reduce test flakiness (#8947)
Probably fixes the first point in #8942

My guess is that the mockExpressionUpdate may be not set in cases when the test runs before App mounting. To make sure all the setup is done, we wait for `App` widget to being mounted before proceeding.

# Important Notes
This PR also change the way we run test's server. Before it was always a production build, but this makes development iteration long. Now we test production build only on CI or when `PROD=true` env variable is set.
2024-02-05 14:20:24 +00:00
Ilya Bogdanov
801cc7b37d
Fix dangling node connection (#8902)
Fixes #8871

The issue was caused by invalid port registration. Because of the existing context switch expression (which is not visible in GUI),  the port incorrectly considered itself to belong to another node. This happened because the port was only aware of the visible part of the node’s AST and considered it the whole node.

There are two fixes in this PR. Either of them fixes the issue, and they are both implemented for robustness:
1. We provide `nodeId` information to the widget tree, so it no longer assumes the node ID from AST.
2. The order of checks in `getPortNodeId` is swapped. Now we first search by AST, only then try to look up the port. It makes sense to me because the AST is a single root of truth, and we should only rely on registered ports if AST does not exist (which happens for unconnected ports).
2024-02-05 10:49:55 +01:00
Adam Obuchowicz
1a8b82e237
Another set of small fixes (#8946)
* `Enter` key accepts the edit in Numeric and Text input
* Newly added node are selected
* Placement of new nodes takes opened visualizations into account.

[Screencast from 2024-02-02 13-02-26.webm](https://github.com/enso-org/enso/assets/3919101/0f328824-1cbc-4b07-988e-dbf17b94dc2f)
2024-02-02 18:11:28 +01:00
Ilya Bogdanov
45221d9167
A quick fix for incorrectly working dropdowns. (#8933)
Partial fix for #8932 

https://github.com/enso-org/enso/assets/6566674/75a878fb-891b-44fc-bdfd-c3cbb90c9f35

This is not a correct fix, as comparing strings is not what we really want, but it should fix most of use cases.
2024-02-02 15:55:22 +01:00
Kaz Wesley
343a644051
Syntactic synchronization, automatic parentheses, metadata in Ast (#8893)
- Synchronize Y.Js clients by AST (implements #8237).
- Before committing an edit, insert any parentheses-nodes needed for the concrete syntax to reflect tree structure (fixes #8884).
- Move `externalId` and all node metadata into a Y.Map owned by each `Ast`. This allows including metadata changes in an edit, enables Y.Js merging of changes to different metadata fields, and will enable the use of Y.Js objects in metadata. (Implements #8804.)

### Important Notes

- Metadata is now set and retrieved through accessors on the `Ast` objects.
- Since some metadata edits need to take effect in real time (e.g. node dragging), new lower-overhead APIs (`commitDirect`, `skipTreeRepair`) are provided for careful use in certain cases.
- The client is now bundled as ESM.
- The build script cleans up git-untracked generated files in an outdated location, which fixes lint errors related to `src/generated` that may occur when switching branches.
2024-02-02 10:22:18 +01:00
Adam Obuchowicz
ed65af7005
CB preview debounce (#8909)
To make engine's life a bit easier, we added 200ms debounce to CB preview updates.
2024-02-01 17:37:00 +00:00
Michael Mauderer
1ba28a3c5c
New scenarios for E2E tests - Displaying Edges (#8904)
Adds e2e test for rendering edges.
2024-01-31 13:42:36 +00:00
somebody1234
cbf6d41e4c
More E2E tests; export default classes from modules (#8730)
This is a prerequisite for adding a CI action for E2E tests.

- Fix E2E tests
- Remove visual regression testing (VRT) and associated fixtures (screenshots) for now
- Switch dashboard almost fully to Vite, from ESBuild, to match GUI2's build tooling.
- Add some new E2E tests:
- Creating assets
- Deleting assets
- Creating assets from the samples on the home page
- Sort assets
- Includes fixes for sorting:
- Group sorted assets by type again (regression) (see https://github.com/enso-org/cloud-v2/issues/554)
- Make sorting by title, case insensitive. This is because it is more intuitive for non-programmers if all items with uppercase names *aren't* separated from those with lowercase names - especially since the Windows FS is case-insensitive.
- Normalization of Unicode letters is *not* currently being done. It can potentially be added later.
- Double-clicking *anywhere* on a directory row now expands it. Previously it was only being expanded when double clicking
- Add recursive label adding/removal to mirror backend
- Note: The current implementation is not exactly the same as the backend's implementation.
- Fix https://github.com/enso-org/cloud-v2/issues/872
- Unset "saved project details" (for opening the last open project) if fetching it produces an error.

# Important Notes
- All tests pass. (run `npm run test:e2e` in `app/ide-desktop/lib/dashboard`)
- All `npm` commands should be run in `app/ide-desktop/lib/dashboard`. `dashboard:*` npm scripts have been removed from `app/ide-desktop` to prevent a mess.
- `npm run dev` confirmed to still work. Note that it has not been changed as it was already using Vite.
- `npm run build` now uses `vite build`. This has been tested using a local HTTP server that supports `404.html`.
- Other cases have been tested:
- `npm run test:e2e` works (all tests pass)
- `./run ide build` works
- `./run ide watch` works
- `./run ide2 build` works
- `./run gui watch` works
2024-01-31 11:35:41 +00:00
Ilya Bogdanov
057bf17ffb
Fix wrapping in doc panel (#8887)
Fixes soft-wrapping of lines in documentation panel.
2024-01-30 15:05:39 +01:00
Ilya Bogdanov
ad6348a12a
Text input widget (#8873)
Closes #8823

https://github.com/enso-org/enso/assets/6566674/966576ec-6507-401c-98d3-bd71c2ffc6b2

Adds a basic text widget for text literals. 

### Important Notes

Several known restrictions:
- Separators would always be replaced with single quotation marks. All types of separators in Enso are supported though, and they would be correctly escaped if needed.
- Logic for widget selection probably needs refinement (works for text literals and `Text` types, but does not work for `Text | Integer`, for example)
- **(!)** There is a very annoying issue when the input field suddenly loses focus, closing the editing mode and discarding any changes. Debugging shows that it happens when we receive an engine update (and probably recreate the node component/widget tree (???)). It requires a separate investigation.
2024-01-30 15:05:28 +01:00
Adam Obuchowicz
2ca4fe94e2
Fix breadcrumbs navigation (#8874)
Fixes #8756

The items were added to stack in wrong order (I wonder how on earth it worked with the engine).
2024-01-29 10:53:44 +00:00
Michael Mauderer
abe0875072
New scenarios for E2E - Displaying proper types on nodes on hover (#8856)
Adds a new test scenario that checks that types are correctly set and displayed after an expression update. Includes checking the string set on the node as well as showing the type label when hovering the output port of a node.
2024-01-29 10:37:44 +00:00
Adam Obuchowicz
ad7fad42fa
Make run button execute in live mode (#8876)
What can I say? It's not quite a bug. Rather a wrong implementation

Anyway, fixes #8810
2024-01-29 09:50:52 +00:00
Adam Obuchowicz
057245ea5e
Fix nested drop downs + test scenarios for drop-down and vector widgets. (#8859)
Part of #8518
Closes #8822

The drop downs were missing, because WidgetFunction had a higher score than them and took precedence. The fix was to adjust scores, so drop down is before both argument name and function. Generally, any widget expecting to "overlap" existing code (and possibly further widgets) should go before WidgetFunction.

# Important Notes
* Extended mockExpressionUpdate to accept a subexpression of a node. Also, I removed it from GraphDb - I want this function to have as little impact on app code as possible.
2024-01-26 17:18:27 +00:00
Kaz Wesley
a04385a6a4
New AST APIs (#8851)
Introduce new AST APIs. They will be used for synchronization in the next PR.

# Important Notes
- `Module.edit` now clones a YDoc containing all the module's data; the resulting `MutableModule` can be edited with mutation APIs.
- Every AST type now has a mutable subtype. These `MutableAst` types expose all editing operations that were previously in `MutableModule`, such as `replace`; they also provide field setters.
2024-01-26 11:32:35 +00:00
Adam Obuchowicz
5dd2dc1c93
Fix gui2 typecheck (#8870) 2024-01-26 09:15:01 +01:00
Ilya Bogdanov
6f51894273
Align collapsed node to the leftmost selected one (#8844)
As discussed on the latest demo.


https://github.com/enso-org/enso/assets/6566674/c68f1df4-285e-413b-b05e-13394dffe3bd
2024-01-25 16:19:41 +01:00
Adam Obuchowicz
3a849ea01b
Connection and visualization fixes (#8803)
Fixes several points from #8745
* Brought back cursor pointer in full screen visualization
* Changed behavior of edge disconnected from one side: Esc will bring the connection back, while click will remove it (and start creating new node if the source was connected).
* When hovering connection, the "active" part (i.e. the part which will be the hanging connection after click) is in normal color, and the rest is dimmed.

[Screencast from 2024-01-19 09-06-48.webm](https://github.com/enso-org/enso/assets/3919101/6df28a9c-51b3-4f98-be10-a35275eac800)
2024-01-25 14:18:26 +00:00
Ilya Bogdanov
a3873b9565
Numeric input widget (#8837)
Closes #8751
Closes #8752

- The numeric widget allows the use of the input field after clicking with LMB
- Slider is only visible if the engine provides widget configuration with set limits (see below for testing)
- Setting value outside limits is possible
- For now, to distinguish drag from click, we compare relative mouse movement on the mouse up event. We might benefit from using a timer instead, but let’s see how good it is now.
- Changes after demo
- No more input validation. You can enter literally anything and it would be accepted.
- Updates debouncing – the code is updated on defocus or when slider dragging has finished.


https://github.com/enso-org/enso/assets/6566674/b3580083-c678-4734-881c-97f8ac56176b
2024-01-25 09:41:37 +00:00
Kaz Wesley
f88bd90ebb
Refactor for YJs AST (#8840)
Some refactoring separated from #8825 for easier review.

# Important Notes
**ID types**

The new *synchronization IDs* will replace `ExprId` for `Ast` references in frontend logic. `ExprId` (now called `ExternalId`) is now used only for module serialization and engine communication. The graph database will maintain an index that is used to translate at the boundaries. For now, this translation is implemented as a type cast, as the IDs have the same values until the next PR.

- `AstId`: Identifies an `Ast` node.
- `NodeId`: A subtype of `AstId`.
- `ExternalId`: UUID used for serialization and engine communication.

**Other changes**:

- Immediate validation of `Owned` usage.
- Eliminate `Ast.RawCode`.
- Prepare to remove `IdMap` from yjsModel.
2024-01-24 19:22:05 +00:00
Adam Obuchowicz
f5c02d36e2
Fix addRequiredImport so it is not fooled by existing module changes (#8813)
A follow-up of [this comment](https://github.com/enso-org/enso/pull/8740#discussion_r1452282468)

`addRequiredImport` now reads the existing import from the edit instead of taking them from the current module. This way, it will consider any imports added so far as part of this edit.
2024-01-24 12:03:25 +00:00
Ilya Bogdanov
d5d4793e0e
Positioning for nodes created when collapsing (#8771)
Closes #8699


https://github.com/enso-org/enso/assets/6566674/82e1bdb3-3f37-4122-9e73-92d39acd0f13
2024-01-18 14:30:13 +00:00
Ilya Bogdanov
f96e5dddd6
e2e tests for collapsing and entering nodes (#8758)
Related to https://github.com/enso-org/enso/issues/8518

These tests already caught one regression in nav breadcrumbs: https://github.com/enso-org/enso/issues/8756

It also provides API for mocking expression updates for arbitrary nodes on the screen. The implementation is a bit convoluted and includes setting a callback on `window`, but it looks like the only possible solution given our architecture and playwright restrictions.
2024-01-18 13:45:18 +00:00
Paweł Grabarz
48a5599eb6
improve argument placeholder resolution for partial applications and … (#8794)
Fixes #8788

- Fixed missing argument lists on constructors, and improved handling for various cases of partially applied functions.
- Extended tests to check for correct `self` argument placeholders.
- Additionally reworked some questionable test code to maintain separation between server and client code.

<img width="1241" alt="image" src="https://github.com/enso-org/enso/assets/919491/5377f57f-18f0-4a50-a8ab-9331862ca547">
2024-01-18 13:13:31 +00:00
AdRiley
ac0d4c9f5f
Make Random.Seed private. Remove unused TEXT_ONLY (#8783)
Random.Seed doesn't work in the GUI and the TEXT_ONLY tag doesn't do anything so it was incorrectly showing up in the component browser.

This MR makes Random.Seed private to hide it from the GUI and completely removes the TEXT_ONLY tag which is unused and unimplemented.
2024-01-17 17:15:51 +00:00
Michael Mauderer
080690b3ad
Fix for code enabling/disabling output context on single node (#8776) 2024-01-17 10:18:40 +00:00
Paweł Grabarz
a880fe80b6
[GUI2] Implement proper connect and disconnect operation on argument placeholders (#8731)
- Correctly applying code edits when connecting to argument placeholders or disconnecting existing arguments.
- Prevented the placeholders from temporarily flickering right after the edit operation.
- Rewritten the placeholder argument placing logic to match the old GUI exactly - the argument should never move right after being connected.
- Fixes #8494
- Fixed some cases of ports either not existing, or existing where they shouldn't.
2024-01-16 21:20:43 +00:00
Adam Obuchowicz
db2d3f1d01
Shorter tag values in WidgetSelection (#8740)
Fixes #8727

Ported GUI1 behavior: The tags in WidgetSelection which are fully qualified names have only last segment displayed, and inserted expression is also shorter (with proper import added).

[Screencast from 2024-01-11 15-14-08.webm](https://github.com/enso-org/enso/assets/3919101/afdf2c1a-3110-4ddd-83ff-fd0c3551afb6)
2024-01-15 11:57:24 +00:00
Adam Obuchowicz
b28b743ae4
Set of GUI2 widgets fixes (#8749)
Implements first two points of #8745

1. The fix for drop-down was simple, just stop click propagation
2. The fix for connections was much more complicated. It turned out, that it's about keeping track of hovered ports; when picking an option in WidgetSelection makes the drop-down disappear - but that won't emit `pointerleave` event, so the port was still deemed hovered. Changed the mechanism for tracking hovered port to more "centralized" one.
2024-01-15 08:12:34 +00:00
Ilya Bogdanov
58cf4e5244
Collapsing nodes (#8686)
Closes #8067

Also fixes `nodeRects` map, as it no longer stores invlisible nodes.

https://github.com/enso-org/enso/assets/6566674/ba66c99f-df74-497b-8924-dc779cce8ef5

# Important Notes
Positioning of newly created nodes is not handled yet, as it requires fixes in the Ast editing API.
2024-01-12 14:08:17 +00:00
Kaz Wesley
ec2de192ce
Fix replaceRef (#8729)
Fix a bug when `replaceRef` is used to replace an object that had children.
2024-01-10 22:55:20 +00:00
Kaz Wesley
1af1175716
Reference rewriting (#8711)
Implements #8683.
2024-01-10 16:34:19 +00:00
somebody1234
8597de1d43
Re-organize lib/dashboard/ (#8587)
- Significantly flattens directory structure of `lib/dashboard/`

# Important Notes
- Basic testing done on:
- dashboard's `npm run dev` which (since quite recently) uses Vite.
- specifically: `npm run dev` in `app/ide-desktop/lib/dashboard`, OR `npm run dashboard:dev` in `app/ide-desktop`
- dashboard's bundle script (`npm run build`) which uses ESBuild.
- GUI2's own entry point (GUI2's `npm run dev`).
- `./run ide build`
- `./run ide watch`
- `./run ide2 build`
- `./run gui watch`
2024-01-10 16:22:11 +00:00
somebody1234
b201577fca
Switch Table viz to AG Grid Enterprise (#8702)
- Closes #8660
- Switches Table viz to use AG Grid Enterprise

# Important Notes
- Not sure this is the proper way to enable full AG Grid Enterprise.
2024-01-09 12:26:28 +00:00
Adam Obuchowicz
c64e833307
Widget refactoring & show widget in placeholders (#8687)
[Screencast from 2024-01-05 12-18-55.webm](https://github.com/enso-org/enso/assets/3919101/f083512f-f698-42d1-b43a-4e50546b958a)

* Before most widgets didn't show in placeholders, because the argument name widget did not create further widgets. Now it try in more cases, and ignores the problem if no widget is found.
* WidgetInput is no longer a set of classes - instead it contains a set of common fields, and every widget can just extend it with new fields. Adjusted priorities accordingly.
* Updated widget definitions: they better try to match types, and take care about default values.

# Important Notes
Setting value on placeholder breaks widgets. The issue is also present in develop (when connecting to placeholder). To restore node, you have to reopen the project.
2024-01-08 13:51:51 +00:00
Ilya Bogdanov
bbf71ec4f1
Preparations for collapsing nodes (#8569)
Preparations for https://github.com/enso-org/enso/issues/8067. The actual implementation requires AST editing.

The implementation resembles the algorithm from the Rust gui.
2024-01-04 16:03:41 +00:00
Michael Mauderer
cd30815c05
Report more errors to the user (#8623) 2024-01-04 14:12:03 +01:00
Kaz Wesley
a215521c10
Tweak commitEdit API (#8667)
Improve `commitEdit` API.

# Important Notes
- `commitEdit` now warns if it is called before a previous edit has been observed. The preferred approach is to ensure all related changes reside in the same `MutableModule`.
- Remove `root` parameter. I included it to avoid a null check/fallible operation, but it's better to repeat the check and simplify the API.
2024-01-04 08:24:33 +00:00
Adam Obuchowicz
2e7d71d459
Refactor widgets to handle dynamic config in input (#8624)
* Merged ArgumentAst and ArgumentPlaceholder into single class.
* Created `AnyWidget` input being a "general use" widget input. Most wigets try to match with it; the `Argument` input is now solely for WidgetArgument(Name) or those handling arguments in a specific way (like selector which want to show on arg name click).
* dynamic config is now part of widget input, and is properly propagated through vector editor/function widgets.

# Important Notes
The widgets still does not work perfectly:
* The chosen options often don't have argument placeholders - that's because we don't display them for constructors. Needs to be added on our side, or engine should send us methodCall info for constructors.
* There are issues with engine's messages sent to us. This makes widgets does not set up (so there is no drop-down, or vector adds `_` instead of default). I'm investigating them and going to fill issues.
2024-01-03 13:37:52 +00:00
Adam Obuchowicz
9c17b260dc
More E2E tests for Component Browser (#8559)
More cases in E2E tests checking all ways of using component browser.

The tests found one actual bug: sometimes we displayed only a few entries after opening CB because the scroller size was not refreshed (we assumed it will be available in the next tick). Refactored Component Browser so it does not use nextTick anymore.
2024-01-03 09:12:38 +00:00
Kaz Wesley
19d0707334
Preparing for AST-based synchronization (#8625)
Further AST integration and API refinement before introducing the new synchronization mechanism.

closes #8609

# Important Notes
API changes:
- Renamed `Ast.parseExpression` / `Ast.parse` to better reflect their usage:
- `Ast.parse` returns a block or a single expression, depending on its input; this is convenient for expressions expected to be single-line.
- `Ast.parseBlock` always treats its input as a block; this is suitable for parsing a file.
- `astExtended` is no longer needed to access span information. `Ast.span` provides access to the value when appropriate (the project's committed modules have spans; uncommitted changes or other parsed expressions don't).
- `SourceRange` is now used everywhere in place of `ContentRange`--the two types had the same definition.

Features:
- Fix CodeEditor viewing.

Implementation improvements:
- Updated widget update handlers (#8545) implementation to Ast API.
- Integrated `imports` more thoroughly with new AST APIs.
- More tests.
2024-01-02 15:18:11 +00:00
Paweł Grabarz
56657cc684
[GUI2] Widget update handlers (#8545)
Fixes #8258 #8267

Added a generic way of setting a new expression value from within a widget, and ability to intercept those update calls from the child widgets. Used that to implement function argument assignment and clearing.

https://github.com/enso-org/enso/assets/919491/513b823b-eb2c-45d8-88ac-4971ba061c59
2023-12-22 10:59:57 +00:00
Michael Mauderer
2d6e4b4813
Display initialization message (#8573)
Implements #8525

[Screencast from 18-12-23 14:40:29.webm](https://github.com/enso-org/enso/assets/1428930/c7db2a9d-0020-4bce-b44c-d6712df58098)

# Important Notes
Previously, we re-used the API from the dashboard. But this mechanism is brittle and is currently even broken with the new GUI. So instead, I just used the Vue equivalent toast API, which seems easier to use.
2023-12-21 16:15:30 +00:00
somebody1234
cbd7397b5e
Fix GUI2 entrypoint (#8542)
- Closes https://github.com/enso-org/cloud-v2/issues/804
- The GUI should now properly configure deep links and auth settings, among other things, because the logic has been ported over from the GUI1 runner.
- The porting was very basic; it may be a good idea to refactor it later, but that is out of scope of this PR.
- This also means that `runner/` should be safe to remove along with GUI1 in the future, as all code relevant to GUI2 now resides in `app/gui2/runner`.

# Important Notes
- The built `ide2` has been tested on Windows, but should also be tested on macOS.
- Should *also* be fully tested in `npm run dev`.
2023-12-21 15:04:30 +00:00
James Dunkerley
ac9d8c710f
Add a quick support for pasting data from Excel. (#8605)
A simple first implementation of pasting data from Excel.

https://github.com/enso-org/enso/assets/4699705/0c2c41ba-6679-4eb8-8d38-0bf14d5f5f24
2023-12-21 11:35:32 +00:00
Adam Obuchowicz
f97e2393dd
Fix E2E tests (#8599)
E2E were failing on develop, now they're fixed.

1. There was a problem in CB which I don't know by what was triggered (But this test is fixed/extended anyway in #8559
2. Otherwise, the test scenes didn't have any nodes due to some races in initialization.
2023-12-20 14:54:55 +00:00
Kaz Wesley
277dfb1991
Ast edits (#8576)
- The module is edited by changing the AST, not the text representation.
- `IdMap`s no longer need to be maintained in parallel with the module content; they are snapshots produced as needed from the ASTs.
- Simplistic synchronization is in place until #8237: Edits are never merged; if two edits are started from the same state, one will be overwritten.
2023-12-19 17:58:11 +00:00
somebody1234
cbf7248370
Fixes for Language Server sync server (#8514)
- Closes #8398

# Important Notes
- The original error caused by a failing `text/openFile` (`openTextFile`) is still present, but (seemingly?) harder to repro now
2023-12-19 05:41:14 +00:00
Michael Mauderer
23e0bafc75
Graph editor breadcrumbs integration (#8519)
Implements  #7788

[Peek 2023-12-12 10-46.webm](https://github.com/enso-org/enso/assets/1428930/7d1f45f6-8323-4adc-9a8c-f6f4bcaeb143)
2023-12-19 04:47:15 +00:00
Ilya Bogdanov
9d27edafce
Fix dropdown widget style (#8531)
Fixing the dropdown widget, as discussed at the last demo.


https://github.com/enso-org/enso/assets/6566674/052462ca-1a09-428f-ba44-437355e2da1c
2023-12-15 15:07:30 +00:00
Ilya Bogdanov
41cb4e32c4
Doc panel improvements (#8530)
Fixes parts of #8135

- Fixed rendering of the documentation panel when no entry is selected.
- Multiple improvements of tags in the documentation panel:
- Group color for `GROUP` tag
- Custom styling for `DEPRECATED`, `UNSTABLE`, and `ADVANCED` tags.
- Sorting
- Collapsing tags that exceed one line with a button
- Filtering out some tags (`ICON` and `TEXT_ONLY` for now)
- Filtering out private items from the documentation
- Fixing group colors (was incorrectly assuming unique group names) and fallback color (was incorrectly replacing every character in the name with `-` before hashing, which was hilarious).
- Fixing ComponentBrowser demo scene.
- Minor fixes for mock database in demo scenes (removed duplicated entry, added an additional one for testing tags)


https://github.com/enso-org/enso/assets/6566674/10f4f5d0-9332-40c6-93c6-8263eb5fd85a
2023-12-15 14:58:57 +00:00
somebody1234
927df167d7
Set output evaluation context for a single node (#8440)
- Closes #8072
- Implement handlers for the corresponding buttons on the circular menu
- Add missing icons and styles
- Add functionality to match and extract ASTs

# Important Notes
None
2023-12-15 10:29:15 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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