Updated the Component Browser stub from @Frizi's branch. Filled with some mocked data and implemented highlight and navigation.
https://github.com/enso-org/enso/assets/3919101/6af57413-bcb6-4402-9a4a-a992d58504ba
# Important Notes
Still missing the input panel, and obviously, the integration with anything will be a part of another task.
- Closes#7730. Adds top bar containing:
- Project title
- Execution mode selector (design/live)
- Navbar containing:
- Navigation previous/next button
- Breadcrumbs
# Important Notes
Icons are currently all separate files. This may need to be changed to a single svg containing individual icons in `defs` if(/when) that is merged into `develop`.
- Renames "Move To Trash" to "Delete" on local backend
- This is because the local backend does not have a trash category (or categories at all)
- Fix search bar autofocus
- The "delete" hotkey was focusing the search bar - this was because the shortcuts handler, and the autofocus handler, were both registered on the same `EventTarget`. The fix is to do `stopImmediatePropagation()` to stop running any other event handler, even ones on the same `EventTarget`.
# Important Notes
None
- Fixes https://github.com/enso-org/cloud-v2/issues/659
`getProjectDetails` was calling `listVersions` to get a fallback IDE version, creating a lot of unnecessary requests to the backend, *especially* because `getProjectDetails` is called periodically when a project is opening.
In this PR, the implementation has been changed to cache the fallback version for one day, meaning the extra `listVersions` calls should now only ever happen once per client per day.
# Important Notes
None
- Closes https://github.com/enso-org/cloud-v2/issues/619
- Async execution controls
# Important Notes
There is no design for this, as such, implementation details use placeholder designs.
- The context menu uses a play icon. An icon similar in style to the "copy" icon *may* work to represent "run in background", but it may be difficult to visually represent that it is being run in the background, without obstructing it with a foreground window
- The icon for projects being run in the background have a green tint, to distinguish them from projects that will be (or are currently) opened in the editor.
- this will ***almost certainly*** need to be replaced with a proper design
- This *may* also make sense for the local backend, *however* as I don't know whether there is a way to access the completion progress of execution from the PM API, local backend support is currently *not* implemented in this PR.
- On a related note: as far as I am aware, there is also no such endpoint for the cloud backend. However, support for async execution was recently added, so I am adding the basic functionality corresponding to the `executeAsync` project state.
- Whether a project is being run in the background is currently lost on refresh. This is because the async execution state is currently not sent by the backend.
- Placeholder shortcuts have been added (Shift+Enter - Cmd+Enter is already taken by the "share" action, and shift+double click). These are totally optional, and can easily be removed.
Closes: #7309
The changed origin of the visualization container caused the issue. Now, the origin is at the top left corner of the visualization, and bounding box abstraction expects the origin at the bottom left. Despite the comments in the code, the bounding box is designed to work with bottom-left origin only.
https://github.com/enso-org/enso/assets/6566674/273abfaa-45b6-4374-8d4c-3b8c4e2c1fc2
Again I hit the problem with shader compilation failing with no apparent reason, and again bumping electron version helped me.
# Important Notes
I bumped to latest `25.x` version as I haven't dared to change major version expecting breaking changes.
Fixes#7468
The fix is pretty simple: we reuse the existing functionality for importing stuff and generating expressions. It fixes issues with `Nothing` or `Report_Unmatched` types.
https://github.com/enso-org/enso/assets/6566674/4e7addf9-2175-4f2a-a571-4ef823de5cb0
While debugging, I found it easier to work with a suggestion database when exported to some external format. Hence, I implemented serde serialization support for database entries and also a new debug shortcut <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>u</kbd> to dump all entries to the console.
- Closes https://github.com/enso-org/cloud-v2/issues/580
- Adds home screen
Other changes:
- Typing in the search bar from the home page, switches to the drive page. This is easy to change/remove, of course
# Important Notes
There are minor differences from the design:
- The Enso logo has opacity 0.6 to match the text color, rather than 0.665
- The list of samples is different
- The border-radius on the "create empty project" tile was changed from 18px to 16px, to match every other border-radius (especially the ones on the tiles for the other samples)
Implementation notes:
- The "new project" circled plus icon has a different color to the primary text color as well, but that has been left as-is
- The sample descriptions have a backdrop-blur, but the background image no longer extends underneath it
- There are currently no inset shadows for the home screen, but it will be easy to copy them from the old implementation from the old templates list
- "Read what's new in Enso 3.0 Beta" currently links to https://enso.org/, rather than a blog post (which does not yet exist)
- The new template backgrounds have been replaced with SVGs. The Excel one uses the Excel logo from Wikipedia; the new geospatial analysis one was converted to SVG via auto-tracing.
There are also several placeholders:
- Sample author icon
- Sample author
- Sample open count
- Sample like ount
Closes#6261
- Adds support for copy-pasting nodes with `cmd + C` and `cmd + V` shortcuts.
- Only a single, currently selected node will be copied. Adding support for multiple node copies seems easy, though (but was out of the scope of the task).
- We use a custom data format for clipboard content. Node's metadata is also copied, so opened visualizations are preserved. However, the visualization's size is not preserved, as we do not store this info in metadata.
- For custom format to work, we use a pretty new feature called [Clipboard pickling](https://github.com/w3c/editing/blob/gh-pages/docs/clipboard-pickling/explainer.md), but it is available in Electron and in most browsers already.
- Pasting plain text from other applications (or from Enso, if the code is copied in edit mode) is supported and is currently enabled. There are some security concerns related to this, though. I will create a separate issue/discussion for that.
- Undo/redo works as you expect.
- New node is pasted at the cursor position.
https://github.com/enso-org/enso/assets/6566674/7a04d941-19f7-4a39-9bce-0e554af50ba3
If the user does not have sufficient permissions to open the project, the project no longer shows the play button. However, this does not work on the local backend because the local backend lacks permissions completely.
# Important Notes
None
Fixes context menu options incorrectly being hidden due to incorrect logic when determining whether someone else is opening a project
# Important Notes
None
Fixes the project icon for new projects being disabled, because `opened_by` is missing, making the frontend think the current user was not the one that opened the project.
# Important Notes
None
- Closes#7463
- Makes table header sticky
- Clips table body so it does not overlap table header
Other changes:
- Clip table header row so it does not overlap extra columns selector
- Hide extra columns selector on local backend (PM backend)
- Focus search bar if the keypress will type regular text
- Change row height from 40px to 32px
- Add "Share" button when the editor is open
- Make entire area of backend selector (Cloud <-> Local) clickable (previously, the padding was not clickable)
- Remove the up-arrow icon to open a project. Projects are now opened by switching to the project tab using the tab selector on the top left (or by double clicking the row).
- Fix opening newly created folder (previously its entries were appended to the end, rather than under the folder)
- Indent background of "name" column (the first column)
- Minor code style changes
- Add background back to "change password" modal (oops)
- Hide "open" context menu entry and show "stop" entry, when a project is currently running
- ℹ️ It might be a good idea to support the "open" action on directories as well, however it is difficult without the assets table refactor in #7540. As such, this functionality will not be added in this PR.
- Fix horizontal padding on "sign in" user menu entry
- Hide email/password validation when using oauth logins
More fixes for assets list:
- Project is inserted at start of list when there are no existing projects
- Project is inserted at start of children when there are no existing children
- Deleting a folder collapses it (hides its descendants)
- Adding children to a newly created folder puts them at the correct depth, rather than depth 1
# Important Notes
None
- Closes https://github.com/enso-org/cloud-v2/issues/568
- Disable project with an `openedBy` that is not the current user
Fixes other issues:
- Fixes freshly restored saved projects not being unset when clicking stop before the editor first opens
- Changes "unable to" in errors to "could not", for consistency
- Users with insufficient permissions now see a network (node graph) icon instead of a play button:
![image](https://github.com/enso-org/enso/assets/4046547/0464ae66-4da7-4374-a4aa-80dd74fa1dc0)
# Important Notes
None
Extracted from #7660.
Fixes the bug that happens when you do:
- Open the app with a saved "last opened project"
- The app will immediately restore the project
- Close the project
- Reopen/reload the app
- The same project will start opening again.
- Expected behavior: The project does not start, because it was previously manually closed.
# Important Notes
None
- Closes https://github.com/enso-org/cloud-v2/issues/647
- Add handling for `Provisioned` project state to frontend
- Also fixes bug causing cloud project loading message to not disappear (oops...)
# Important Notes
- sometimes the editor opens fine, but the websocket times out
- when checking requests, I don't see a request that returns `Provisioned`, so I can't be 100% sure that the handling for the `Provisioned` state actually works
Fix issues restoring cloud projects that have been closed.
On current develop, the frontend assumes cloud projects are still open from the last time they were open. If this is not the case, it tries to open WebSocket endpoints that no longer exist
# Important Notes
For a relatively easy way to test:
- Run `Enso.dmg` or `./ide run watch`
- Open a cloud project
- Refresh Electron to make sure restoration is working
- Go to `localhost:8080`
- Close the project
- Refresh Electron to make sure startup + restoration is working
Should also test restoring local projects to make sure that didn't break.
I was unable to properly test cloud projects (the one I tested with opened, but was blank with just the IDE background and no cursor and no nodes, for some reason)
- Closes#6730
- Changes config to allow environment variables to override server host and port
- Adds port scanning to Electron app to ensure the PM is started at a free port
# Important Notes
- `SERVER_PORT=abcd enso.AppImage` does NOT work. It would not be difficult to implement, but it probably needs discussion on how exactly it should be implemented - for example, `SERVER_PORT` is quite a generic name, should the Electron app pass though something like `ENSO_PM_SERVER_PORT` to the PM as `SERVER_PORT` instead?
⚠️ Port scanning is *only* implemented in the JS frontend. It is not implemented:
- In Scala, because the JS/Rust code calling it needs to know the port as well. There shouldn't be any problems with adding port scanning though, if that's desired
- In Rust, because I'm not sure parsing the host and port from a string is a good idea.
- (This also applies to JS, but it *must* work in JS, and port scanning is already a dependency there so it's quite a bit easier)
- QA *will* need a new PM (`sbt buildProjectManagerDistribution` or `./run backend sbt` -> `buildProjectManagerDistribution`), and the path must be supplied as: `-engine.project-manager-path=path/to/new/pm/here`
- Fixes#7603
- "Move All To Trash" option sometimes appears even when the list is empty
# Important Notes
This appears to be caused by multiple things:
- deleting a single item does not remove it from the set of selected keys
- waiting for `project/close` to make sure a project can be `project/delete`d, takes a while.
Both issues have been fixed, by adding a new `AssetListEvent` to let the assets table to immediately remove the asset's key (its id or placeholder id) from the set of selected keys
This commit introduces a new cursor shape, a double arrow, to be displayed during the hover over the resize grip in the graph editor's visualization component. The rotation of the double arrow depends on whether the cursor is to the left or right of the dividing line from the top left to bottom-right corner of the grip. This gives a more intuitive visual cue to users about the direction of resizing.
![Peek 2023-08-23 13-57](https://github.com/enso-org/enso/assets/1428930/d0f19205-85f3-4046-b3ef-7540030c9ab5)
close#7604
After moving the rename action to the dashboard, IDE is unaware of the new project name. PR implements a new `refactoring/projectRenamed` notification that is sent from the server to clients and informs them about the changed project name.
# Important Notes
https://github.com/enso-org/enso/assets/357683/7c62726d-217e-4e69-8e48-568e0b7b8c34
- Closes https://github.com/enso-org/cloud-v2/issues/610
- New user menu
- Remove "go to profile" action that does not currently have an action, and does not exist in new design
- Add placeholder icons for existing actions
- Re-style "change password" modal to fit in with the design
# Important Notes
There are many differences from the design - none are visual differences though:
- The list of actions is completely different - there are no menu entries in common between the design and the current
- This also means that *all* current icons are placeholders. There are no appropriate icons in the "icons" Figma tab either.
- The user icon is still a placeholder, as there is no backend support for user icons yet.
- The user menu entries are highlighted on hover (not specified in the design), but to make this look nice, some of the padding has been moved from the outer container to the individual menu entries.
- The menu entries use the same component as the context menu, so they *do* support shortcuts, and adding shortcuts to them will be very easy, *however* no shortcuts have been set for the new actions, because they are different from the actions in the Figma design (and so they don't have an official default shortcut)
- Closes https://github.com/enso-org/cloud-v2/issues/511
- Adds sorting. Currently supported columns: "Name" and "Last Modified"
# Important Notes
The sort arrows have a slightly thicker border (changed from 2px to 2.14px), to remove the (very small) internal hole in the Figma design. It is possible to make the shape more accurate to the original design by using a polygon (or a path) that traces around the original outline instead, but I figured it's not worth spending the extra time on a fix that may not be correct.
ℹ️ The comparison function for sorting is quite complicated. I think this is the least intrusive change for now, but it is worth considering changing `AssetsTable` to store items internally as a tree instead, and do a preorder traversal to flatten it into an array when needed.
- Closes https://github.com/enso-org/cloud-v2/issues/615
- Add category switcher
# Important Notes
None of the buttons currently do anything. This is intentional, as the corresponding backend functionality does not yet exist.
- Closes#7576
- Stop using icons for non-macOS platforms, because it is non-standard to use icons
- Increase width otherwise entries will line wrap
# Important Notes
None
- Closes#7536
- Top bar is now below fullscreen visualizations
Other changes:
- Fully hides mouse cursor in editor view
# Important Notes
There should be basically no logic changes - check the code to be extra sure.
The main things that should be tested are:
- cursor should be hidden on top bar in the editor, and visible when not in the editor
- cursor should be visible in the "change password" modal
Use the new Enso Font; also change the anti-aliasing logic to be based on device pixel ratio, rather than platform. This will improve the clarity of font rendering on Windows/Linux machines with high pixel densities.
Design reference:
![image](https://github.com/enso-org/enso/assets/1047859/934ec9ac-52c3-4a81-a9f9-143378ecb658)
Tested on various combinations of DPR/platform:
OS X, `devicePixelRatio` = 2 (should look similar to how we were already rendering *mplus1* on OS X):
<img width="1440" alt="Screenshot 2023-08-07 at 5 46 11 PM" src="https://github.com/enso-org/enso/assets/1047859/2fdf251a-ba5e-426f-b6c4-194347a9cee4">
Windows, `devicePixelRatio` = 1.25 (should look similar to how we were already rendering *mplus1* on this platform/DPR):
![image](https://github.com/enso-org/enso/assets/1047859/55c4a129-4fff-4a9b-8e55-51a5d206e659)
Linux, `devicePixelRatio` = 1 (should look similar to how we were already rendering *mplus1* on this platform/DPR):
![image](https://github.com/enso-org/enso/assets/1047859/c5ac61f0-e3c5-43ca-8ee7-e1e04e84d35e)
# Important Notes
Style changes:
- Use the Enso Font for code in Rust, replacing the DejaVu fonts.
- Use the Enso Font in HTML: code in documentation, and error visualizations.
- Change SpanWidgets from Bold to Extra Bold, to match the design.
Implementation improvements:
- The new font download is cached (and Github-authenticated); this should eliminate a "rate limit" build failure I've
encountered in the past.
- Clean up DocSection HTML rendering a bit.
- Remove a CSS file that seems to have been superseded.
- Closes#7498
- Validation regex previously disallowed non-ASCII characters, now fixed
- Changes every password input to use the correct regex. For old/new passwords, it uses the regular input. For password confirmations, it uses the new password, converted to a regex. This makes it so that the password confirmation input's validation only succeeds when it exactly matches the new password.
# Important Notes
None
* Support arguments list in the doc parser
* Support new doc sections in documentation panel
* Remove headers
* Remove outer dom and place breadcrumbs
* Fix methods icon
* Use unordered list class in css
* Improve tags styles
* Remove virtual component groups docs
* Cleanup top-level css styles
* Small adjustments to headers
* Add styles for emphasized text
* Add bold font for arguments
* Self-review
* Remove redundant placeholder struct.
* Update outdated doc.
* Avoid allocation when comparing strings.
* Avoid empty paragraph.
* Reduce allocations.
* Update test to remove empty paragraph.
* Fix rebase issues.
* Improve padding and size handling in UI themes
Added padding_x and padding_y to hardcoded theme's breadcrumb settings to ensure consistent padding. Also, these padding settings and breadcrumb_height are now used directly in the Style structure, eliminating hardcoded values in the view documentation.
* Adjusted breadcrumb background dimensions calculation.
* Add support for improper arguments formatting in documenation comments
* Do not include Icon tag into the docs
* Fix documentation panel resizing
* enso-formatter
---------
Co-authored-by: Michael Mauderer <michael.mauderer@enso.org>
Fixes#7423
Refactored widget matching algorithm to allow creating wrapper widgets even in cases where the widget config override is present. That allowed the widgets to be reordered, such that the argument name ends up being inside the dropdown widget. That way clicking it opens the dropdown.
Added explicit manual layout for the dropdown arrow position. Now it is positioned on the center of a selected appropriate child widget. For prefix chains, the leftmost part of the prefix application (the method or constructor) is selected.
https://github.com/enso-org/enso/assets/919491/86678b9d-c04e-4545-8d11-2d1e85b9b951
Fix for `showLogs` when opening a second cloud project. Alternative to #7568.
This one avoids loading the cloud's `index.js.gz`, unless it is in the cloud - and in the cloud, it only loads the first `index.js.gz`.
1. When opening CB with source node, the type name is skipped and only method names are displayed. Fixes#7471
2. When entered Main module of some library, the module names are no longer displayed with their full qualified name.
![image](https://github.com/enso-org/enso/assets/3919101/2d1fe4ad-6391-41d6-89a1-410492457b57)
# Important Notes
Refactoring: I changed the internal representation of `ImString` to `Rc<str>` instead of `Rc<String>` to reduce the number of allocations and memory jumps. I even tried to remove `ImString` altogether, but it was not easy, and the main problem was lacking Default implementation.
This was meant to be a trivial change, but actually a dirty workaround needed to be applied. Because enter is used to both open searcher and accept input/entry, both actions were fired at once. I fixed it by debouncing opening searcher event (so the searcher will be opened only once key event handling is over)
This fixes a few issues:
* support for `enso-project` bundles that were compressed in a way that includes leading `./` in the paths;
* partially undos #7305 — projects won't be renamed on import.
Many thanks to @somebody1234 for the help.
Fixes cloud projects not being able to be opened.
The cause is because the IDE React component was calling `document.body.removeChild()`, but the script was being added to `document.head`. The `removeChild()` has now been replaced with `child.remove()` to prevent this from happening again.
# Important Notes
None
Closes#7409https://github.com/enso-org/enso/assets/6566674/d4cb6733-dc9f-454e-ba1b-e76260bda467
# Important Notes
A new config parameter was added, `startup.displayedProjectName`. When connecting IDE to the LS, it must be provided directly with the `rpcUrl` and `dataUrl` parameters. If not provided, `startup.project` will be displayed in the IDE instead. Remember that `startup.project` must be a valid Enso project name, so-called `normalized name`.
Closes https://github.com/enso-org/cloud-v2/issues/571
- Moves all interaction with `localStorage` into a `LocalStorage` class
- Saves and loads current tab (dashboard, or IDE)
- Saves and loads currently open project
Unrelated fixes:
- Changes authentication toast notifications to replace loading toast, rather than creating a new toast
# Important Notes
⚠️ `remoteLog` has not been parametrised with `projectId` (and `sessionId` for cloud projects)
There are several places that previously used manual `localStorage.setItem` and `getItem`:
- Whether the templates list is currently open
- The current project management backend (local, or cloud)
- The path to the current directory is (as far as I can tell) obsolete, as the new directory view always displays the root directory, and so it has been removed
Closes https://github.com/enso-org/cloud-v2/issues/560
- New context menu
- Global keyboard shortcut handler
- Moves the existing "escape" keybindings (close modal, cancel editing names) to global keybind handlers
# Important Notes
- The "Upload To Cloud" action is not present in the Figma design. As such:
- Its current icon is an edit of the "cloud_from" icon, with the arrow upside down
- It does not have a corresponding keyboard shortcut
- Closes https://github.com/enso-org/cloud-v2/issues/561
- New "Invite" modal
- Change autocomplete multi-select behavior
- Fix scrolling for autocomplete
- Scrolling when there are many users with permissions
- New backend permissions
- ⚠️ Intentional differences from Figma design:
- The permission type selector (the secondary modal) is slightly wider. This is because of minor changes to the text - check thread for details.
- The permission type selector for sharing with new users (the top one, next to the input) is vertically offset 4px more than usual. This is intentional; it means there is roughly the same spacing on either side of the input's border, and also means there is spacing between the "invite" button and the permission type selector
- Many buttons are faded out (`opacity-50`) when they are not interactable.
- Text changes
- "Invite" changes to "Share" in blue button
- "File" changes to "<asset type>" in permission type selector
# Important Notes
Some options don't work because the backend representation for permissions is currently different - in particular, the `admin`, `edit`, and `read` permissions, and the `docs` sub-permission.
ℹ️ Currently only works with new backend permissions - i.e. `ENVIRONMENT` must be `'pbuchu'` in `config.ts`.
- Closes https://github.com/enso-org/cloud-v2/issues/478
- Download local project as `.enso-project` archive
- Requires latest nightly version of Project Manager
- Closes https://github.com/enso-org/cloud-v2/issues/510
- Allow uploading `.enso-project` to local backend
- Closes https://github.com/enso-org/cloud-v2/issues/477
- Promote local project to cloud
- Currently errors with 500 (when uploading a small bundle) or 413 (when uploading a large bundle). May be fixed soon
# Important Notes
The "upload project to cloud" context menu action does not currently have an entry in the new context menu, so that will probably need an official design at some point
Fixes#7411
So far, this branch removes window control buttons and go-to dashboard (hamburger icon), and adds option for dashboard to set offset of the rest of top bar panels.
* Fix creating first local project
* Fix ESLint warning
* Fix bug
* Fix bug
* Remove `isRunning` from row state
* Fix row state resetting when placeholder is being forcefully shown
* Remove `forceShowPlaceholder` option from `table.tsx`
* Rename `DirectoryView` to `DriveView`
* Attempt to fix events
* Always keep `Delete` action enabled
On the local backend, now waits for project to fully open before deleting
* Only allow one project open at a time
* Fix "invalid params" error when creating new project
* Fix "invalid params" when creating many projects quickly
* wip: Fix cloud project loading modal not being dismissed
* Maybe fix opening cloud project after refresh
`/open` is no longer sent according to DevTools
* wip: Switching to local backend with cloud project open results in "invalid params"
* Fix "invalid params" when switching to local backend with cloud project open
* Fix logic for showing errors on buttons
* Don't close project when switching backend
* Fix minor error
Fixes#7405Fixes#7445
The "hidden entry" bug was caused by wrong component browser position and size set when all displayed entries fit the viewport.
The scrolling issue was due to change various "hover rectangles" order - some were above the scroll bars.
- Tweak the definition of "first-word match" so that, now that all components except aliases contain `.`, the delimiter doesn't result in penalizing non-alias matches.
- Fix matching of aliases containing spaces, and add test.
Fixes#7006Fixes#6999
Fixed several issues around visualizations:
1. The visualizations of previewed CBs are displayed. For some reason, the code which showed them wasn't there.
1. The AST ID is assigned to view ID before attaching visualization. This makes previews work in the first place.
2. The visualizations are restored after fixing an error on node.
For some reason, the hosted UI for both email and password and SSO, as well as the `Auth.federatedSignIn({provider: 'Google'})` call require the `aws.cognito.signin.user.admin` scope to be enabled to fetch and update user attributed. However, a call to `Auth.signIn(email, password)` does not. This is not well documented in AWS Cognito.
# Important Notes
`aws.cognito.signin.user.admin` gives you access to all Cognito User Pool APIs. Which federatedSignIn with google provider uses to get `currentUserInfo()` where we store optional `organizationId`. It does not provide any admin level access to other cognito or AWS parts.
* wip
* wip
* New backend switcher
* New user bar (user and chat buttons)
* Page switcher
* New search bar; minor style fixes
* Address QA
* Refactor HTML `button`s into `Button` component
* Add cloud color back to Tailwind
* Fix icons shrinking
* Fix bug
---------
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
Closes#7244
- Section navigator removed
- Added a button panel on top of the documentation
- Show/hide documentation panel button is functional, documentation panel has animation.
- All other buttons are read-only (unclickable).
- "Hovered item preview" caption was removed from the documentation panel
- Breadcrumbs are flying in the temporary position. They should be functional but will be moved to the documentation panel in a separate task.
- Sizes and layouts of the CB panels match the design.
- The color of the application background changed. Also fixed a bug because of which the stylesheet setting of the background was not taken into account.
Known issues:
- ~~The buttons panel partially hides the topmost entry in the list. To fix that, we would need API changes to the grid view, I decided not to do that as part of the PR. We need to add padding on top of the scroll area content.~~
- Scrollbar is not rendered correctly at the bottom – the scroll area mask should crop it.
- Component list entries are not exactly as in design – I didn't touch this part of the code.
- Breadcrumbs are in the wrong position.
https://github.com/enso-org/enso/assets/6566674/409bebb5-572a-4760-852d-f666124689a2
Fixes#7301
When dropping the entire Application, we were removing the scene first, and only then the executor. But when executor had tasks containing still some GUI elements, those elements tried to reach scene on drop, what caused panic.
Here we clear the executor earlier, so the scene is deleted when nobody should try to access it.
Fixes#6552Fixes#6910Fixes#6872
Implementation of new node design. Includes many changes related to stylesheet update handling and per-style FRP construction, as well as refactoring of scene layers used by graph editor. Some additional components were migrated to use `Rectangle` shape and new mouse handling events. Fixed text rendering, where random thin lines appeared at the borders of glyph sprites. Refined edge layout to match new node sizes and not leave any visible gaps between line segments.
The node colors are currently randomly selected from predefined list. Later this will be improved to use group information from the suggestion database, once that is fully migrated to use the documentation tags, thus removing the dependency on the execution context.
https://github.com/enso-org/enso/assets/919491/aa687e53-a2fa-4e95-a15f-132c05e6337a
<img width="653" alt="image" src="https://github.com/enso-org/enso/assets/919491/30f3e897-62fc-40ea-b57b-124ac923bafd">
* Set translucency options
* Vibrancy on Windows
* Use explicit background image instead of vibrancy
* Attempt to fix `ide build`
* Fix lint warning
* Remove background from authentication flow
* Fix background image and position
---------
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
Introduce new APIs for managing focus and using focus to inform delivery of keyboard events.
Use new APIs to implement the following behavior:
Focus:
- If the component browser is opened, its initial state is *focused*.
- If the node input area's text component is clicked, the component browser's state becomes *blurred*.
- If a click occurs anywhere in the component browser, the component browser's state becomes *focused*.
Event dispatch:
- When the component browser is in the *focused* state, it handles certain keyboard events (chiefly, arrow keys).
- If the component browser handles an event, the event is not received by other components.
- If an event occurs that the component browser doesn't handle, the node input area's text component receives the event.
[vokoscreenNG-2023-06-29_10-55-00.webm](https://github.com/enso-org/enso/assets/1047859/f1d9d07c-8c32-4482-ba32-15b6e4e20ae7)
# Important Notes
Changes to display object interface:
- **`display::Object` can now be derived.**
- Introduce display object *focus receiver* concept. Many components, when receiving focus, should actually be focused indirectly by focusing a descendant.
- For example, when the CB Panel receives focus, its descendant at `self.model().grid.model().grid` should be focused, because that's the underlying Grid View, which has its own event handlers. By allowing each level of the hierarchy to define a `focus_receiver`, focus can reach the right object without the CB panel having to know structural details of its descendants.
- When delegating to a field's `display::Object` implementation, the derived implementation uses the child's `focus_receiver`, which will normally be the correct behavior.
**Changes to `shortcut` API**:
- New `View::focused_shortcuts()` is a focus-aware alternative to `View::default_shortcuts()` (which should now only be used for global shortcuts, i.e. shortcuts that don't depend on whether the component is focused). It's based on the *Keyboard Event* API (see below), so events propagate up the focus hierarchy until a shortcut is executed and `stop_propagation()` is called; this allows sensible resolution of event targets when more than one component is capable of handling the same keypress.
Keypress dataflow overview:
DOM -> KeyboardManager -> FrpKeyboard -> KeyboardEvents -> Shortcut.
Low-level keyboard changes to support Focus:
- New `KeyboardManager`: Attaches DOM event handlers the same way as `MouseManager`.
- New *Keyboard Event* API: `on_event::<KeyDown>()`. Events propagate up the focus hierarchy. This API is used for low-level keyboard listeners such a `Text`, which may need complex logic to determine whether a key is handled (rather than having a closed set of bindings, which can be handled by `shortcut`).
- FRP keyboard: Now attaches to the `KeyboardManager` API. It now serves primarily to produce Keyboard Events (it still performs the role of making `KeyUp` events saner in a couple different ways). The FRP keyboard can also be used directly as a global keyboard, for such things as reacting to modifier state.
Misc:
- Updated the workspace `syn` to version 2. Crates still depending on legacy `syn` now do so through the workspace-level `syn_1` alias.
* wip: refactor all tables into one single `AssetsTable`
* wip: Continue merging the four asset tables; make files type-error-free
* Get table working again
* Prepare for nested directories; insert new items at correct position
* Save extra columns state; minor style fixes
* Make tab toggle bar sticky
* Rename array.withItemsInsertedAtBoundary
* Fix minor bug; adjust dropzone appearance
* Indentation for nested assets; fetching nested assets; svg color changes
* New appearances for permission display; minor fixes for "shared with" modal
* Address issues
* Minor bug fixes
* New assets upload bar
* Adjust permission display and table cell borders
* Adjust styling
* Change `toastAndLog` to a hook
* Address issues
* Make table full-width
---------
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
This PR consists of two primary changes:
1. I've replaced `react-hot-toast` with `react-toastify` library. Both serve the same purpose — sending popup notifications (so-called "toasts"). However, the latter comes with a richer feature set that matches our requirements much better.
2. I've exposed the relevant API surface to the Rust. Now Rust code can easily send notifications.
### Important Notes
At this point, no attempt at customizing style of notifications was made (other than selecting the "light" theme).
Likely we should consider this soon after integration as a separate task.
Fixes#7336 in a quick way.
Next to the old way of defining groups, the library can just add `GROUP` tag to some entities, and it will be added to the group specified in tag's description.
The group name may be qualified (with project name, like `Standard.Base.Input/Output`) or just name - in the latter case, IDE will assume a group defined in the same library as the entity.
Also moved some entities from "export" list in package.yaml to GROUP tag to give an example. I didn't move all of those, as I assume the library team will reorganize those groups anyway.
### Important Notes
@jdunkerley @radeusgd @GregoryTravis When you will start specifying groups in tags, remember that:
* The groups still belongs to a concrete project; if some entity outside a project wants to be added to its group, the "qualified" name should be specified. See `Table.new` example in this PR.
* If the group name does not reflect any group in package.yaml **the tag is ignored**.
* A single entity may be only in a single group. If it's specified in both package.yaml and in tag, the tag takes precedence.
---------
Co-authored-by: Ilya Bogdanov <fumlead@gmail.com>
Fixes#7198Fixes#7318https://github.com/enso-org/enso/assets/3919101/4aead1e2-de01-4b6e-aa12-403af0b3c677
This PR changes the way components are kept in the controllers to allow mixing different groups when filtering. On this occasion, the code was greatly simplified:
* Instead of identifying entries by section, group and entry ID we have just a single EntryId representing position on the list. This way the view was simplified.
* Removed support for headers in Component Grid (but the Grid View still has this feature).
* Removed remnants of the old searcher and "actions".
Also, this PR fixes#7201. I decided that the top modules will have full path (namespace, library and module name), so they will be displayed as `Standard.Base.Data` instead of just `Data` (so it's clear we're browsing part of the standard library.
### Important Notes
The searcher's breadcrumbs controller is in not very nice state, but it will be revised anyway, as the breadcrumbs will be synchronized with documentation panel in the new design.
* Consistent order for statements in `dashboard.tsx`; change functions back to lambdas
* Create convenience aliases for each asset type
* Remove obsolete FIXME
* Refactor out column renderers into components
* Enable `prefer-const` lint
* Remove hardcoded product name
* Add fixme
* Enable `react-hooks` lints (not working for some reason)
* Consistent messages for naming-convention lint overrides
* Enable `react` lints
* Extract out tables for each asset type
* Refactor out column display mode switcher to a file
* Switch VM check state to use an enum
* Fix lint errors
* Minor section change
* Fix position of create forms
* Fix bugs; improve debugging QoL
* Add documentation for new components
* Refactor out drive bar
* Refactor out event handlers to variables
* Minor clarifications
* Refactor out directory view; some fixes; improve React DX
There are still many issues when switching backends
* Add `assert`
* Use `backend.platform` instead of checking for properties
* Fix errors when switching backend
* Minor style changes; fix lint errors
* Fix assert behavior
* Change `Rows` to `Table`
* Fixes
* Fix lint errors
* Fix "show dashboard" button
* Implement click to rename
* Fix lint errors
* Fix lint errors (along with a bug in `devServiceWorker`)
* Enable dev-mode on `ide watch`
* Fix bug in `useAsyncEffect` introduced during merge
* More fixes; new debug hooks; fix infinite loop in `auth.tsx`
* Inline Cognito methods
* Remove redundant `Promise.resolve`s
* Fix column display
* Fixes
* Simplify modal type
* Fix bug when opening IDE
* Shift+click to select a range of table items
* Implement delete multiple
* Fixes
* Tick and cross for rename input; fixes
* Implement rename and delete directory and multi-delete directory; fixes
* Optimize modal re-rendering
* Make some internal `Props` private
* Remove old asset selection code
* Eliminate re-renders when clicking document body
* Fix name flickering when renaming
* Use static placeholders
* Avoid refreshing entire directory on rename
* Use asset name instead of ID in error messages
* QoL improvements
* Enable react lints and `strict-boolean-expressions`
* Extract dashboard feature flags to its own module
* Feature flag to show more toasts; minimize calls to `listDirectory`
* Deselect selection on delete; hide unused features; add exception to PascalCase lint
* Fix projects disappearing after being created
* Fix name of `projectEvent` module imports
* Re-disable delete when project is being closed
* Fix assets refreshing when adding new projects
* Refactor row state into `Table`; fix delete not being disabled again
* Address review
* Implement shortcut registry
* Fix stop icon spinning when switching backends (ported from #6919)
* Give columns names
* Immediately show project as opening
* Replace `asNewtype` with constructor functions
* Address review
* Minor bugfixes
* Prepare for optimistically updated tables
* wip 2
* Fix type errors
* Remove indirect usages of `doRefresh`
Updating the lists of items will need to be re-added later
* Remove `toastPromise`
* Fix `New_Directory_-Infinity` bug
* wip
* WIP: Begin restoring functionality to rows
* Fix most issues with DirectoriesTable
* Port optimistic UI from `DirectoriesTable` to all other asset tables
* Fix bugs in item list events for asset tables
* Merge `projectActionButton` into `projectsTable`
* Remove `RenameModal`; minor context menu bugfixes
* Fix bugs
* Remove small default user icon
* Fix more bugs
* Fix bugs
* Fix type error
* Address review and QA
* Fix optimistic UI for "manage permissions" modal
* Fix "share with" modal
* Fix template spinner disappearing
* Allow multiple projects to be opened on local backend; fix version lifecycle returned by local backend
* Fix minor bug when closing local project
---------
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
Closes#7200
Updating the looks of the project's top bar to the new design.
- Project name moved from breadcrumbs to the left of the execution environment selector.
- All components use auto-layout in most places, except for breadcrumbs (changing them means basically rewriting them from scratch, but we will use CB's breadcrumbs instead)
- Components no longer rely on individual positioning but rather work as parts of the "project view top bar" abstraction (with the use of auto-layout)
- We have a new debug scene for the project view top bar, replacing the debug scene for execution environment selector.
- Most style parameters were moved to the stylesheet, except breadcrumbs.
- Top bar is now fully managed by the Project View, not Graph Editor
- Project name is no longer editable. There is no way to rename a project inside the IDE (the corresponding code is removed). It can react on mouse hovers, but the color will not change for now.
- Current execution environment has extra bold font and is no longer capitalized.
- **Breadcrumbs can be considered broken** from the design point of view. I have no intention of making them look as in the design because we want to reuse CB's breadcrumbs component instead. The functionality should be fully preserved, though.
- The Play Icon on the execution environment selector is not updated to the newest design, I suggest creating a separate task for that (I think it is the first case of a rounded triangle in the application, and implementation would some time).
https://github.com/enso-org/enso/assets/6566674/16747c02-15b2-4806-ace3-6f03c98040f1
Fixes#7259
Node label (and output port in general) used to depend on view-mode logic, which is currently not fully functional. Since we have removed profiling mode from the application, It's best to remove some remaining parts of it to avoid them from interfering.
Labels now work as they used to, being shown on hover or when ctrl is held down.
![image](https://github.com/enso-org/enso/assets/919491/5e6996a4-6d84-4d36-a624-03a53f7e6e8a)
This PR contains minimal changes to have a visual part of #7198. It updates the view of _component list only_ to the newest design. The CB panel was shrunk in process, and breadcrumbs are a bit obscured, but they will be moved around in the next few PRs.
![image](https://github.com/enso-org/enso/assets/3919101/a562e365-d512-4320-ae19-10701edaa9ac)
### Important Notes
* This does not touch proper entry ordering yet.
* The component browser background is not (yet) updated; as some colors have alphas in the design, this may affect them.
* Add backend endpoints for "share with" button
* wip
* Fix bugs
* Invite user to organization if email is not found
* Minor fix for error message
* Address review
* Address issues
* Fix React error about identical keys
* Fix "share with" modal z-index; filter out users with permissions on asset
* Fix errors; address comment
* Fix
* Change submit button text to "Already has access" when appropriate
* Address review
* Show email on hover
* Finish renaming "share with" modal
* Select multiple for "share with" modal
* Minor style changes
* Deselect other permissions when "own" permission is selected
* Fix deselecting permissions
* Remove unused svg
---------
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
* Show spinner on templates when creating project
* Immediately show project as loading
* Fix infinite spinner bug
* Fix bugs
---------
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
part of #7178
Changelog:
- add: `text/fileModifiedOnDisk` notification
- update: during the auto-save, check if the file is modified on disk and send the notification. I.e. auto-save does not overwrite the file if it was changed on disk (but the save command does)
- update: IDE handles the file-modified-on-disk notification and reloads the module from disk
# Important Notes
Currently, the auto-save (and the check that the file is modified on disk) is triggered only after the file was edited. The proper check (using the file-watcher service) will be added in the next PR
https://github.com/enso-org/enso/assets/357683/ff91f3e6-2f7a-4c01-a745-98cb140e1964
Fixes#7236
# Important Notes
This was caused by `userMenu` having an effect that depends on `setModal` and `unsetModal`, which were not memoized - so they would be a different value every time.
Closes#7047
Adds an ability to resize visualizations by dragging a special (invisible) shape along the bottom and right borders of visualizations.
- Visualizations are aligned to the left border of the node now.
- Default visualization width now equals to the node's width (default height is the same)
- Changing the width of the node also changes visualization width, but only if no manual drag-resizing was applied
- Visualization size is preserved when reopening visualization (but it is not saved in project metadata)
- No visual indication that resizing is possible exist, it will be implemented in #7049https://github.com/enso-org/enso/assets/6566674/2f2525e8-cf10-4c92-953a-b69eb97a954a
Adds a new bare-bones AI searcher that can be triggered with `cmd+tab`. It will interpret the searcher input as a prompt to an AI model and replace the created node with the suggestion that was computed.
https://github.com/enso-org/enso/assets/1428930/f8403533-54ba-4ea5-9d3c-6bdf3cf336b5
Implements the first step of #7099.
# Important Notes
Contains some refactoring that allows us to have multiple controllers side by side. So QA testing should make sure that the Component Browser Searcher is still working as before.
part of #7178
Changelog:
- add: `cmd+alt+y` keybinding that re-opens the file, applies new content, and re-executes the program
This is the first part of the task to support the external edits. The next step will be to reload the module contents by the notification from the language server.
# Important Notes
https://github.com/enso-org/enso/assets/357683/79917e22-b846-4bd9-b03a-33a48d5f75b9
* Special noncapturable-nonbubbleable events
* A prototype of hover handling
* Revert "Special noncapturable-nonbubbleable events"
This reverts commit abdc0cf7eff9aba44656d959f6736250c69bf206.
* Make it consistent with docs
* Update app/gui/view/graph-editor/src/component/node/output/port.rs
Co-authored-by: Kaz Wesley <kaz@lambdaverse.org>
* Optimize a bit
* Extends docs
---------
Co-authored-by: Kaz Wesley <kaz@lambdaverse.org>
* QoL improvements
* Enable react lints and `strict-boolean-expressions`
* Address review
* Minor bugfixes
---------
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
* wip
* wip. includes broken code
* Pass organization id when user is created
* Make backend endpoints properly error
The "set username" screen currently returns 500 server error
Fixes#6379https://github.com/enso-org/enso/assets/3919101/be509314-a5f7-41c8-be0f-a7c46deca477
Before, the quick visualization preview (ctrl/cmd + output port hover) was flickering, because shown visualization made output port no longer hovered. To fix that, the preview is hidden only when both the output port _and_ the preview stop being hovered.
Also discovered that the visualization chooser is not visible or looks ugly when visualization with HTML elements is shown over the nodes, so I made it not being visible on previews.
Closes https://github.com/enso-org/cloud-v2/issues/490:
- Make templates collapsible
- Add scroll-based shadow to templates
- Move scrollbars from body to templates and directory listing
# Important Notes
None
On my machine, I had a weird problem with shaders failing to link (without any meaningful error message). It was caused by my system upgrade - old packages had the issue as well. Bumping electron version fixed the issue.
Fixes#7064
Because our position adjusting mechanism was very confusing for users, especially on edge drops, this PR disables this adjusting for the cases where node is about to be put under the mouse pointer.
* Change cdn domain
Fixes cloud-v2/#484
* Remove modal from file upload flow
Fixes part of cloud-v2/#483
* Add optimistic UI; add more toast messages
Fixes part of cloud-v2/#483
* Handle `authentication` and `new-dashboard` flags correctly
Fixes cloud-v2/#481
* Fix bugs
* Use offline mode when `-authentication=false`
* Stop row from resizing when loading permissions
* Fix issues
* Navigate back to login screen on registration success
* Prevent scrollbar flickering
The scrollbar still blinks when switching backends, but it now does not resize. The blinking seems to be very difficult to avoid.
* Stop modal close button from overlapping text
* Fix stop icon spinning when switching backends
Remote backend not tested
* Remove modal from files table plus button
* Scrollbar-aware column count
Fixes#6955 by:
- using `visualisationModule` to specify the module where the visualization is to be used
- referring to method in `Meta.get_annotation` with `.method_name` - e.g. unresolved symbol notation
- evaluating arguments to `Meta.get_annotation` in the context of the user module (which can access the extension functions)
* Extract SVGs to individual files
Probably not working for cloud frontend (`watch-dashboard`, `build-dashboard`) yet
Dynamic SVGs were not extracted out
* Make file SVGs work for `watch-dashboard` and `build-dashboard`
* Document SVG loaders
* Address QA issues
Fixes#6908
Fast typing leads to a race condition where the end of the node editing can happen where the state of the CB is not caught up yet. This leads to two issues:
1. The wrong selection is made, as the View of the Component Browser has not been updated yet, but the selection from there is used to determine how the node is created.
2. Processing of the keys is aborted early, while still waiting for additional key input.
This is now fixed.
https://github.com/enso-org/enso/assets/1428930/dce82bb3-1c25-4a67-988a-d74469dc8fcd
Closes#6705
This PR removes Tailwind from dependencies of the documentation panel and also brings some essential design improvements.
List of fixed things:
- Massive refactoring, removing unnecessary HTML tags, and simplifying the overall layout.
- Spacing to the right of the bullet in the bullet lists is much smaller. Bullets also have the same color as the following text.
- Paddings before headers increased.
- Colon used instead of the comma between the method link and its summary.
- Module or type names in the top header are now delimited by `.`, which matches the Enso language.
- We now use Twemoji icons in marked sections. Now `Info` and `Important` icons are much nicer.
- Constructors are now in a separate section as methods.
- Headers correctly handle long entry names.
List of not fixed things: (I will create additional issues for them)
- Argument names in the list are not bold. We receive a `<ul>` HTML code from the engine. We don't know whether it contains argument names or something else. It requires support from the LS protocol.
- No highlight for things delimited by `<pre>` tags in the text (like `Nothing` on the screenshot below). It also requires support from the LS protocol because we don't inspect received text and can't modify it.
![image](https://github.com/enso-org/enso/assets/6566674/868f1e03-e53a-4eb6-a306-8b439264fec5)
In the video from IDE, you can see some issues with spacing in the documentation, namely redundant blank lines at the beginning of each example and multiline (and multi-paragraph!) summaries for methods. This can't be fixed on the IDE side. I will create separate issues for that.
https://github.com/enso-org/enso/assets/6566674/e4cef3d1-7a13-4d3b-b11d-f5ee2c05ca82https://github.com/enso-org/enso/assets/6566674/43970982-ba43-4530-8ffd-6bce790d5d77
Fixes#6816.
The code for adding imports for dropdown widgets was unified with CB. The code was moved from the searcher controller to the graph controller.
Also, I changed the signature for a few `lookup_*` methods of the suggestion database, because I have always found it weird that they return `Option` instead of `Result`. They now work nicely with the surrounding code.
https://github.com/enso-org/enso/assets/6566674/49125f8d-096e-4cca-a922-4811ed717a4d
Fixes#6772
When detaching an existing edge by grabbing by a source port, the node's code is no longer immediately modified. It is only changed once the edge has been either connected or destroyed. When grabbing on the source side, the existing behavior is preserved. That way, we always have guaranteed place to keep the edge connected to.
https://github.com/enso-org/enso/assets/919491/49e560cb-0a29-4c6a-97ec-4370185b8c89
In general, the detached edges are now more stable, resilient to all kinds of expression modifications during the drag.
https://github.com/enso-org/enso/assets/919491/e62450ff-46b2-466f-ac33-f4f19e66ee1d
In case there is a situation where the currently dragged edge's port is destroyed (e.g. by Undo/Redo), instead of showing glitched port position it is simply dropped.
https://github.com/enso-org/enso/assets/919491/8fb089aa-a4a5-4a8c-92eb-23aeff9867b8
# Important Notes
The whole edge connection and view handling at the graph-editor view level has been completely rewritten. The edge endpoints are now identified using new `PortId` structure, that is not dependant on the span-tree. This prepares us for eventual removal of the span-tree in favour of manipulating AST directly. Right now those `PortId`s are still stored within the span-tree nodes, but it will be easy to eventually generate them on the fly from the AST itself. The widget tree has also already been switched to that representation where appropriate.
Additionally, I have started splitting the graph editor FRP network into smaller methods. Due to its absolutely enormous size and complexity of it, I haven't finished the split completely, and mostly edge-related part is refactored. I don't want to block this PR on this any longer though, as the merge conflicts are getting a bit unwieldy to deal with.
Fixes#6855
Correctly sets the layers of the full-screen panel and the scrollbars. The full-screen panel needs to be in the `panel` layer, as it is fixed and above everything else. The scrollbars in the text visualization should be placed together with their parents, so they are switched correctly between layers when enabling/disabling full-screen. Leaving their layer otherwise unspecified should not lead to occlusion issues, as all other elements in the text visualization are Dom elements, and therefore placed below EnsoGL elements.
https://github.com/enso-org/enso/assets/1428930/db80c5b7-69fd-4bf5-84ab-c83664227059
Fixes performance problems observed when creating/resolving errors (#6674):
|before|after|
|---|---|
|![vokoscreenNG-2023-06-09_08-49-46.webm](https://github.com/enso-org/enso/assets/1047859/a0048b32-4906-41cd-8899-6e2543ef6942)|![vokoscreenNG-2023-06-09_08-50-54.webm](https://github.com/enso-org/enso/assets/1047859/fef81512-ad89-4418-ae10-d54de94d96ea)|
This also helps with #6637, although I haven't been able to reproduce the degree of slowness shown there so I can't confirm that this resolves that issue.
# Important Notes
- Disable visualizations until shown. [Faster startup, and all graph changes.]
- 6x faster message deserialization. [Saves 400ms when making a change with many visualizations open.]
- Fast edge recoloring. [Saves 100-150ms when disconnecting an edge in Orders.]
- Add a checked implementation of a `profiler` data structure, used instead of the fast `unsafe` version when `debug-assertions` are enabled.
Several small changes:
- Dropdowns: Populate `GridView` lazily (fixes#6865).
- Clear disconnected edges when editing node (fixes case 1 in #7018).
- Fix regression in node selection rendering (2nd bug in #6975).
- Update profiler docs. The hotkey to *prOfile without exiting* is now `Ctrl+Alt+O` (`Ctrl+Alt+P` has been requisitioned by the CB).
Node selection:
| Pre-`Rectangle` | This PR |
| --- | --- |
| ![image](https://github.com/enso-org/enso/assets/1047859/bec341c1-dbf8-404d-9f2a-5d070c80ff15) | ![image](https://github.com/enso-org/enso/assets/1047859/8161390c-f64b-4bb3-8b7a-b87b2f9b4cd3) |
# Important Notes
- `Rectangle`: When `inset > border`, the extra space is now between the body and the border, not outside the border.
- More robust node layering logic. Now an inconsistent layer order cannot occur, even if something strange happens (like editing an expression and an edge at the same time).
- The dynamic drop down in the `drop_down` example scene doesn't show any entries before (or after) this, so I can't test the dynamic case.
This PR adds facilities for controllers to be aware of what shortcut command is currently being processed. This allows grouping consequences of single user action into a single transaction without hard-coding it separately for all the separate paths case-by-case, which turned out to be challenging and error-prone.
Additionally, a number of minor fixes were carried over from #6877:
* workaround for #6718;
* avoiding creating spurious transactions when dealing with node positions;
* dropping any non-user user-triggered transactions that occur during the IDE project initialization.
Implements #6544 (eliminates 10/42 of the constantly-displayed draw calls).
Fixes#6717. Improves startup CPU time by 5% (250ms, loading Orders on my dev box).
# Important Notes
- Edges: New implementation uses only Rectangle under most conditions.
- Node and action area: Replace some shapes with Rectangle.
- List view: Replace some shapes with Rectangle.
- Display object hierarchy: The lowest-level shape instance types no longer have their own display objects.
- Includes initial support for using `Rectangle` to display triangles.
`executionContext/create` method has an optional `context_id` parameter. Supplying this argument makes the user's session more reproducible. I.e. this way the language server can recreate the user's session by recording the requests.
* Save backend type; fix `-startup.project`
* Attempt to fix for cloud
* Fix for cloud and implement automatic opening
* Fixes
* Add missing functionality
* Switch default backend to local backend
* Fix type error
* Fix saving backend
* Make loading message appear instantly
* Fix context menu positioning
* Fixes and QoL improvements
* Style scrollbar on `document.body`
* Fix `-startup.project`; other minor fixes
* Open project immediately when creating from template; minor fix
* Finally fix spinner bugs
* Fix some minor bugs
* Fix bugs when closing project
* Disallow deleting local projects while they are still running
* Close modals when buttons are clicked
Fixes#6763
The bug was caused by pushing stack frames in the engine first, then failing to get graph controller - in that case we didn't update graph, but kept the stack, so graph was not synchronized with stack.
This PR changes the approach: we try to open graph first, only then push frames to stack. If _any_ frame will fail, we try to pop those we pushed so far, to restore the previous state. The same fix was applied for leaving nodes.
Also, I realized, that running several "enter node" / "leave node" actions could mix push/pop operations, making a mess with our execution context state. I've added a mutex to ensure we won't do this: the contesting operation will simply fail.
# Important Notes
In case when _restoring_ state fails, I did not have any better idea than just trying until it succeed.
- Add the missing dropdowns for `Locale` and `Encoding`.
- Correct a few mismatched type signatures.
- Adjust `order_by` calls with a single `Sort_Column` to call in a Vector.
- Adjust parameter names for `transpose`.
- Fix for the table viz: escape HTML and `suppressFieldDotNotation`.
- Use `Filter_Condition.Equal True` for the default filter.
- Adjust `Data.fetch` to return the response on success when parse fails. Rename `parse` to `try_auto_parse`.
- Add various aliases for methods.
- Add tests for `Table.set` when using a `Vector`, `Range` or `Date_Range`.
- Add check for mismatched length on `Table.set`.
![image](https://github.com/enso-org/enso/assets/4699705/23ea0ba3-2b05-4af8-afd9-f35b55446c24)
![image](https://github.com/enso-org/enso/assets/4699705/8b0253e6-e9e8-490a-9607-0da51ab5a215)
* Dashboard and authentication changes
* wip
* Replace `useNavigate` with a wrapper
* Fixes
* Fix flipped boolean
* QoL improvement for request blocking
* Add service worker to cache dependencies
Now, quick typing in component browser and pressing "enter" should not cut off the last part typed. Fixes#6733https://github.com/enso-org/enso/assets/3919101/3979ed5a-ba4e-4e25-93e6-672e731b7bd8
On this occasion, also fixed "go-to-dashboard" button and "Unsupported engine version" being over the full-screen visualization. Fixes#6722
# Important Notes
I did a significant refactoring of Project View:
1. The huge `frp::extend` block was split into multiple `init` methods.
2. Remaining of the "Old searcher" were removed.
3. The "Edited" event from node's input is emitted only when in edit mode (it's consistent with other API terminology, and makes FRP for showing CB much simpler.
The code was _mostly_ moved around, but the check is advised anyway, as there were small changes here and there.
close#6800
Update the `executionContext/expressionUpdates` notification and send the list of not applied arguments in addition to the method pointer.
# Important Notes
IDE is updated to support the new API.
Implements #6792Fixes#6715Fixes#6052Fixes#5689
The dynamic dropdown widgets entries now can specify additional widget configuration as a list of `parameters` of the inner method call. That allows for creating smarter widgets within nested constructors, taking the outer widget's context into account.
<img width="772" alt="image" src="https://github.com/enso-org/enso/assets/919491/97c70654-9170-4cf0-ae4d-2c25c74caa96">
With the changes to the serialization logic, I have also adressed issues related to automatic label generation for both static and dynamic dropdown entries. For access chains (e.g. `Foo.Bar.Baz_Qux`), the label will now always contain only the last segment, and all underscores will be removed (e.g. `Baz Qux`). This also applies to dynamic entries where the label is not explicitly specified in method annotation.
<img width="265" alt="image" src="https://github.com/enso-org/enso/assets/919491/1abe6c77-010b-4622-b252-97cd1543cb48">
Additionaly, now the dynamic entries containing constructors will also be resolved within suggestion database, allowing us to automatically insert relevant import, shorten the actually used expression and wrap it with parentheses if required. That was required for nested widgets to show up, as we depend on properly resolved argument names to show them. The widget definitions in annotations no longer need to wrap the expressions manually. Instead, the constructors used in dropdown entries should be specified using fully qualified names, similarly to how we do it in tag values.
CC @jdunkerley - The dropdown entries containing just a constructor will no longer need added parentheses around them. Instead, the constructors should be specified using fully qualified names, similarly to how we do it in tag values.
<img width="389" alt="image" src="https://github.com/enso-org/enso/assets/919491/19944b5b-d0c7-43ac-bf17-ca1556e0b3f0">
Note that currently the import resolution is attempted even if the used constructor is is not specified using a fully qualified name. To accomplish that, the IDE is performing a more expensive search through whole suggestion database for matching type and module (e.g. in example above, we are searching for a match for `Aggregate_Column.First`). If there are multiple potential matches due to a name collision, it is undefined which one would be preferred. Effectively one will be picked at random. To avoid that, the libraries should over time transition to using fully qualified names wherever possible.
# Important Notes
I have removed the `payload` field from the span tree, and with it the generic argument on its nodes. This was already partially done on the branch with new design, on which I also had a few changes that turned out to be useful for this PR. So I pulled it in as well. It is a nice simplification that will ease our further work on removing the span-tree altogether. The biggest impact it had was on the node output port, where I had to store the port data outside of the span tree. This is the approach we would be taking when transitioning to AST anyway.
This is a fix for a couple of recent regressions:
- Fixes#6756: Projects couldn't be renamed anymore from within the project view.
- Fixes#6804: One could no longer switch between projects from within the project view.
- It also unblocks the issue with the spinner (that got reverted), but that probably needs some extra attention.
It might be the long-term goal to have different UX solutions to these cases, but this should fix those regressions in the short term at least.
Thanks to @somebody1234 for the in-depth conversation (and the actual code!).
Fixes#6736Fixes#6486Fixes#6601
To achieve goal mentioned in the title the following changes were made:
1. Now it's normal state of Component Browser to have no entry selected. In that case pressing enter will accept the input as-is.
2. The issues of `Column.from_vector` or actually any code being unintentionally inserted should be resolved, as in most of those scenarios we do not select any item in CB after list reload. Specifically, the first element is selected only when:
* the input is empty (so the user just starts writing code)
* or we filter by some pattern (we select the best match). This includes writing literal.
3. On this occasion, inserting literal was fixed, so no more random spaces are inserted inside.
4. Also, the entries in groups other than local group are reversed: now the entries specified as first in "component groups" section in the library will be easily approachable. In particular, now "Text input" is selected by default in empty node instead of `Column.from_vector`.
https://github.com/enso-org/enso/assets/3919101/42064b08-16b4-4519-81de-8a2d3701c112
Only invalidate the graph editor view at most once per frame. On develop, this saves about 70ms (2%). Testing a recent backend without #6755 as a stress-test, this saves about 5s (45%). This reflects better scalability to large numbers of `SuggestionUpdate` messages.
Fixes#6630.
# Important Notes
- Also fix intermittent profiling failures occurring since the introduction of microtasks.
* Remove unused code: project management in component browser
* Encapsulate internal FRP logic of project list
* Collapse some code paths
* Open project passed on command line through presenter
A project name or ID that is passed on the command line was initialised
in the controller setup, before the presenters and views are set up.
Now, we fully initialise the IDE before opening a project so we have
control over the view while a project is being opened.
* Show a spinner in all cases of opening a project
* Let root presenter open/close projects when switching projects
* Change spinner to make progress over a fixed period
* Resolve issues when Project Manager API isn't available
* Bump wasm size limit
Re-introduce a feature that was removed with #6638: only initialize visualization choosers when they are visible. This avoids initializing lots of invisible UI elements at the same time when opening a project.
Fixes#6754. The issue mentions being able to create and delete nodes when the full-screen visualisation is active. Besides those, you now also can't:
- collapse nodes into a function
- enter a function
- exit a function
- Handles the `show-dashboard` event to hide the IDE and show the dashboard
- This replaces the temporary Ctrl+Alt+D shortcut to do the same action. The Ctrl+Alt+D shortcut has been removed.
# Important Notes
None
Fixes some of #6662
Issues addressed:
- `ide watch` and `gui watch` should now use the desktop platform
- error screen should now be shown when passing invalid options
- password (both creating password when registering, and resetting password) should now warn on invalid input
# Important Notes
Instead of checking whether `location.hostname === 'localhost'`, I've opted to use a constant defined by the build tool instead. This is to make it easier to merge the cloud IDE and desktop IDE entrypoints in the future, since it would be able to simply set `platform: Platform.cloud` in the build config.
Should fix [cloud-v2#464](https://github.com/enso-org/cloud-v2/issues/464).
# Important Notes
I'm not 100% clear on how to repro the issue so i'm partly just guessing the root cause.
I have eliminated various other things from being potential causes though - e.g. `localStorage` indicates that the AWS libraries are clearing their entries as expected.
* Fix cloud-v2/#432
* Delay setting backend to local backend; don't list directory if user is not enabled
* Add a way to debug specific dashboard paths
* Fix bug
* Check resources and status immediately
Refactored the logic behind selecting appropriate widgets for span tree nodes. Now the bulk of it is moved into widget methods. When a given widget type is reporting to be not compatible with the expression, it will not be used even if the configuration was overriden using an method argument annotation. In that case, the usual logic for automatically selecting the appropriate widget will kick in.
![image](https://github.com/enso-org/enso/assets/919491/6316e21e-c509-4cc4-a3a6-c482798894d0)
* Run typecheck and eslint on Lint CI
* Address reviews; fix type errors in `.d.ts` files
* Remove unused parameter
* Run prettier
* Fix lint error
---------
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
* Disable cloud backend for unverified users
* Use local backend as default backend
* Try to fix Project Manager reconnection logic
* Set default backend to remote backend when local backend is not available
* Attempt to suppress WebSocket error console message
* Minor fix for loading spinner
* Hide "Open as folder" context menu option, when on local backend
* Remove duplicate `onSubmit` handler
* Fix live-reload
* Remove debug `console.log`
* Minor refactor; properly unset modals on click
* "created" project state for local backend, for parity with remote backend
* Hide directory path when on local backend
* Undo minor refactor
* set newDashboard & authentication flags to true
* Revert "set newDashboard & authentication flags to true"
This reverts commit 5974170866.
---------
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
Fixes#5203
This PR changes behavior when `text/applyChange` returned error.
Before we always assumed that the change was _not_ applied, and tried to send full synchronization still assuming old file content. But this was not the case on some errors (timeouts for example). Now we instead reopen the file (getting its actual content) and then make a full invalidation.
Also added a shortcut allowing manual file reloading, what may be useful in some kinds of error (and also allowed me testing of reopening file in the application).
# Important Notes
The unit tests of sending text updates were improved: now we actually check if all expected messages are emitted from the IDE.
Fixes#6521: Picking a function from the CB that's defined in the main module now resolves to `Main.<func-name>` instead of `<project-name>.<func-name>`.
Note that, when collapsing nodes to a function, this referral style was already used, so this is just a change in the behaviour of the CB.
- Fix couple of bugs in Table viz: rounding of bottom div, missing character, not including row count as an option.
- Add better JSON format for `Row`, add support for visualization in the Table viz both for `Vector Row` or `Row`.
- Fix some type signature errors.
- Move `Column_Format` to `Standard.Table.Internal`.
- Move `format_widget` to `File_Format.default_widget` and sort the signature of `Widget` methods.
- Added utility to make `Single_Choice` widgets.
- Added dropdown for delimiter on split methods.
- Removed `default_widget` from `Problem_Behavior` and `Filter_Condition`.
- Altered signature and widgets for table functions.
- Added `to_column` extension to allow easy conversion of Range and Vector to Column.
- Added `compute`, `compute_bulk`, `running` to Column to allow statistic computation.
- Added drop down for `Table.write` format parameter.
- Added drop down for `Table.rename_columns`.
- Added support for Vector of pairs for renaming columns.
- Added check when making a map from Vector if not 2 items.
![image](https://github.com/enso-org/enso/assets/4699705/beed257c-efe3-44a3-9e3a-041354701735)
- Enables the `require-jsdoc` lint
- Fixes all lint errors caused by enabling this lint.
# Important Notes
- There is no option to require JSDoc for other constructs, like top-level constants.
Partially fixes https://github.com/enso-org/enso/issues/5051
Fix the expression of the node representing a file being uploaded after drag'n'dropping, so it relates to the actually existing standard library function.
* Fix cloud-v2/#433
* Implement "last modified" for local backend
* Minor improvements to documentation
* Show nothing instead of 1970-01-01 if last modified date does not exist
* Fix type errors
# Important Notes
The mouse handling changes involve an unfortunate huge hack, where we enable mouse events on the mouse shape during box selection. That way we know for sure that no other shape will be able to receive mouse enter event. Then the list editor widget is modified to only actually respond to events when its background is hovered. We will definitely want a more proper way to handle mouse event contention, but it's definitely out of scope for current bugfixing.
Fixes#6260: The shortcut to open the full-screen visualisation is now `shift-space` so it doesn't interfere with the `space` shortcut to toggle the mini-visualisation.