Commit Graph

923 Commits

Author SHA1 Message Date
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
mwu
3a2ca2ae0f we don't need to hardcode version numbers probably 2024-02-20 16:32:04 +01: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
somebody1234
50d5f32570
Fix dashboard tests (#9050)
Fixes issues that were causing CI to fail.

# Important Notes
None
2024-02-19 11:47:48 +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
Michał Wawrzyniec Urbańczyk
06c8776099
CI: Fix macOS notarization (#9066) 2024-02-15 11:53:51 +01: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
Kaz Wesley
cfe3d99da0
Fix Code Editor click (#9051)
Clearing the selection on mouseup breaks the CodeMirror integration. Adding this exception for contenteditable elements would fix it. Is this compatible with whatever this event handler is needed for?
2024-02-14 17:27:27 +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
somebody1234
92f420efec
Add "Invite" button on top right (#8987)
- Implement https://github.com/enso-org/cloud-v2/issues/884
- Add an "Invite" button that is present when the "Share" button is not present

# Important Notes
None
2024-02-13 12:17:45 +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
somebody1234
f7a84d06e4
Organization settings page (#8960)
- Close https://github.com/enso-org/cloud-v2/issues/840
- Add organization page
- Add wrappers for required API endpoints (get, update, delete org; upload org picture)

# Important Notes
None
2024-02-13 09:21:40 +00:00
somebody1234
ecc434e788
Fix dashboard issues (#9015)
- Fix https://github.com/enso-org/cloud-v2/issues/892
- Fix listing recent projects (currently errors ⚠️)
- Fix "update" action in the "duplicate files found when uploading" modal doing nothing, when overwriting a file newly created in the current session
- Remove dropzone (very oudated) in favor of dropping directly onto directory rows
- Fix various issues with dragging
- Fix all spinners not animating on Firefox
- Fix column selector disappearing all the way to the right on Firefox
- Change auto-generated name of duplicate files from `foo (2)` to `foo 2`

# Important Notes
None
2024-02-12 14:07:58 +00:00
somebody1234
a8d5dcceac
Fix chat styling; fix focus issues in chat (#8988)
- Implement https://github.com/enso-org/cloud-v2/issues/885
- Adjust chat styling to match more with the rest of the `ide2` Figma design (and the screenshots from the original issue...)

# Important Notes
None
2024-02-12 12:48:08 +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
somebody1234
129022ae12
Support for creating and editing Data Links (#8882)
- Close https://github.com/enso-org/cloud-v2/issues/734
- Add modal to create a new Data Link
- Add the same input to the asset right panel
- Add entries on context menu and Drive Bar
- The shortcut is <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>N</kbd>
- Add (and use) corresponding backend endpoints

# Important Notes
- All UI is currently generated based off of a single-source-of-truth JSON Schema file.
- JSON Schema was chosen for a few reasons:
- trivial to parse (it's plain JSON)
- sufficiently powerful (supports unions (used in the initial schema), objects, and singleton/literal types)
- but still quite simple (this makes it easier to implement various utilities for, because there are fewer cases to cover)
- Note that it is definitely possible to change this. The original suggestion was a TypeScript file, which can definitely be done even using just the `typescript` package itself - I just prefer to avoid adding another step in the build process, especially one that depends on the `typescript` package at runtime.
- Note also that we *do* actually bundle transpilers as part of the visualization loading code in GUI2 - so for now at least, the size of the dependency isn't a primary concern, but rather just the mental overhead of having another dependency for this one specific task.
2024-02-12 10:05:30 +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
somebody1234
784d06912f
Make (almost) all interfaces readonly (#8800)
This is not strictly necessary (as indicated by the fact that no actual logic needed to be changed), but it doesn't hurt to make this change.
- Make (almost) all `interface`s `readonly`
- Some of them are *not* readonly; this is intentional as those *do* need to be mutated
- A `no-restricted-syntax` lint rule has been added, but only for `interfaces` - it has been added neither for `classes` nor for `readonly T[]`
- A lint rule for `extends React.PropsWithChildren` instead of `extends Readonly<React.PropsWithChildren>` would be easy to add though...

# Important Notes
- There should be no logic changes, so QA shouldn't need to test anything in particular.
2024-02-07 11:26:59 +00:00
somebody1234
2db13bd168
Fix saved project validation (#8951)
Fix an oversight of project validation disallowing `accessToken: null`, which will be the case when in offline mode/not logged in.

# Important Notes
None
2024-02-07 10:47:04 +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
somebody1234
8bfdf0063a
Bump expect timeout and add retries for dashboard E2E tests (#8939)
- Fix flaky dashboard E2E tests that occur because of timeouts

# Important Notes
None
2024-02-06 15:52:03 +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
Adam Obuchowicz
8eeef71c26
Fix loading wasm for ydocs server (#8952)
#8893 introduced a fatal regression for old IDE + new IDE also does not work on every system.

The fix:
1. Don't assume that WASM needed by ydocs server is bundled
2. Don't assume we know its exact name.
2024-02-02 17:01:58 +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