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.
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.
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).
#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.
- 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.
This PR adds a native aarch64 target to our release process.
It also includes refactoring of workflow generation and minor tweaks:
* removing some workarounds in the generated action code that are not needed anymore;
* some version bumps that are harmless;
* release builds have cleaning enabled unconditionally.
- Close#8911
- Add dashboard unit tests to GUI2 CI
- Add dashboard E2E tests to GUI2 CI
- Fix (minor) issues in dashboard unit tests
# Important Notes
None
- Closes https://github.com/enso-org/cloud-v2/issues/784
- Add version panel
# Important Notes
- The backend sends an `isLatest` field in the response, but this is currently *not* shown in the UI because I think it isn't particularly useful.
- Versions are displayed in descending order (most recent first)
- Versions have hover effects, but there is not yet any relevant behavior that can be triggered on click.
- The versions breadcrumbs control displays the version number in the Figma design, however it is not yet returned by the cloud backend (and should ideally not take an extra request)
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
Closes#8823https://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.
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.
Part of #8518Closes#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.
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.
- Depends on unmerged backend features:
- https://github.com/enso-org/cloud-v2/issues/832
- https://github.com/enso-org/cloud-v2/issues/833
- Close https://github.com/enso-org/cloud-v2/issues/829
- Add scaffold for settings page
- Add endpoint for deleting user
- Add endpoint for uploading profile picture
- Modify API types to add profile picture to user info
- Add shortcuts:
- <kbd>Cmd</kbd>+<kbd>,</kbd> to open settings page (shortcut taken from VS Code)
- <kbd>Esc</kbd> to close settings page
- ℹ️ Note that, while the settings page is considered as a page by the logic, it is not saved for the next session, as the settings page should be a transitional page (it should only ever be open to do one specific task, and then immediately closed again)
- Partly implement https://github.com/enso-org/cloud-v2/issues/840
- Add "members" tab with member list
- Add "Invite Users" button to be able to invite multiple users
- Misc. QoL improvements
- Deselect selections when clicking away from the selection
# Important Notes
None
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)
Closes#8751Closes#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
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.
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.
- Close https://github.com/enso-org/cloud-v2/issues/856
- Implement upload for existing files
- This is triggered by uploading a file with the same name.
- Add a modal that allows the user to select whether to rename or update the file, for each conflicting file
# Important Notes
- There are a *lot* of buttons in the modal. Any ideas on how to make this screen clearer/simpler/easier to understand would be greatly appreciated.
- There are currently a few minor backend issues preventing all functionality from fully working:
- Projects currently cannot be updated due to a bug
- Neither files nor projects can be uploaded if their name contains `()` - e.g. `foo (2).txt`
This makes it consistent with the indentation style of GUI2.
# Important Notes
- This commit *will* need to be added to [`.git-blame-ignore-revs`](https://github.com/enso-org/enso/blob/develop/.git-blame-ignore-revs) *after* it is merged.
- This shouldn't need any particular QA (although QA doesn't hurt), as the only thing that was done is a `npx prettier -w .`, meaning that there should be zero logic changes.
- Closes https://github.com/enso-org/cloud-v2/issues/857
- Changes format for new folders from `New_Folder_1` to `New Folder 1`
- Changes format for new projects from `New_Project_1` to `New Project 1`
- Uses names for projects created from templates, rather than `Upper_Snake_Case`d IDs
# Important Notes
- Folders containing spaces work fine on cloud backend
- ⚠️ Unable to test opening a project with a space in its name on the cloud backend.
- Projects containing spaces work (open, edit, and execute fine on local backend
- Fix https://github.com/enso-org/cloud-v2/issues/848
- Disables dragging rows when a row is being edited
- Also disables dragging rows on the local backend, as folders are not yet supported there
- Fix other issues found (not sure if they were introduced by this PR):
- Cut (Cmd+X) does not fade out assets
- Cancelling editing names actually still renames the asset
- Cut/Copy/Paste/Undo shortcuts when renaming *also* trigger "copy assets" (etc.) shortcuts
- Apply suggested QoL improvement:
- Disallow renaming an asset to a blank name (a name consisting only of whitespace). Current (new) behavior is to silently revert the asset name to its original name.
# Important Notes
None
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.
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">
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.
These components are a legacy remnant of the old design, where `Table` needed to be reusable because there was a separate table for each asset type.
# Important Notes
None
- 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.
This is required because `index.ts` was renamed to `entrypoint.ts` in order to avoid colliding with the main export of the `enso-dashboard` module, which is used by `gui2` as `dashboard.run()`. This file was renamed in #8587, causing the issue.
Build script changes also included thanks to @mwu-tow.
# Important Notes
This should only affect projects opened against the remote (cloud) backend, meaning that to test this, you should open a project against the cloud backend.
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.
- Use `rootDirectoryId` returned by backend instead of mirroring backend behavior to generate the root directory ID
- To test this, move/copy an asset *to* the root directory.
- Move the right side of the top bar back to the right edge in editor view (oops)
- To test this one just open any project and make sure the top bar doesn't look funny.
- Delete the barrel export of `#/hooks` in the dashboard (left over due to an oversight when removing the other barrel exports)
- Should not need to be tested; all imports have simply been moved to point to the actual declaring file. As such, as long as the code still typechecks, it should be working fine.
- Delete a duplicated (unused) file caused by a bad merge.
# Important Notes
None