Commit Graph

328 Commits

Author SHA1 Message Date
Adam Obuchowicz
7db7fa039c
Add remove nodes icon to selection menu (#9827)
![image](https://github.com/enso-org/enso/assets/3919101/29c09e74-47db-4bd5-8770-4a79b23a7cf1)
2024-05-02 05:51:54 +00:00
Shixian Sheng
c340727735
Fixed LICENSE Link. Added missing LICENSE file (#9804)
Added License to the app/gui2 folder and 2 links for it in README
2024-05-01 19:15:52 +02:00
Kaz Wesley
6655d5fbb2
Move node type to visualization container (#9784) 2024-04-30 08:55:43 -04:00
Adam Obuchowicz
04a10b72e5
Dragging edges (#9788)
Fixes #9423
2024-04-29 14:16:02 +00:00
Adam Obuchowicz
210f0482a4
Set of improvements: selection "committed" state and "add new compnent" button hitbox fix. (#9775)
1. Did selection refactoring as follow-up of #9519. Now the circular menu visibility or node extension is altered only when selection is ended (before, node shrank once the selection started a bit less blinking).

[Screencast from 2024-04-24 10-56-05.webm](https://github.com/enso-org/enso/assets/3919101/744e7579-80dd-4d44-a545-7af812239be2)

3. Fixes #9699 I don't know why the add-node button shape was done in :before element, if it happily works by shaping the main div itself.

[Screencast from 2024-04-24 10-51-57.webm](https://github.com/enso-org/enso/assets/3919101/004aede5-ea00-4e30-9a3d-6e2574e3b755)
2024-04-29 11:31:26 +00:00
James Dunkerley
c5179309fd
Improve Table Viz handling of Numbers (#9793)
- Added support for NaN, Infinity and -Infinity in the Table viz.
- Simplified the logic so all the formatting in a single place in the Table viz.
- Sorted Number formatting for BigInt and < 10000.

![image](https://github.com/enso-org/enso/assets/4699705/1486eb7e-df87-4516-90d0-75fda1e9743d)

![image](https://github.com/enso-org/enso/assets/4699705/e55c0e6b-bd3c-4dcf-a65f-41f8516568a6)
2024-04-26 07:52:40 +00:00
Kaz Wesley
12cbd900b4
Node creation improvements (#9781) 2024-04-25 09:18:38 -04:00
Adam Obuchowicz
5807c5c112
Restore state after reconnecting (#9755)
Fixes: #8522

Execution context is refactored slightly: now we have a single `sync` function to synchronize both visualization and execution stack.

Tested hibernation on Linux: I was able to continue my work  🎉

# Important Notes
The Refinement Notes state, that the execution mode should be set before updating the stack, but actually it makes an error on startup (changing context automatically re-executes programs, what fails if there's no frame on the stack).
2024-04-25 09:02:47 +00:00
Ilya Bogdanov
717f6bb330
Display argument placeholders for autoscoped constructors (#9737)
Fixes #9635 

<img width="925" alt="Screenshot 2024-04-18 at 2 43 09 PM" src="https://github.com/enso-org/enso/assets/6566674/fbdce484-ac0b-4e30-8577-1c9dc419dffe">
2024-04-24 13:40:42 +02:00
Adam Obuchowicz
70985932b1
Selection panel (#9771)
Fixes #9519

[Screencast from 2024-04-23 12-57-01.webm](https://github.com/enso-org/enso/assets/3919101/873925db-1c9b-43e5-8144-6503c362baa0)

# Important Notes
I decided to go against our refinement notes, as in the action the blinking does not look bad, and seeing "live" how many nodes are selected may be useful.
2024-04-24 08:56:44 +00:00
Jaroslav Tulach
ff62c1e25f
Access non-self arguments when widget annotations are computed (#9410) 2024-04-24 03:58:32 +02:00
AdRiley
fa6b7f859f
Add new icons (#9756)
Restore, Clone, Group (Only Group is mine the others were already in Figma)

![image](https://github.com/enso-org/enso/assets/1720119/f74c3afa-f490-427a-b675-584077b202bb)
2024-04-20 09:48:58 +00:00
Kaz Wesley
6426478c97
Copy/paste improvements (#9734)
Copying nodes:
- Multiple nodes supported.
- Node comments and user-specified colors included.
- Google Sheets data can be pasted to produce a `Table` node, handled the same way as Excel data.

# Important Notes
- Fix E2E tests on OS X.
- Add E2E and unit tests for clipboard.
- Use the lexer to test text escaping; fix text escaping issues and inconsistencies.
2024-04-19 16:33:51 +00:00
Adam Obuchowicz
de406c69fa
Automatic reconnect with Language Server. (#9691)
Fixes #8520

If the websocket is closed not by us, we automatically try to reconnect with it, and initialize the protocol again. **Restoring state (execution contexts, attached visualizations) is not part of this PR**.

It's a part of making IDE work after hibernation (or LS crash).

# Important Notes
It required somewhat heavy refactoring:
1. I decided to use an existing implementation of reconnecting websocket. Replaced (later discovered by me) our implementation.
2. The LanguageServer class now handles both reconnecting and re-initializing - that make usage of it simpler (no more `Promise<LanguageServer>` - each method will just wait for (re)connection and initialization.
3. The stuff in `net` src's module was partially moved to shared's counterpart (with tests). Merged `exponentialBackoff` implementations, which also brought me to
4. Rewriting LS client, so it returns Result instead of throwing, what is closer our desired state, and allows us using exponentialBackoff method without any wrappers.
2024-04-19 13:39:45 +00:00
James Dunkerley
16126a0c71
Working through various issues from OKR / blog use. (#9739)
- Fixed `list_directory` so that it works with defaults and uses the `Folder_Browse`.
![image](https://github.com/enso-org/enso/assets/4699705/cf8eb187-a1fe-4eb7-a017-e7bb40e30e12)
- Adjusted types of `order_by` in `Aggregate_Column.First` and `Aggregate_Column.Last` so supports single `Sort_Column`.
- Adjusted types of `order_by` in `Aggregate_Column.First` and `Aggregate_Column.Last` so an empty Vector is valid (treated as Nothing).
- Adjusted `Count_Distinct` so if an empty set of columns then equivalent to `Count`.
- Use the multi-select widget for `columns` in `Count_Distinct`.
![image](https://github.com/enso-org/enso/assets/4699705/86e8f3c1-9cbe-4fb3-b6fd-43b937346082)
- Sort the widget for `order_by` in `First` / `Last`.
![image](https://github.com/enso-org/enso/assets/4699705/d624544c-6f4d-42ef-bb97-79b68aa60569)
- Bug fix for widgets with both tagValues and dynamic data. (Thanks @farmaazon).
- Use the multi-select for various things.
2024-04-18 21:50:20 +00:00
Ilya Bogdanov
7e345075b3
Implement special handling of subapplications when collecting MethodCallInfo (#9677)
Fixes on of the issues in #9354

Stale method call info for inner sub-application was causing additional argument placeholders on the node for certain expressions. Now it is fixed:
1. We only create function widget for the most top-level expression in the prefix application chain.
2. We reuse method call info from inner expressions, assuming it will be always correct for our purposes.

https://github.com/enso-org/enso/assets/6566674/91d2b4ba-a789-4c7b-b40c-f09ac45da7f0
2024-04-16 10:39:04 +00:00
Paweł Grabarz
0ee113a4d9
Disconnect nodes when deleted (#9659)
Fixes #9315

https://github.com/enso-org/enso/assets/919491/8551c901-4bef-4a7a-bfb6-10578f0c125a
2024-04-16 08:11:31 +00:00
Paweł Grabarz
9d2d9038c9
Fix spurious gui e2e dropdown test failures (#9697)
In GUI E2E `widgets.spec.ts`, be more specific about which tested dropdowns should be visible. Since the tested node actually receives two dropdowns, the test could fail by detecting both and expecting only one. Since we already have a very specific selector for the dropdown we are testing, use it instead of fresh global locator.
2024-04-15 16:05:14 +00:00
Ilya Bogdanov
59a9c8e59c
Fix node placement (#9696)
Fixes #9689

We should consider visualization size in all cases. `visibleArea` has multiple usages, but they all seem to benefit from the change (e.g. zoom to selected will also consider visualization sizes).

https://github.com/enso-org/enso/assets/6566674/3c9ae4a9-27f5-4736-83b5-4b3a500564e7
2024-04-15 13:18:52 +00:00
Paweł Grabarz
3b21f5579f
Fix node arguments hiding animation, clipping and dropdown styles. (#9685)
Fixes #9492

Implemented generic component for flawless size-based transitions, then used it for hiding arguments and dropdown animation. That replaced the `max-size`-based CSS animation that caused original issue. Refactored dropdown positioning to avoid further issues related to animation overflow clipping. The dropdown also got a bit of a lift to fit closer to styles in current Figma designs.

https://github.com/enso-org/enso/assets/919491/e85fd68c-b2e8-4d58-90e1-4fd7b33f1c9b
2024-04-12 13:44:13 +00:00
Kaz Wesley
b631745c1d
Interaction resumption (#9621)
Prevent interactions such as an open dropdown from being disrupted by the temporary state of absent type information occurring after an edit.

https://github.com/enso-org/enso/assets/1047859/bcc7fa02-847f-4cd0-b9fc-3186a97c5816

All widget-edit interactions that are active when a component is to be unmounted save state and are suspended. When a new component defining a `WidgetEditHandler` is instantiated, if the component is found to be equivalent to a component that was suspended, and no other interaction has been initiated in the interim, the interaction is restarted using the suspended state.

# Important Notes
- Fix a bug caused by a variable tracking an interaction's active state getting out of sync with the interaction. `WidgetEditHandler` now provides a reactive `active` property; using it is simpler and avoids this type of bug in the future.
- Fix a flickering bug that sometimes made it hard to open dropdowns by clicking the arrow.
2024-04-11 15:39:16 +00:00
Paweł Grabarz
922ac66baf
working hot reload for widget definitions (#9657)
Fixed a long-standing annoyance that widgets weren't fully hot-reloadable. Now when the widget definition (e.g. `score` function) is modified, it is hot-reloaded and new version immediately takes effect.

https://github.com/enso-org/enso/assets/919491/8e6d5a67-68ec-4353-8235-32657b32e2ec

# Important Notes
Because of how HMR API works, it needs to be passed from each widget module to the `widgetDefinition` function as an argument. When not provided, the definition will not be hot-reloadable (but the widget will still work as it used to).
2024-04-11 14:11:34 +00:00
Ilya Bogdanov
7e810feed9
Display parens in groups (#9678)
Fixes another point in #9354

Displays parens for Group AST (except top-level arguments).

<img width="630" alt="Screenshot 2024-04-11 at 3 08 01 PM" src="https://github.com/enso-org/enso/assets/6566674/8e3be87a-975b-404e-8a15-2752bd94cd4c">
2024-04-11 11:49:14 +00:00
Adam Obuchowicz
0bc7cb54eb
Change window title (#9676)
Fixes #9665

To Enso.

![image](https://github.com/enso-org/enso/assets/3919101/d5f29b9f-2509-4bd9-899a-ae5988b8089f)
2024-04-11 10:59:49 +00:00
Paweł Grabarz
4bf79776c5
Store graph viewport in client local storage (#9651)
Fixes #6250

With this change, I've also slightly refactored the graph editor component by grouping related functionality into neat block and moving already loosely coupled groups to separate files. Further work will be needed to simplify it, but it is a good first step.

https://github.com/enso-org/enso/assets/919491/fedce111-ea79-463f-a543-da3ecce28bf5
2024-04-09 12:02:11 +00:00
Sergei Garin
2c78f4eefd
Add prefixes for cloud url params (#9649)
This PR adds an ability to exclude some keys in URLSearchParams from being parsed by GUI.
2024-04-09 07:38:06 +00:00
Ilya Bogdanov
8aef2146db
Use predefined zoom levels (#9585)
Fixes one subtask of #9354

https://github.com/enso-org/enso/assets/6566674/3418d31e-2d80-48b2-ba8b-9e000b09cf14
2024-04-08 11:12:53 +00:00
Ilya Bogdanov
e174dee1bf
Fix documentation panel layout (#9615)
Fixes #9414

`.argument` class was not scoped and broke documentation panel.


<img width="439" alt="Screenshot 2024-04-03 at 3 06 43 PM" src="https://github.com/enso-org/enso/assets/6566674/fe94a668-8125-452c-b038-196e5a10657c">
2024-04-08 11:06:00 +00:00
Kaz Wesley
5f464389bc
Hide errors from input nodes (#9633)
When a node has an error/warning/panic that exactly matches one of its input nodes, hide the message until the node is interacted with, showing an icon.

https://github.com/enso-org/enso/assets/1047859/4b1b5e3d-c236-40d7-a3e7-e6ab8182ecd5

# Important Notes
- New icon is used for panics.
- Opening circular menu now shifts any message out of the way, not just warnings.
2024-04-05 18:07:32 +00:00
somebody1234
143665d944
Remove obsolete GUI arguments (#9466)
- Close #8610

# Important Notes
QA notes:
- The GUI2 warning screen should not show up - the arguments that GUI2 do not understand have been removed.
- However, it should be tested that the warnings screen should correctly work when invalid arguments really *are* passed in:
- Via URL query parameters (electron, might need to open the electron app then the browser, *or* do `location.href = ` in DevTools in Electron.)
- By editing `Editor.tsx` to inject invalid args to the big configuration object we pass to the GUI entrypoint.
2024-04-05 16:20:56 +00:00
Paweł Grabarz
9c2d25ea8d
Improve gui app disposal handling and close all network connections (#9579)
Fixes #8964

All GUI network connections are now closed after the application is unmounted.
2024-04-04 13:49:54 +00:00
Ilya Bogdanov
a474955e28
Fix dropdown item paddings (#9616)
Fixes a small issue with dropdown item alignment.

<img width="243" alt="Screenshot 2024-04-03 at 4 55 12 PM" src="https://github.com/enso-org/enso/assets/6566674/96803537-bc30-456c-b694-5fd7c70e21db">
2024-04-03 13:35:13 +00:00
Ilya Bogdanov
44097508c7
Make color override stable (#9612)
Fixes #9610

I was wondering why we need this check, now I know.
2024-04-03 13:01:36 +00:00
Ilya Bogdanov
c37fffe33d
Fix numeric input widget (#9602)
Fixes the issue with numeric input being unclickable if the WidgetSelection is present. The issue was caused by double handling of the click event both in numeric input (it opened the dropdown) and in dropdown (it closed itself).
2024-04-02 20:36:12 +00:00
Paweł Grabarz
84c8535587
Allow vector widget only on vector expressions. (#9596)
Fixes #9593

<img width="426" alt="image" src="https://github.com/enso-org/enso/assets/919491/a794a023-420d-4358-8068-252d8d136a57">
2024-04-02 13:41:58 +00:00
Ilya Bogdanov
9db264231e
Fix project edits (#9594)
Fixes the issue that prevents project edits from being committed.
2024-04-02 12:33:14 +00:00
Ilya Bogdanov
bef6f3a4f9
Color picker (#9570)
Closes #8680

The color picker is triggered by new Circular menu item or by keyboard shortcut (set to `Mod+Shift+C` for **C**olor).
The color picker affects *selected* nodes, so it works nicely both in cases when we use Circular menu on a single node a shortcut with multiple selected nodes.

Color is only changed when the user selects a new one inside the color picker, but there is no specific way to reset default color (you would have to recreate the node).

https://github.com/enso-org/enso/assets/6566674/a4497bea-f432-486d-85f8-f2772ba5694f
2024-04-02 11:27:13 +00:00
Ilya Bogdanov
084f4ee033
Fix numeric widget slider (#9578)
Fixes #9574


https://github.com/enso-org/enso/assets/6566674/ac9c381f-b62f-43cf-8ad9-a71c75c9fbc3
2024-04-01 20:16:57 +00:00
Adam Obuchowicz
2384fe851d
Fix undoing node removal (#9561)
Fixes #9314

The node deletion does not remove AST node from the module, only unpin it from its parent; so undoing does not add this node, just modify it, and thus we weren't informed about metadata change.
2024-03-29 16:31:00 +00:00
Adam Obuchowicz
207c7af136
Block FQN substitution in drop downs (#9569)
While blocked FQN substitution when creating/editing node, the drop-downs still used it, and it does not work.

This amends that + added a reference to a task where we want to fix the original issue.
2024-03-28 14:11:20 +00:00
James Dunkerley
e262801daa
Restructure Standard.Table. (#9559)
Move the types from `Standard.Table.Data` to `Standard.Table`.

Exceptions:
- `Standard.Table.Data.Report_Unmatched` => `Standard.Table.Constants`.
- `Standard.Table.Data.Join_Kind_Cross` => `Standard.Table.Internal.Join_Kind_Cross`.
Also removed constructor as an atom type.
- `Standard.Table.Extensions.Table_Ref` => `Standard.Table.Internal.Table_Ref`.
- `Standard.Table.Data.Type.Value_Type_Helpers` => `Standard.Table.Internal.Value_Type_Helpers`.
- `Standard.Table.Data.Type.Enso_Types` => `Standard.Table.Internal.Value_Type_Helpers`.
- `Standard.Table.Data.Type.Storage` => `Standard.Table.Internal.Storage`.

Changed all `Standard.Table` imports inside project to be project.
Favoured importing from `Standard.Table.Main` in `Standard.Database`.
Also fixed some linting in Enso_File.
2024-03-27 17:10:43 +00:00
somebody1234
6f7a51470d
Directory management on Local (Project Manager) backend (#9353)
- Implement https://github.com/enso-org/cloud-v2/issues/961
- Allow directory management on Local backend
- Setting a custom root directory is currently *out of scope* of this PR.
- Listing directories
- Deleting directories and files
- Adjust project-related APIs to accept parent directory path (as required by PM when not interacting with root directory)
- QoL improvements related to testing this PR
- New watch script (`npm run watch2`, `npm run watch:linux`) in `app/ide-desktop/lib/client/`) for testing IDE2 on Electron without having to build the entire app
- Adjustments to `gui2`'s `vite.config.ts` to allow React HMR when doing dev in Electron

# Important Notes
- Support for deleting files and folders uses the API introduced by #9359 - so it will not work until that PR is merged in.
- Support for uploading files uses the API specified by #9360 - so it will not work until that issue is closed.
2024-03-27 14:42:23 +00:00
Adam Obuchowicz
b422b59ed1
Fix collapsing node issues (#9545)
Fixes #9412
Fixes #9159
2024-03-27 14:00:33 +00:00
Michał Wawrzyniec Urbańczyk
05715bdedf
Inject AG Grid and Mapbox keys through the CI from the GitHub organization variables (#9544)
This PR exposes two new variables added to GitHub organization.

# Important Notes
<details>
<summary>Dev builds issue</summary>
I have doubts about this approach, as this breaks Map visualization on developer builds:

![obraz](https://github.com/enso-org/enso/assets/1548407/29aa8e40-7481-4460-bdd4-c30d3ee76b6c)

It seems that Mapbox API cannot be used without the token — [the documentation](https://docs.mapbox.com/help/getting-started/access-tokens/) suggest so, and the  https://api.mapbox.com/styles/v1/mapbox/light-v9?access_token=no-token yields quite obvious `{"message":"Not Authorized - Invalid Token"}`.

Still, the CI-produced packages have no issues.
</details>

EDIT: [We do want this behavior, as discussed internally.](https://discord.com/channels/401396655599124480/1221868987030311012/1222162657352876075)
2024-03-27 00:17:37 +00:00
Adam Obuchowicz
09a6ab7bd6
Select node on any edit (#9536)
Fixes #7478

[Screencast from 2024-03-25 15-44-50.webm](https://github.com/enso-org/enso/assets/3919101/bd5b2bbd-631f-4397-97ae-d925b9194210)
2024-03-26 13:01:51 +00:00
Paweł Grabarz
1fa1803f6c
Move imports to first script block to avoid prettier issues (#9512)
Fixes #9502
2024-03-26 10:34:25 +00:00
Paweł Grabarz
1872bb66ea
Ignore repeated key events for bound shortcuts, adjust visualization min width (#9537)
Fixes #8538 #9515

All repeated keyboard events handled through `defineShortcuts` are now ignored. For example, holding ctrl+v no longer pastes nodes repeatedly.

Also adjusted visualization min-width to 200px, since it was a trivial change.

![image](https://github.com/enso-org/enso/assets/919491/7997898f-bcee-45f2-aacb-e10a49b159d6)
2024-03-25 19:29:31 +00:00
Adam Obuchowicz
70f847f295
Fix file browser on Linux and Windows (#9538)
Fixes #9503

[The `showFileBrowser` documentation has a note](https://www.electronjs.org/docs/latest/api/dialog#dialogshowopendialogsyncbrowserwindow-options), that Linux and Windows don't support enabling picking dir and file.
2024-03-25 17:07:04 +00:00
Kaz Wesley
22a2c208c0
Multi-select (part 1) (#9516)
* Multi-select
2024-03-25 12:05:20 -04:00
Kaz Wesley
0d34126b86
New JSON visualization (#9409)
* JSON viz with projections, colors, inlining

* Ensure GraphEditor receives keyboard events for newly-selected nodes

* Consider positioned, unsized nodes when positioning
2024-03-25 12:03:18 -04:00