From 58512e701e7acba9dd83bfc056913b767ad939c1 Mon Sep 17 00:00:00 2001 From: Sergei Garin Date: Fri, 15 Nov 2024 15:12:55 +0300 Subject: [PATCH] Show docs on Dashboard (#11391) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://github.com/enso-org/cloud-v2/issues/1445 PR is more or less ready for feedback,CR, and QA. # Read before looking into: **Known issues:** - [x] Need to adjust timings for the animations (they're a bit out of sync). - [x] After the latest rebase, the side panel might expand while clicking on the sidebar toggle. - [ ] Images no longer display. 🤦 - [x] Need to restore the functionality around spotlighting a component Demo: https://github.com/user-attachments/assets/8cec9ec0-4753-482e-8637-f3857b4396a5 --- .prettierignore | 7 +- app/common/src/services/Backend.ts | 62 ++- app/common/src/text/english.json | 37 +- app/common/src/text/index.ts | 4 +- app/gui/.gitignore | 1 + .../e2e/dashboard/actions/DrivePageActions.ts | 57 +- .../e2e/dashboard/actions/LoginPageActions.ts | 5 +- app/gui/e2e/dashboard/actions/index.ts | 126 +++-- app/gui/e2e/dashboard/api.ts | 107 ++-- app/gui/e2e/dashboard/assetPanel.spec.ts | 18 +- app/gui/e2e/dashboard/auth.setup.ts | 29 + .../e2e/dashboard/authPreserveEmail.spec.ts | 3 + app/gui/e2e/dashboard/labels.spec.ts | 53 +- app/gui/e2e/dashboard/labelsPanel.spec.ts | 5 +- app/gui/e2e/dashboard/loginLogout.spec.ts | 4 +- app/gui/e2e/dashboard/loginScreen.spec.ts | 6 +- app/gui/e2e/dashboard/membersSettings.spec.ts | 38 -- app/gui/e2e/dashboard/setup.spec.ts | 3 + app/gui/e2e/dashboard/signUp.spec.ts | 3 + app/gui/env.d.ts | 7 + app/gui/index.html | 2 +- app/gui/package.json | 7 +- app/gui/playwright.config.ts | 47 +- app/gui/src/dashboard/App.tsx | 82 +-- app/gui/src/dashboard/assets/file_text.svg | 3 + app/gui/src/dashboard/assets/group.svg | 3 + app/gui/src/dashboard/assets/inspect.svg | 3 + app/gui/src/dashboard/assets/pen.svg | 12 +- app/gui/src/dashboard/assets/versions.svg | 3 + .../components/AnimatedBackground.tsx | 122 ++++- .../AriaComponents/Button/Button.tsx | 6 +- .../AriaComponents/Dialog/Dialog.tsx | 4 +- .../AriaComponents/Dialog/Popover.tsx | 40 +- .../components/AriaComponents/Form/Form.tsx | 8 +- .../Form/components/FieldValue.tsx | 31 ++ .../AriaComponents/Form/components/index.ts | 1 + .../components/AriaComponents/Form/types.ts | 2 - .../AriaComponents/Text/useVisualTooltip.tsx | 1 + .../components/Devtools/EnsoDevtools.tsx | 18 +- .../Devtools/EnsoDevtoolsProvider.tsx | 26 +- .../dashboard/components/ErrorBoundary.tsx | 7 +- app/gui/src/dashboard/components/Loader.tsx | 6 +- .../MarkdownViewer/MarkdownViewer.tsx | 81 +++ .../components/MarkdownViewer/index.ts | 6 + .../src/dashboard/components/MenuEntry.tsx | 32 +- app/gui/src/dashboard/components/Result.tsx | 2 + app/gui/src/dashboard/components/Spinner.tsx | 36 +- .../dashboard/components/StatelessSpinner.tsx | 32 +- .../components/dashboard/AssetRow.tsx | 249 ++++++--- .../components/dashboard/ProjectIcon.tsx | 99 ++-- .../dashboard/ProjectNameColumn.tsx | 21 +- .../dashboard/components/dashboard/column.ts | 9 +- .../dashboard/column/SharedWithColumn.tsx | 9 +- .../AccessedByProjectsColumnHeading.tsx | 12 +- .../AccessedDataColumnHeading.tsx | 12 +- .../columnHeading/DocsColumnHeading.tsx | 12 +- .../columnHeading/LabelsColumnHeading.tsx | 13 +- .../columnHeading/ModifiedColumnHeading.tsx | 50 +- .../columnHeading/NameColumnHeading.tsx | 39 +- .../columnHeading/SharedWithColumnHeading.tsx | 15 +- .../src/dashboard/events/assetListEvent.ts | 2 +- app/gui/src/dashboard/hooks/backendHooks.ts | 101 +++- .../dashboard/hooks/debounceCallbackHooks.ts | 96 ++-- .../src/dashboard/hooks/debounceStateHooks.ts | 9 +- app/gui/src/dashboard/hooks/measureHooks.ts | 259 +++++++++ app/gui/src/dashboard/hooks/projectHooks.ts | 56 +- .../src/dashboard/hooks/spotlightHooks.tsx | 89 +-- app/gui/src/dashboard/index.tsx | 3 + .../dashboard/layouts/AssetContextMenu.tsx | 16 +- .../layouts/AssetDiffView/AssetDiffView.tsx | 85 ++- .../AssetDiffView/useFetchVersionContent.ts | 38 +- .../dashboard/layouts/AssetDocs/AssetDocs.tsx | 69 +++ .../src/dashboard/layouts/AssetDocs/index.ts | 6 + app/gui/src/dashboard/layouts/AssetPanel.tsx | 182 ------- .../layouts/AssetPanel/AssetPanel.tsx | 267 +++++++++ .../AssetPanel/components/AssetPanelTabs.tsx | 150 +++++ .../components/AssetPanelToggle.tsx | 80 +++ .../src/dashboard/layouts/AssetPanel/index.ts | 6 + .../dashboard/layouts/AssetProjectSession.tsx | 22 +- .../layouts/AssetProjectSessions.tsx | 71 ++- .../src/dashboard/layouts/AssetProperties.tsx | 106 ++-- .../src/dashboard/layouts/AssetSearchBar.tsx | 511 +++++++++++------- .../layouts/AssetVersions/AssetVersions.tsx | 80 ++- .../layouts/AssetVersions/useAssetVersions.ts | 39 +- app/gui/src/dashboard/layouts/AssetsTable.tsx | 144 ++--- app/gui/src/dashboard/layouts/Drive.tsx | 7 +- app/gui/src/dashboard/layouts/DriveBar.tsx | 80 ++- app/gui/src/dashboard/layouts/Editor.tsx | 75 +-- app/gui/src/dashboard/layouts/Labels.tsx | 8 +- .../Settings/ActivityLogSettingsSection.tsx | 4 +- .../layouts/Settings/SetupTwoFaForm.tsx | 26 +- .../Settings/UserGroupsSettingsSection.tsx | 12 +- app/gui/src/dashboard/layouts/TabBar.tsx | 333 +++++------- app/gui/src/dashboard/layouts/UserBar.tsx | 8 - app/gui/src/dashboard/layouts/UserMenu.tsx | 120 ++-- .../modals/ManagePermissionsModal.tsx | 9 +- .../src/dashboard/modals/NewLabelModal.tsx | 2 +- .../src/dashboard/modals/ProjectLogsModal.tsx | 5 +- .../authentication/AuthenticationPage.tsx | 22 +- .../pages/authentication/LoadingScreen.tsx | 20 +- .../dashboard/pages/authentication/Login.tsx | 32 +- .../dashboard/pages/dashboard/Dashboard.tsx | 143 +---- .../pages/dashboard/DashboardTabBar.tsx | 102 ++++ .../pages/dashboard/DashboardTabPanels.tsx | 104 ++++ .../src/dashboard/providers/AuthProvider.tsx | 31 +- .../dashboard/providers/BackendProvider.tsx | 21 + .../src/dashboard/providers/DriveProvider.tsx | 194 ++++++- .../providers/LocalStorageProvider.tsx | 52 +- .../dashboard/providers/ProjectsProvider.tsx | 256 ++++----- .../src/dashboard/providers/TextProvider.tsx | 9 +- .../src/dashboard/services/LocalBackend.ts | 24 +- .../src/dashboard/services/ProjectManager.ts | 54 +- .../src/dashboard/services/RemoteBackend.ts | 32 +- .../dashboard/services/remoteBackendPaths.ts | 11 +- app/gui/src/dashboard/tailwind.css | 18 +- .../src/dashboard/utilities/AssetTreeNode.ts | 19 +- app/ide-desktop/client/esbuildConfig.ts | 8 - app/ide-desktop/client/package.json | 10 +- app/ide-desktop/client/src/index.ts | 7 + app/ide-desktop/client/src/projectManager.ts | 18 + app/ide-desktop/client/watch.ts | 106 ++-- pnpm-lock.yaml | 135 +---- 122 files changed, 3999 insertions(+), 2343 deletions(-) create mode 100644 app/gui/e2e/dashboard/auth.setup.ts delete mode 100644 app/gui/e2e/dashboard/membersSettings.spec.ts create mode 100644 app/gui/src/dashboard/assets/file_text.svg create mode 100644 app/gui/src/dashboard/assets/group.svg create mode 100644 app/gui/src/dashboard/assets/inspect.svg create mode 100644 app/gui/src/dashboard/assets/versions.svg create mode 100644 app/gui/src/dashboard/components/AriaComponents/Form/components/FieldValue.tsx create mode 100644 app/gui/src/dashboard/components/MarkdownViewer/MarkdownViewer.tsx create mode 100644 app/gui/src/dashboard/components/MarkdownViewer/index.ts create mode 100644 app/gui/src/dashboard/hooks/measureHooks.ts create mode 100644 app/gui/src/dashboard/layouts/AssetDocs/AssetDocs.tsx create mode 100644 app/gui/src/dashboard/layouts/AssetDocs/index.ts delete mode 100644 app/gui/src/dashboard/layouts/AssetPanel.tsx create mode 100644 app/gui/src/dashboard/layouts/AssetPanel/AssetPanel.tsx create mode 100644 app/gui/src/dashboard/layouts/AssetPanel/components/AssetPanelTabs.tsx create mode 100644 app/gui/src/dashboard/layouts/AssetPanel/components/AssetPanelToggle.tsx create mode 100644 app/gui/src/dashboard/layouts/AssetPanel/index.ts create mode 100644 app/gui/src/dashboard/pages/dashboard/DashboardTabBar.tsx create mode 100644 app/gui/src/dashboard/pages/dashboard/DashboardTabPanels.tsx diff --git a/.prettierignore b/.prettierignore index ecdac9bcb1..04a47d3184 100644 --- a/.prettierignore +++ b/.prettierignore @@ -35,9 +35,10 @@ pnpm-lock.yaml # Generated files app/ide-desktop/lib/client/electron-builder-config.json app/ide-desktop/lib/content-config/src/config.json -app/ide-desktop/lib/dashboard/playwright-report/ -app/ide-desktop/lib/dashboard/playwright/.cache/ -app/ide-desktop/lib/dashboard/dist/ +app/gui/playwright-report/ +app/gui/playwright/.auth/ + +app/gui/dist/ app/gui/view/documentation/assets/stylesheet.css app/rust-ffi/pkg app/gui/src/project-view/assets/font-*.css diff --git a/app/common/src/services/Backend.ts b/app/common/src/services/Backend.ts index afd40fdbb4..423c7edc4a 100644 --- a/app/common/src/services/Backend.ts +++ b/app/common/src/services/Backend.ts @@ -709,6 +709,12 @@ export function findLeastUsedColor(labels: Iterable