Commit Graph

37 Commits

Author SHA1 Message Date
Paweł Grabarz
a83297b7db
Drop git dependency on enso-bot repository (#11539) 2024-11-12 18:25:19 +00:00
Adam Obuchowicz
d02f7e21df
Restore pnpm-lock (#11514)
Bypassing issue with CI
2024-11-12 10:05:07 +00:00
Adam Obuchowicz
86c59469d0
Increase timeout and vite version (#11492)
1. The electron test hit timeouts from time to time, probably because of slow response from the engine: increased timeout.
2. Unify vite version across packages.
2024-11-08 08:43:02 +00:00
Kaz Wesley
867c77d5cc
New markdown editor (#11469)
Implements #11240.

https://github.com/user-attachments/assets/4d2f8021-3e0f-4d39-95df-bcd72bf7545b

# Important Notes
- Fix a Yjs document corruption bug caused by `DeepReadonly` being replaced by a stub; introduce a `DeepReadonly` implementation without Vue dependency.
- Fix right panel sizing when code editor is open.
- Fix right panel slide-in animation.
- `Ast.Function` renamed to `Ast.FunctionDef`.
2024-11-06 16:54:32 +00:00
Paweł Grabarz
9703cb1dd0
Align esbuild versions across packages (#11459)
Part of #11458

Should get rid of the "magical" CI failure: https://github.com/enso-org/enso/actions/runs/11576387008/job/32225209090#step:7:254
2024-11-05 23:43:27 +00:00
Dmitry Bushev
47943a2e62
Add compression to the metadata code snapshot (#11470)
close #11420

Changelog:
- update: add zlib compression to the `snapshot` metadata field
- add: implement nodejs `zlib` for polyglot ydoc-server
- add: implement nodejs `Buffer` for polyglot ydoc-server
2024-11-05 11:57:43 +00:00
Sergei Garin
fdab2233ac
Add React compiler (#11405)
This PR adds React Compiler to the dashboard
Read more about the compiler: https://github.com/reactwg/react-compiler/discussions/5

- This PR expects that these PRs are merged:
- #11380
- #11382

## Reasoning

On our codebase adding React compiler led to significant perf improvements across the whole app. But the most impact was on the AssetsTable (see video attachment). Adding React compiler reduced the rerender scope of the AssetsTable from the whole table to the certain elements that changed, and made the table much more usable.

Without compiler (page freezed):

https://github.com/user-attachments/assets/16505b40-123b-4153-9c22-880f5dfa211c


Compiler solves the issue:

https://github.com/user-attachments/assets/6a298876-f28d-4b3d-8247-50b0c7ecb7f8

This PR requires thorough testing of the dashboard for potential bugs introduced by the compiler
2024-10-31 12:10:22 +00:00
somebody1234
c6e87c2a17
Optimize asset table rendering (#11382)
- Depends on:
- #11380
- Some optimizations for re-rendering assets table:
- Omit `visibilities` from `state` in favor of passing each `AssetRow`'s `visibility` directly to the row. This minimizes spurious `state` updates.
- Pass `id` and `parentId` to `AssetRow` instead of the entire object. This ensures that re-fetches do not force a re-render of the `AssetRow` - we are no longer passing a reference to the object, so we are now comparing by string comparison (which is almost always stable).

# Important Notes
None
2024-10-31 10:36:10 +00:00
Sergei Garin
fae18c0a04
Add eslint-react-compiler (#11404)
* Add React compiler eslint rules and fix issues across reusable components

* Fix compiler errors

* Remove fail-on-warnings for eslint

* Set max-warnings to 41 to match the amount of warnings introduced by react-compiler

* Add comment for lint task
2024-10-28 15:58:41 +03:00
Dmitry Bushev
db0582d11c
Metadata should not depend on absolute text spans (#11390)
close #11304

Changelog:
- update: add `ide.snapshot` optional metadata field containing the source code of the file
- update: `syncFileContents` method tries to repair the metadata spans when it detects that the source file was edited and the received code does not match the code stored in the `ide.snapshot` metadata field

# Important Notes
Tested in gui
2024-10-28 09:41:46 +00:00
Adam Obuchowicz
908f426cac
A set of little improvements. (#11386)
1. Bumped eslint and its plugins versions, and autofix new errors (mostly eslint disables which were no longer neccessary)
2. ~~Replace eslint with eslint-p which speed up linter a bit (at least on my machine)~~ - CI machines don't like it.
3. Fixed/worked around one problem with flacky selection _unit_ tests.
2024-10-24 07:38:08 +00:00
Adam Obuchowicz
d1ee7fadce
Remove download font scripts (#11317)
The fonts were added (by mistake) anyway, but they are rarely changed, and the scripts add unnecessary complexity.

This also fixes some post- #11287 problems.
2024-10-14 16:11:42 +00:00
Adam Obuchowicz
4a249688e8
Unify Frontend App (#11287)
Fixes #10668
Fixes #8484

Summary of changes:
* `gui2` and `dashboard` are merged to `gui` directory. Various configs were merged (package.json, playwrigth, TS...). The src and e2e directories are split to `dashboard` and `project-view` for now.
* E2E tests run two servers on different ports. The tests are organized in projects. This is also to be changed soon, as we plan to [use better mocking in GUI/ProjectView](#9726)
* ESlint configs were merged to central `eslint.config.mjs`, and that file was moved to repository root. We kept the dashboard lints, but they can be relaxed. The dashboard code was changed to meet GUI lints.
* Also, the versions of linter plugins were bumped, and code fixed.
* The ide-desktop/client no longer has `dashboard` dependency - the only type used there was moved to common package.
* `common` package moved to `app`.
2024-10-11 18:23:02 +00:00
somebody1234
7a00e6ef26
Dashboard improvements (from 24 September 2024 + 30 September 2024) (#11219)
- Close https://github.com/enso-org/cloud-v2/issues/1508
- ⚠️ Labels modal - add selection indicator where user can (de)select multiple labels
- Checkboxes currently still cause the dialog to (incorrectly) close
- Edit datalink -> select enso secret -> options are too narrow for enso path. Strip enso://Users(Teams), if possible make the options list longer on the left side
- Added (or rather, re-enabled via CSS) horizontal scroll instead
- Make Versions, Sessions, Settings as tabs similar to documentation panel in graph editor
- Edit description in context menu should open asset panel with description input active
- Edit secret should be moved to asset panel (same like datalink)
- Dim background when "edit description", "edit secret", or "edit datalink" are clicked/triggered via shortcut to highlight input
- Hide unused (= no backend support) columns and icons: accessed by projects and accessed data
- *Partial* frontend fixes for https://github.com/enso-org/cloud-v2/issues/1529
- (1) Fix settings title being horizontally centered and split on multiple lines
- (2)  backend issue
- (3)  out of scope
- (4)  backend issue
- (5)  out of scope
- (6)  out of scope
- (7)  backend issue
- (8)  already fixed in #11126
- (9)  out of scope (potentially requires a way to trigger a tooltip on a disabled button)
- (10)  out of scope
- (11)  out of scope
- (12)  out of scope
- (13) URL encode `enso://` URLs in "copy as path"
- (14) Double click on datalink make asset open and close (not sure if this has already been fixed)
- (15) Clicking anywhere on Asset Panel no longer deselects assets (not sure if this has already been fixed)
- (16)  addressed in #11268
- (17) Make list of labels in Asset Panel (right sidebar) horizontal instead of (incorrectly) vertical
- (18) Only show "Billing" settings tab for organization admins
- Use "workspace" instead of "network" icon for project tabs
- Other fixes:
- Fix Asset Panel (right sidebar) not being able to be toggled off if it is temporarily open (when triggered from editing description, or editing secret, or editing datalink)
- Make "cancel" and "reset" buttons default to outline variant, instead of ghost variant
- Fix style of dropdown
- Change Datalink editor dialog so that object keys are above inputs, not beside them. This gives inputs much more horizontal space for children of deeply nested objects.

Issues left to fix:
- Checkboxes currently still cause the dialog to (incorrectly) close
- "Edit description" actions etc. do not properly focus inputs

Issues left to do (out of scope):
- Show username of user currently using a project (possibly as tooltip?) if the project is currently disabled.
- Dropdown and autocomplete entries should be in their own dialog, so that they can escape the parent dialog if they are too long

# Important Notes
None
2024-10-09 09:10:49 +00:00
Adam Obuchowicz
e6b904d012
Integration Tests (#11186)
A stub for integration tests to be run locally; part of #8487

To run tests, you need to:
1. Build IDE package: `./run ide build`
2. set ENSO_TEST_USER and ENSO_TEST_USER_PASSWORD to some working credentials (I used my personal account, but there will be also test user soon)
3. run `corepack pnpm -r --filter enso exec playwright test`

The tests are run with a separate projects directory set up in tmpdir, so any local workspace dir is not affected.

The only test so far just checks if it's possible to log in and create a new project.
2024-09-27 15:11:13 +00:00
Adam Obuchowicz
3941634036
Table Widget: removing columns and rows (#11151)
Fixes: #10758

[Screencast from 2024-09-23 13-19-31.webm](https://github.com/user-attachments/assets/aa28708e-f4c9-400a-966d-1d82abe99f1e)

# Important Notes
To add custom options, I needed to bump AGGrid version. But not the newest one, as it made some bugs I failed to fix.
2024-09-23 14:24:40 +00:00
Paweł Grabarz
c996707027
Add support for touch-based graph navigation and selection (#11056)
Fixes #9493

Tested on windows desktop (standard mouse), macbook touchpad and iphone, which should behave similarily to windows touchscreen devices.
2024-09-20 16:31:45 +00:00
Sergei Garin
b5122348da
MFA (#10875)
* Draft checkbox component

* Fixes in Setup Page

* Invite Users

* Add usergroup setup after subscription

* Fix comments

* Refetch Interval + Feature Toggles

* Fix lint

* Address issues

* Fix Dialog

* Assign users to the user group

* Use transitions to navigate between steps

* Small fixes

* Improve styling for scrollbars

* Fix typescript

* OTP input

* Fix setup logic

* Show Setup dialog only for admins

* Add otp

* OTP input

* 2FA settings section

* Small improvements

* Fixes

* Small fixes

* Remove w-full

* TOTP at login

* Fixes in 2FA

* Fixes in types

* Fix totp

* Merge fixes

* Merge fixes x2

* Merge fixes x2

* Fix types

* Fix types

* Fix cancel button

* Fix reset button

* Fix types

* Fix prettier

* Fix prettier

* Fix lint

* Fix lint

* Fix control

* Address prettier

* Fix MFA mock

* Fix sign in message

* Fix tests

* Address CR

* Fix types
2024-09-13 16:00:31 +03:00
Kaz Wesley
1bcbc00004
Update Vue (#11016)
See: https://blog.vuejs.org/posts/vue-3-5
2024-09-10 13:18:35 -04:00
somebody1234
9ec60299e4
Local Dashboard fixes (#10958)
- Fix most of https://github.com/enso-org/cloud-v2/issues/1459
- Prevent click + click from triggering rename on Windows and Linux. Behavior is preserved on macOS.
- Fix text in Drive when root folder is empty
- Properly remove the "Drop here to upload box" after a file is dropped
- "Copy as path" now unconditionally uses `/` for path delimiters, even on Windows
- Duplicating a project in the root folder on Windows no longer errors
- Extra folders in the sidebar now (correctly) show folder name, rather than path, on Windows
- Mouse pointer when dragging to a folder is now move, not copy

Not addressed:
- [no-repro] Tooltips should have some latency before showing up
- This should already be the case, although it may work weirdly (once the tooltip opens, there is no delay on subsequent tooltips opening until the last tooltip closes.)
- [no-repro] Ctrl-click should add to selection
- Column width should be resizable
- This requires a refactor and therefore is considered out of scope for this PR
- [no-repro] Choosing root folder needs a file browser
- [no-repro] Choosing root folder doesn't do anything get the same list as we had before
- [no-repro] Open in explorer didn't work in a file but did on project - possibly fixed by path changes.
- [no-repro] Opening an enso-project by double clicking resulted on it being renamed with a (2)

Related changes:
- Make "root directory" picker's file browser default to the current root directory

# Important Notes
None
2024-09-08 06:54:41 +00:00
Sergei Garin
3be8770a0a
Setup Screen Improvements (#10844) 2024-09-05 16:11:02 +00:00
somebody1234
848e8699d7
Dashboard UX improvements (#10868)
- Fix dropdown focus issues
- Keyboard navigation to/from dropdowns and between options
- Mouse focus to/from dropdowns (there is no mouse navigation between options)
- Use new inputs in "new secret" modal
- Simplify form types
- Switch activity log date filters to use `DatePicker` which is a wrapper around a `react-aria-components` input
- Update `react-aria-components`
- Prevent Navigator2D from handling event if it has already been `defaultPrevented`
- Switch from `*` imports to `{}` imports for various files
- Switch assets table row headings to use new components

# Important Notes
None
2024-08-29 05:54:21 +00:00
Paweł Grabarz
4d2cc04e17
More robust ydoc server watch (#10817)
Fixed occasional issues with ydoc server starting in dev mode, which were caused by missing dist file, then nodemon failing to trigger a file watch event after esbuild completion. Now esbuild is directly responsible for managing a child process, without needing an additional layer of file watchers.
2024-08-14 13:17:53 +00:00
Adam Obuchowicz
6eece5f8d6
Table Editor Widget (#10774)
Fixes #10293

The Table Editor Widget allows adding rows and columns, editing cells and renaming columns.

[Screencast from 2024-08-07 13-17-37.webm](https://github.com/user-attachments/assets/d2e708b5-6516-4107-bc17-f018e455c111)

# Important Notes
* The parts of Table Visualization which were useful for the widget were put in vue component. On this occasion, we use aggrid vue.
2024-08-12 14:45:58 +00:00
Paweł Grabarz
b286adaae4
Split ydoc server into separate module (#10735)
# Important Notes
The command to run the gui dev environment has been changed. Invoking the old command will print a message about that.
From now on, use `pnpm dev:gui2` in repository root.
2024-08-08 12:12:05 +00:00
Kaz Wesley
3a4b942aae
Help tab (#10771)
Add context sensitive help to right side panel; implements #10582.

https://github.com/user-attachments/assets/0d6bce44-735a-4deb-86c9-72a088ab1d59

# Important Notes
- The rightmost (i.e. current) breadcrumb is no longer clickable.
2024-08-07 14:49:24 +00:00
Hubert Plociniczak
0c55ee50cf
Debug Ydoc/LS interaction without making code changes (#10687)
* Debug Ydoc without making code changes

Previously the log statements were guarded by a constant. Now log
statements are printed if YDOC_DEBUG=true env var is set during launch.

* debug LS RPCs

* bump vite to 5.3.5

* s/YDOC_DEBUG/YDOC_LS_DEBUG

* Address PR comment

* nit

* nit

* fix tests

* yet another linting problem
2024-08-06 19:53:36 +02:00
Sergei Garin
a5922e0844
New Signup flow (#10616) 2024-08-01 09:35:41 +00:00
somebody1234
4b96be8ef8 Edit prettier config (#10648) 2024-07-26 17:47:59 +10:00
Paweł Grabarz
8a3180eb89
Refactor node layout to handle arbitrary widget sizes, add Table.new widget stub (#10599)
Implements #10484, also fixed an issue with dropdown arrow icon being pointed in the wrong direction.

Changed the way we handle spacing around ports and other rounded widgets. Now it is the innermost token element that actually pads itself when appropriate, allowing rounded widgets to stay tightly nested together. This cleans up an issue we've had with an unnecessary padding at the end of node, and makes margins easier to control in general.


<img width="371" alt="image" src="https://github.com/user-attachments/assets/4aa2ae0f-06f6-45fd-b7a1-1b7c0f60d395">
2024-07-25 14:26:29 +00:00
somebody1234
ebf4cd5c1f
Inline modules in app/ide-desktop/ (#10305)
- Remove unnecessary modules
- Remove `ts-plugin-namespace-auto-import` as it was a workaround to use the non-conventional `import *` convention
- Remove `esbuild-plugin-copy-directories` as it is unuse
- Inline modules that are only ever used once
- Inline `project-manager-shim` into `gui2` - it is only used during `gui2`'s dev mode
- Inline `content-config` into `client`
- Flatten `app/ide-desktop/lib/` to `app/ide-desktop/`
- Flatten `app/ide-desktop/lib/dashboard/` to `app/dashboard/`

# Important Notes
- As mentioned above, all remaining modules have been moved up from `app/ide-desktop/lib/` to `app/ide-desktop/`. It's not ideal but I'd rather hold off on moving them anywhere else before we have a consensus on what should go where.
- (That is to say, this may not be the final directory structure - but I figure it's fine to get *something* done so that hopefully the rest of the restructuring is simpler.)
2024-07-17 09:10:42 +00:00
somebody1234
cf9d757457
Even more dashboard fixes (#10541)
- Fix https://github.com/enso-org/cloud-v2/issues/1383
- Fix file download - both on Electron, and in browser
- Refresh versions list when uploading neww file version
- Fix app crashing when asset is opened in asset panel while switching to Local Backend
- Don't show asset id when asset is opened in asset panel, but user is on the Local backend, resulting in the internal Asset ID being shown
- Fix drag-n-drop
- ⚠️ `npm run dev` is NOT fixed in this PR - however it should already be fixed in another PR which has already been merged. This needs testing to confirm whether it is fixed though.

Other changes:
- Add support for "duplicate project" endpoint on Local Backend
- Fix downloading project from nested directory on Local Backend (not working)
- Refactor more E2E tests to use the "new" architecture
- Simplify "new" E2E architecture to minimize boilerplate

# Important Notes
- When testing downloads, both Electron and browser should be tested as they use completely separate implementations for how files are downloaded.
2024-07-16 09:55:45 +00:00
Kaz Wesley
11d2a44792
Cloud file browser (#10513)
https://github.com/user-attachments/assets/54cc375d-2a77-431c-af85-75fc872e2bcc

Closes #10167.
2024-07-15 15:22:51 +00:00
somebody1234
151438157e
Optimize assets table (#10522)
- Fix https://github.com/enso-org/cloud-v2/issues/1379
- Stop re-rendering the entire `AssetsTable` on every `AssetEvent`
- This is achieved by using `zustand` for fine-grained reactivity.

Other misc fixes:
- Fix "unique key prop" error in sidebar
- Vertically center asset panel toggle icon in top bar
- Limit width of asset names (show tooltip when asset name is too wide)

# Important Notes
None
2024-07-15 10:06:15 +00:00
somebody1234
b55086de75
More dashboard fixes (#10494)
- Fix context menu floating some distance away from the right side when clicking near right edge
- Add a line beside nested categories to make it clearer that it's not a UI glitch
- Fix watch mode for electron app

# Important Notes
None
2024-07-10 09:04:20 +00:00
Kaz Wesley
bc92035683
Share tanstack QueryClient between dashboard and IDE (#10431)
* Share tanstack QueryClient between dashboard and IDE

Part of #10400.

* Lint

* Review: Use enso-common

* Remove outdated README

* Naming

* Fix

* Lint

* enso-common CODEOWNERS: GUI+Dashboard

* Review: Prepare for GUI to be run from cloud entry point

* Lint

* Lint

* Fix e2e tests

* Fix e2e tests in CI?

* Clean CI build

* Revert "Clean CI build"

This reverts commit 73f2fb7972.

* Fix redundant dependency

* Work around a vue-query bug

* Lint

* fmt
2024-07-09 11:01:10 -04:00
Paweł Grabarz
d9972d547a
Migrate to pnpm (#10422)
Fixes #10197

# Important Notes
From now on, package installation will be using `pnpm install`. Installing it globally is fine for convenience, but it can also be used as `corepack pnpm install` without having to install anything other than node. For now, all other scripts are still invoked using `npm`, so we can still invoke them with usual `--workspace` setting. As far as I can tell that doesn't really have any other side effects and is identical as running the script through `pnpm run` in respective workspace project subdirectory.
2024-07-05 11:13:04 +00:00