Просмотр исходного кода

Merge branch 'master' into feat/display-plugin-cards-dynamically

jam411 3 лет назад
Родитель
Сommit
7615104787
100 измененных файлов с 1411 добавлено и 1465 удалено
  1. 0 0
      .github/dependabot.yml.org
  2. 2 2
      .github/workflows/release-rc.yml
  3. 2 2
      .github/workflows/release-slackbot-proxy.yml
  4. 9 8
      .github/workflows/release.yml
  5. 1 1
      lerna.json
  6. 1 1
      package.json
  7. 1 1
      packages/app/cypress.config.ts
  8. 15 28
      packages/app/package.json
  9. 1 1
      packages/app/public/static/locales/en_US/translation.json
  10. 1 1
      packages/app/public/static/locales/ja_JP/translation.json
  11. 1 1
      packages/app/public/static/locales/zh_CN/translation.json
  12. 32 0
      packages/app/src/client/services/layout.ts
  13. 3 2
      packages/app/src/components/Admin/App/SiteUrlSetting.tsx
  14. 1 1
      packages/app/src/components/Admin/Customize/CustomizeCssSetting.tsx
  15. 1 1
      packages/app/src/components/Admin/Customize/CustomizeNoscriptSetting.tsx
  16. 1 1
      packages/app/src/components/Admin/Customize/CustomizeScriptSetting.tsx
  17. 2 1
      packages/app/src/components/Common/Dropdown/PageItemControl.tsx
  18. 1 1
      packages/app/src/components/DescendantsPageListModal.module.scss
  19. 2 2
      packages/app/src/components/DescendantsPageListModal.tsx
  20. 5 6
      packages/app/src/components/Layout/AdminLayout.tsx
  21. 14 11
      packages/app/src/components/Layout/BasicLayout.tsx
  22. 2 3
      packages/app/src/components/Layout/NoLoginLayout.tsx
  23. 1 3
      packages/app/src/components/Layout/RawLayout.tsx
  24. 2 11
      packages/app/src/components/Layout/SearchResultLayout.tsx
  25. 4 9
      packages/app/src/components/Layout/ShareLinkLayout.tsx
  26. 8 2
      packages/app/src/components/Navbar/AppearanceModeDropdown.tsx
  27. 1 1
      packages/app/src/components/Navbar/GrowiNavbar.tsx
  28. 2 2
      packages/app/src/components/PageEditor/Editor.tsx
  29. 20 33
      packages/app/src/components/PageEditor/LinkEditModal.jsx
  30. 3 1
      packages/app/src/components/PageStatusAlert.tsx
  31. 14 11
      packages/app/src/components/Sidebar.tsx
  32. 1 1
      packages/app/src/components/Sidebar/CustomSidebar.tsx
  33. 1 1
      packages/app/src/components/Sidebar/PageTree/PrivateLegacyPagesLink.tsx
  34. 1 1
      packages/app/src/components/Sidebar/RecentChanges.module.scss
  35. 4 4
      packages/app/src/components/Sidebar/SidebarContents.tsx
  36. 23 24
      packages/app/src/components/Sidebar/Skeleton/SidebarSkeleton.tsx
  37. 4 1
      packages/app/src/components/Sidebar/Skeleton/TagContentSkeleton.tsx
  38. 0 5
      packages/app/src/components/Sidebar/Tag.module.scss
  39. 2 3
      packages/app/src/components/StickyStretchableScroller.tsx
  40. 2 2
      packages/app/src/components/TableOfContents.tsx
  41. 77 82
      packages/app/src/pages/[[...path]].page.tsx
  42. 13 3
      packages/app/src/pages/_app.page.tsx
  43. 8 6
      packages/app/src/pages/_private-legacy-pages.page.tsx
  44. 17 17
      packages/app/src/pages/_search.page.tsx
  45. 7 1
      packages/app/src/pages/admin/[...path].page.tsx
  46. 8 3
      packages/app/src/pages/admin/app.page.tsx
  47. 7 2
      packages/app/src/pages/admin/audit-log.page.tsx
  48. 8 3
      packages/app/src/pages/admin/customize.page.tsx
  49. 8 3
      packages/app/src/pages/admin/export.page.tsx
  50. 7 3
      packages/app/src/pages/admin/global-notification/[globalNotificationId].page.tsx
  51. 6 2
      packages/app/src/pages/admin/global-notification/new.page.tsx
  52. 8 3
      packages/app/src/pages/admin/importer.page.tsx
  53. 6 2
      packages/app/src/pages/admin/index.page.tsx
  54. 9 3
      packages/app/src/pages/admin/markdown.page.tsx
  55. 8 3
      packages/app/src/pages/admin/notification.page.tsx
  56. 6 2
      packages/app/src/pages/admin/plugins.page.tsx
  57. 7 2
      packages/app/src/pages/admin/search.page.tsx
  58. 8 4
      packages/app/src/pages/admin/security.page.tsx
  59. 7 2
      packages/app/src/pages/admin/slack-integration-legacy.page.tsx
  60. 8 3
      packages/app/src/pages/admin/slack-integration.page.tsx
  61. 7 3
      packages/app/src/pages/admin/user-group-detail/[userGroupId].page.tsx
  62. 7 2
      packages/app/src/pages/admin/user-groups.page.tsx
  63. 6 2
      packages/app/src/pages/admin/users/external-accounts.page.tsx
  64. 7 2
      packages/app/src/pages/admin/users/index.page.tsx
  65. 7 2
      packages/app/src/pages/installer.page.tsx
  66. 7 2
      packages/app/src/pages/invited.page.tsx
  67. 7 2
      packages/app/src/pages/login.page.tsx
  68. 17 6
      packages/app/src/pages/me/[[...path]].page.tsx
  69. 94 79
      packages/app/src/pages/share/[[...path]].page.tsx
  70. 15 5
      packages/app/src/pages/tags.page.tsx
  71. 25 6
      packages/app/src/pages/trash.page.tsx
  72. 9 2
      packages/app/src/pages/user-activation.page.tsx
  73. 2 2
      packages/app/src/pages/utils/commons.ts
  74. 10 1
      packages/app/src/stores/middlewares/sync-to-storage.ts
  75. 14 8
      packages/app/src/stores/ui.tsx
  76. 24 18
      packages/app/src/stores/websocket.tsx
  77. 2 2
      packages/app/src/styles/_layout.scss
  78. 3 0
      packages/app/src/styles/style-app.scss
  79. 11 8
      packages/app/test/cypress/integration/10-install/10-install--install.spec.ts
  80. 1 1
      packages/app/test/cypress/integration/20-basic-features/20-basic-features--access-to-page.spec.ts
  81. 35 72
      packages/app/test/cypress/integration/20-basic-features/20-basic-features--access-to-pagelist.spec.ts
  82. 11 5
      packages/app/test/cypress/integration/20-basic-features/20-basic-features--click-page-icons.spec.ts
  83. 119 257
      packages/app/test/cypress/integration/20-basic-features/20-basic-features--use-tools.spec.ts
  84. 2 2
      packages/app/test/cypress/integration/21-basic-features-for-guest/21-basic-features-for-guest--access-to-page.spec.ts
  85. 204 110
      packages/app/test/cypress/integration/30-search/30-search--search.spec.ts
  86. 145 58
      packages/app/test/cypress/integration/50-sidebar/50-sidebar--access-to-side-bar.spec.ts
  87. 2 1
      packages/app/test/cypress/integration/50-sidebar/50-sidebar--switching-sidebar-mode.spec.ts
  88. 1 1
      packages/app/test/cypress/integration/60-home/60-home--home.spec.ts
  89. 20 19
      packages/app/test/cypress/support/commands.ts
  90. 1 1
      packages/codemirror-textlint/package.json
  91. 1 1
      packages/core/package.json
  92. 1 1
      packages/hackmd/package.json
  93. 4 2
      packages/preset-themes/package.json
  94. 1 1
      packages/remark-drawio/package.json
  95. 1 1
      packages/remark-growi-directive/package.json
  96. 4 4
      packages/remark-lsx/package.json
  97. 1 1
      packages/slack/package.json
  98. 2 2
      packages/slackbot-proxy/package.json
  99. 2 2
      packages/ui/package.json
  100. 155 432
      yarn.lock

+ 0 - 0
.github/dependabot.yml → .github/dependabot.yml.org


+ 2 - 2
.github/workflows/release-rc.yml

@@ -34,14 +34,14 @@ jobs:
         echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
 
     - name: Login to GitHub Container Registry
-      uses: docker/login-action@v1
+      uses: docker/login-action@v2
       with:
         registry: ghcr.io
         username: wsmoogle
         password: ${{ secrets.DOCKER_REGISTRY_ON_GITHUB_PASSWORD }}
 
     - name: Set up Docker Buildx
-      uses: docker/setup-buildx-action@v1
+      uses: docker/setup-buildx-action@v2
 
     - name: Build and push
       uses: docker/build-push-action@v2

+ 2 - 2
.github/workflows/release-slackbot-proxy.yml

@@ -36,7 +36,7 @@ jobs:
         echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
 
     - name: Login to GitHub Container Registry
-      uses: docker/login-action@v1
+      uses: docker/login-action@v2
       with:
         registry: ghcr.io
         username: wsmoogle
@@ -55,7 +55,7 @@ jobs:
         gcloud auth configure-docker --quiet
 
     - name: Set up Docker Buildx
-      uses: docker/setup-buildx-action@v1
+      uses: docker/setup-buildx-action@v2
 
     - name: Build and push
       uses: docker/build-push-action@v2

+ 9 - 8
.github/workflows/release.yml

@@ -144,7 +144,7 @@ jobs:
 
     - name: Docker meta
       id: meta
-      uses: docker/metadata-action@v3
+      uses: docker/metadata-action@v4
       with:
         images: weseek/growi,ghcr.io/weseek/growi
         flavor: |
@@ -155,22 +155,24 @@ jobs:
           type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}.{{minor}}
           type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}.{{minor}}.{{patch}}
 
-    - name: Login to docker.io registry
-      run: |
-        echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
+    - name: Login to Docker Hub
+      uses: docker/login-action@v2
+      with:
+        username: wsmoogle
+        password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
 
     - name: Login to GitHub Container Registry
-      uses: docker/login-action@v1
+      uses: docker/login-action@v2
       with:
         registry: ghcr.io
         username: wsmoogle
         password: ${{ secrets.DOCKER_REGISTRY_ON_GITHUB_PASSWORD }}
 
     - name: Set up Docker Buildx
-      uses: docker/setup-buildx-action@v1
+      uses: docker/setup-buildx-action@v2
 
     - name: Build and push
-      uses: docker/build-push-action@v2
+      uses: docker/build-push-action@v3
       with:
         context: .
         file: ./packages/app/docker/Dockerfile
@@ -202,4 +204,3 @@ jobs:
       run: |
         STATUS=`git status --porcelain`
         if [ -z "$STATUS" ]; then exit 0; else exit 1; fi
-

+ 1 - 1
lerna.json

@@ -1,7 +1,7 @@
 {
   "npmClient": "yarn",
   "useWorkspaces": true,
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "packages": [
     "packages/*"
   ]

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "growi",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "description": "Team collaboration software using markdown",
   "tags": [
     "wiki",

+ 1 - 1
packages/app/cypress.config.ts

@@ -16,7 +16,7 @@ export default defineConfig({
         return launchOptions;
       });
     },
-    defaultCommandTimeout: 10000,
+    defaultCommandTimeout: 7000,
   },
   fileServerFolder: 'test/cypress',
   fixturesFolder: 'test/cypress/fixtures',

+ 15 - 28
packages/app/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/app",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "license": "MIT",
   "scripts": {
     "//// for production": "",
@@ -53,6 +53,7 @@
   "// comments for dependencies": {
     "openid-client": "Node.js 12 or higher is required for openid-client@3 and above.",
     "escape-string-regexp": "5.0.0 or above exports only ESM",
+    "next": "/Sandbox rendering is crashed with v12.3 or above ",
     "string-width": "5.0.0 or above exports only ESM."
   },
   "dependencies": {
@@ -64,24 +65,22 @@
     "@elastic/elasticsearch7": "npm:@elastic/elasticsearch@^7.17.0",
     "@godaddy/terminus": "^4.9.0",
     "@google-cloud/storage": "^5.8.5",
-    "@growi/codemirror-textlint": "^6.0.0-RC.9",
-    "@growi/core": "^6.0.0-RC.9",
-    "@growi/hackmd": "^6.0.0-RC.9",
-    "@growi/preset-themes": "^6.0.0-RC.9",
-    "@growi/remark-drawio": "^6.0.0-RC.9",
-    "@growi/remark-growi-directive": "^6.0.0-RC.9",
-    "@growi/remark-lsx": "^6.0.0-RC.9",
-    "@growi/slack": "^6.0.0-RC.9",
+    "@growi/codemirror-textlint": "^6.0.0-RC.13",
+    "@growi/core": "^6.0.0-RC.13",
+    "@growi/hackmd": "^6.0.0-RC.13",
+    "@growi/preset-themes": "^6.0.0-RC.13",
+    "@growi/remark-drawio": "^6.0.0-RC.13",
+    "@growi/remark-growi-directive": "^6.0.0-RC.13",
+    "@growi/remark-lsx": "^6.0.0-RC.13",
+    "@growi/slack": "^6.0.0-RC.13",
     "@promster/express": "^7.0.2",
     "@promster/server": "^7.0.4",
-    "@slack/events-api": "^3.0.0",
     "@slack/web-api": "^6.2.4",
     "@slack/webhook": "^6.0.0",
     "JSONStream": "^1.3.5",
     "archiver": "^5.3.0",
     "array.prototype.flatmap": "^1.2.2",
     "async-canvas-to-blob": "^1.0.3",
-    "aws-sdk": "^2.1044.0",
     "axios": "^0.24.0",
     "axios-retry": "^3.2.4",
     "body-parser": "^1.18.2",
@@ -134,7 +133,7 @@
     "mongoose-unique-validator": "^2.0.3",
     "multer": "~1.4.0",
     "multer-autoreap": "^1.0.3",
-    "next": "^12.2.5",
+    "next": "~12.2",
     "next-i18next": "^12.1.0",
     "next-superjson": "^0.0.4",
     "next-themes": "^0.2.0",
@@ -150,8 +149,6 @@
     "passport-local": "^1.0.0",
     "passport-saml": "^3.2.0",
     "passport-twitter": "^1.0.4",
-    "prism-themes": "^1.9.0",
-    "prom-client": "^13.0.0",
     "rate-limiter-flexible": "^2.3.7",
     "react": "^18.2.0",
     "react-bootstrap-typeahead": "^5.2.2",
@@ -168,7 +165,7 @@
     "react-syntax-highlighter": "^15.5.0",
     "react-toastify": "^9.1.1",
     "react-use-ripple": "^1.5.2",
-    "reactstrap": "^8.9.0",
+    "reactstrap": "^8.10.1",
     "reconnecting-websocket": "^4.4.0",
     "redis": "^3.0.2",
     "rehype-katex": "^6.0.2",
@@ -181,10 +178,7 @@
     "remark-gfm": "^3.0.1",
     "remark-math": "^5.1.1",
     "remark-wiki-link": "^1.0.4",
-    "rimraf": "^3.0.0",
-    "simplebar-react": "^2.3.6",
     "socket.io": "^4.2.0",
-    "sticky-events": "^3.4.11",
     "stream-to-promise": "^3.0.0",
     "string-width": "=4.2.2",
     "superjson": "^1.9.1",
@@ -208,23 +202,16 @@
     "handsontable": "v7.0.0 or above is no loger MIT lisence."
   },
   "devDependencies": {
-    "@growi/ui": "^6.0.0-RC.9",
+    "@growi/ui": "^6.0.0-RC.13",
     "@handsontable/react": "=2.1.0",
     "@icon/themify-icons": "1.0.1-alpha.3",
     "@next/bundle-analyzer": "^12.2.3",
-    "@types/compression": "^1.7.0",
     "@types/express": "^4.17.11",
-    "@types/jquery": "^3.5.8",
-    "@types/multer": "^1.4.5",
     "@types/react-scroll": "^1.8.4",
     "autoprefixer": "^9.0.0",
     "babel-loader": "^8.2.5",
     "bootstrap": "^4.6.1",
-    "browser-sync": "^2.27.7",
-    "bunyan-debug": "^2.0.0",
-    "cli": "~1.0.1",
     "codemirror": "^5.64.0",
-    "colors": "=1.4.0",
     "connect-browser-sync": "^2.1.0",
     "core-js": "=2.6.9",
     "diff2html": "^3.1.2",
@@ -242,23 +229,23 @@
     "material-icons": "^1.11.3",
     "morgan": "^1.10.0",
     "next-transpile-modules": "^9.0.0",
-    "normalize-path": "^3.0.0",
     "penpal": "^4.0.0",
     "plantuml-encoder": "^1.2.5",
     "prettier": "^1.19.1",
     "react-codemirror2": "^6.0.0",
     "react-copy-to-clipboard": "^5.0.1",
     "react-dropzone": "^11.2.4",
-    "react-frame-component": "^4.0.0",
     "react-hotkeys": "^2.0.0",
     "react-waypoint": "^10.1.0",
     "rehype-rewrite": "^3.0.6",
     "replacestream": "^4.0.3",
     "reveal.js": "^4.3.1",
     "sass": "^1.53.0",
+    "simplebar-react": "^2.3.6",
     "simple-line-icons": "^2.5.5",
     "simple-load-script": "^1.0.2",
     "socket.io-client": "^4.2.0",
+    "sticky-events": "^3.4.11",
     "swagger2openapi": "^5.3.1",
     "ts-node-dev": "^2.0.0",
     "tsc-alias": "^1.2.9"

+ 1 - 1
packages/app/public/static/locales/en_US/translation.json

@@ -570,6 +570,7 @@
     }
   },
   "private_legacy_pages": {
+    "title": "Private Legacy Pages",
     "bulk_operation": "Bulk operation",
     "convert_all_selected_pages": "Convert all to new v5 compatible format",
     "input_path_to_convert": "Input a path to convert pages",
@@ -731,7 +732,6 @@
     "logout": "Logout"
   },
   "pagetree": {
-    "private_legacy_pages": "Private Legacy Pages",
     "cannot_rename_a_title_that_contains_slash": "Cannot rename a title that contains '/'",
     "you_cannot_move_this_page_now": "You cannot move this page now",
     "something_went_wrong_with_moving_page": "Something went wrong with moving page"

+ 1 - 1
packages/app/public/static/locales/ja_JP/translation.json

@@ -569,6 +569,7 @@
     }
   },
   "private_legacy_pages": {
+    "title": "旧形式のプライベートページ",
     "bulk_operation": "一括操作",
     "convert_all_selected_pages": "新しい v5 互換形式に一括変換",
     "input_path_to_convert": "パスを入力して変換",
@@ -730,7 +731,6 @@
     "logout": "ログアウト"
   },
   "pagetree": {
-    "private_legacy_pages": "旧形式のプライベートページ",
     "cannot_rename_a_title_that_contains_slash": "`/` が含まれているタイトルにリネームできません",
     "you_cannot_move_this_page_now": "現在、このページを移動することはできません",
     "something_went_wrong_with_moving_page": "ページの移動に問題が発生しました"

+ 1 - 1
packages/app/public/static/locales/zh_CN/translation.json

@@ -574,6 +574,7 @@
     }
 	},
   "private_legacy_pages": {
+    "title": "私人遗留页面",
     "bulk_operation": "批量操作",
     "convert_all_selected_pages": "全部转换为新的v5兼容格式",
 		"input_path_to_convert": "输入一个转换页面的路径",
@@ -735,7 +736,6 @@
     "logout": "登出"
   },
   "pagetree": {
-    "private_legacy_pages": "私人遗留页面",
     "cannot_rename_a_title_that_contains_slash": "不能重命名包含 ’/' 的标题",
     "you_cannot_move_this_page_now": "你现在不能移动这个页面",
     "something_went_wrong_with_moving_page": "移动页面时出了问题"

+ 32 - 0
packages/app/src/client/services/layout.ts

@@ -0,0 +1,32 @@
+import { useIsContainerFluid, useShareLinkId } from '~/stores/context';
+import { useSWRxCurrentPage } from '~/stores/page';
+import { useEditorMode } from '~/stores/ui';
+
+export const useEditorModeClassName = (): string => {
+  const { getClassNamesByEditorMode } = useEditorMode();
+
+  // TODO: Enable `editing-sidebar` class somehow
+  // https://redmine.weseek.co.jp/issues/111527
+  // const classNames: string[] = [];
+  // if (currentPage != null) {
+  //   const isSidebar = currentPage.path === '/Sidebar';
+  //   classNames.push(...getClassNamesByEditorMode(/* isSidebar */));
+  // }
+
+  return `${getClassNamesByEditorMode().join(' ') ?? ''}`;
+};
+
+export const useCurrentGrowiLayoutFluidClassName = (): string => {
+  const { data: shareLinkId } = useShareLinkId();
+  const { data: currentPage } = useSWRxCurrentPage(shareLinkId ?? undefined);
+
+  const { data: dataIsContainerFluid } = useIsContainerFluid();
+
+  const isContainerFluidEachPage = currentPage == null || !('expandContentWidth' in currentPage)
+    ? null
+    : currentPage.expandContentWidth;
+  const isContainerFluidDefault = dataIsContainerFluid;
+  const isContainerFluid = isContainerFluidEachPage ?? isContainerFluidDefault;
+
+  return isContainerFluid ? 'growi-layout-fluid' : '';
+};

+ 3 - 2
packages/app/src/components/Admin/App/SiteUrlSetting.tsx

@@ -18,19 +18,20 @@ type Props = {
 
 const SiteUrlSetting = (props: Props) => {
   const { t } = useTranslation('admin', { keyPrefix: 'app_setting' });
+  const { t: tCommon } = useTranslation('commons');
   const { adminAppContainer } = props;
 
 
   const submitHandler = useCallback(async() => {
     try {
       await adminAppContainer.updateSiteUrlSettingHandler();
-      toastSuccess(t('toaster.update_successed', { target: t('site_url.title') }));
+      toastSuccess(tCommon('toaster.update_successed', { target: t('site_url.title') }));
     }
     catch (err) {
       toastError(err);
       logger.error(err);
     }
-  }, [adminAppContainer, t]);
+  }, [adminAppContainer, t, tCommon]);
 
   return (
     <React.Fragment>

+ 1 - 1
packages/app/src/components/Admin/Customize/CustomizeCssSetting.tsx

@@ -46,7 +46,7 @@ const CustomizeCssSetting = (props: Props): JSX.Element => {
               className="form-control"
               name="customizeCss"
               rows={8}
-              value={adminCustomizeContainer.state.currentCustomizeCss || ''}
+              defaultValue={adminCustomizeContainer.state.currentCustomizeCss || ''}
               onChange={(e) => { adminCustomizeContainer.changeCustomizeCss(e.target.value) }}
             />
             {/* disabled in v6.0.0 temporarily -- 2022.12.19 Yuki Takei

+ 1 - 1
packages/app/src/components/Admin/Customize/CustomizeNoscriptSetting.tsx

@@ -50,7 +50,7 @@ const CustomizeNoscriptSetting = (props: Props): JSX.Element => {
               className="form-control"
               name="customizeNoscript"
               rows={8}
-              value={adminCustomizeContainer.state.currentCustomizeNoscript || ''}
+              defaultValue={adminCustomizeContainer.state.currentCustomizeNoscript || ''}
               onChange={(e) => { adminCustomizeContainer.changeCustomizeNoscript(e.target.value) }}
             />
             {/* disabled in v6.0.0 temporarily -- 2022.12.19 Yuki Takei

+ 1 - 1
packages/app/src/components/Admin/Customize/CustomizeScriptSetting.tsx

@@ -47,7 +47,7 @@ const CustomizeScriptSetting = (props: Props): JSX.Element => {
               className="form-control"
               name="customizeScript"
               rows={8}
-              value={adminCustomizeContainer.state.currentCustomizeScript || ''}
+              defaultValue={adminCustomizeContainer.state.currentCustomizeScript || ''}
               onChange={(e) => { adminCustomizeContainer.changeCustomizeScript(e.target.value) }}
             />
             {/* disabled in v6.0.0 temporarily -- 2022.12.19 Yuki Takei

+ 2 - 1
packages/app/src/components/Common/Dropdown/PageItemControl.tsx

@@ -247,9 +247,10 @@ const PageItemControlDropdownMenu = React.memo((props: DropdownMenuProps): JSX.E
   return (
     <DropdownMenu
       data-testid="page-item-control-menu"
-      positionFixed
       modifiers={{ preventOverflow: { boundariesElement: 'viewport' } }}
       right={alignRight}
+      container="body"
+      style={{ zIndex: 1055 }} /* make it larger than $zindex-modal of bootstrap */
     >
       {contents}
     </DropdownMenu>

+ 1 - 1
packages/app/src/components/DescendantsPageListModal.module.scss

@@ -1,4 +1,4 @@
-.grw-page-accessories-modal :global {
+.grw-descendants-page-list-modal :global {
   .modal-header {
     button.close {
       margin: auto 0rem auto auto;

+ 2 - 2
packages/app/src/components/DescendantsPageListModal.tsx

@@ -93,8 +93,8 @@ export const DescendantsPageListModal = (): JSX.Element => {
       size="xl"
       isOpen={isOpened}
       toggle={close}
-      data-testid="page-accessories-modal"
-      className={`grw-page-accessories-modal ${styles['grw-page-accessories-modal']} ${isWindowExpanded ? 'grw-modal-expanded' : ''} `}
+      data-testid="descendants-page-list-modal"
+      className={`grw-descendants-page-list-modal ${styles['grw-descendants-page-list-modal']} ${isWindowExpanded ? 'grw-modal-expanded' : ''} `}
     >
       <ModalHeader className="p-0" toggle={close} close={buttons}>
         <CustomNavTab

+ 5 - 6
packages/app/src/components/Layout/AdminLayout.tsx

@@ -8,25 +8,24 @@ import { RawLayout } from './RawLayout';
 
 import styles from './Admin.module.scss';
 
+
+const AdminNavigation = dynamic(() => import('~/components/Admin/Common/AdminNavigation'), { ssr: false });
+const SystemVersion = dynamic(() => import('../SystemVersion'), { ssr: false });
 const HotkeysManager = dynamic(() => import('../Hotkeys/HotkeysManager'), { ssr: false });
 
 
 type Props = {
-  title?: string
   componentTitle?: string
   children?: ReactNode
 }
 
 
 const AdminLayout = ({
-  children, title, componentTitle,
+  children, componentTitle,
 }: Props): JSX.Element => {
 
-  const AdminNavigation = dynamic(() => import('~/components/Admin/Common/AdminNavigation'), { ssr: false });
-  const SystemVersion = dynamic(() => import('../SystemVersion'), { ssr: false });
-
   return (
-    <RawLayout title={title}>
+    <RawLayout>
       <div className={`admin-page ${styles['admin-page']}`}>
         <GrowiNavbar isGlobalSearchHidden={true} />
 

+ 14 - 11
packages/app/src/components/Layout/BasicLayout.tsx

@@ -4,6 +4,7 @@ import dynamic from 'next/dynamic';
 import { DndProvider } from 'react-dnd';
 import { HTML5Backend } from 'react-dnd-html5-backend';
 
+import { useEditorModeClassName } from '../../client/services/layout';
 import { GrowiNavbar } from '../Navbar/GrowiNavbar';
 import Sidebar from '../Sidebar';
 
@@ -27,21 +28,13 @@ const Fab = dynamic(() => import('../Fab').then(mod => mod.Fab), { ssr: false })
 
 
 type Props = {
-  title: string
-  className?: string,
-  expandContainer?: boolean,
   children?: ReactNode
+  className?: string
 }
 
-export const BasicLayout = ({
-  children, title, className, expandContainer,
-}: Props): JSX.Element => {
-
-  const myClassName = `${className ?? ''} ${expandContainer ? 'growi-layout-fluid' : ''}`;
-
+export const BasicLayout = ({ children, className }: Props): JSX.Element => {
   return (
-    <RawLayout title={title} className={myClassName}>
-
+    <RawLayout className={className ?? ''}>
       <DndProvider backend={HTML5Backend}>
         <GrowiNavbar />
 
@@ -75,3 +68,13 @@ export const BasicLayout = ({
     </RawLayout>
   );
 };
+
+export const BasicLayoutWithEditorMode = ({ children }: Props): JSX.Element => {
+  const className = useEditorModeClassName();
+
+  return (
+    <BasicLayout className={className}>
+      {children}
+    </BasicLayout>
+  );
+};

+ 2 - 3
packages/app/src/components/Layout/NoLoginLayout.tsx

@@ -7,20 +7,19 @@ import { RawLayout } from './RawLayout';
 import commonStyles from './NoLoginLayout.module.scss';
 
 type Props = {
-  title: string,
   className?: string,
   children?: ReactNode,
 }
 
 export const NoLoginLayout = ({
-  children, title, className,
+  children, className,
 }: Props): JSX.Element => {
   const classNames: string[] = ['wrapper'];
   if (className != null) {
     classNames.push(className);
   }
   return (
-    <RawLayout title={title} className={`${commonStyles.nologin}`}>
+    <RawLayout className={`${commonStyles.nologin}`}>
       <div className="nologin">
         <div id="wrapper">
           <div id="page-wrapper">

+ 1 - 3
packages/app/src/components/Layout/RawLayout.tsx

@@ -12,12 +12,11 @@ const logger = loggerFactory('growi:cli:RawLayout');
 
 
 type Props = {
-  title?: string,
   className?: string,
   children?: ReactNode,
 }
 
-export const RawLayout = ({ children, title, className }: Props): JSX.Element => {
+export const RawLayout = ({ children, className }: Props): JSX.Element => {
   const classNames: string[] = ['layout-root', 'growi'];
   if (className != null) {
     classNames.push(className);
@@ -35,7 +34,6 @@ export const RawLayout = ({ children, title, className }: Props): JSX.Element =>
   return (
     <>
       <Head>
-        <title>{title}</title>
         <meta charSet="utf-8" />
         <meta name="viewport" content="initial-scale=1.0, width=device-width" />
       </Head>

+ 2 - 11
packages/app/src/components/Layout/SearchResultLayout.tsx

@@ -5,23 +5,14 @@ import { BasicLayout } from '~/components/Layout/BasicLayout';
 import commonStyles from './SearchResultLayout.module.scss';
 
 type Props = {
-  title: string,
-  className?: string,
   children?: ReactNode,
 }
 
-const SearchResultLayout = ({
-  children, title, className,
-}: Props): JSX.Element => {
-
-  const classNames: string[] = [];
-  if (className != null) {
-    classNames.push(className);
-  }
+const SearchResultLayout = ({ children }: Props): JSX.Element => {
 
   return (
     <div className={`on-search ${commonStyles['on-search']}`}>
-      <BasicLayout title={title} className={classNames.join(' ')}>
+      <BasicLayout>
         <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
         <div id="main" className="main search-page mt-0">
           { children }

+ 4 - 9
packages/app/src/components/Layout/ShareLinkLayout.tsx

@@ -2,6 +2,7 @@ import React, { ReactNode } from 'react';
 
 import dynamic from 'next/dynamic';
 
+import { useEditorModeClassName } from '../../client/services/layout';
 import { GrowiNavbar } from '../Navbar/GrowiNavbar';
 
 import { RawLayout } from './RawLayout';
@@ -16,20 +17,14 @@ const Fab = dynamic(() => import('../Fab').then(mod => mod.Fab), { ssr: false })
 
 
 type Props = {
-  title: string
-  className?: string,
-  expandContainer?: boolean,
   children?: ReactNode
 }
 
-export const ShareLinkLayout = ({
-  children, title, className, expandContainer,
-}: Props): JSX.Element => {
-
-  const myClassName = `${className ?? ''} ${expandContainer ? 'growi-layout-fluid' : ''}`;
+export const ShareLinkLayout = ({ children }: Props): JSX.Element => {
+  const className = useEditorModeClassName();
 
   return (
-    <RawLayout title={title} className={myClassName}>
+    <RawLayout className={className}>
       <GrowiNavbar isGlobalSearchHidden={true} />
 
       <div className="page-wrapper d-flex d-print-block">

+ 8 - 2
packages/app/src/components/Navbar/AppearanceModeDropdown.tsx

@@ -113,10 +113,16 @@ export const AppearanceModeDropdown:FC<AppearanceModeDropdownProps> = (props: Ap
       <div className="dropdown-menu dropdown-menu-right">
 
         {/* sidebar mode */}
-        {[renderSidebarModeSwitch(false), dropdownDivider]}
+        {renderSidebarModeSwitch(false)}
+        {dropdownDivider}
 
         {/* side bar mode on editor */}
-        {isAuthenticated && [renderSidebarModeSwitch(true), dropdownDivider]}
+        {isAuthenticated && (
+          <>
+            {renderSidebarModeSwitch(true)}
+            {dropdownDivider}
+          </>
+        )}
 
         {/* color mode */}
         <h6 className="dropdown-header">{t('personal_dropdown.color_mode')}</h6>

+ 1 - 1
packages/app/src/components/Navbar/GrowiNavbar.tsx

@@ -80,7 +80,7 @@ const NavbarRight = memo((): JSX.Element => {
         <li className="grw-apperance-mode-dropdown nav-item dropdown">
           <AppearanceModeDropdown isAuthenticated={isAuthenticated} />
         </li>
-        <li id="login-user" className="nav-item"><a className="nav-link" href="/login">Login</a></li>;
+        <li id="login-user" className="nav-item"><a className="nav-link" href="/login">Login</a></li>
       </>
     );
   }, [isAuthenticated]);

+ 2 - 2
packages/app/src/components/PageEditor/Editor.tsx

@@ -227,7 +227,7 @@ const Editor: ForwardRefRenderFunction<IEditorMethods, EditorPropsType> = (props
     );
   }, [isUploading]);
 
-  const renderNavbar = useCallback(() => {
+  const renderNavbar = () => {
     return (
       <div className="m-0 navbar navbar-default navbar-editor" data-testid="navbar-editor" style={{ minHeight: 'unset' }}>
         <ul className="pl-2 nav nav-navbar">
@@ -238,7 +238,7 @@ const Editor: ForwardRefRenderFunction<IEditorMethods, EditorPropsType> = (props
         </ul>
       </div>
     );
-  }, [editorSubstance]);
+  };
 
   const renderCheatsheetModal = useCallback(() => {
     const hideCheatsheetModal = () => {

+ 20 - 33
packages/app/src/components/PageEditor/LinkEditModal.jsx

@@ -345,7 +345,7 @@ class LinkEditModal extends React.PureComponent {
     return (
       <div className="card well pt-3">
         <form className="form-group mb-0">
-          <div className="form-group row">
+          <div className="form-group mb-0 row">
             <label className="col-sm-3">{t('link_edit.path_format')}</label>
             <div className="col-sm-9">
               <div className="custom-control custom-checkbox custom-checkbox-info custom-control-inline">
@@ -376,36 +376,23 @@ class LinkEditModal extends React.PureComponent {
               </div>
             </div>
           </div>
-          <div className="form-group row mb-0">
-            <label className="col-sm-3">{t('link_edit.notation')}</label>
-            <div className="col-sm-9">
-              <div className="custom-control custom-radio custom-control-inline">
-                <input
-                  type="radio"
-                  className="custom-control-input"
-                  id="markdownType"
-                  value={Linker.types.markdownLink}
-                  checked={this.state.linkerType === Linker.types.markdownLink}
-                  onChange={e => this.handleSelecteLinkerType(e.target.value)}
-                />
-                <label className="custom-control-label" htmlFor="markdownType">
-                  {t('link_edit.markdown')}
-                </label>
-              </div>
-              <div className="custom-control custom-radio custom-control-inline">
-                <input
-                  type="radio"
-                  className="custom-control-input"
-                  id="growiType"
-                  value={Linker.types.growiLink}
-                  checked={this.state.linkerType === Linker.types.growiLink}
-                  onChange={e => this.handleSelecteLinkerType(e.target.value)}
-                />
-                <label className="custom-control-label" htmlFor="growiType">
-                  {t('link_edit.GROWI_original')}
-                </label>
-              </div>
-              {this.isApplyPukiwikiLikeLinkerPlugin && (
+          {this.isApplyPukiwikiLikeLinkerPlugin && (
+            <div className="form-group row mb-0 mt-1">
+              <label className="col-sm-3">{t('link_edit.notation')}</label>
+              <div className="col-sm-9">
+                <div className="custom-control custom-radio custom-control-inline">
+                  <input
+                    type="radio"
+                    className="custom-control-input"
+                    id="markdownType"
+                    value={Linker.types.markdownLink}
+                    checked={this.state.linkerType === Linker.types.markdownLink}
+                    onChange={e => this.handleSelecteLinkerType(e.target.value)}
+                  />
+                  <label className="custom-control-label" htmlFor="markdownType">
+                    {t('link_edit.markdown')}
+                  </label>
+                </div>
                 <div className="custom-control custom-radio custom-control-inline">
                   <input
                     type="radio"
@@ -419,9 +406,9 @@ class LinkEditModal extends React.PureComponent {
                     {t('link_edit.pukiwiki')}
                   </label>
                 </div>
-              )}
+              </div>
             </div>
-          </div>
+          )}
         </form>
       </div>
     );

+ 3 - 1
packages/app/src/components/PageStatusAlert.tsx

@@ -3,6 +3,7 @@ import React, { useCallback, useMemo } from 'react';
 import { useTranslation } from 'next-i18next';
 import * as ReactDOMServer from 'react-dom/server';
 
+import { useIsGuestUser } from '~/stores/context';
 import { useEditingMarkdown, useIsConflict } from '~/stores/editor';
 import {
   useHasDraftOnHackmd, useIsHackmdDraftUpdatingInRealtime, useRevisionIdHackmdSynced,
@@ -31,6 +32,7 @@ export const PageStatusAlert = (): JSX.Element => {
   const { mutate: mutateEditingMarkdown } = useEditingMarkdown();
   const { open: openConflictDiffModal } = useConflictDiffModal();
   const { mutate: mutateEditorMode } = useEditorMode();
+  const { data: isGuest } = useIsGuestUser();
 
   // store remote latest page data
   const { data: revisionIdHackmdSynced } = useRevisionIdHackmdSynced();
@@ -151,7 +153,7 @@ export const PageStatusAlert = (): JSX.Element => {
     getContentsForDraftExistsAlert,
   ]);
 
-  if (alertComponentContents == null) { return <></> }
+  if (isGuest || alertComponentContents == null) { return <></> }
 
   const { additionalClasses, label, btn } = alertComponentContents;
 

+ 14 - 11
packages/app/src/components/Sidebar.tsx

@@ -1,5 +1,5 @@
 import React, {
-  useCallback, useEffect, useRef, useState,
+  memo, useCallback, useEffect, useRef, useState,
 } from 'react';
 
 import dynamic from 'next/dynamic';
@@ -22,12 +22,16 @@ import { StickyStretchableScrollerProps } from './StickyStretchableScroller';
 
 import styles from './Sidebar.module.scss';
 
+const StickyStretchableScroller = dynamic<StickyStretchableScrollerProps>(() => import('./StickyStretchableScroller')
+  .then(mod => mod.StickyStretchableScroller), { ssr: false });
+const SidebarContents = dynamic(() => import('./Sidebar/SidebarContents')
+  .then(mod => mod.SidebarContents), { ssr: false, loading: () => <SidebarSkeleton /> });
 
 const sidebarMinWidth = 240;
 const sidebarMinimizeWidth = 20;
 const sidebarFixedWidthInDrawerMode = 320;
 
-const GlobalNavigation = () => {
+const GlobalNavigation = memo(() => {
   const { data: isDrawerMode } = useDrawerMode();
   const { data: currentContents } = useCurrentSidebarContents();
   const { data: isCollapsed, mutate: mutateSidebarCollapsed } = useSidebarCollapsed();
@@ -54,13 +58,10 @@ const GlobalNavigation = () => {
 
   return <SidebarNav onItemSelected={itemSelectedHandler} />;
 
-};
+});
+GlobalNavigation.displayName = 'GlobalNavigation';
 
-const SidebarContentsWrapper = () => {
-  const StickyStretchableScroller = dynamic<StickyStretchableScrollerProps>(() => import('./StickyStretchableScroller')
-    .then(mod => mod.StickyStretchableScroller), { ssr: false, loading: () => <SidebarSkeleton /> });
-  const SidebarContents = dynamic(() => import('./Sidebar/SidebarContents')
-    .then(mod => mod.SidebarContents), { ssr: false, loading: () => <SidebarSkeleton /> });
+const SidebarContentsWrapper = memo(() => {
   const { mutate: mutateSidebarScroller } = useSidebarScrollerRef();
 
   const calcViewHeight = useCallback(() => {
@@ -85,10 +86,11 @@ const SidebarContentsWrapper = () => {
       <DrawerToggler iconClass="icon-arrow-left" />
     </>
   );
-};
+});
+SidebarContentsWrapper.displayName = 'SidebarContentsWrapper';
 
 
-const Sidebar = (): JSX.Element => {
+const Sidebar = memo((): JSX.Element => {
 
   const { data: isDrawerMode } = useDrawerMode();
   const { data: isDrawerOpened, mutate: mutateDrawerOpened } = useDrawerOpened();
@@ -354,6 +356,7 @@ const Sidebar = (): JSX.Element => {
     </>
   );
 
-};
+});
+Sidebar.displayName = 'Sidebar';
 
 export default Sidebar;

+ 1 - 1
packages/app/src/components/Sidebar/CustomSidebar.tsx

@@ -47,7 +47,7 @@ const CustomSidebar: FC = () => {
       <div className="grw-sidebar-content-header py-3 d-flex">
         <h3 className="mb-0">
           {t('CustomSidebar')}
-          <Link href="/Sidebar"><a className="h6 ml-2"><i className="icon-pencil"></i></a></Link>
+          <Link href="/Sidebar#edit"><a className="h6 ml-2"><i className="icon-pencil"></i></a></Link>
         </h3>
         <SidebarHeaderReloadButton onClick={() => mutate()} />
       </div>

+ 1 - 1
packages/app/src/components/Sidebar/PageTree/PrivateLegacyPagesLink.tsx

@@ -10,7 +10,7 @@ export const PrivateLegacyPagesLink: FC = memo(() => {
   return (
     <Link href="/_private-legacy-pages" prefetch={false}>
       <a className="h5 grw-private-legacy-pages-anchor text-decoration-none">
-        <i className="icon-drawer mr-2"></i> {t('pagetree.private_legacy_pages')}
+        <i className="icon-drawer mr-2"></i> {t('private_legacy_pages.title')}
       </a>
     </Link>
   );

+ 1 - 1
packages/app/src/components/Sidebar/RecentChanges.module.scss

@@ -29,7 +29,7 @@
 
   .grw-recent-changes-skeleton-date {
     @include grw-skeleton-text($font-size:10px, $line-height:12px);
-    width: 90px;
+    width: 80px;
   }
 
   .grw-recent-changes-item-lower {

+ 4 - 4
packages/app/src/components/Sidebar/SidebarContents.tsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { memo } from 'react';
 
 import { SidebarContentsType } from '~/interfaces/ui';
 import { useCurrentSidebarContents } from '~/stores/ui';
@@ -8,7 +8,7 @@ import PageTree from './PageTree';
 import RecentChanges from './RecentChanges';
 import Tag from './Tag';
 
-export const SidebarContents = (): JSX.Element => {
+export const SidebarContents = memo(() => {
   const { data: currentSidebarContents } = useCurrentSidebarContents();
 
   let Contents;
@@ -29,5 +29,5 @@ export const SidebarContents = (): JSX.Element => {
   return (
     <Contents />
   );
-
-};
+});
+SidebarContents.displayName = 'SidebarContents';

+ 23 - 24
packages/app/src/components/Sidebar/Skeleton/SidebarSkeleton.tsx

@@ -1,6 +1,7 @@
-import React from 'react';
+import React, { memo } from 'react';
+
+import { useTranslation } from 'next-i18next';
 
-import { Skeleton } from '~/components/Skeleton';
 import { SidebarContentsType } from '~/interfaces/ui';
 import { useCurrentSidebarContents } from '~/stores/ui';
 
@@ -9,42 +10,40 @@ import PageTreeContentSkeleton from './PageTreeContentSkeleton';
 import RecentChangesContentSkeleton from './RecentChangesContentSkeleton';
 import TagContentSkeleton from './TagContentSkeleton';
 
-import styles from './SidebarSkeleton.module.scss';
-
-export const SidebarHeaderSkeleton = (): JSX.Element => {
-  return (
-    <div className="grw-sidebar-content-header py-3">
-      <Skeleton additionalClass={styles['grw-sidebar-content-header-skeleton']} />
-    </div>
-  );
-};
-
-export const SidebarSkeleton = (): JSX.Element => {
-
+export const SidebarSkeleton = memo(() => {
+  const { t } = useTranslation();
   const { data: currentSidebarContents } = useCurrentSidebarContents();
 
-  let SidebarContentSkeleton: () => JSX.Element;
+  let Contents: () => JSX.Element;
+  let title: string;
   switch (currentSidebarContents) {
 
-    case SidebarContentsType.TAG:
-      SidebarContentSkeleton = TagContentSkeleton;
-      break;
     case SidebarContentsType.RECENT:
-      SidebarContentSkeleton = RecentChangesContentSkeleton;
+      Contents = RecentChangesContentSkeleton;
+      title = t('Recent Changes');
       break;
     case SidebarContentsType.CUSTOM:
-      SidebarContentSkeleton = CustomSidebarContentSkeleton;
+      Contents = CustomSidebarContentSkeleton;
+      title = t('CustomSidebar');
+      break;
+    case SidebarContentsType.TAG:
+      Contents = TagContentSkeleton;
+      title = t('Tags');
       break;
     case SidebarContentsType.TREE:
     default:
-      SidebarContentSkeleton = PageTreeContentSkeleton;
+      Contents = PageTreeContentSkeleton;
+      title = t('Page Tree');
       break;
   }
 
   return (
     <div className={currentSidebarContents === SidebarContentsType.TAG ? 'px-4' : 'px-3'}>
-      <SidebarHeaderSkeleton />
-      <SidebarContentSkeleton />
+      <div className="grw-sidebar-content-header py-3">
+        <h3 className="mb-0">{title}</h3>
+      </div>
+      <Contents />
     </div>
   );
-};
+});
+SidebarSkeleton.displayName = 'SidebarSkeleton';

+ 4 - 1
packages/app/src/components/Sidebar/Skeleton/TagContentSkeleton.tsx

@@ -1,5 +1,7 @@
 import React from 'react';
 
+import { useTranslation } from 'next-i18next';
+
 import { Skeleton } from '~/components/Skeleton';
 
 import styles from '../Tag.module.scss';
@@ -11,10 +13,11 @@ export const TagListSkeleton = (): JSX.Element => {
 };
 
 const TagContentSkeleton = (): JSX.Element => {
+  const { t } = useTranslation('');
 
   return (
     <>
-      <Skeleton additionalClass={`${styles['grw-tag-skeleton-h3']} my-3`} />
+      <h3 className="my-3">{t('tag_list')}</h3>
       <TagListSkeleton />
     </>
   );

+ 0 - 5
packages/app/src/components/Sidebar/Tag.module.scss

@@ -1,10 +1,5 @@
 @use '~/styles/mixins' as *;
 
-.grw-tag-skeleton-h3 {
-  @include grw-skeleton-h3;
-  max-width: 120px;
-}
-
 .grw-tag-list-skeleton {
   height: 90px;
 }

+ 2 - 3
packages/app/src/components/StickyStretchableScroller.tsx

@@ -1,5 +1,5 @@
 import React, {
-  useEffect, useCallback, ReactNode, useRef, useState, useMemo, RefObject,
+  useEffect, useCallback, FC, useRef, useState, useMemo, RefObject,
 } from 'react';
 
 import SimpleBar from 'simplebar-react';
@@ -15,7 +15,6 @@ export type StickyStretchableScrollerProps = {
   stickyElemSelector: string,
   simplebarRef?: (ref: RefObject<SimpleBar>) => void,
   calcViewHeight?: (scrollElement: HTMLElement) => number,
-  children?: ReactNode,
 }
 
 /**
@@ -40,7 +39,7 @@ export type StickyStretchableScrollerProps = {
     </StickyStretchableScroller>
   );
  */
-export const StickyStretchableScroller = (props: StickyStretchableScrollerProps): JSX.Element => {
+export const StickyStretchableScroller: FC<StickyStretchableScrollerProps> = (props) => {
 
   const {
     children, stickyElemSelector, calcViewHeight, simplebarRef: setSimplebarRef,

+ 2 - 2
packages/app/src/components/TableOfContents.tsx

@@ -1,14 +1,13 @@
 import React, { useCallback } from 'react';
 
 import { pagePathUtils } from '@growi/core';
+import dynamic from 'next/dynamic';
 import ReactMarkdown from 'react-markdown';
 
 import { useCurrentPagePath } from '~/stores/page';
 import { useTocOptions } from '~/stores/renderer';
 import loggerFactory from '~/utils/logger';
 
-import { StickyStretchableScroller } from './StickyStretchableScroller';
-
 import styles from './TableOfContents.module.scss';
 
 const { isUserPage: _isUserPage } = pagePathUtils;
@@ -17,6 +16,7 @@ const { isUserPage: _isUserPage } = pagePathUtils;
 const logger = loggerFactory('growi:TableOfContents');
 
 const TableOfContents = (): JSX.Element => {
+  const StickyStretchableScroller = dynamic(() => import('./StickyStretchableScroller').then(mod => mod.StickyStretchableScroller), { ssr: false });
 
   const { data: currentPagePath } = useCurrentPagePath();
 

+ 77 - 82
packages/app/src/pages/[[...path]].page.tsx

@@ -11,7 +11,7 @@ import type {
 } from '@growi/core';
 import ExtensibleCustomError from 'extensible-custom-error';
 import {
-  NextPage, GetServerSideProps, GetServerSidePropsContext,
+  GetServerSideProps, GetServerSidePropsContext,
 } from 'next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import dynamic from 'next/dynamic';
@@ -19,6 +19,7 @@ import Head from 'next/head';
 import { useRouter } from 'next/router';
 import superjson from 'superjson';
 
+import { useCurrentGrowiLayoutFluidClassName } from '~/client/services/layout';
 import { Comments } from '~/components/Comments';
 import { PageAlerts } from '~/components/PageAlert/PageAlerts';
 // import { useTranslation } from '~/i18n';
@@ -42,7 +43,7 @@ import { useSWRxCurrentPage, useSWRxIsGrantNormalized } from '~/stores/page';
 import { useRedirectFrom } from '~/stores/page-redirect';
 import { useRemoteRevisionId } from '~/stores/remote-latest-page';
 import {
-  useEditorMode, useSelectedGrant,
+  useSelectedGrant,
   usePreferDrawerModeByUser, usePreferDrawerModeOnEditByUser, useSidebarCollapsed, useCurrentSidebarContents, useCurrentProductNavWidth,
 } from '~/stores/ui';
 import { useSetupGlobalSocket, useSetupGlobalSocketForPage } from '~/stores/websocket';
@@ -53,7 +54,7 @@ import loggerFactory from '~/utils/logger';
 // import GrowiSubNavigation from '../client/js/components/Navbar/GrowiSubNavigation';
 // import GrowiSubNavigationSwitcher from '../client/js/components/Navbar/GrowiSubNavigationSwitcher';
 import { DescendantsPageListModal } from '../components/DescendantsPageListModal';
-import { BasicLayout } from '../components/Layout/BasicLayout';
+import { BasicLayoutWithEditorMode } from '../components/Layout/BasicLayout';
 import GrowiContextualSubNavigation from '../components/Navbar/GrowiContextualSubNavigation';
 import DisplaySwitcher from '../components/Page/DisplaySwitcher';
 // import { serializeUserSecurely } from '../server/models/serializers/user-serializer';
@@ -71,10 +72,10 @@ import {
   useEditorConfig, useIsAllReplyShown, useIsUploadableFile, useIsUploadableImage, useCustomizedLogoSrc, useIsContainerFluid,
 } from '../stores/context';
 
+import { NextPageWithLayout } from './_app.page';
 import {
-  CommonProps, getNextI18NextConfig, getServerSideCommonProps, useCustomTitle,
+  CommonProps, getNextI18NextConfig, getServerSideCommonProps, generateCustomTitle,
 } from './utils/commons';
-// import { useCurrentPageSWR } from '../stores/page';
 
 
 declare global {
@@ -188,7 +189,7 @@ type Props = CommonProps & {
   sidebarConfig: ISidebarConfig,
 };
 
-const GrowiPage: NextPage<Props> = (props: Props) => {
+const Page: NextPageWithLayout<Props> = (props: Props) => {
   // const { t } = useTranslation();
   const router = useRouter();
 
@@ -266,18 +267,18 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
   // useIsNotCreatable(props.isForbidden || !isCreatablePage(pagePath)); // TODO: need to include props.isIdentical
   useCurrentPathname(props.currentPathname);
 
-  const { data: currentPage } = useSWRxCurrentPage(undefined, pageWithMeta?.data ?? null); // store initial data
+  useSWRxCurrentPage(undefined, pageWithMeta?.data ?? null); // store initial data
 
   useEditingMarkdown(pageWithMeta?.data.revision?.body);
 
   const { data: grantData } = useSWRxIsGrantNormalized(pageId);
   const { mutate: mutateSelectedGrant } = useSelectedGrant();
 
-  const { getClassNamesByEditorMode } = useEditorMode();
-
   useSetupGlobalSocket();
   useSetupGlobalSocketForPage(pageId);
 
+  const growiLayoutFluidClass = useCurrentGrowiLayoutFluidClassName();
+
   const shouldRenderPutbackPageModal = pageWithMeta != null
     ? _isTrashPage(pageWithMeta.data.path)
     : false;
@@ -291,93 +292,87 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
   useEffect(() => {
     const decodedURI = decodeURI(window.location.pathname);
     if (isClient() && decodedURI !== props.currentPathname) {
-      router.replace(props.currentPathname, undefined, { shallow: true });
+      const { search, hash } = window.location;
+      router.replace(`${props.currentPathname}${search}${hash}`, undefined, { shallow: true });
     }
   }, [props.currentPathname, router]);
 
-  const classNames: string[] = [];
-
-  const isSidebar = pagePath === '/Sidebar';
-  classNames.push(...getClassNamesByEditorMode(isSidebar));
-
   const isTopPagePath = isTopPage(pageWithMeta?.data.path ?? '');
 
-  const isContainerFluidEachPage = currentPage == null || !('expandContentWidth' in currentPage)
-    ? null
-    : currentPage.expandContentWidth;
-  const isContainerFluidDefault = props.isContainerFluid;
-  const isContainerFluid = isContainerFluidEachPage ?? isContainerFluidDefault;
+  const title = generateCustomTitle(props, 'GROWI');
 
   return (
     <>
       <Head>
-        {/*
-        {renderScriptTagByName('drawio-viewer')}
-        {renderScriptTagByName('highlight-addons')}
-        {renderHighlightJsStyleTag(props.highlightJsStyle)}
-        */}
+        <title>{title}</title>
       </Head>
-
-      <DrawioViewerScript />
-
-      <BasicLayout title={useCustomTitle(props, 'GROWI')} className={classNames.join(' ')} expandContainer={isContainerFluid}>
-
-        <div className="h-100 d-flex flex-column justify-content-between">
-          <header className="py-0 position-relative">
-            <div id="grw-subnav-container">
-              <GrowiContextualSubNavigation isLinkSharingDisabled={props.disableLinkSharing} />
-            </div>
-          </header>
-          <div className="d-edit-none">
-            <GrowiSubNavigationSwitcher />
+      <div className={`dynamic-layout-root ${growiLayoutFluidClass} h-100 d-flex flex-column justify-content-between`}>
+        <header className="py-0 position-relative">
+          <div id="grw-subnav-container">
+            <GrowiContextualSubNavigation isLinkSharingDisabled={props.disableLinkSharing} />
           </div>
+        </header>
+        <div className="d-edit-none">
+          <GrowiSubNavigationSwitcher />
+        </div>
+
+        <div id="grw-subnav-sticky-trigger" className="sticky-top"></div>
+        <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
+
+        <div className="flex-grow-1">
+          <div id="main" className={`main ${isUsersHomePage(props.currentPathname) && 'user-page'}`}>
+            <div id="content-main" className="content-main grw-container-convertible">
+              { props.isIdenticalPathPage && <IdenticalPathPage /> }
+
+              { !props.isIdenticalPathPage && (
+                <>
+                  <PageAlerts />
+                  { props.isForbidden && <ForbiddenPage /> }
+                  { props.isNotCreatablePage && <NotCreatablePage />}
+                  { !props.isForbidden && !props.isNotCreatablePage && <DisplaySwitcher />}
+                  {/* <DisplaySwitcher /> */}
+                  <PageStatusAlert />
+                </>
+              ) }
 
-          <div id="grw-subnav-sticky-trigger" className="sticky-top"></div>
-          <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
-
-          <div className="flex-grow-1">
-            <div id="main" className={`main ${isUsersHomePage(props.currentPathname) && 'user-page'}`}>
-              <div id="content-main" className="content-main grw-container-convertible">
-                { props.isIdenticalPathPage && <IdenticalPathPage /> }
-
-                { !props.isIdenticalPathPage && (
-                  <>
-                    <PageAlerts />
-                    { props.isForbidden && <ForbiddenPage /> }
-                    { props.isNotCreatablePage && <NotCreatablePage />}
-                    { !props.isForbidden && !props.isNotCreatablePage && <DisplaySwitcher />}
-                    {/* <DisplaySwitcher /> */}
-                    <PageStatusAlert />
-                  </>
-                ) }
-
-                {/* <div className="col-xl-2 col-lg-3 d-none d-lg-block revision-toc-container">
-                  <div id="revision-toc" className="revision-toc mt-3 sps sps--abv" data-sps-offset="123">
-                    <div id="revision-toc-content" className="revision-toc-content"></div>
-                  </div>
-                </div> */}
-              </div>
+              {/* <div className="col-xl-2 col-lg-3 d-none d-lg-block revision-toc-container">
+                <div id="revision-toc" className="revision-toc mt-3 sps sps--abv" data-sps-offset="123">
+                  <div id="revision-toc-content" className="revision-toc-content"></div>
+                </div>
+              </div> */}
             </div>
           </div>
-          { !props.isIdenticalPathPage && !props.isNotFound && (
-            <footer className="footer d-edit-none">
-              { pageWithMeta != null && pagePath != null && !isTopPagePath && (
-                <Comments pageId={pageId} pagePath={pagePath} revision={pageWithMeta.data.revision} />
-              ) }
-              { pageWithMeta != null && isUsersHomePage(pageWithMeta.data.path) && (
-                <UsersHomePageFooter creatorId={pageWithMeta.data.creator._id}/>
-              ) }
-              <CurrentPageContentFooter />
-            </footer>
-          )}
-
-          <UnsavedAlertDialog />
-          <DescendantsPageListModal />
-          <DrawioModal />
-          <HandsontableModal />
-          {shouldRenderPutbackPageModal && <PutbackPageModal />}
         </div>
-      </BasicLayout>
+        { !props.isIdenticalPathPage && !props.isNotFound && (
+          <footer className="footer d-edit-none">
+            { pageWithMeta != null && pagePath != null && !isTopPagePath && (
+              <Comments pageId={pageId} pagePath={pagePath} revision={pageWithMeta.data.revision} />
+            ) }
+            { pageWithMeta != null && isUsersHomePage(pageWithMeta.data.path) && (
+              <UsersHomePageFooter creatorId={pageWithMeta.data.creator._id}/>
+            ) }
+            <CurrentPageContentFooter />
+          </footer>
+        )}
+
+        {shouldRenderPutbackPageModal && <PutbackPageModal />}
+      </div>
+    </>
+  );
+};
+
+Page.getLayout = function getLayout(page) {
+  return (
+    <>
+      <DrawioViewerScript />
+
+      <BasicLayoutWithEditorMode>
+        {page}
+      </BasicLayoutWithEditorMode>
+      <UnsavedAlertDialog />
+      <DescendantsPageListModal />
+      <DrawioModal />
+      <HandsontableModal />
     </>
   );
 };
@@ -645,4 +640,4 @@ export const getServerSideProps: GetServerSideProps = async(context: GetServerSi
   };
 };
 
-export default GrowiPage;
+export default Page;

+ 13 - 3
packages/app/src/pages/_app.page.tsx

@@ -1,6 +1,7 @@
-import React, { useEffect } from 'react';
+import React, { ReactElement, ReactNode, useEffect } from 'react';
 
 import { isServer } from '@growi/core';
+import { NextPage } from 'next';
 import { appWithTranslation } from 'next-i18next';
 import { AppProps } from 'next/app';
 import { SWRConfig } from 'swr';
@@ -32,9 +33,15 @@ const swrConfig: SWRConfigValue = {
 };
 
 
+// eslint-disable-next-line @typescript-eslint/ban-types
+export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
+  getLayout?: (page: ReactElement) => ReactNode,
+}
+
 type GrowiAppProps = AppProps & {
-  pageProps: CommonProps;
+  Component: NextPageWithLayout,
 };
+
 // register custom serializer
 registerTransformerForObjectId();
 
@@ -58,9 +65,12 @@ function GrowiApp({ Component, pageProps }: GrowiAppProps): JSX.Element {
   useGrowiVersion(commonPageProps.growiVersion);
   useCustomizedLogoSrc(commonPageProps.customizedLogoSrc);
 
+  // Use the layout defined at the page level, if available
+  const getLayout = Component.getLayout ?? (page => page);
+
   return (
     <SWRConfig value={swrConfig}>
-      <Component {...pageProps} />
+      {getLayout(<Component {...pageProps} />)}
     </SWRConfig>
   );
 }

+ 8 - 6
packages/app/src/pages/_private-legacy-pages.page.tsx

@@ -1,6 +1,7 @@
 import {
   NextPage, GetServerSideProps, GetServerSidePropsContext,
 } from 'next';
+import { useTranslation } from 'next-i18next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import dynamic from 'next/dynamic';
 import Head from 'next/head';
@@ -22,7 +23,7 @@ import {
 } from '~/stores/ui';
 
 import {
-  CommonProps, getNextI18NextConfig, getServerSideCommonProps, useCustomTitle,
+  CommonProps, getNextI18NextConfig, getServerSideCommonProps, generateCustomTitle,
 } from './utils/commons';
 
 const SearchResultLayout = dynamic(() => import('~/components/Layout/SearchResultLayout'), { ssr: false });
@@ -47,6 +48,8 @@ type Props = CommonProps & {
 };
 
 const PrivateLegacyPage: NextPage<Props> = (props: Props) => {
+  const { t } = useTranslation();
+
   const { userUISettings } = props;
 
   const PrivateLegacyPages = dynamic(() => import('~/components/PrivateLegacyPages'), { ssr: false });
@@ -74,18 +77,17 @@ const PrivateLegacyPage: NextPage<Props> = (props: Props) => {
   // render config
   useRendererConfig(props.rendererConfig);
 
+  const title = generateCustomTitle(props, t('private_legacy_pages.title'));
+
   return (
     <>
       <Head>
-        {/*
-        {renderScriptTagByName('drawio-viewer')}
-        {renderScriptTagByName('highlight-addons')}
-        */}
+        <title>{title}</title>
       </Head>
 
       <DrawioViewerScript />
 
-      <SearchResultLayout title={useCustomTitle(props, 'GROWI')}>
+      <SearchResultLayout>
         <div id="private-regacy-pages">
           <PrivateLegacyPages />
         </div>

+ 17 - 17
packages/app/src/pages/_search.page.tsx

@@ -24,8 +24,9 @@ import {
 import { SearchPage } from '../components/SearchPage';
 
 import {
-  CommonProps, getNextI18NextConfig, getServerSideCommonProps, useCustomTitle,
+  CommonProps, getNextI18NextConfig, getServerSideCommonProps, generateCustomTitle,
 } from './utils/commons';
+import { NextPageWithLayout } from './_app.page';
 
 const SearchResultLayout = dynamic(() => import('~/components/Layout/SearchResultLayout'), { ssr: false });
 
@@ -53,7 +54,7 @@ type Props = CommonProps & {
 
 };
 
-const SearchResultPage: NextPage<Props> = (props: Props) => {
+const SearchResultPage: NextPageWithLayout<Props> = (props: Props) => {
   const { userUISettings } = props;
 
   // commons
@@ -87,33 +88,32 @@ const SearchResultPage: NextPage<Props> = (props: Props) => {
     return <PutbackPageModal />;
   };
 
-  const classNames: string[] = [];
-  // if (props.isContainerFluid) {
-  //   classNames.push('growi-layout-fluid');
-  // }
+  const title = generateCustomTitle(props, 'GROWI');
 
   return (
     <>
       <Head>
-        {/*
-        {renderScriptTagByName('drawio-viewer')}
-        {renderScriptTagByName('highlight-addons')}
-        */}
+        <title>{title}</title>
       </Head>
 
-      <DrawioViewerScript />
-
-      <SearchResultLayout title={useCustomTitle(props, 'GROWI')} className={classNames.join(' ')}>
-        <div id="search-page">
-          <SearchPage />
-        </div>
-      </SearchResultLayout>
+      <div id="search-page" className="dynamic-layout-root">
+        <SearchPage />
+      </div>
 
       <PutbackPageModal />
     </>
   );
 };
 
+SearchResultPage.getLayout = function getLayout(page) {
+  return (
+    <>
+      <DrawioViewerScript />
+      <SearchResultLayout>{page}</SearchResultLayout>
+    </>
+  );
+};
+
 async function injectUserUISettings(context: GetServerSidePropsContext, props: Props): Promise<void> {
   const { model: mongooseModel } = await import('mongoose');
 

+ 7 - 1
packages/app/src/pages/admin/[...path].page.tsx

@@ -2,8 +2,9 @@ import {
   NextPage, GetServerSideProps, GetServerSidePropsContext,
 } from 'next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 
-import { CommonProps } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 import { useIsMaintenanceMode } from '~/stores/maintenanceMode';
 
@@ -17,8 +18,13 @@ const AdminAppPage: NextPage<CommonProps> = (props) => {
   useIsMaintenanceMode(props.isMaintenanceMode);
   useCurrentUser(props.currentUser ?? null);
 
+  const title = generateCustomTitle(props, 'GROWI');
+
   return (
     <AdminLayout>
+      <Head>
+        <title>{title}</title>
+      </Head>
       <AdminNotFoundPage />
     </AdminLayout>
   );

+ 8 - 3
packages/app/src/pages/admin/app.page.tsx

@@ -4,11 +4,12 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 
 import AdminAppContainer from '~/client/services/AdminAppContainer';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 import { useIsMaintenanceMode } from '~/stores/maintenanceMode';
 
@@ -24,7 +25,6 @@ const AdminAppPage: NextPage<CommonProps> = (props) => {
   useIsMaintenanceMode(props.isMaintenanceMode);
   useCurrentUser(props.currentUser ?? null);
 
-  const title = t('headers.app_settings');
   const injectableContainers: Container<any>[] = [];
 
   if (isClient()) {
@@ -32,9 +32,14 @@ const AdminAppPage: NextPage<CommonProps> = (props) => {
     injectableContainers.push(adminAppContainer);
   }
 
+  const title = generateCustomTitle(props, t('headers.app_settings'));
+
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={title}>
+        <Head>
+          <title>{title}</title>
+        </Head>
         <AppSettingsPageContents />
       </AdminLayout>
     </Provider>

+ 7 - 2
packages/app/src/pages/admin/audit-log.page.tsx

@@ -3,10 +3,11 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 
 import { SupportedActionType } from '~/interfaces/activity';
 import { CrowiRequest } from '~/interfaces/crowi-request';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser, useAuditLogEnabled, useAuditLogAvailableActions } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -29,9 +30,13 @@ const AdminAuditLogPage: NextPage<Props> = (props) => {
   useCurrentUser(props.currentUser ?? null);
 
   const title = t('audit_log_management.audit_log');
+  const headTitle = generateCustomTitle(props, title);
 
   return (
-    <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+    <AdminLayout componentTitle={title}>
+      <Head>
+        <title>{headTitle}</title>
+      </Head>
       <AuditLogManagement />
     </AdminLayout>
   );

+ 8 - 3
packages/app/src/pages/admin/customize.page.tsx

@@ -4,11 +4,12 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 import AdminCustomizeContainer from '~/client/services/AdminCustomizeContainer';
 import { CrowiRequest } from '~/interfaces/crowi-request';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCustomizeTitle, useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -27,7 +28,8 @@ const AdminCustomizeSettingsPage: NextPage<Props> = (props) => {
   useCustomizeTitle(props.customizeTitle);
   useCurrentUser(props.currentUser ?? null);
 
-  const title = t('customize_settings.customize_settings');
+  const componentTitle = t('customize_settings.customize_settings');
+  const pageTitle = generateCustomTitle(props, componentTitle);
   const injectableContainers: Container<any>[] = [];
 
   if (isClient()) {
@@ -39,7 +41,10 @@ const AdminCustomizeSettingsPage: NextPage<Props> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={componentTitle}>
+        <Head>
+          <title>{pageTitle}</title>
+        </Head>
         <CustomizeSettingContents />
       </AdminLayout>
     </Provider>

+ 8 - 3
packages/app/src/pages/admin/export.page.tsx

@@ -4,10 +4,11 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 import AdminAppContainer from '~/client/services/AdminAppContainer';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -20,7 +21,8 @@ const AdminExportDataArchivePage: NextPage<CommonProps> = (props) => {
   const { t } = useTranslation('admin');
   useCurrentUser(props.currentUser ?? null);
 
-  const title = t('export_management.export_archive_data');
+  const componentTitle = t('export_management.export_archive_data');
+  const pageTitle = generateCustomTitle(props, componentTitle);
   const injectableContainers: Container<any>[] = [];
 
   if (isClient()) {
@@ -30,7 +32,10 @@ const AdminExportDataArchivePage: NextPage<CommonProps> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={componentTitle}>
+        <Head>
+          <title>{pageTitle}</title>
+        </Head>
         <ExportArchiveDataPage />
       </AdminLayout>
     </Provider>

+ 7 - 3
packages/app/src/pages/admin/global-notification/[globalNotificationId].page.tsx

@@ -6,13 +6,14 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { useRouter } from 'next/router';
 import { Container, Provider } from 'unstated';
 
 
 import AdminNotificationContainer from '~/client/services/AdminNotificationContainer';
 import { toastError } from '~/client/util/apiNotification';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../../utils/admin-page-util';
@@ -43,7 +44,7 @@ const AdminGlobalNotificationNewPage: NextPage<CommonProps> = (props) => {
 
 
   const title = t('external_notification.external_notification');
-  const customTitle = useCustomTitle(props, title);
+  const customTitle = generateCustomTitle(props, title);
 
 
   const injectableContainers: Container<any>[] = [];
@@ -56,7 +57,10 @@ const AdminGlobalNotificationNewPage: NextPage<CommonProps> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={customTitle} componentTitle={title} >
+      <AdminLayout componentTitle={title}>
+        <Head>
+          <title>{customTitle}</title>
+        </Head>
         {
           currentGlobalNotificationId != null && router.isReady
       && <ManageGlobalNotification globalNotificationId={currentGlobalNotificationId} />

+ 6 - 2
packages/app/src/pages/admin/global-notification/new.page.tsx

@@ -4,10 +4,11 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 import AdminNotificationContainer from '~/client/services/AdminNotificationContainer';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../../utils/admin-page-util';
@@ -31,7 +32,10 @@ const AdminGlobalNotificationNewPage: NextPage<CommonProps> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={title}>
+        <Head>
+          <title>{title}</title>
+        </Head>
         <ManageGlobalNotification />
       </AdminLayout>
     </Provider>

+ 8 - 3
packages/app/src/pages/admin/importer.page.tsx

@@ -4,10 +4,11 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 import AdminImportContainer from '~/client/services/AdminImportContainer';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -20,7 +21,8 @@ const AdminDataImportPage: NextPage<CommonProps> = (props) => {
   const { t } = useTranslation('admin');
   useCurrentUser(props.currentUser ?? null);
 
-  const title = t('importer_management.import_data');
+  const componentTitle = t('importer_management.import_data');
+  const pageTitle = generateCustomTitle(props, componentTitle);
   const injectableContainers: Container<any>[] = [];
 
   if (isClient()) {
@@ -31,7 +33,10 @@ const AdminDataImportPage: NextPage<CommonProps> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={componentTitle}>
+        <Head>
+          <title>{pageTitle}</title>
+        </Head>
         <DataImportPageContents />
       </AdminLayout>
     </Provider>

+ 6 - 2
packages/app/src/pages/admin/index.page.tsx

@@ -4,11 +4,12 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 import AdminHomeContainer from '~/client/services/AdminHomeContainer';
 import { CrowiRequest } from '~/interfaces/crowi-request';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser, useGrowiCloudUri, useGrowiAppIdForGrowiCloud } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -46,7 +47,10 @@ const AdminHomePage: NextPage<Props> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={title}>
+        <Head>
+          <title>{title}</title>
+        </Head>
         <AdminHome
           nodeVersion={props.nodeVersion}
           npmVersion={props.npmVersion}

+ 9 - 3
packages/app/src/pages/admin/markdown.page.tsx

@@ -4,11 +4,12 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 
 import AdminMarkDownContainer from '~/client/services/AdminMarkDownContainer';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -21,7 +22,9 @@ const AdminMarkdownPage: NextPage<CommonProps> = (props) => {
   const { t } = useTranslation('admin');
   useCurrentUser(props.currentUser ?? null);
 
-  const title = t('markdown_settings.markdown_settings');
+  const componentTitle = t('markdown_settings.markdown_settings');
+  const pageTitle = generateCustomTitle(props, componentTitle);
+
   const injectableContainers: Container<any>[] = [];
 
   if (isClient()) {
@@ -32,7 +35,10 @@ const AdminMarkdownPage: NextPage<CommonProps> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={componentTitle}>
+        <Head>
+          <title>{pageTitle}</title>
+        </Head>
         <MarkDownSettingContents />
       </AdminLayout>
     </Provider>

+ 8 - 3
packages/app/src/pages/admin/notification.page.tsx

@@ -4,10 +4,11 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 import AdminNotificationContainer from '~/client/services/AdminNotificationContainer';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -20,7 +21,8 @@ const AdminExternalNotificationPage: NextPage<CommonProps> = (props) => {
   const { t } = useTranslation('admin');
   useCurrentUser(props.currentUser ?? null);
 
-  const title = t('external_notification.external_notification');
+  const componentTitle = t('external_notification.external_notification');
+  const pageTitle = generateCustomTitle(props, componentTitle);
   const injectableContainers: Container<any>[] = [];
 
   if (isClient()) {
@@ -32,7 +34,10 @@ const AdminExternalNotificationPage: NextPage<CommonProps> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={componentTitle}>
+        <Head>
+          <title>{pageTitle}</title>
+        </Head>
         <NotificationSetting />
       </AdminLayout>
     </Provider>

+ 6 - 2
packages/app/src/pages/admin/plugins.page.tsx

@@ -4,11 +4,12 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 
 import AdminAppContainer from '~/client/services/AdminAppContainer';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 import { useIsMaintenanceMode } from '~/stores/maintenanceMode';
 
@@ -37,7 +38,10 @@ const AdminAppPage: NextPage<CommonProps> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={title} >
+        <Head>
+          <title>{generateCustomTitle(props, title)}</title>
+        </Head>
         <PluginsExtensionPageContents />
       </AdminLayout>
     </Provider>

+ 7 - 2
packages/app/src/pages/admin/search.page.tsx

@@ -3,9 +3,10 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 
 import { CrowiRequest } from '~/interfaces/crowi-request';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useIsSearchServiceReachable, useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -27,9 +28,13 @@ const AdminFullTextSearchManagementPage: NextPage<Props> = (props) => {
   useIsSearchServiceReachable(props.isSearchServiceReachable);
 
   const title = t('full_text_search_management.full_text_search_management');
+  const headTitle = generateCustomTitle(props, title);
 
   return (
-    <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+    <AdminLayout componentTitle={title}>
+      <Head>
+        <title>{headTitle}</title>
+      </Head>
       <FullTextSearchManagement />
     </AdminLayout>
   );

+ 8 - 4
packages/app/src/pages/admin/security.page.tsx

@@ -4,6 +4,7 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 import AdminGeneralSecurityContainer from '~/client/services/AdminGeneralSecurityContainer';
@@ -15,7 +16,7 @@ import AdminOidcSecurityContainer from '~/client/services/AdminOidcSecurityConta
 import AdminSamlSecurityContainer from '~/client/services/AdminSamlSecurityContainer';
 import AdminTwitterSecurityContainer from '~/client/services/AdminTwitterSecurityContainer';
 import { CrowiRequest } from '~/interfaces/crowi-request';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser, useIsMailerSetup, useSiteUrl } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -36,7 +37,8 @@ const AdminSecuritySettingsPage: NextPage<Props> = (props) => {
   useSiteUrl(props.siteUrl);
   useIsMailerSetup(props.isMailerSetup);
 
-  const title = t('security_settings.security_settings');
+  const componentTitle = t('security_settings.security_settings');
+  const pageTitle = generateCustomTitle(props, componentTitle);
   const adminSecurityContainers: Container<any>[] = [];
 
   if (isClient()) {
@@ -65,10 +67,12 @@ const AdminSecuritySettingsPage: NextPage<Props> = (props) => {
     }
   }
 
-
   return (
     <Provider inject={[...adminSecurityContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={componentTitle}>
+        <Head>
+          <title>{pageTitle}</title>
+        </Head>
         <SecurityManagement />
       </AdminLayout>
     </Provider>

+ 7 - 2
packages/app/src/pages/admin/slack-integration-legacy.page.tsx

@@ -4,10 +4,11 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 import AdminSlackIntegrationLegacyContainer from '~/client/services/AdminSlackIntegrationLegacyContainer';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -21,6 +22,7 @@ const AdminLegacySlackIntegrationPage: NextPage<CommonProps> = (props) => {
   useCurrentUser(props.currentUser ?? null);
 
   const title = t('slack_integration_legacy.slack_integration_legacy');
+  const headTitle = generateCustomTitle(props, title);
   const injectableContainers: Container<any>[] = [];
 
   if (isClient()) {
@@ -31,7 +33,10 @@ const AdminLegacySlackIntegrationPage: NextPage<CommonProps> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={title}>
+        <Head>
+          <title>{headTitle}</title>
+        </Head>
         <LegacySlackIntegration />
       </AdminLayout>
     </Provider>

+ 8 - 3
packages/app/src/pages/admin/slack-integration.page.tsx

@@ -3,9 +3,10 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 
 import { CrowiRequest } from '~/interfaces/crowi-request';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser, useSiteUrl } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -25,10 +26,14 @@ const AdminSlackIntegrationPage: NextPage<Props> = (props) => {
   useCurrentUser(props.currentUser ?? null);
   useSiteUrl(props.siteUrl);
 
-  const title = t('slack_integration.slack_integration');
+  const componentTitle = t('slack_integration.slack_integration');
+  const pageTitle = generateCustomTitle(props, componentTitle);
 
   return (
-    <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+    <AdminLayout componentTitle={componentTitle}>
+      <Head>
+        <title>{pageTitle}</title>
+      </Head>
       <SlackIntegration />
     </AdminLayout>
   );

+ 7 - 3
packages/app/src/pages/admin/user-group-detail/[userGroupId].page.tsx

@@ -3,10 +3,11 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { useRouter } from 'next/router';
 
 import { CrowiRequest } from '~/interfaces/crowi-request';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useIsAclEnabled, useCurrentUser } from '~/stores/context';
 import { useIsMaintenanceMode } from '~/stores/maintenanceMode';
 
@@ -27,14 +28,17 @@ const AdminUserGroupDetailPage: NextPage<Props> = (props: Props) => {
   const { userGroupId } = router.query;
 
   const title = t('user_group_management.user_group_management');
-  const customTitle = useCustomTitle(props, title);
+  const customTitle = generateCustomTitle(props, title);
 
   const currentUserGroupId = Array.isArray(userGroupId) ? userGroupId[0] : userGroupId;
 
   useIsAclEnabled(props.isAclEnabled);
 
   return (
-    <AdminLayout title={customTitle} componentTitle={title} >
+    <AdminLayout componentTitle={title}>
+      <Head>
+        <title>{customTitle}</title>
+      </Head>
       {
         currentUserGroupId != null && router.isReady
       && <UserGroupDetailPage userGroupId={currentUserGroupId} />

+ 7 - 2
packages/app/src/pages/admin/user-groups.page.tsx

@@ -3,9 +3,10 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 
 import { CrowiRequest } from '~/interfaces/crowi-request';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useIsAclEnabled, useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../utils/admin-page-util';
@@ -25,9 +26,13 @@ const AdminUserGroupPage: NextPage<Props> = (props) => {
   useIsAclEnabled(props.isAclEnabled);
 
   const title = t('user_group_management.user_group_management');
+  const headTitle = generateCustomTitle(props, title);
 
   return (
-    <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+    <AdminLayout componentTitle={title}>
+      <Head>
+        <title>{headTitle}</title>
+      </Head>
       <UserGroupPage />
     </AdminLayout>
   );

+ 6 - 2
packages/app/src/pages/admin/users/external-accounts.page.tsx

@@ -4,10 +4,11 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 import AdminExternalAccountsContainer from '~/client/services/AdminExternalAccountsContainer';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../../utils/admin-page-util';
@@ -34,7 +35,10 @@ const AdminUserManagementPage: NextPage<CommonProps> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={title}>
+        <Head>
+          <title>{title}</title>
+        </Head>
         <ManageExternalAccount />
       </AdminLayout>
     </Provider>

+ 7 - 2
packages/app/src/pages/admin/users/index.page.tsx

@@ -4,11 +4,12 @@ import {
 } from 'next';
 import { useTranslation } from 'next-i18next';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { Container, Provider } from 'unstated';
 
 import AdminUsersContainer from '~/client/services/AdminUsersContainer';
 import { CrowiRequest } from '~/interfaces/crowi-request';
-import { CommonProps, useCustomTitle } from '~/pages/utils/commons';
+import { CommonProps, generateCustomTitle } from '~/pages/utils/commons';
 import { useCurrentUser, useIsMailerSetup } from '~/stores/context';
 
 import { retrieveServerSideProps } from '../../../utils/admin-page-util';
@@ -29,6 +30,7 @@ const AdminUserManagementPage: NextPage<Props> = (props) => {
   useIsMailerSetup(props.isMailerSetup);
 
   const title = t('user_management.user_management');
+  const headTitle = generateCustomTitle(props, title);
   const injectableContainers: Container<any>[] = [];
 
   if (isClient()) {
@@ -40,7 +42,10 @@ const AdminUserManagementPage: NextPage<Props> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout componentTitle={title}>
+        <Head>
+          <title>{headTitle}</title>
+        </Head>
         <UserManagement />
       </AdminLayout>
     </Provider>

+ 7 - 2
packages/app/src/pages/installer.page.tsx

@@ -5,6 +5,7 @@ import {
   NextPage, GetServerSideProps, GetServerSidePropsContext,
 } from 'next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
+import Head from 'next/head';
 
 import { NoLoginLayout } from '~/components/Layout/NoLoginLayout';
 
@@ -15,7 +16,7 @@ import {
 
 
 import {
-  CommonProps, getNextI18NextConfig, getServerSideCommonProps, useCustomTitle,
+  CommonProps, getNextI18NextConfig, getServerSideCommonProps, generateCustomTitle,
 } from './utils/commons';
 
 
@@ -39,10 +40,14 @@ const InstallerPage: NextPage<Props> = (props: Props) => {
   useConfidential(props.confidential);
   useCsrfToken(props.csrfToken);
 
+  const title = generateCustomTitle(props, 'GROWI');
   const classNames: string[] = [];
 
   return (
-    <NoLoginLayout title={useCustomTitle(props, 'GROWI')} className={classNames.join(' ')}>
+    <NoLoginLayout className={classNames.join(' ')}>
+      <Head>
+        <title>{title}</title>
+      </Head>
       <div id="installer-form-container">
         <InstallerForm />
       </div>

+ 7 - 2
packages/app/src/pages/invited.page.tsx

@@ -5,6 +5,7 @@ import { USER_STATUS } from '@growi/core';
 import { NextPage, GetServerSideProps, GetServerSidePropsContext } from 'next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 
 import { InvitedFormProps } from '~/components/InvitedForm';
 import { NoLoginLayout } from '~/components/Layout/NoLoginLayout';
@@ -13,7 +14,7 @@ import type { CrowiRequest } from '~/interfaces/crowi-request';
 import { useCsrfToken, useCurrentPathname, useCurrentUser } from '../stores/context';
 
 import {
-  CommonProps, getServerSideCommonProps, useCustomTitle, getNextI18NextConfig,
+  CommonProps, getServerSideCommonProps, generateCustomTitle, getNextI18NextConfig,
 } from './utils/commons';
 
 const InvitedForm = dynamic<InvitedFormProps>(() => import('~/components/InvitedForm').then(mod => mod.InvitedForm), { ssr: false });
@@ -30,10 +31,14 @@ const InvitedPage: NextPage<Props> = (props: Props) => {
   useCurrentPathname(props.currentPathname);
   useCurrentUser(props.currentUser);
 
+  const title = generateCustomTitle(props, 'GROWI');
   const classNames: string[] = ['invited-page'];
 
   return (
-    <NoLoginLayout title={useCustomTitle(props, 'GROWI')} className={classNames.join(' ')}>
+    <NoLoginLayout className={classNames.join(' ')}>
+      <Head>
+        <title>{title}</title>
+      </Head>
       <InvitedForm invitedFormUsername={props.invitedFormUsername} invitedFormName={props.invitedFormName} />
     </NoLoginLayout>
   );

+ 7 - 2
packages/app/src/pages/login.page.tsx

@@ -4,6 +4,7 @@ import {
   NextPage, GetServerSideProps, GetServerSidePropsContext,
 } from 'next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
+import Head from 'next/head';
 
 import { NoLoginLayout } from '~/components/Layout/NoLoginLayout';
 import { LoginForm } from '~/components/LoginForm';
@@ -17,7 +18,7 @@ import {
 } from '../stores/context';
 
 import {
-  CommonProps, getServerSideCommonProps, useCustomTitle, getNextI18NextConfig,
+  CommonProps, getServerSideCommonProps, generateCustomTitle, getNextI18NextConfig,
 } from './utils/commons';
 
 type Props = CommonProps & {
@@ -42,10 +43,14 @@ const LoginPage: NextPage<Props> = (props: Props) => {
   // page
   useCurrentPathname(props.currentPathname);
 
+  const title = generateCustomTitle(props, 'GROWI');
   const classNames: string[] = ['login-page'];
 
   return (
-    <NoLoginLayout title={useCustomTitle(props, 'GROWI')} className={classNames.join(' ')}>
+    <NoLoginLayout className={classNames.join(' ')}>
+      <Head>
+        <title>{title}</title>
+      </Head>
       <LoginForm
         objOfIsExternalAuthEnableds={props.enabledStrategies}
         isLocalStrategySetup={props.isLocalStrategySetup}

+ 17 - 6
packages/app/src/pages/me/[[...path]].page.tsx

@@ -8,6 +8,7 @@ import {
 import { useTranslation } from 'next-i18next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 import { useRouter } from 'next/router';
 
 import { BasicLayout } from '~/components/Layout/BasicLayout';
@@ -28,8 +29,9 @@ import {
 import loggerFactory from '~/utils/logger';
 
 import {
-  CommonProps, getNextI18NextConfig, getServerSideCommonProps, useCustomTitle,
+  CommonProps, getNextI18NextConfig, getServerSideCommonProps, generateCustomTitle,
 } from '../utils/commons';
+import { NextPageWithLayout } from '../_app.page';
 
 
 const logger = loggerFactory('growi:pages:me');
@@ -53,7 +55,7 @@ const InAppNotificationPage = dynamic(
   () => import('~/components/InAppNotification/InAppNotificationPage').then(mod => mod.InAppNotificationPage), { ssr: false },
 );
 
-const MePage: NextPage<Props> = (props: Props) => {
+const MePage: NextPageWithLayout<Props> = (props: Props) => {
   const router = useRouter();
   const { t } = useTranslation(['translation', 'commons']);
   const { path } = router.query;
@@ -109,10 +111,14 @@ const MePage: NextPage<Props> = (props: Props) => {
 
   useRendererConfig(props.rendererConfig);
 
+  const title = generateCustomTitle(props, 'GROWI');
+
   return (
     <>
-      <BasicLayout title={useCustomTitle(props, 'GROWI')}>
-
+      <Head>
+        <title>{title}</title>
+      </Head>
+      <div className="dynamic-layout-root">
         <header className="py-3">
           <div className="container-fluid">
             <h1 className="title">{ targetPage.title }</h1>
@@ -126,12 +132,17 @@ const MePage: NextPage<Props> = (props: Props) => {
             {targetPage.component}
           </div>
         </div>
-
-      </BasicLayout>
+      </div>
     </>
   );
 };
 
+MePage.getLayout = function getLayout(page) {
+  return (
+    <BasicLayout>{page}</BasicLayout>
+  );
+};
+
 async function injectUserUISettings(context: GetServerSidePropsContext, props: Props): Promise<void> {
   const req = context.req as CrowiRequest<IUserHasId & any>;
   const { user } = req;

+ 94 - 79
packages/app/src/pages/share/[[...path]].page.tsx

@@ -7,7 +7,9 @@ import {
 import { useTranslation } from 'next-i18next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 
+import { useCurrentGrowiLayoutFluidClassName } from '~/client/services/layout';
 import CountBadge from '~/components/Common/CountBadge';
 import PageListIcon from '~/components/Icons/PageListIcon';
 import { ShareLinkLayout } from '~/components/Layout/ShareLinkLayout';
@@ -22,13 +24,14 @@ import { RendererConfig } from '~/interfaces/services/renderer';
 import { IShareLinkHasId } from '~/interfaces/share-link';
 import {
   useCurrentUser, useCurrentPathname, useCurrentPageId, useRendererConfig, useIsSearchPage,
-  useShareLinkId, useIsSearchServiceConfigured, useIsSearchServiceReachable, useIsSearchScopeChildrenAsDefault, useDrawioUri,
+  useShareLinkId, useIsSearchServiceConfigured, useIsSearchServiceReachable, useIsSearchScopeChildrenAsDefault, useDrawioUri, useIsContainerFluid,
 } from '~/stores/context';
 import { useDescendantsPageListModal } from '~/stores/modal';
 import loggerFactory from '~/utils/logger';
 
+import { NextPageWithLayout } from '../_app.page';
 import {
-  CommonProps, getServerSideCommonProps, useCustomTitle, getNextI18NextConfig,
+  CommonProps, getServerSideCommonProps, generateCustomTitle, getNextI18NextConfig,
 } from '../utils/commons';
 
 const logger = loggerFactory('growi:next-page:share');
@@ -47,7 +50,7 @@ type Props = CommonProps & {
   rendererConfig: RendererConfig,
 };
 
-const SharedPage: NextPage<Props> = (props: Props) => {
+const SharedPage: NextPageWithLayout<Props> = (props: Props) => {
   useIsSearchPage(false);
   useShareLinkId(props.shareLink?._id);
   useCurrentPageId(props.shareLink?.relatedPage._id);
@@ -58,98 +61,110 @@ const SharedPage: NextPage<Props> = (props: Props) => {
   useIsSearchServiceReachable(props.isSearchServiceReachable);
   useIsSearchScopeChildrenAsDefault(props.isSearchScopeChildrenAsDefault);
   useDrawioUri(props.drawioUri);
+  useIsContainerFluid(props.isContainerFluid);
 
   const { open: openDescendantPageListModal } = useDescendantsPageListModal();
   const { t } = useTranslation();
 
+  const growiLayoutFluidClass = useCurrentGrowiLayoutFluidClassName();
+
   const isNotFound = props.shareLink == null || props.shareLink.relatedPage == null || props.shareLink.relatedPage.isEmpty;
   const isShowSharedPage = !props.disableLinkSharing && !isNotFound && !props.isExpired;
   const shareLink = props.shareLink;
 
+  const title = generateCustomTitle(props, 'GROWI');
+
   return (
     <>
-      <DrawioViewerScript />
-
-      <ShareLinkLayout title={useCustomTitle(props, 'GROWI')} expandContainer={props.isContainerFluid}>
-        <div className="h-100 d-flex flex-column justify-content-between">
-          <header className="py-0 position-relative">
-            {isShowSharedPage && <GrowiContextualSubNavigation isLinkSharingDisabled={props.disableLinkSharing} />}
-          </header>
-
-          <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
-
-          <div className="flex-grow-1">
-            <div id="content-main" className="content-main">
-              <div className="grw-container-convertible">
-                { props.disableLinkSharing && (
-                  <div className="mt-4">
-                    <ForbiddenPage isLinkSharingDisabled={props.disableLinkSharing} />
-                  </div>
-                )}
-
-                { (isNotFound && !props.disableLinkSharing) && (
-                  <div className="container-lg">
-                    <h2 className="text-muted mt-4">
-                      <i className="icon-ban" aria-hidden="true" />
-                      <span> Page is not found</span>
-                    </h2>
-                  </div>
-                )}
-
-                { (props.isExpired && !props.disableLinkSharing && shareLink != null) && (
-                  <div className="container-lg">
-                    <ShareLinkAlert expiredAt={shareLink.expiredAt} createdAt={shareLink.createdAt} />
-                    <h2 className="text-muted mt-4">
-                      <i className="icon-ban" aria-hidden="true" />
-                      <span> Page is expired</span>
-                    </h2>
-                  </div>
-                )}
-
-                {(isShowSharedPage && shareLink != null) && (
-                  <>
-                    <ShareLinkAlert expiredAt={shareLink.expiredAt} createdAt={shareLink.createdAt} />
-                    <div className="d-flex flex-column flex-lg-row-reverse">
-
-                      <div className="grw-side-contents-container">
-                        <div className="grw-side-contents-sticky-container">
-
-                          {/* Page list */}
-                          <div className={`grw-page-accessories-control ${styles['grw-page-accessories-control']}`}>
-                            { shareLink.relatedPage.path != null && (
-                              <button
-                                type="button"
-                                className="btn btn-block btn-outline-secondary grw-btn-page-accessories
-                                rounded-pill d-flex justify-content-between align-items-center"
-                                onClick={() => openDescendantPageListModal(shareLink.relatedPage.path)}
-                                data-testid="pageListButton"
-                              >
-                                <div className="grw-page-accessories-control-icon">
-                                  <PageListIcon />
-                                </div>
-                                {t('page_list')}
-                                <CountBadge count={shareLink.relatedPage.descendantCount} offset={1} />
-                              </button>
-                            ) }
-                          </div>
-
-                          <div className="d-none d-lg-block">
-                            <TableOfContents />
-                          </div>
-                        </div>
+      <Head>
+        <title>{title}</title>
+      </Head>
+
+      <div className={`dynamic-layout-root ${growiLayoutFluidClass} h-100 d-flex flex-column justify-content-between`}>
+        <header className="py-0 position-relative">
+          {isShowSharedPage && <GrowiContextualSubNavigation isLinkSharingDisabled={props.disableLinkSharing} />}
+        </header>
+
+        <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
+
+        <div className="flex-grow-1">
+          <div id="content-main" className="content-main grw-container-convertible">
+            { props.disableLinkSharing && (
+              <div className="mt-4">
+                <ForbiddenPage isLinkSharingDisabled={props.disableLinkSharing} />
+              </div>
+            )}
+
+            { (isNotFound && !props.disableLinkSharing) && (
+              <div className="container-lg">
+                <h2 className="text-muted mt-4">
+                  <i className="icon-ban" aria-hidden="true" />
+                  <span> Page is not found</span>
+                </h2>
+              </div>
+            )}
+
+            { (props.isExpired && !props.disableLinkSharing && shareLink != null) && (
+              <div className="container-lg">
+                <ShareLinkAlert expiredAt={shareLink.expiredAt} createdAt={shareLink.createdAt} />
+                <h2 className="text-muted mt-4">
+                  <i className="icon-ban" aria-hidden="true" />
+                  <span> Page is expired</span>
+                </h2>
+              </div>
+            )}
+
+            {(isShowSharedPage && shareLink != null) && (
+              <>
+                <ShareLinkAlert expiredAt={shareLink.expiredAt} createdAt={shareLink.createdAt} />
+                <div className="d-flex flex-column flex-lg-row-reverse">
+
+                  <div className="grw-side-contents-container">
+                    <div className="grw-side-contents-sticky-container">
+
+                      {/* Page list */}
+                      <div className={`grw-page-accessories-control ${styles['grw-page-accessories-control']}`}>
+                        { shareLink.relatedPage.path != null && (
+                          <button
+                            type="button"
+                            className="btn btn-block btn-outline-secondary grw-btn-page-accessories
+                            rounded-pill d-flex justify-content-between align-items-center"
+                            onClick={() => openDescendantPageListModal(shareLink.relatedPage.path)}
+                            data-testid="pageListButton"
+                          >
+                            <div className="grw-page-accessories-control-icon">
+                              <PageListIcon />
+                            </div>
+                            {t('page_list')}
+                            <CountBadge count={shareLink.relatedPage.descendantCount} offset={1} />
+                          </button>
+                        ) }
                       </div>
 
-                      <div className="flex-grow-1 flex-basis-0 mw-0">
-                        <Page />
+                      <div className="d-none d-lg-block">
+                        <TableOfContents />
                       </div>
                     </div>
-                  </>
-                )}
-              </div>
-            </div>
+                  </div>
+
+                  <div className="flex-grow-1 flex-basis-0 mw-0">
+                    <Page />
+                  </div>
+                </div>
+              </>
+            )}
           </div>
         </div>
-      </ShareLinkLayout>
+      </div>
+    </>
+  );
+};
+
+SharedPage.getLayout = function getLayout(page) {
+  return (
+    <>
+      <DrawioViewerScript />
+      <ShareLinkLayout>{page}</ShareLinkLayout>
     </>
   );
 };

+ 15 - 5
packages/app/src/pages/tags.page.tsx

@@ -26,8 +26,9 @@ import {
 } from '../stores/context';
 
 import {
-  CommonProps, getServerSideCommonProps, getNextI18NextConfig, useCustomTitle,
+  CommonProps, getServerSideCommonProps, getNextI18NextConfig, generateCustomTitle,
 } from './utils/commons';
+import { NextPageWithLayout } from './_app.page';
 
 const PAGING_LIMIT = 10;
 
@@ -49,7 +50,7 @@ type Props = CommonProps & {
 const TagList = dynamic(() => import('~/components/TagList'), { ssr: false });
 const TagCloudBox = dynamic(() => import('~/components/TagCloudBox'), { ssr: false });
 
-const TagPage: NextPage<CommonProps> = (props: Props) => {
+const TagPage: NextPageWithLayout<CommonProps> = (props: Props) => {
   const [activePage, setActivePage] = useState<number>(1);
   const [offset, setOffset] = useState<number>(0);
 
@@ -64,7 +65,7 @@ const TagPage: NextPage<CommonProps> = (props: Props) => {
   const tagData: IDataTagCount[] = tagDataList?.data || [];
   const totalCount: number = tagDataList?.totalCount || 0;
   const isLoading = tagDataList === undefined && error == null;
-  const classNames: string[] = [];
+
 
   useIsSearchPage(false);
   useIsSearchServiceConfigured(props.isSearchServiceConfigured);
@@ -79,11 +80,14 @@ const TagPage: NextPage<CommonProps> = (props: Props) => {
 
   useRendererConfig(props.rendererConfig);
 
+  const title = generateCustomTitle(props, 'GROWI');
+
   return (
     <>
       <Head>
+        <title>{title}</title>
       </Head>
-      <BasicLayout title={useCustomTitle(props, 'GROWI')} className={classNames.join(' ')}>
+      <div className="dynamic-layout-root">
         <div className="grw-container-convertible mb-5 pb-5" data-testid="tags-page">
           <h2 className="my-3">{`${t('Tags')}(${totalCount})`}</h2>
           <div className="px-3 mb-5 text-center">
@@ -109,11 +113,17 @@ const TagPage: NextPage<CommonProps> = (props: Props) => {
           }
           <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
         </div>
-      </BasicLayout>
+      </div>
     </>
   );
 };
 
+TagPage.getLayout = function getLayout(page) {
+  return (
+    <BasicLayout>{page}</BasicLayout>
+  );
+};
+
 async function injectUserUISettings(context: GetServerSidePropsContext, props: Props): Promise<void> {
   const { model: mongooseModel } = await import('mongoose');
 

+ 25 - 6
packages/app/src/pages/trash.page.tsx

@@ -4,7 +4,9 @@ import type { IUser, IUserHasId } from '@growi/core';
 import { NextPage, GetServerSideProps, GetServerSidePropsContext } from 'next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import dynamic from 'next/dynamic';
+import Head from 'next/head';
 
+import { useCurrentGrowiLayoutFluidClassName } from '~/client/services/layout';
 import { GrowiSubNavigation } from '~/components/Navbar/GrowiSubNavigation';
 import type { CrowiRequest } from '~/interfaces/crowi-request';
 import type { RendererConfig } from '~/interfaces/services/renderer';
@@ -15,15 +17,16 @@ import {
   useCurrentProductNavWidth, useCurrentSidebarContents, useDrawerMode, usePreferDrawerModeByUser, usePreferDrawerModeOnEditByUser, useSidebarCollapsed,
 } from '~/stores/ui';
 
-import { BasicLayout } from '../components/Layout/BasicLayout';
+import { BasicLayoutWithEditorMode } from '../components/Layout/BasicLayout';
 import {
   useCurrentUser, useCurrentPageId, useCurrentPathname,
   useIsSearchServiceConfigured, useIsSearchServiceReachable,
   useIsSearchScopeChildrenAsDefault, useIsSearchPage, useShowPageLimitationXL, useIsGuestUser, useRendererConfig,
 } from '../stores/context';
 
+import { NextPageWithLayout } from './_app.page';
 import {
-  CommonProps, getServerSideCommonProps, getNextI18NextConfig, useCustomTitle,
+  CommonProps, getServerSideCommonProps, getNextI18NextConfig, generateCustomTitle,
 } from './utils/commons';
 
 const TrashPageList = dynamic(() => import('~/components/TrashPageList').then(mod => mod.TrashPageList), { ssr: false });
@@ -45,7 +48,7 @@ type Props = CommonProps & {
   rendererConfig: RendererConfig,
 };
 
-const TrashPage: NextPage<CommonProps> = (props: Props) => {
+const TrashPage: NextPageWithLayout<CommonProps> = (props: Props) => {
   useCurrentUser(props.currentUser ?? null);
 
   useIsSearchServiceConfigured(props.isSearchServiceConfigured);
@@ -70,9 +73,16 @@ const TrashPage: NextPage<CommonProps> = (props: Props) => {
   const { data: isDrawerMode } = useDrawerMode();
   const { data: isGuestUser } = useIsGuestUser();
 
+  const growiLayoutFluidClass = useCurrentGrowiLayoutFluidClassName();
+
+  const title = generateCustomTitle(props, 'GROWI');
+
   return (
     <>
-      <BasicLayout title={useCustomTitle(props, 'GROWI')} >
+      <Head>
+        <title>{title}</title>
+      </Head>
+      <div className={`dynamic-layout-root ${growiLayoutFluidClass}`}>
         <header className="py-0 position-relative">
           <GrowiSubNavigation
             pagePath="/trash"
@@ -83,13 +93,22 @@ const TrashPage: NextPage<CommonProps> = (props: Props) => {
           />
         </header>
 
-        <div className="grw-container-convertible mb-5 pb-5">
+        <div className="content-main grw-container-convertible mb-5 pb-5">
           <TrashPageList />
         </div>
 
         <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
-      </BasicLayout>
+      </div>
+    </>
+  );
+};
 
+TrashPage.getLayout = function getLayout(page) {
+  return (
+    <>
+      <BasicLayoutWithEditorMode>
+        {page}
+      </BasicLayoutWithEditorMode>
       <EmptyTrashModal />
       <PutbackPageModal />
     </>

+ 9 - 2
packages/app/src/pages/user-activation.page.tsx

@@ -1,5 +1,6 @@
 import { NextPage, GetServerSideProps, GetServerSidePropsContext } from 'next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
+import Head from 'next/head';
 
 import CompleteUserRegistrationForm from '~/components/CompleteUserRegistrationForm';
 import { NoLoginLayout } from '~/components/Layout/NoLoginLayout';
@@ -9,7 +10,7 @@ import type { RegistrationMode } from '~/interfaces/registration-mode';
 import { IUserRegistrationOrder } from '~/server/models/user-registration-order';
 
 import {
-  getServerSideCommonProps, getNextI18NextConfig, useCustomTitle, CommonProps,
+  getServerSideCommonProps, getNextI18NextConfig, generateCustomTitle, CommonProps,
 } from './utils/commons';
 
 type Props = CommonProps & {
@@ -21,8 +22,14 @@ type Props = CommonProps & {
 }
 
 const UserActivationPage: NextPage<Props> = (props: Props) => {
+
+  const title = generateCustomTitle(props, 'GROWI');
+
   return (
-    <NoLoginLayout title={useCustomTitle(props, 'GROWI')}>
+    <NoLoginLayout>
+      <Head>
+        <title>{title}</title>
+      </Head>
       <CompleteUserRegistrationForm
         token={props.token}
         email={props.email}

+ 2 - 2
packages/app/src/pages/utils/commons.ts

@@ -101,7 +101,7 @@ export const getNextI18NextConfig = async(
  * @param props
  * @param title
  */
-export const useCustomTitle = (props: CommonProps, title: string): string => {
+export const generateCustomTitle = (props: CommonProps, title: string): string => {
   return props.customTitleTemplate
     .replace('{{sitename}}', props.appTitle)
     .replace('{{page}}', title)
@@ -114,7 +114,7 @@ export const useCustomTitle = (props: CommonProps, title: string): string => {
  * @param props
  * @param pagePath
  */
-export const useCustomTitleForPage = (props: CommonProps, pagePath: string): string => {
+export const generateCustomTitleForPage = (props: CommonProps, pagePath: string): string => {
   const dPagePath = new DevidedPagePath(pagePath, true, true);
 
   return props.customTitleTemplate

+ 10 - 1
packages/app/src/stores/middlewares/sync-to-storage.ts

@@ -1,6 +1,10 @@
 import { isClient } from '@growi/core';
 import { Middleware } from 'swr';
 
+import loggerFactory from '~/utils/logger';
+
+const logger = loggerFactory('growi:stores:sync-to-storage');
+
 const generateKeyInStorage = (key: string): string => {
   return `swr-cache-${key}`;
 };
@@ -30,7 +34,12 @@ export const createSyncToStorageMiddlware = (
       // retrieve initial data from storage
       const itemInStorage = storage.getItem(keyInStorage);
       if (itemInStorage != null) {
-        initData = storageSerializer.deserialize(itemInStorage);
+        try {
+          initData = storageSerializer.deserialize(itemInStorage);
+        }
+        catch (e) {
+          logger.warn(`Could not deserialize the item for the key '${keyInStorage}'`);
+        }
       }
 
       config.fallbackData = initData;

+ 14 - 8
packages/app/src/stores/ui.tsx

@@ -6,7 +6,7 @@ import {
 import { withUtils, SWRResponseWithUtils } from '@growi/core/src/utils/with-utils';
 import { Breakpoint, addBreakpointListener, cleanupBreakpointListener } from '@growi/ui';
 import { HtmlElementNode } from 'rehype-toc';
-import SimpleBar from 'simplebar-react';
+import type SimpleBar from 'simplebar-react';
 import {
   useSWRConfig, SWRResponse, Key, Fetcher,
 } from 'swr';
@@ -79,14 +79,16 @@ export const useIsMobile = (): SWRResponse<boolean, Error> => {
   return useStaticSWR<boolean, Error>(key, undefined, configuration);
 };
 
-const getClassNamesByEditorMode = (editorMode: EditorMode | undefined, isSidebar = false): string[] => {
+// TODO: Enable `editing-sidebar` class
+// https://redmine.weseek.co.jp/issues/111527
+const getClassNamesByEditorMode = (editorMode: EditorMode | undefined /* , isSidebar = false */): string[] => {
   const classNames: string[] = [];
   switch (editorMode) {
     case EditorMode.Editor:
       classNames.push('editing', 'builtin-editor');
-      if (isSidebar) {
-        classNames.push('editing-sidebar');
-      }
+      // if (isSidebar) {
+      //   classNames.push('editing-sidebar');
+      // }
       break;
     case EditorMode.HackMD:
       classNames.push('editing', 'hackmd');
@@ -138,8 +140,10 @@ export const determineEditorModeByHash = (): EditorMode => {
   }
 };
 
+// TODO: Enable `editing-sidebar` class somehow
+// https://redmine.weseek.co.jp/issues/111527
 type EditorModeUtils = {
-  getClassNamesByEditorMode: (isEditingSidebar: boolean) => string[],
+  getClassNamesByEditorMode: (/* isEditingSidebar: boolean */) => string[],
 }
 
 export const useEditorMode = (): SWRResponseWithUtils<EditorModeUtils, EditorMode> => {
@@ -167,9 +171,11 @@ export const useEditorMode = (): SWRResponseWithUtils<EditorModeUtils, EditorMod
     return mutateOriginal(editorMode, shouldRevalidate);
   }, [isEditable, mutateOriginal]);
 
+  // TODO: Enable `editing-sidebar` class
+  // https://redmine.weseek.co.jp/issues/111527
   // construct getClassNamesByEditorMode method
-  const getClassNames = useCallback((isEditingSidebar: boolean) => {
-    return getClassNamesByEditorMode(swrResponse.data, isEditingSidebar);
+  const getClassNames = useCallback((/* isEditingSidebar: boolean */) => {
+    return getClassNamesByEditorMode(swrResponse.data /* , isEditingSidebar */);
   }, [swrResponse.data]);
 
   return Object.assign(swrResponse, {

+ 24 - 18
packages/app/src/stores/websocket.tsx

@@ -1,6 +1,6 @@
 import { useEffect } from 'react';
 
-import io, { Socket } from 'socket.io-client';
+import type { Socket } from 'socket.io-client';
 import { SWRResponse } from 'swr';
 
 import loggerFactory from '~/utils/logger';
@@ -23,14 +23,19 @@ export const useSetupGlobalSocket = (): void => {
   const { mutate } = useStaticSWR(GLOBAL_SOCKET_KEY);
 
   useEffect(() => {
-    const socket = io(GLOBAL_SOCKET_NS, {
-      transports: ['websocket'],
-    });
+    const setUpSocket = async() => {
+      const { io } = await import('socket.io-client');
+      const socket = io(GLOBAL_SOCKET_NS, {
+        transports: ['websocket'],
+      });
 
-    socket.on('error', (err) => { logger.error(err) });
-    socket.on('connect_error', (err) => { logger.error('Failed to connect with websocket.', err) });
+      socket.on('error', (err) => { logger.error(err) });
+      socket.on('connect_error', (err) => { logger.error('Failed to connect with websocket.', err) });
 
-    mutate(socket);
+      mutate(socket);
+    };
+
+    setUpSocket();
 
   }, [mutate]);
 };
@@ -39,23 +44,24 @@ export const useGlobalSocket = (): SWRResponse<Socket, Error> => {
   return useStaticSWR(GLOBAL_SOCKET_KEY);
 };
 
+// comment out for porduction build error: https://github.com/weseek/growi/pull/7131
 /*
  * Global Admin Socket
  */
-export const useSetupGlobalAdminSocket = (shouldInit: boolean): SWRResponse<Socket, Error> => {
-  let socket: Socket | undefined;
+// export const useSetupGlobalAdminSocket = (shouldInit: boolean): SWRResponse<Socket, Error> => {
+//   let socket: Socket | undefined;
 
-  if (shouldInit) {
-    socket = io(GLOBAL_ADMIN_SOCKET_NS, {
-      transports: ['websocket'],
-    });
+//   if (shouldInit) {
+//     socket = io(GLOBAL_ADMIN_SOCKET_NS, {
+//       transports: ['websocket'],
+//     });
 
-    socket.on('error', (err) => { logger.error(err) });
-    socket.on('connect_error', (err) => { logger.error('Failed to connect with websocket.', err) });
-  }
+//     socket.on('error', (err) => { logger.error(err) });
+//     socket.on('connect_error', (err) => { logger.error('Failed to connect with websocket.', err) });
+//   }
 
-  return useStaticSWR(shouldInit ? GLOBAL_ADMIN_SOCKET_KEY : null, socket);
-};
+//   return useStaticSWR(shouldInit ? GLOBAL_ADMIN_SOCKET_KEY : null, socket);
+// };
 
 export const useGlobalAdminSocket = (): SWRResponse<Socket, Error> => {
   return useStaticSWR(GLOBAL_ADMIN_SOCKET_KEY);

+ 2 - 2
packages/app/src/styles/_layout.scss

@@ -6,11 +6,11 @@ body {
   overscroll-behavior-y: none;
 }
 
-.layout-root:not(.growi-layout-fluid) .grw-container-convertible {
+.dynamic-layout-root:not(.growi-layout-fluid) .grw-container-convertible {
   @extend .container-lg;
 }
 
-.layout-root.growi-layout-fluid .grw-container-convertible {
+.dynamic-layout-root.growi-layout-fluid .grw-container-convertible {
   @extend .container-fluid;
 }
 

+ 3 - 0
packages/app/src/styles/style-app.scss

@@ -10,6 +10,9 @@
 @import '~simplebar/dist/simplebar.min.css';
 @import 'override-simplebar';
 
+// Emoji-mart style
+@import '~emoji-mart/css/emoji-mart.css';
+
 // KaTeX
 @import '~katex/dist/katex.min';
 

+ 11 - 8
packages/app/test/cypress/integration/10-install/10-install--install.spec.ts

@@ -3,22 +3,24 @@ describe('Install', () => {
 
   beforeEach(() => {
     cy.visit('/');
+    cy.getByTestid('installerForm').should('be.visible');
   });
 
   it('Successfully show installer', () => {
-    cy.getByTestid('installerForm').should('be.visible');
     cy.screenshot(`${ssPrefix}-redirect-to-installer-page`);
   });
 
   it('Sccessfully choose languages', () => {
-    cy.getByTestid('installerForm').should('be.visible');
     cy.getByTestid('dropdownLanguage').should('be.visible');
-    // TODO: should not use wait.
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(1000); // waiting for load
 
-    cy.getByTestid('dropdownLanguage').click();
-    cy.get('.dropdown-menu').should('be.visible');
+    // open Language Dropdown, wait for language data to load
+    cy.waitUntil(() => {
+      // do
+      cy.getByTestid('dropdownLanguage').click();
+      // wati until
+      return cy.get('.dropdown-menu').then($elem => $elem.is(':visible'));
+    });
+
     cy.getByTestid('dropdownLanguageMenu-en_US').click();
     cy.get('.alert-success').should('be.visible');
     cy.screenshot(`${ssPrefix}-select-en_US`);
@@ -48,8 +50,9 @@ describe('Install', () => {
     cy.getByTestid('btnSubmit').click();
 
     // Redirects to the root page take a long time (more than 10000ms)
+    cy.getByTestid('grw-pagetree-item-container', { timeout: 20000 }).should('be.visible');
+
     cy.waitUntilSkeletonDisappear();
-    cy.getByTestid('grw-pagetree-item-container').should('be.visible');
     cy.screenshot(`${ssPrefix}-installed-redirect-to-root-page`, {
       blackout: ['[data-hide-in-vrt=true]']
     });

+ 1 - 1
packages/app/test/cypress/integration/20-basic-features/20-basic-features--access-to-page.spec.ts

@@ -15,7 +15,7 @@ context('Access to page', () => {
     // for check download toc data
     cy.get('.toc-link').eq(0).contains('Table of Contents');
 
-    cy.collapseSidebar(true);
+    cy.collapseSidebar(true, true);
     cy.screenshot(`${ssPrefix}-sandbox`);
   });
 

+ 35 - 72
packages/app/test/cypress/integration/20-basic-features/20-basic-features--access-to-pagelist.spec.ts

@@ -5,79 +5,61 @@ context('Access to pagelist', () => {
     cy.fixture("user-admin.json").then(user => {
       cy.login(user.username, user.password);
     });
-  });
-
-  it('Page list modal is successfully opened ', () => {
     cy.visit('/');
-    cy.waitUntilSkeletonDisappear();
     cy.collapseSidebar(true);
+    cy.waitUntilSkeletonDisappear();
 
-    cy.getByTestid('pageListButton').click({force: true});
-    cy.getByTestid('page-accessories-modal').parent().should('have.class','show');
-    cy.getByTestid('page-list-item-L').should('be.visible');
+    // open PageAccessoriesModal
+    cy.waitUntil(() => {
+      // do
+      cy.getByTestid('pageListButton').click({force: true});
+      // wait until
+      return cy.getByTestid('descendants-page-list-modal').then($elem => $elem.is(':visible'));
+    });
+
+    cy.waitUntilSpinnerDisappear();
+  });
 
+  it('Page list modal is successfully opened ', () => {
     // Wait until the string "You cannot see this page" is no longer displayed
     cy.getByTestid('page-list-item-L').eq(0).within(() => {
       cy.get('.icon-exclamation').should('not.exist');
     });
 
+    cy.waitUntilSpinnerDisappear();
+    cy.waitUntilSkeletonDisappear();
     cy.screenshot(`${ssPrefix}1-open-pagelist-modal`);
   });
 
-  it('Successfully duplicate a page from page list', () => {
-    cy.visit('/');
-    cy.getByTestid('pageListButton').click({force: true});
-    cy.getByTestid('page-accessories-modal').parent().should('have.class','show').within(() => {
-      cy.getByTestid('open-page-item-control-btn').first().click();
-      cy.getByTestid('page-item-control-menu').should('have.class', 'show').first().within(() => {
-        // eslint-disable-next-line cypress/no-unnecessary-waiting
-        cy.wait(300);
-        cy.screenshot(`${ssPrefix}2-open-page-item-control-menu`);
-        cy.getByTestid('open-page-duplicate-modal-btn').click();
+  it('Successfully open PageItemControl', () => {
+    cy.waitUntil(() => {
+      // do
+      cy.getByTestid('descendants-page-list-modal').within(() => {
+        cy.getByTestid('page-list-item-L').first().within(() => {
+          cy.getByTestid('open-page-item-control-btn').click();
+        });
       });
+      // wait until
+      return cy.get('.dropdown-menu.show').then($elem => $elem.is(':visible'));
     });
-    cy.getByTestid('page-duplicate-modal').should('be.visible').screenshot(`${ssPrefix}3-duplicate-page-modal-opened`);
-    cy.getByTestid('page-duplicate-modal').should('be.visible').within(() => {
-      cy.get('.rbt-input-main').type('-duplicate', {force: true})
-    }).screenshot(`${ssPrefix}4-input-duplicated-page-name`);
-    cy.getByTestid('page-duplicate-modal').should('be.visible').within(() => {
-      cy.get('.modal-footer > button').click();
-    });
-    cy.get('body').type('{esc}');
-    cy.getByTestid('pageListButton').click({force: true});
-    cy.getByTestid('page-accessories-modal').parent().should('have.class','show').within(() => {
-      cy.get('.list-group-item').eq(0).within(() => {
-        cy.screenshot(`${ssPrefix}5-duplicated-page`);
-      });
+
+    cy.get('.dropdown-menu.show').within(() => {
+      cy.getByTestid('open-page-duplicate-modal-btn').should('be.visible')
     });
-  });
 
-  it('Successfully expand and close modal', () => {
-    cy.visit('/');
     cy.waitUntilSkeletonDisappear();
-    cy.collapseSidebar(true);
-
-    cy.getByTestid('pageListButton').click({force: true});
-    cy.getByTestid('page-accessories-modal').parent().should('have.class','show');
-    cy.getByTestid('page-list-item-L').should('be.visible');
-
-    // Wait until the string "You cannot see this page" is no longer displayed
-    cy.getByTestid('page-list-item-L').eq(0).within(() => {
-      cy.get('.icon-exclamation').should('not.exist');
-    });
+    cy.waitUntilSpinnerDisappear();
+    cy.screenshot(`${ssPrefix}2-open-page-item-control-menu`);
+  });
 
-    cy.screenshot(`${ssPrefix}6-page-list-modal-size-normal`);
-    cy.getByTestid('page-accessories-modal').parent().should('have.class','show').within(() => {
-      cy.get('button.close').eq(0).click();
-    });
+  it('Successfully expand and close modal', () => {
+    cy.get('button.close').eq(0).click();
 
+    cy.waitUntilSkeletonDisappear();
+    cy.waitUntilSpinnerDisappear();
     cy.screenshot(`${ssPrefix}7-page-list-modal-size-fullscreen`);
 
-    cy.getByTestid('page-accessories-modal').parent().should('have.class','show').within(() => {
-      cy.get('button.close').eq(1).click();
-    });
-
-    cy.collapseSidebar(true);
+    cy.get('button.close').eq(1).click();
     cy.screenshot(`${ssPrefix}8-close-page-list-modal`);
   });
 });
@@ -95,30 +77,11 @@ context('Access to timeline', () => {
     cy.collapseSidebar(true);
 
     cy.getByTestid('pageListButton').click({force: true});
-    cy.getByTestid('page-accessories-modal').parent().should('have.class','show').within(() => {
+    cy.getByTestid('descendants-page-list-modal').parent().should('have.class','show').within(() => {
       cy.get('.nav-title > li').eq(1).find('a').click();
     });
     // eslint-disable-next-line cypress/no-unnecessary-waiting
     cy.wait(500); // wait for loading wiki
     cy.screenshot(`${ssPrefix}1-timeline-list`);
   });
-
-  it('Successfully expand and close modal', () => {
-    cy.visit('/');
-    cy.collapseSidebar(true);
-
-    cy.getByTestid('pageListButton').click({force: true});
-    cy.getByTestid('page-accessories-modal').parent().should('have.class','show').within(() => {
-      cy.get('.nav-title > li').eq(1).find('a').click();
-      cy.get('button.close').eq(0).click();
-    });
-    cy.get('.modal').should('be.visible');
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(500); // wait for loading wiki
-    cy.screenshot(`${ssPrefix}2-timeline-list-fullscreen`);
-    cy.getByTestid('page-accessories-modal').parent().should('have.class','show').within(() => {
-      cy.get('button.close').eq(1).click();
-    });
-    cy.screenshot(`${ssPrefix}3-close-modal`);
-  });
 });

+ 11 - 5
packages/app/test/cypress/integration/20-basic-features/20-basic-features--click-page-icons.spec.ts

@@ -6,13 +6,11 @@ context('Click page icons button', () => {
     cy.fixture("user-admin.json").then(user => {
       cy.login(user.username, user.password);
     });
-    // collapse sidebar
-    cy.collapseSidebar(true);
   });
 
   it('Successfully subscribe/unsubscribe a page', () => {
     cy.visit('/Sandbox');
-    cy.waitUntilSkeletonDisappear();
+    cy.collapseSidebar(true, true);
 
     // Subscribe
     cy.get('#subscribe-button').click({force: true});
@@ -26,6 +24,7 @@ context('Click page icons button', () => {
     })
     cy.getByTestid('subscribe-button-tooltip').should('not.exist');
 
+    cy.waitUntilSkeletonDisappear();
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}1-subscribe-page`) })
 
     // Unsubscribe
@@ -40,12 +39,13 @@ context('Click page icons button', () => {
     })
     cy.getByTestid('subscribe-button-tooltip').should('not.exist');
 
+    cy.waitUntilSkeletonDisappear();
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}2-unsubscribe-page`) })
   });
 
   it('Successfully Like / Dislike a page', () => {
     cy.visit('/Sandbox');
-    cy.waitUntilSkeletonDisappear();
+    cy.collapseSidebar(true);
 
     // like
     cy.get('#like-button').click({force: true});
@@ -59,6 +59,7 @@ context('Click page icons button', () => {
     })
     cy.getByTestid('like-button-tooltip').should('not.exist');
 
+    cy.waitUntilSpinnerDisappear();
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}3-like-page`) });
 
     // total liker (user-list-popover is commented out because it is sometimes displayed and sometimes not.)
@@ -78,6 +79,7 @@ context('Click page icons button', () => {
     })
     cy.getByTestid('like-button-tooltip').should('not.exist');
 
+    cy.waitUntilSpinnerDisappear();
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}5-dislike-page`) });
 
     // total liker (user-list-popover is commented out because it is sometimes displayed and sometimes not.)
@@ -88,7 +90,7 @@ context('Click page icons button', () => {
 
   it('Successfully Bookmark / Unbookmark a page', () => {
     cy.visit('/Sandbox');
-    cy.waitUntilSkeletonDisappear();
+    cy.collapseSidebar(true);
 
     // bookmark
     cy.get('#bookmark-button').click({force: true});
@@ -102,11 +104,13 @@ context('Click page icons button', () => {
     })
     cy.getByTestid('bookmark-button-tooltip').should('not.exist');
 
+    cy.waitUntilSpinnerDisappear();
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}7-bookmark-page`) });
 
     // total bookmarker
     cy.get('#po-total-bookmarks').click({force: true});
     cy.get('.user-list-popover').should('be.visible');
+    cy.waitUntilSpinnerDisappear();
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}8-bookmarks-counter`) });
 
     // unbookmark
@@ -121,11 +125,13 @@ context('Click page icons button', () => {
     })
     cy.getByTestid('bookmark-button-tooltip').should('not.exist');
 
+    cy.waitUntilSpinnerDisappear();
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}9-unbookmark-page`) });
 
     // total bookmarker
     cy.get('#po-total-bookmarks').click({force: true});
     cy.get('.user-list-popover').should('be.visible');
+    cy.waitUntilSpinnerDisappear();
     cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}10-bookmarks-counter`) });
   });
 

+ 119 - 257
packages/app/test/cypress/integration/20-basic-features/20-basic-features--use-tools.spec.ts

@@ -1,25 +1,3 @@
-context('Switch Sidebar content', { scrollBehavior: false }, () => {
-  const ssPrefix = 'switch-sidebar-content';
-
-  beforeEach(() => {
-    // login
-    cy.fixture("user-admin.json").then(user => {
-      cy.login(user.username, user.password);
-    });
-  });
-
-  it('PageTree is successfully shown', () => {
-    cy.visit('/page');
-    cy.collapseSidebar(false);
-    cy.waitUntilSkeletonDisappear();
-
-    cy.getByTestid('grw-sidebar-nav-primary-page-tree').click();
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(1500);
-    cy.screenshot(`${ssPrefix}-pagetree-after-load`);
-  });
-});
-
 context('Modal for page operation', () => {
 
   const ssPrefix = 'modal-for-page-operation-';
@@ -33,12 +11,13 @@ context('Modal for page operation', () => {
 
   it("PageCreateModal is shown and closed successfully", () => {
     cy.visit('/');
-    cy.waitUntilSkeletonDisappear();
 
-    cy.getByTestid('newPageBtn').click();
-
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(1000) // Wait for animation to finish when the Create Page button is pressed
+    cy.waitUntil(() => {
+      // do
+      cy.getByTestid('newPageBtn').click({force: true});
+      // wait until
+      return cy.getByTestid('page-create-modal').then($elem => $elem.is(':visible'));
+    });
 
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {
       cy.screenshot(`${ssPrefix}new-page-modal-opened`);
@@ -52,9 +31,13 @@ context('Modal for page operation', () => {
   it("Successfully Create Today's page", () => {
     const pageName = "Today's page";
     cy.visit('/');
-    cy.waitUntilSkeletonDisappear();
 
-    cy.getByTestid('newPageBtn').click();
+    cy.waitUntil(() => {
+      // do
+      cy.getByTestid('newPageBtn').click({force: true});
+      // wait until
+      return cy.getByTestid('page-create-modal').then($elem => $elem.is(':visible'));
+    });
 
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {
       cy.get('.page-today-input2').type(pageName);
@@ -67,10 +50,7 @@ context('Modal for page operation', () => {
 
     cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
 
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(300);
-
-    cy.collapseSidebar(true, true);
+    cy.collapseSidebar(true);
     cy.waitUntilSkeletonDisappear();
     cy.screenshot(`${ssPrefix}create-today-page`);
   });
@@ -78,16 +58,17 @@ context('Modal for page operation', () => {
   it('Successfully create page under specific path', () => {
     const pageName = 'child';
 
-    cy.visit('/Sandbox');
-    cy.waitUntilSkeletonDisappear();
-
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(1000);
+    cy.visit('/foo/bar');
 
-    cy.getByTestid('newPageBtn').click();
+    cy.waitUntil(() => {
+      // do
+      cy.getByTestid('newPageBtn').click({force: true});
+      // wait until
+      return cy.getByTestid('page-create-modal').then($elem => $elem.is(':visible'));
+    });
 
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {
-      cy.get('.rbt-input-main').should('have.value', '/Sandbox/');
+      cy.get('.rbt-input-main').should('have.value', '/foo/bar/');
       cy.get('.rbt-input-main').type(pageName);
       cy.screenshot(`${ssPrefix}under-path-add-page-name`);
       cy.getByTestid('btn-create-page-under-below').click();
@@ -98,9 +79,6 @@ context('Modal for page operation', () => {
 
     cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
 
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(300);
-
     cy.waitUntilSkeletonDisappear();
     cy.collapseSidebar(true);
     cy.screenshot(`${ssPrefix}create-page-under-specific-page`);
@@ -108,12 +86,15 @@ context('Modal for page operation', () => {
 
   it('Trying to create template page under the root page fail', () => {
     cy.visit('/');
-    cy.waitUntilSkeletonDisappear();
 
-    cy.getByTestid('newPageBtn').click();
+    cy.waitUntil(() => {
+      // do
+      cy.getByTestid('newPageBtn').click({force: true});
+      // wait until
+      return cy.getByTestid('page-create-modal').then($elem => $elem.is(':visible'));
+    });
 
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {
-
       cy.getByTestid('grw-page-create-modal-path-name').should('have.text', '/');
 
       cy.get('#template-type').click();
@@ -138,7 +119,6 @@ context('Modal for page operation', () => {
 
   it('Page Deletion and PutBack is executed successfully', { scrollBehavior: false }, () => {
     cy.visit('/Sandbox/Bootstrap4');
-    cy.waitUntilSkeletonDisappear();
 
     cy.get('#grw-subnav-container').within(() => {
       cy.getByTestid('open-page-item-control-btn').click({force: true});
@@ -229,58 +209,56 @@ context('Page Accessories Modal', () => {
     cy.fixture("user-admin.json").then(user => {
       cy.login(user.username, user.password);
     });
+
+    cy.visit('/Sandbox/Bootstrap4');
+
+    cy.getByTestid('grw-contextual-sub-nav').as('subnav').should('be.visible').within(() => {
+      cy.getByTestid('open-page-item-control-btn').as('pageItemControlBtn').should('be.visible');
+    });
+    cy.waitUntil(() => {
+      // do
+      cy.get('@pageItemControlBtn').click();
+      // wait until
+      return cy.get('.dropdown-menu.show').then($elem => $elem.is(':visible'));
+    });
+
   });
 
   it('Page History is shown successfully', () => {
-     cy.visit('/Sandbox/Bootstrap4');
-     cy.waitUntilSkeletonDisappear();
-
-     cy.get('#grw-subnav-container').within(() => {
-      cy.getByTestid('open-page-item-control-btn').within(() => {
-        cy.get('button.btn-page-item-control').click({force: true});
-      });
+    cy.get('.dropdown-menu.show').should('be.visible').within(() => {
       cy.getByTestid('open-page-accessories-modal-btn-with-history-tab').click({force: true});
     });
 
-     cy.getByTestid('page-history').should('be.visible');
-     cy.collapseSidebar(true);
-     cy.screenshot(`${ssPrefix}-open-page-history-bootstrap4`);
+    cy.getByTestid('page-history').should('be.visible');
+
+    cy.collapseSidebar(true, true);
+    cy.waitUntilSpinnerDisappear();
+    cy.screenshot(`${ssPrefix}-open-page-history-bootstrap4`);
   });
 
   it('Page Attachment Data is shown successfully', () => {
-     cy.visit('/Sandbox/Bootstrap4');
-     cy.waitUntilSkeletonDisappear();
-
-     cy.get('#grw-subnav-container').within(() => {
-      cy.getByTestid('open-page-item-control-btn').within(() => {
-        cy.get('button.btn-page-item-control').click({force: true});
-      });
+    cy.get('.dropdown-menu.show').should('be.visible').within(() => {
       cy.getByTestid('open-page-accessories-modal-btn-with-attachment-data-tab').click({force: true});
     });
 
-     cy.getByTestid('page-attachment').should('be.visible').contains('No attachments yet.');
+    cy.waitUntilSpinnerDisappear();
+    cy.getByTestid('page-attachment').should('be.visible').contains('No attachments yet.');
 
-     cy.collapseSidebar(true);
-     cy.screenshot(`${ssPrefix}-open-page-attachment-data-bootstrap4`);
+    cy.collapseSidebar(true);
+    cy.screenshot(`${ssPrefix}-open-page-attachment-data-bootstrap4`);
   });
 
   it('Share Link Management is shown successfully', () => {
-    cy.visit('/Sandbox/Bootstrap4');
-    cy.waitUntilSkeletonDisappear();
-
-    cy.get('#grw-subnav-container').within(() => {
-      cy.getByTestid('open-page-item-control-btn').within(() => {
-        cy.get('button.btn-page-item-control').click({force: true});
-      });
-      cy.getByTestid('open-page-accessories-modal-btn-with-share-link-management-data-tab').should('be.visible');
-      cy.getByTestid('open-page-accessories-modal-btn-with-share-link-management-data-tab').click();
-   });
+    cy.get('.dropdown-menu.show').should('be.visible').within(() => {
+      cy.getByTestid('open-page-accessories-modal-btn-with-share-link-management-data-tab').click({force: true});
+    });
 
-   cy.getByTestid('page-accessories-modal').should('be.visible');
-   cy.getByTestid('share-link-management').should('be.visible');
+    cy.waitUntilSpinnerDisappear();
+    cy.getByTestid('page-accessories-modal').should('be.visible');
+    cy.getByTestid('share-link-management').should('be.visible');
 
-   cy.collapseSidebar(true);
-   cy.screenshot(`${ssPrefix}-open-share-link-management-bootstrap4`);
+    cy.collapseSidebar(true);
+    cy.screenshot(`${ssPrefix}-open-share-link-management-bootstrap4`);
   });
 });
 
@@ -297,209 +275,93 @@ context('Tag Oprations', { scrollBehavior: false }, () =>{
     const ssPrefix = 'tag-operations-add-new-tag-'
     const tag = 'we';
 
-    cy.visit('/Sandbox');
-    cy.waitUntilSkeletonDisappear();
+    cy.visit('/Sandbox/Bootstrap4');
 
-    cy.get('#edit-tags-btn-wrapper-for-tooltip > a').should('be.visible');
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(200);
-    cy.get('#edit-tags-btn-wrapper-for-tooltip > a').click();
-    cy.get('#edit-tag-modal').should('be.visible').screenshot(`${ssPrefix}1-edit-tag-input`);
+    // Add tag
+    cy.get('#edit-tags-btn-wrapper-for-tooltip').as('edit-tag-tooltip').should('be.visible');
 
-    cy.get('#edit-tag-modal').within(() => {
-      cy.get('.rbt-input-main').type(tag, {force: true});
-      cy.get('#tag-typeahead-asynctypeahead').should('be.visible');
-      cy.get('#tag-typeahead-asynctypeahead-item-0').should('be.visible');
-      cy.screenshot(`${ssPrefix}2-type-tag-name`);
+    // open Edit Tags Modal
+    cy.waitUntil(() => {
+      // do
+      cy.get('@edit-tag-tooltip').find('a').click({force: true});
+      // wait until
+      return cy.get('#edit-tag-modal').then($elem => $elem.is(':visible'));
     });
 
-    cy.get('#edit-tag-modal').within(() => {
+    cy.collapseSidebar(true);
+    cy.get('#edit-tag-modal').should('be.visible').screenshot(`${ssPrefix}1-edit-tag-input`);
+
+    cy.get('#edit-tag-modal').should('be.visible').within(() => {
+      cy.get('.rbt-input-main').type(tag);
       cy.get('#tag-typeahead-asynctypeahead').should('be.visible');
       cy.get('#tag-typeahead-asynctypeahead-item-0').should('be.visible');
-      cy.get('a#tag-typeahead-asynctypeahead-item-0').click({force: true})
-      cy.screenshot(`${ssPrefix}3-insert-tag-name`);
-    });
-
-    cy.get('#edit-tag-modal').within(() => {
+      // select
+      cy.get('a#tag-typeahead-asynctypeahead-item-0').click();
+      // save
       cy.get('div.modal-footer > button').click();
     });
 
     cy.get('.toast').should('be.visible').trigger('mouseover');
     cy.get('.grw-taglabels-container > .grw-tag-labels > a').contains(tag).should('exist');
-    /* eslint-disable cypress/no-unnecessary-waiting */
-    cy.wait(150); // wait for toastr to change its color occured by mouseover
-    cy.collapseSidebar(true);
-    cy.screenshot(`${ssPrefix}4-click-done`);
-  });
 
-  it('Successfully duplicate page by generated tag', () => {
-    const ssPrefix = 'tag-operations-page-duplicate-';
-    const tag = 'we';
-    const newPageName = 'our';
+    cy.screenshot(`${ssPrefix}2-click-done`);
+  });
 
-    cy.visit('/Sandbox');
-    cy.waitUntilSkeletonDisappear();
+});
 
-    cy.get('.grw-tag-label').should('be.visible').contains(tag).click();
+context('Shortcuts', () => {
+  const ssPrefix = 'shortcuts';
 
-    // Search result page
-    cy.getByTestid('search-result-base').should('be.visible');
-    cy.getByTestid('search-result-list').should('be.visible');
-    cy.getByTestid('search-result-content', { timeout: 60000 }).should('be.visible');
-    cy.get('#revision-loader', { timeout: 60000 }).contains('Table of Contents', { timeout: 60000 });
+  beforeEach(() => {
+    // login
+    cy.fixture("user-admin.json").then(user => {
+      cy.login(user.username, user.password);
+    });
+  });
 
-    // force to add 'active' to pass VRT: https://github.com/weseek/growi/pull/6603
-    cy.getByTestid('page-list-item-L').first().invoke('addClass', 'active');
-    cy.collapseSidebar(true);
-    cy.screenshot(`${ssPrefix}1-click-tag-name`);
-    cy.getByTestid('search-result-list').should('be.visible').then(($el)=>{
-      cy.wrap($el).within(()=>{
-        cy.getByTestid('open-page-item-control-btn').first().click();
-      });
+  it('Successfully updating a page using a shortcut on a previously created page', { scrollBehavior: false }, () => {
+    const body1 = 'hello';
+    const body2 = ' world!';
+    const savePageShortcutKey = '{ctrl+s}';
 
-      // eslint-disable-next-line cypress/no-unnecessary-waiting
-      cy.wait(1500); // for wait rendering pagelist info
-      cy.collapseSidebar(true);
-      cy.screenshot(`${ssPrefix}2-click-three-dots-menu`);
+    cy.visit('/Sandbox/child');
 
-      cy.wrap($el).within(()=>{
-        cy.getByTestid('open-page-item-control-btn').first().within(()=>{
-          cy.getByTestid('open-page-duplicate-modal-btn').click();
-        })
+    cy.get('#grw-page-editor-mode-manager').as('pageEditorModeManager').should('be.visible');
+    cy.waitUntil(() => {
+      // do
+      cy.get('@pageEditorModeManager').within(() => {
+        cy.get('button:nth-child(2)').click();
       });
+      // until
+      return cy.get('.layout-root').then($elem => $elem.hasClass('editing'));
     })
 
-    cy.getByTestid('page-duplicate-modal').should('be.visible').within(() => {
-      cy.get('.rbt-input-main').type(`-${newPageName}`, {force: true});
-    }).screenshot(`${ssPrefix}3-duplicate-page`);
-
-    cy.getByTestid('page-duplicate-modal').within(() => {
-      cy.intercept('POST', '/_api/v3/pages/duplicate').as('duplicate');
-      cy.get('.modal-footer > button.btn').click();
-      // Wait for completion of request to '/_api/v3/pages/duplicate'
-      cy.wait('@duplicate')
-    });
-
-    cy.visit(`Sandbox-${newPageName}`);
-    cy.waitUntilSkeletonDisappear();
-    cy.collapseSidebar(true);
-    cy.screenshot(`${ssPrefix}4-duplicated-page`);
-  });
-
-  it('Successfully rename page from generated tag', () => {
-    const ssPrefix = 'tag-operations-page-rename-';
-    const tag = 'we';
-    const oldPageName = '/Sandbox-our';
-    const newPageName = '/Sandbox-us';
-
-    cy.visit(oldPageName);
-    cy.waitUntilSkeletonDisappear();
-
-    cy.get('.grw-tag-label').should('be.visible').contains(tag).click();
+    cy.get('.grw-editor-navbar-bottom').should('be.visible');
 
-    // Search result page
-    cy.getByTestid('search-result-base').should('be.visible');
-    cy.getByTestid('search-result-list').should('be.visible');
-    cy.getByTestid('search-result-content', { timeout: 60000 }).should('be.visible');
-    cy.get('#revision-loader', { timeout: 60000 }).contains('Table of Contents', { timeout: 60000 });
+    // 1st
+    cy.get('.CodeMirror').type(body1);
+    cy.get('.CodeMirror').contains(body1);
+    cy.get('.page-editor-preview-body').contains(body1);
+    cy.get('.CodeMirror').type(savePageShortcutKey);
 
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(300);
-    cy.collapseSidebar(true);
-    cy.screenshot(`${ssPrefix}1-click-tag-name`);
-
-    cy.getByTestid('search-result-list').within(() => {
-      cy.get('.list-group-item').each(($row) => {
-        if($row.find('a').text() === oldPageName){
-          cy.wrap($row).within(() => {
-            cy.getByTestid('open-page-item-control-btn').first().click();
-            cy.getByTestid('page-item-control-menu').should('have.class', 'show').then(() => {
-              // empty sentence in page list empty: https://github.com/weseek/growi/pull/6880
-              cy.getByTestid('revision-short-body-in-page-list-item-L').invoke('text', '');
-            });
-
-            cy.getByTestid('page-item-control-menu').within(()=>{
-              cy.getByTestid('open-page-delete-modal-btn');
-              cy.screenshot(`${ssPrefix}2-open-page-item-control-menu`);
-            })
-          });
-        }
-      });
+    cy.get('.Toastify__toast').should('be.visible').within(() => {
+      cy.get('.Toastify__close-button').should('be.visible').click();
+      cy.get('.Toastify__progress-bar').invoke('attr', 'style', 'display: none')
     });
+    cy.screenshot(`${ssPrefix}-update-page-1`);
 
-    cy.getByTestid('search-result-list').within(() => {
-      cy.get('.list-group-item').each(($row) => {
-        if($row.find('a').text() === oldPageName){
-          cy.wrap($row).within(() => {
-            cy.getByTestid('open-page-move-rename-modal-btn').click({force: true});
-          });
-        }
-      });
-    });
+    cy.get('.Toastify').should('not.be.visible');
 
-    cy.getByTestid('page-rename-modal').should('be.visible').within(() => {
-      cy.get('.rbt-input-main').clear().type(newPageName,{force: true});
-    }).screenshot(`${ssPrefix}3-insert-new-page-name`);
+    // 2nd
+    cy.get('.CodeMirror').type(body2);
+    cy.get('.CodeMirror').contains(body2);
+    cy.get('.page-editor-preview-body').contains(body2);
+    cy.get('.CodeMirror').type(savePageShortcutKey);
 
-    cy.getByTestid('page-rename-modal').should('be.visible').within(() => {
-      cy.intercept('PUT', '/_api/v3/pages/rename').as('rename');
-      cy.getByTestid('grw-page-rename-button').should('not.be.disabled').click();
-      // Wait for completion of request to '/_api/v3/pages/rename'
-      cy.wait('@rename')
+    cy.get('.Toastify__toast').should('be.visible').within(() => {
+      cy.get('.Toastify__close-button').should('be.visible').click();
+      cy.get('.Toastify__progress-bar').invoke('attr', 'style', 'display: none')
     });
-
-    cy.visit(newPageName);
-    cy.waitUntilSkeletonDisappear();
-
-    cy.getByTestid('grw-tag-labels').should('be.visible')
-    cy.collapseSidebar(true);
-    cy.screenshot(`${ssPrefix}4-new-page-name-applied`);
+    cy.screenshot(`${ssPrefix}-update-page-2`);
   });
 });
-
-// context('Shortcuts', () => {
-//   const ssPrefix = 'shortcuts';
-
-//   beforeEach(() => {
-//     // login
-//     cy.fixture("user-admin.json").then(user => {
-//       cy.login(user.username, user.password);
-//     });
-//   });
-
-//   it('Successfully updating a page using a shortcut on a previously created page', { scrollBehavior: false }, () => {
-//     const body1 = 'hello';
-//     const body2 = 'world';
-//     const savePageShortcutKey = '{ctrl+s}';
-
-//     cy.visit('/Sandbox/child');
-//     cy.waitUntilSkeletonDisappear();
-
-//     cy.get('#grw-subnav-container').within(() => {
-//       cy.getByTestid('editor-button').click();
-//     });
-
-//     cy.get('.layout-root').should('have.class', 'editing');
-//     cy.get('.grw-editor-navbar-bottom').should('be.visible');
-
-//     // 1st
-//     cy.get('.CodeMirror').type(body1);
-//     cy.get('.CodeMirror').contains(body1);
-//     cy.get('.page-editor-preview-body').contains(body1);
-//     cy.get('.CodeMirror').type(savePageShortcutKey);
-
-//     cy.get('.Toastify').should('visible').trigger('mouseover');
-//     cy.screenshot(`${ssPrefix}-update-page-1`);
-//     cy.get('.Toastify__close-button').should('be.visible').click();
-//     cy.get('.Toastify').should('not.be.visible');
-
-//     // 2nd
-//     cy.get('.CodeMirror').type(body2);
-//     cy.get('.CodeMirror').contains(body2);
-//     cy.get('.page-editor-preview-body').contains(body2);
-//     cy.get('.CodeMirror').type(savePageShortcutKey);
-
-//     cy.get('.Toastify').should('visible').trigger('mouseover');
-//     cy.screenshot(`${ssPrefix}-update-page-2`);
-//   });
-// });

+ 2 - 2
packages/app/test/cypress/integration/21-basic-features-for-guest/21-basic-features-for-guest--access-to-page.spec.ts

@@ -4,7 +4,7 @@ context('Access to page by guest', () => {
   it('/Sandbox is successfully loaded', () => {
     cy.visit('/Sandbox');
     cy.getByTestid('grw-pagetree-item-container').should('be.visible');
-    cy.collapseSidebar(true);
+    cy.collapseSidebar(true, true);
     cy.screenshot(`${ssPrefix}-sandbox`);
   });
 
@@ -18,7 +18,7 @@ context('Access to page by guest', () => {
     // hide fab // disable fab for sticky-events warning
     // cy.getByTestid('grw-fab-container').invoke('attr', 'style', 'display: none');
 
-    cy.collapseSidebar(true, true);
+    cy.collapseSidebar(true);
     cy.screenshot(`${ssPrefix}-sandbox-headers`);
   });
 

+ 204 - 110
packages/app/test/cypress/integration/30-search/30-search--search.spec.ts

@@ -1,13 +1,12 @@
 context('Access to search result page', () => {
   const ssPrefix = 'access-to-result-page-directly-';
 
+
   beforeEach(() => {
     // login
     cy.fixture("user-admin.json").then(user => {
       cy.login(user.username, user.password);
     });
-    // collapse sidebar
-    cy.collapseSidebar(true);
   });
 
   it('/_search with "q" param is successfully loaded', () => {
@@ -19,12 +18,17 @@ context('Access to search result page', () => {
     cy.get('.wiki').should('be.visible');
     // for avoid mismatch by auto scrolling
     cy.get('.search-result-content-body-container').scrollTo('top');
+
+    cy.collapseSidebar(true, true);
+    cy.waitUntilSkeletonDisappear();
     cy.screenshot(`${ssPrefix}with-q`);
   });
 
   it('checkboxes behaviors', () => {
     cy.visit('/_search', { qs: { q: 'labels alerts cards blocks' } });
 
+    cy.collapseSidebar(true);
+
     cy.getByTestid('search-result-base').should('be.visible');
     cy.getByTestid('search-result-list').should('be.visible');
     cy.getByTestid('search-result-content').should('be.visible');
@@ -36,7 +40,9 @@ context('Access to search result page', () => {
     cy.getByTestid('page-list-item-L').first().invoke('addClass', 'active');
 
     cy.getByTestid('cb-select').first().click({force: true});
+
     cy.screenshot(`${ssPrefix}the-first-checkbox-on`);
+
     cy.getByTestid('cb-select').first().click({force: true});
     cy.screenshot(`${ssPrefix}the-first-checkbox-off`);
 
@@ -61,8 +67,6 @@ context('Access to legacy private pages', () => {
     cy.fixture("user-admin.json").then(user => {
       cy.login(user.username, user.password);
     });
-    // collapse sidebar
-    cy.collapseSidebar(true);
   });
 
   it('/_private-legacy-pages is successfully loaded', () => {
@@ -71,6 +75,8 @@ context('Access to legacy private pages', () => {
     cy.getByTestid('search-result-base').should('be.visible');
     cy.getByTestid('search-result-private-legacy-pages').should('be.visible');
 
+    cy.collapseSidebar(true);
+    cy.waitUntilSkeletonDisappear();
     cy.screenshot(`${ssPrefix}shown`);
   });
 
@@ -84,14 +90,14 @@ context('Search all pages', () => {
     cy.fixture("user-admin.json").then(user => {
       cy.login(user.username, user.password);
     });
-    // collapse sidebar
-    cy.collapseSidebar(true);
   });
 
   it(`Search all pages by word is successfully loaded`, () => {
     const searchText = 'help';
 
     cy.visit('/');
+
+    cy.collapseSidebar(true, true);
     cy.waitUntilSkeletonDisappear();
 
     cy.get('.rbt-input').click();
@@ -102,107 +108,62 @@ context('Search all pages', () => {
     cy.get('.rbt-input-main').type(`${searchText}`);
     cy.screenshot(`${ssPrefix}2-insert-search-text`, { capture: 'viewport'});
     cy.get('.rbt-input-main').type('{enter}');
-
-
-    cy.getByTestid('search-result-base').should('be.visible');
-    cy.getByTestid('search-result-list').should('be.visible');
-    cy.getByTestid('search-result-content').should('be.visible');
-    cy.get('.wiki').should('be.visible');
-    // force to add 'active' to pass VRT: https://github.com/weseek/growi/pull/6603
-    cy.getByTestid('page-list-item-L').first().invoke('addClass', 'active');
-    // for avoid mismatch by auto scrolling
-    cy.get('.search-result-content-body-container').scrollTo('top');
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(1500);
-    cy.screenshot(`${ssPrefix}3-search-page-results`, { capture: 'viewport'});
-
-    cy.getByTestid('open-page-item-control-btn').eq(1).click();
-    cy.getByTestid('search-result-content').should('be.visible');
-    cy.get('.wiki').should('be.visible');
-    // for avoid mismatch by auto scrolling
-    cy.get('.search-result-content-body-container').scrollTo('top');
-    cy.screenshot(`${ssPrefix}4-click-three-dots-menu`, {capture: 'viewport'});
-
-    //Add bookmark
-    cy.getByTestid('add-remove-bookmark-btn').click({force: true});
-    cy.get('.btn-bookmark.active').should('be.visible');
-    cy.screenshot(`${ssPrefix}5-add-bookmark`, {capture: 'viewport'});
-
-    // Duplicate page
-    cy.getByTestid('open-page-duplicate-modal-btn').first().click({force: true});
-    cy.getByTestid('page-duplicate-modal').should('be.visible').within(() => {
-      cy.screenshot(`${ssPrefix}6-duplicate-page`);
-    });
-
-    // Close Modal
-    cy.get('body').type('{esc}');
-
-    // Move / Rename Page
-    cy.getByTestid('open-page-move-rename-modal-btn').first().click({force: true});
-    cy.getByTestid('page-rename-modal').should('be.visible').within(() => {
-      cy.screenshot(`${ssPrefix}7-move-rename-page`);
-    });
-
-    // Close Modal
-    cy.get('body').type('{esc}');
-
-    // Delete page
-    cy.getByTestid('open-page-delete-modal-btn').first().click({ force: true});
-    cy.getByTestid('page-delete-modal').should('be.visible').within(() => {
-      cy.screenshot(`${ssPrefix}8-delete-page`);
-    });
   });
 
   it(`Search all pages by tag is successfully loaded `, () => {
     const tag = 'help';
     const searchText = `tag:${tag}`;
+
     cy.visit('/');
-    cy.waitUntilSkeletonDisappear();
 
     // Add tag
     cy.get('#edit-tags-btn-wrapper-for-tooltip').as('edit-tag-tooltip').should('be.visible');
-    cy.get('@edit-tag-tooltip').within(()=>{
-      cy.get('a').should('be.visible').click();
-    })
-    cy.get('#edit-tag-modal').as('tag-modal').should('be.visible');
 
-    cy.get('@tag-modal').within(() => {
+    // open Edit Tags Modal
+    cy.waitUntil(() => {
+      // do
+      cy.get('@edit-tag-tooltip').find('a').click({force: true});
+      // wait until
+      return cy.get('#edit-tag-modal').then($elem => $elem.is(':visible'));
+    });
+
+    cy.get('#edit-tag-modal').should('be.visible').within(() => {
       cy.get('.rbt-input-main').type(tag);
       cy.get('#tag-typeahead-asynctypeahead').should('be.visible');
       cy.get('#tag-typeahead-asynctypeahead-item-0').should('be.visible');
-      cy.get('a#tag-typeahead-asynctypeahead-item-0').click()
-    });
-
-    cy.get('#edit-tag-modal').within(() => {
+      // select
+      cy.get('a#tag-typeahead-asynctypeahead-item-0').click();
+      // save
       cy.get('div.modal-footer > button').click();
     });
 
     cy.visit('/');
-    cy.waitUntilSkeletonDisappear();
 
     cy.get('.rbt-input').should('be.visible');
     cy.get('.rbt-input').click();
     cy.get('.rbt-input-main').type(`${searchText}`);
+
+    cy.collapseSidebar(true);
+    cy.waitUntilSkeletonDisappear();
     cy.screenshot(`${ssPrefix}1-insert-search-text-with-tag`, { capture: 'viewport'});
+
     cy.get('.rbt-input-main').type('{enter}');
 
     cy.getByTestid('search-result-base').should('be.visible');
     cy.getByTestid('search-result-list').should('be.visible');
     cy.getByTestid('search-result-content').should('be.visible');
     cy.get('.wiki').should('be.visible');
-    cy.waitUntilSpinnerDisappear();
 
     // force to add 'active' to pass VRT: https://github.com/weseek/growi/pull/6603
     cy.getByTestid('page-list-item-L').first().invoke('addClass', 'active');
-    cy.screenshot(`${ssPrefix}2-search-with-tag-result`, {capture: 'viewport'});
 
-    cy.getByTestid('search-result-content').should('be.visible');
-    cy.get('.wiki').should('be.visible');
-    cy.screenshot(`${ssPrefix}3-click-three-dots-menu-search-with-tag`, {capture: 'viewport'});
+    cy.collapseSidebar(true);
+    cy.waitUntilSpinnerDisappear();
+    cy.waitUntilSkeletonDisappear();
+    cy.screenshot(`${ssPrefix}2-search-with-tag-result`, {capture: 'viewport'});
 
   });
 
-  // TODO: fix this VRT
   it('Successfully order page search results by tag', () => {
     const tag = 'help';
 
@@ -212,50 +173,185 @@ context('Search all pages', () => {
     cy.getByTestid('search-result-list').should('be.visible');
     cy.getByTestid('search-result-content').should('be.visible');
     cy.get('.wiki').should('be.visible');
-    cy.waitUntilSpinnerDisappear();
 
     // force to add 'active' to pass VRT: https://github.com/weseek/growi/pull/6603
     cy.getByTestid('page-list-item-L').first().invoke('addClass', 'active');
+
+    cy.collapseSidebar(true);
+    cy.waitUntilSkeletonDisappear();
+    cy.waitUntilSpinnerDisappear();
     cy.screenshot(`${ssPrefix}1-tag-order-click-tag-name`, {capture: 'viewport'});
 
-    cy.get('.grw-search-page-nav').within(() => {
-      cy.get('button.dropdown-toggle').first().click({force: true});
-      cy.get('.dropdown-menu-right').should('be.visible');
-      cy.get('.dropdown-menu-right > button:nth-child(1)').click({force: true});
+  });
+
+});
+
+context('Sort with dropdown', () => {
+  const ssPrefix = 'sort-with-dropdown-';
+
+  beforeEach(() => {
+    // login
+    cy.fixture("user-admin.json").then(user => {
+      cy.login(user.username, user.password);
     });
+
+    cy.visit('/_search', { qs: { q: 'sand' } });
+
     cy.getByTestid('search-result-base').should('be.visible');
     cy.getByTestid('search-result-list').should('be.visible');
     cy.getByTestid('search-result-content').should('be.visible');
-    // cy.get('.wiki').should('be.visible');
-    // cy.screenshot(`${ssPrefix}2-tag-order-by-relevance`);
+    cy.get('.wiki').should('be.visible');
 
-    cy.get('.grw-search-page-nav').within(() => {
-      cy.get('button.dropdown-toggle').first().click({force: true});
-      cy.get('.dropdown-menu-right').should('be.visible');
-      cy.get('.dropdown-menu-right > button:nth-child(2)').click({force: true});
+    cy.waitUntilSpinnerDisappear();
+    // for avoid mismatch by auto scrolling
+    cy.get('.search-result-content-body-container').scrollTo('top');
+
+    // open sort dropdown
+    cy.waitUntil(() => {
+      // do
+      cy.get('.grw-search-page-nav').within(() => {
+        cy.get('button.dropdown-toggle').first().click({force: true});
+      });
+      // wait until
+      return cy.get('.grw-search-page-nav').within(() => {
+        return Cypress.$('.dropdown-menu.show').is(':visible');
+      });
+    });
+  });
+
+  it('Open sort dropdown', () => {
+    cy.get('.grw-search-page-nav .dropdown-menu.show').should('be.visible');
+      cy.screenshot(`${ssPrefix}2-open-sort-dropdown`);
+  });
+
+  it('Sort by relevance', () => {
+    cy.get('.grw-search-page-nav .dropdown-menu.show').should('be.visible').within(() => {
+      cy.get('button:nth-child(1)').click({force: true});
     });
     cy.getByTestid('search-result-base').should('be.visible');
     cy.getByTestid('search-result-list').should('be.visible');
     cy.getByTestid('search-result-content').should('be.visible');
-    // cy.get('.wiki').should('be.visible');
-    // cy.screenshot(`${ssPrefix}3-tag-order-by-creation-date`);
+    cy.get('.wiki').should('be.visible');
 
-    cy.get('.grw-search-page-nav').within(() => {
-      cy.get('button.dropdown-toggle').first().click({force: true});
-      cy.get('.dropdown-menu-right').should('be.visible');
-      cy.get('.dropdown-menu-right > button:nth-child(3)').click({force: true});
+    cy.waitUntilSpinnerDisappear();
+    // for avoid mismatch by auto scrolling
+    cy.get('.search-result-content-body-container').scrollTo('top');
+    cy.screenshot(`${ssPrefix}3-tag-order-by-relevance`);
+  });
+
+  it('Sort by creation date', () => {
+    cy.get('.grw-search-page-nav .dropdown-menu.show').should('be.visible').within(() => {
+      cy.get('button:nth-child(2)').click({force: true});
     });
     cy.getByTestid('search-result-base').should('be.visible');
     cy.getByTestid('search-result-list').should('be.visible');
     cy.getByTestid('search-result-content').should('be.visible');
-    // cy.get('.wiki').should('be.visible');
+    cy.get('.wiki').should('be.visible');
+
     cy.waitUntilSpinnerDisappear();
+    // for avoid mismatch by auto scrolling
+    cy.get('.search-result-content-body-container').scrollTo('top');
+    cy.screenshot(`${ssPrefix}3-tag-order-by-creation-date`);
+  });
 
-    // cy.screenshot(`${ssPrefix}4-tag-order-by-last-update-date`);
+  it('Sort by last update date', () => {
+    cy.get('.grw-search-page-nav .dropdown-menu.show').should('be.visible').within(() => {
+      cy.get('button:nth-child(3)').click({force: true});
+    });
+    cy.getByTestid('search-result-base').should('be.visible');
+    cy.getByTestid('search-result-list').should('be.visible');
+    cy.getByTestid('search-result-content').should('be.visible');
+    cy.get('.wiki').should('be.visible');
+
+    cy.waitUntilSpinnerDisappear();
+    // for avoid mismatch by auto scrolling
+    cy.get('.search-result-content-body-container').scrollTo('top');
+    cy.screenshot(`${ssPrefix}4-tag-order-by-last-update-date`);
   });
 
 });
 
+
+context('Search and use', () => {
+  const ssPrefix = 'search-and-use-';
+
+  beforeEach(() => {
+    // login
+    cy.fixture("user-admin.json").then(user => {
+      cy.login(user.username, user.password);
+    });
+
+    cy.visit('/_search', { qs: { q: 'labels alerts cards blocks' } });
+    cy.getByTestid('search-result-base').should('be.visible');
+    cy.getByTestid('search-result-list').should('be.visible');
+    cy.getByTestid('search-result-content').should('be.visible');
+    cy.get('.wiki').should('be.visible');
+
+    cy.getByTestid('page-list-item-L').first().as('firstItem');
+
+    // force to add 'active' to pass VRT: https://github.com/weseek/growi/pull/6603
+    cy.get('@firstItem').invoke('addClass', 'active');
+    // for avoid mismatch by auto scrolling
+    cy.get('.search-result-content-body-container').scrollTo('top');
+
+    cy.waitUntil(() => {
+      // do
+      cy.get('@firstItem').within(() => {
+        cy.getByTestid('open-page-item-control-btn').click();
+      });
+      // wait until
+      return cy.get('.dropdown-menu.show').then($elem => $elem.is(':visible'));
+    });
+  });
+
+  it('Successfully the dropdown is opened', () => {
+    cy.get('.dropdown-menu.show').should('be.visible');
+    cy.screenshot(`${ssPrefix}1-click-three-dots-menu`, {capture: 'viewport'});
+  });
+
+  it('Successfully add bookmark', () => {
+    cy.get('.dropdown-menu.show').should('be.visible').within(() => {
+      // Add bookmark
+      cy.getByTestid('add-remove-bookmark-btn').click({force: true});
+    });
+    cy.getByTestid('search-result-content').within(() => {
+      cy.get('.btn-bookmark.active').should('be.visible');
+    });
+    cy.screenshot(`${ssPrefix}2-add-bookmark`, {capture: 'viewport'});
+  });
+
+  it('Successfully open duplicate modal', () => {
+    cy.get('.dropdown-menu.show').should('be.visible').within(() => {
+      cy.getByTestid('open-page-duplicate-modal-btn').click({force: true});
+    });
+    cy.getByTestid('page-duplicate-modal').should('be.visible').within(() => {
+      cy.screenshot(`${ssPrefix}3-duplicate-page`);
+    });
+    // Close Modal
+    cy.get('body').type('{esc}');
+  });
+
+  it('Successfully open move/rename modal', () => {
+    cy.get('.dropdown-menu.show').should('be.visible').within(() => {
+      cy.getByTestid('open-page-move-rename-modal-btn').click({force: true});
+    });
+    cy.getByTestid('page-rename-modal').should('be.visible').within(() => {
+      cy.screenshot(`${ssPrefix}4-move-rename-page`);
+    });
+    // Close Modal
+    cy.get('body').type('{esc}');
+  });
+
+  it('Successfully open delete modal', () => {
+    cy.get('.dropdown-menu.show').should('be.visible').within(() => {
+      cy.getByTestid('open-page-delete-modal-btn').click({ force: true});
+    });
+    cy.getByTestid('page-delete-modal').should('be.visible').within(() => {
+      cy.screenshot(`${ssPrefix}5-delete-page`);
+    });
+  });
+})
+
 context('Search current tree with "prefix":', () => {
   const ssPrefix = 'search-current-tree-';
 
@@ -264,21 +360,31 @@ context('Search current tree with "prefix":', () => {
     cy.fixture("user-admin.json").then(user => {
       cy.login(user.username, user.password);
     });
-    // collapse sidebar
-    cy.collapseSidebar(true);
   });
 
   it(`Search current tree by word is successfully loaded`, () => {
     const searchText = 'help';
+
     cy.visit('/');
     cy.waitUntilSkeletonDisappear();
+    cy.collapseSidebar(true);
 
-    cy.getByTestid('select-search-scope').click();
-    cy.get('.input-group-prepend.show > div > button:nth-child(2)').click();
-    cy.get('.rbt-input').click();
-    cy.get('.rbt-menu.dropdown-menu.show').should('be.visible').within(() => {
+    cy.waitUntil(() => {
+      // do
+      cy.getByTestid('select-search-scope').click();
+      // wait until
+      return cy.get('.grw-global-search-container').within(() => {
+        return Cypress.$('.dropdown-menu.show').is(':visible');
+      });
+    });
+
+    cy.get('.grw-global-search-container').within(() => {
+      cy.get('.dropdown-menu.show').should('be.visible');
+      cy.get('.input-group-prepend.show > div > button:nth-child(2)').click();
+      cy.get('.rbt-input').should('be.focused');
       cy.screenshot(`${ssPrefix}1-search-input-focused`);
-    })
+    });
+
     cy.get('.rbt-input').type(`${searchText}`);
     cy.screenshot(`${ssPrefix}2-insert-search-text`, { capture: 'viewport'});
     cy.get('.rbt-input').type('{enter}');
@@ -293,19 +399,7 @@ context('Search current tree with "prefix":', () => {
     cy.getByTestid('page-list-item-L').first().invoke('addClass', 'active');
     // for avoid mismatch by auto scrolling
     cy.get('.search-result-content-body-container').scrollTo('top');
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(1500);
     cy.screenshot(`${ssPrefix}3-search-page-results`, { capture: 'viewport'});
-
-    cy.getByTestid('search-result-list').within(() => {
-      cy.getByTestid('open-page-item-control-btn').first().click();
-    })
-
-    // for avoid mismatch by auto scrolling
-    cy.get('.search-result-content-body-container').scrollTo('top');
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(1500);
-    cy.screenshot(`${ssPrefix}4-click-three-dots-menu`, {capture: 'viewport'});
   });
 
 });

+ 145 - 58
packages/app/test/cypress/integration/50-sidebar/50-sidebar--access-to-side-bar.spec.ts

@@ -12,13 +12,21 @@ describe('Access to sidebar', () => {
     context('when access to root page', { scrollBehavior: false }, () => {
       beforeEach(() => {
         cy.visit('/');
-        cy.waitUntilSkeletonDisappear();
+
+        // Workaround for waitinig initial open/close interaction
+        // TODO: remove this cy.wait() after SSR without the initial interaction is implemented
+        // eslint-disable-next-line cypress/no-unnecessary-waiting
+        cy.wait(2000);
+
+        // Since this is a sidebar test, call collapseSidebar in beforeEach.
         cy.collapseSidebar(false);
       });
 
       describe('Test show/collapse button', () => {
         it('Successfully show sidebar', () => {
-          cy.getByTestid('grw-pagetree-item-container').should('be.visible');
+          cy.getByTestid('grw-contextual-navigation-sub').should('be.visible');
+
+          cy.waitUntilSkeletonDisappear();
           cy.screenshot(`${ssPrefix}1-sidebar-shown`, {
             capture: 'viewport',
             // Blackout for recalculation of toc content hight
@@ -28,6 +36,10 @@ describe('Access to sidebar', () => {
 
         it('Successfully collapse sidebar', () => {
           cy.getByTestid('grw-navigation-resize-button').click({force: true});
+
+          cy.getByTestid('grw-contextual-navigation-sub').should('not.be.visible');
+
+          cy.waitUntilSkeletonDisappear();
           cy.screenshot(`${ssPrefix}2-sidebar-collapsed`, {
             capture: 'viewport',
             // Blackout for recalculation of toc content hight
@@ -37,9 +49,21 @@ describe('Access to sidebar', () => {
       });
 
       describe('Test page tree tab', () => {
+        beforeEach(() => {
+          cy.getByTestid('grw-sidebar-nav-primary-page-tree').should('be.visible')
+            .then($elem => {
+              // open if inactive
+              if (!$elem.hasClass('active')) {
+                cy.getByTestid('grw-sidebar-nav-primary-page-tree').click();
+              }
+            });
+        });
+
         it('Successfully access to page tree', () => {
           cy.getByTestid('grw-contextual-navigation-sub').within(() => {
             cy.getByTestid('grw-pagetree-item-container').should('be.visible');
+
+            cy.waitUntilSkeletonDisappear();
             cy.screenshot(`${ssPrefix}page-tree-1-access-to-page-tree`);
           });
         });
@@ -49,34 +73,45 @@ describe('Access to sidebar', () => {
             cy.get('.grw-pagetree-open').should('be.visible');
 
             // hide page tree tiems
-            cy.get('.grw-pagetree-triangle-btn').eq(0).click();
+            cy.get('.grw-pagetree-triangle-btn').first().click();
+
             cy.screenshot(`${ssPrefix}page-tree-2-hide-page-tree-items`);
           });
         });
 
         it('Successfully click Add to Bookmarks button', () => {
-          // click three dots
-          cy.get('.grw-pagetree-item-children').eq(0).within(() => {
-            cy.getByTestid('open-page-item-control-btn').find('button').eq(0).invoke('css','display','block').click();
+          cy.waitUntil(() => {
+            // do
+            cy.getByTestid('grw-contextual-navigation-sub').within(() => {
+              cy.get('.grw-pagetree-item-children').first().as('pagetreeItem').within(() => {
+                cy.getByTestid('open-page-item-control-btn').find('button').first().invoke('css','display','block').click()
+              });
+            });
+            // wait until
+            return cy.get('.dropdown-menu.show').then($elem => $elem.is(':visible'));
           });
 
-          cy.getByTestid('page-item-control-menu').should('have.class', 'show');
           cy.screenshot(`${ssPrefix}page-tree-3-before-click-button`, {
             // Blackout for recalculation of toc content hight
             blackout: ['.grw-side-contents-container', '[data-hide-in-vrt=true]'],
           });
 
           // click add remove bookmark btn
-          cy.getByTestid('page-item-control-menu').should('have.class', 'show').within(() => {
-            cy.getByTestid('add-remove-bookmark-btn').click();
-          });
+          cy.getByTestid('page-item-control-menu').should('have.class', 'show')
+          cy.getByTestid('add-remove-bookmark-btn').click();
 
           // show dropdown again
-          cy.get('.grw-pagetree-item-children').eq(0).within(() => {
-            cy.getByTestid('open-page-item-control-btn').find('button').eq(0).invoke('css','display','block').click();
+          cy.waitUntil(() => {
+            // do
+            cy.getByTestid('grw-contextual-navigation-sub').within(() => {
+              cy.get('.grw-pagetree-item-children').first().as('pagetreeItem').within(() => {
+                cy.getByTestid('open-page-item-control-btn').find('button').first().invoke('css','display','block').click()
+              });
+            });
+            // wait until
+            return cy.get('.dropdown-menu.show').then($elem => $elem.is(':visible'));
           });
 
-          cy.getByTestid('page-item-control-menu').should('have.class', 'show');
           cy.screenshot(`${ssPrefix}page-tree-4-after-click-button`, {
             // Blackout for recalculation of toc content hight
             blackout: ['.grw-side-contents-container', '[data-hide-in-vrt=true]'],
@@ -84,43 +119,69 @@ describe('Access to sidebar', () => {
         });
 
         it('Successfully show duplicate page modal', () => {
-          cy.get('.grw-pagetree-item-children').eq(0).within(() => {
-            cy.getByTestid('open-page-item-control-btn').find('button').eq(0).invoke('css','display','block').click();
+          cy.waitUntil(() => {
+            // do
+            cy.getByTestid('grw-contextual-navigation-sub').within(() => {
+              cy.get('.grw-pagetree-item-children').first().as('pagetreeItem').within(() => {
+                cy.getByTestid('open-page-item-control-btn').find('button').first().invoke('css','display','block').click()
+              });
+            });
+            // wait until
+            return cy.get('.dropdown-menu.show').then($elem => $elem.is(':visible'));
           });
-          cy.get('.dropdown-menu.show').should('be.visible').within(() => {
-            cy.getByTestid('open-page-duplicate-modal-btn').click();
+
+          cy.get('.dropdown-menu.show').within(() => {
+            cy.getByTestid('open-page-duplicate-modal-btn').should('be.visible').click();
           });
+
           cy.getByTestid('page-duplicate-modal').should('be.visible').within(() => {
-            cy.get('.rbt-input-main').type('_test');
+            cy.get('.form-control').type('_test');
+
             cy.screenshot(`${ssPrefix}page-tree-5-duplicate-page-modal`);
+
             cy.get('.modal-header > button').click();
           });
         });
 
         it('Successfully rename page', () => {
-          cy.getByTestid('grw-contextual-navigation-sub').within(() => {
-            cy.get('.grw-pagetree-item-children').eq(0).within(() => {
-              cy.getByTestid('open-page-item-control-btn').find('button').eq(0).invoke('css','display','block').click()
-            });
-            cy.get('.dropdown-menu.show').should('be.visible').within(() => {
-              cy.getByTestid('open-page-move-rename-modal-btn').click();
-            });
-            cy.get('.grw-pagetree-item-children').eq(0).within(() => {
-              cy.getByTestid('closable-text-input').type('_newname');
+          cy.waitUntil(() => {
+            // do
+            cy.getByTestid('grw-contextual-navigation-sub').within(() => {
+              cy.get('.grw-pagetree-item-children').first().as('pagetreeItem').within(() => {
+                cy.getByTestid('open-page-item-control-btn').find('button').first().invoke('css','display','block').click()
+              });
             });
-            cy.screenshot(`${ssPrefix}page-tree-6-rename-page`);
+            // wait until
+            return cy.get('.dropdown-menu.show').then($elem => $elem.is(':visible'));
           });
+
+          cy.get('.dropdown-menu.show').within(() => {
+            cy.getByTestid('open-page-move-rename-modal-btn').should('be.visible').click();
+          });
+
+          cy.get('@pagetreeItem').within(() => {
+            cy.getByTestid('closable-text-input').type('_newname');
+          })
+
+          cy.screenshot(`${ssPrefix}page-tree-6-rename-page`);
         });
 
         it('Successfully show delete page modal', () => {
-          cy.getByTestid('grw-contextual-navigation-sub').within(() => {
-            cy.get('.grw-pagetree-item-children').eq(0).within(() => {
-              cy.getByTestid('open-page-item-control-btn').find('button').eq(0).invoke('css','display','block').click()
-            });
-            cy.get('.dropdown-menu.show').should('be.visible').within(() => {
-              cy.getByTestid('open-page-delete-modal-btn').click();
+          cy.waitUntil(() => {
+            // do
+            cy.getByTestid('grw-contextual-navigation-sub').within(() => {
+              cy.get('.grw-pagetree-item-children').first().as('pagetreeItem').within(() => {
+                cy.getByTestid('open-page-item-control-btn').find('button').first().invoke('css','display','block').click()
+              });
             });
+            // wait until
+            return cy.get('.dropdown-menu.show').then($elem => $elem.is(':visible'));
           });
+
+          cy.get('.dropdown-menu.show').within(() => {
+            cy.getByTestid('open-page-delete-modal-btn').should('be.visible').click();
+          });
+
           cy.getByTestid('page-delete-modal').should('be.visible').within(() => {
             cy.screenshot(`${ssPrefix}page-tree-7-delete-page-modal`);
             cy.get('.modal-header > button').click();
@@ -129,14 +190,21 @@ describe('Access to sidebar', () => {
       });
 
       describe('Test custom sidebar tab', () => {
-        it('Successfully access to custom sidebar', () => {
-          cy.getByTestid('grw-sidebar-nav-primary-custom-sidebar').click();
-
-          // eslint-disable-next-line cypress/no-unnecessary-waiting
-          cy.wait(1500); // Wait debounce for UserUISettings update
+        beforeEach(() => {
+          cy.getByTestid('grw-sidebar-nav-primary-custom-sidebar').should('be.visible')
+            .then($elem => {
+              // open if inactive
+              if (!$elem.hasClass('active')) {
+                cy.getByTestid('grw-sidebar-nav-primary-custom-sidebar').click();
+              }
+            });
+        });
 
+        it('Successfully access to custom sidebar', () => {
           cy.getByTestid('grw-contextual-navigation-sub').within(() => {
-            cy.get('.grw-sidebar-content-header.h5').find('a');
+            cy.get('.grw-sidebar-content-header > h3').find('a');
+
+            cy.waitUntilSkeletonDisappear();
             cy.screenshot(`${ssPrefix}custom-sidebar-1-access-to-custom-sidebar`);
           });
         });
@@ -144,32 +212,43 @@ describe('Access to sidebar', () => {
         it('Successfully redirect to editor', () => {
           const content = '# HELLO \n ## Hello\n ### Hello';
 
-          cy.get('.grw-sidebar-content-header.h5').find('a').click();
+          cy.get('.grw-sidebar-content-header > h3').find('a').click();
+
+          cy.get('.layout-root').should('have.class', 'editing');
           cy.get('.CodeMirror textarea').type(content, {force: true});
+
           cy.screenshot(`${ssPrefix}custom-sidebar-2-redirect-to-editor`);
+
           cy.getByTestid('save-page-btn').click();
           cy.get('.layout-root').should('not.have.class', 'editing');
         });
 
         it('Successfully create custom sidebar content', () => {
-          cy.getByTestid('grw-contextual-navigation-sub').within(() => {
-            cy.get('.grw-custom-sidebar-content').should('be.visible');
-            cy.screenshot(`${ssPrefix}custom-sidebar-3-content-created`);
-          });
+          cy.getByTestid('grw-sidebar-nav-primary-custom-sidebar')
+            .should('be.visible')
+            .should('have.class', 'active');
+
+          cy.waitUntilSkeletonDisappear();
+          cy.screenshot(`${ssPrefix}custom-sidebar-3-content-created`);
         });
       });
 
       describe('Test recent changes tab', () => {
-        it('Successfully access to recent changes', () => {
-          cy.getByTestid('grw-sidebar-nav-primary-recent-changes').click();
-
-          // eslint-disable-next-line cypress/no-unnecessary-waiting
-          cy.wait(1500); // Wait debounce for UserUISettings update
+        beforeEach(() => {
+          cy.getByTestid('grw-sidebar-nav-primary-recent-changes').should('be.visible')
+            .then($elem => {
+              // open if inactive
+              if (!$elem.hasClass('active')) {
+                cy.getByTestid('grw-sidebar-nav-primary-recent-changes').click();
+              }
+            });
+        });
 
+        it('Successfully access to recent changes', () => {
           cy.getByTestid('grw-recent-changes').should('be.visible');
           cy.get('.list-group-item').should('be.visible');
 
-          // The scope of the capture is not narrowed because the blackout is shifted
+          // The scope of the screenshot is not narrowed because the blackout is shifted
           cy.screenshot(`${ssPrefix}recent-changes-1-access-to-recent-changes`, {
             // Blackout for recalculation of toc content hight
             blackout: ['.grw-side-contents-container', '[data-hide-in-vrt=true]'],
@@ -182,7 +261,7 @@ describe('Access to sidebar', () => {
             cy.get('.list-group-item').should('be.visible');
           });
 
-          // The scope of the capture is not narrowed because the blackout is shifted
+          // The scope of the screenshot is not narrowed because the blackout is shifted
           cy.screenshot(`${ssPrefix}recent-changes-2-switch-content-size`, {
             // Blackout for recalculation of toc content hight
             blackout: ['.grw-side-contents-container', '[data-hide-in-vrt=true]'],
@@ -191,14 +270,20 @@ describe('Access to sidebar', () => {
       });
 
       describe('Test tags tab', () => {
-        it('Successfully access to tags', () => {
-          cy.getByTestid('grw-sidebar-nav-primary-tags').click();
-
-          // eslint-disable-next-line cypress/no-unnecessary-waiting
-          cy.wait(1500); // Wait debounce for UserUISettings update
+        beforeEach(() => {
+          cy.getByTestid('grw-sidebar-nav-primary-tags').should('be.visible')
+            .then($elem => {
+              // open if inactive
+              if (!$elem.hasClass('active')) {
+                cy.getByTestid('grw-sidebar-nav-primary-tags').click();
+              }
+            });
+        });
 
+        it('Successfully access to tags', () => {
           cy.getByTestid('grw-contextual-navigation-sub').within(() => {
             cy.getByTestid('grw-tags-list').should('be.visible');
+
             cy.screenshot(`${ssPrefix}tags-1-access-to-tags`);
           });
         });
@@ -207,11 +292,12 @@ describe('Access to sidebar', () => {
           cy.get('.grw-container-convertible > div > .btn-primary').click({force: true});
           cy.collapseSidebar(true);
           cy.getByTestid('grw-tags-list').should('be.visible');
+
           cy.screenshot(`${ssPrefix}tags-2-click-all-tags-button`);
         });
       });
 
-      // TODO: No Drafts pages on GROWI version 6
+      // // TODO: No Drafts pages on GROWI version 6
       // it('Successfully access to My Drafts page', () => {
       //   cy.visit('/');
       //   cy.collapseSidebar(true);
@@ -241,6 +327,7 @@ describe('Access to sidebar', () => {
 
           cy.get('.grw-page-path-hierarchical-link').should('be.visible');
           cy.get('.grw-custom-nav-tab').should('be.visible');
+
           cy.screenshot(`${ssPrefix}access-to-trash-page`);
         });
       });

+ 2 - 1
packages/app/test/cypress/integration/50-sidebar/50-sidebar--switching-sidebar-mode.spec.ts

@@ -21,7 +21,8 @@ context('Switch sidebar mode', () => {
 
   it('Switching sidebar mode', () => {
     cy.visit('/');
-    cy.collapseSidebar(true, true)
+    // This test uses collapseSidebar here, because this test for the sidebar.
+    cy.collapseSidebar(true)
     cy.get('.grw-apperance-mode-dropdown').first().click();
 
     cy.get('[for="swSidebarMode"]').click({force: true});

+ 1 - 1
packages/app/test/cypress/integration/60-home/60-home--home.spec.ts

@@ -45,7 +45,7 @@ context('Access User settings', () => {
       cy.login(user.username, user.password);
     });
     cy.visit('/me');
-    cy.collapseSidebar(true);
+    cy.collapseSidebar(true, true);
     // hide fab // disable fab for sticky-events warning
     // cy.getByTestid('grw-fab-container').invoke('attr', 'style', 'display: none');
   });

+ 20 - 19
packages/app/test/cypress/support/commands.ts

@@ -69,26 +69,27 @@ Cypress.Commands.add('waitUntilSpinnerDisappear', () => {
   cy.get('.fa-spinner').should('not.exist');
 });
 
-Cypress.Commands.add('collapseSidebar', (isCollapsed: boolean) => {
-  const isSidebarExists = isVisibleByTestId('grw-sidebar-wrapper');
+Cypress.Commands.add('collapseSidebar', (isCollapsed: boolean, waitUntilSaving = false) => {
+  cy.getByTestid('grw-sidebar-wrapper', { timeout: 5000 }).within(() => {
+    // process only when Dock Mode
+    cy.get('.grw-sidebar-dock').within(() => {
+      const isSidebarContextualNavigationHidden = isHiddenByTestId('grw-contextual-navigation-sub');
+      if (isSidebarContextualNavigationHidden === isCollapsed) {
+        return;
+      }
 
-  if (!isSidebarExists) {
-    return;
-  }
-
-  const isSidebarContextualNavigationHidden = isHiddenByTestId('grw-contextual-navigation-sub');
-  if (isSidebarContextualNavigationHidden === isCollapsed) {
-    return;
-  }
-
-  cy.waitUntil(() => {
-    // do
-    cy.getByTestid("grw-navigation-resize-button").click({force: true});
-    // wait until saving UserUISettings
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(1500);
+      cy.waitUntil(() => {
+        // do
+        cy.getByTestid("grw-navigation-resize-button").click({force: true});
+        // wait until saving UserUISettings
+        if (waitUntilSaving) {
+          // eslint-disable-next-line cypress/no-unnecessary-waiting
+          cy.wait(1500);
+        }
 
-    // wait until
-    return cy.getByTestid('grw-contextual-navigation-sub').then($contents => isHidden($contents) === isCollapsed);
+        // wait until
+        return cy.getByTestid('grw-contextual-navigation-sub').then($contents => isHidden($contents) === isCollapsed);
+      });
+    });
   });
 });

+ 1 - 1
packages/codemirror-textlint/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/codemirror-textlint",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "license": "MIT",
   "main": "dist/index.js",
   "scripts": {

+ 1 - 1
packages/core/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/core",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "description": "GROWI Core Libraries",
   "license": "MIT",
   "keywords": [

+ 1 - 1
packages/hackmd/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/hackmd",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "description": "GROWI js and css files to use hackmd",
   "license": "MIT",
   "main": "dist/index.js",

+ 4 - 2
packages/preset-themes/package.json

@@ -1,10 +1,12 @@
 {
   "name": "@growi/preset-themes",
   "description": "GROWI preset themes",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "license": "MIT",
   "main": "dist/libs/index.js",
-  "files": ["dist"],
+  "files": [
+    "dist"
+  ],
   "scripts": {
     "build": "yarn build:libs & yarn build:themes",
     "build:w": "yarn build:libs -w & yarn build:themes -w",

+ 1 - 1
packages/remark-drawio/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/remark-drawio",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "description": "remark plugin to draw diagrams with draw.io (diagrams.net)",
   "license": "MIT",
   "keywords": [

+ 1 - 1
packages/remark-growi-directive/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/remark-growi-directive",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "description": "remark plugin to support GROWI plugin (forked from remark-directive@2.0.1)",
   "license": "MIT",
   "keywords": [

+ 4 - 4
packages/remark-lsx/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/remark-lsx",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "description": "GROWI plugin to list pages",
   "license": "MIT",
   "keywords": ["growi", "growi-plugin"],
@@ -23,9 +23,9 @@
     "test": ""
   },
   "dependencies": {
-    "@growi/core": "^6.0.0-RC.9",
-    "@growi/remark-growi-directive": "^6.0.0-RC.9",
-    "@growi/ui": "^6.0.0-RC.9",
+    "@growi/core": "^6.0.0-RC.13",
+    "@growi/remark-growi-directive": "^6.0.0-RC.13",
+    "@growi/ui": "^6.0.0-RC.13",
     "swr": "^1.3.0"
   },
   "devDependencies": {

+ 1 - 1
packages/slack/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/slack",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "license": "MIT",
   "main": "dist/index.js",
   "typings": "dist/index.d.ts",

+ 2 - 2
packages/slackbot-proxy/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/slackbot-proxy",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-slackbot-proxy.0",
   "license": "MIT",
   "scripts": {
     "build": "yarn tsc && tsc-alias -p tsconfig.build.json",
@@ -26,7 +26,7 @@
   },
   "dependencies": {
     "@godaddy/terminus": "^4.9.0",
-    "@growi/slack": "^6.0.0-RC.9",
+    "@growi/slack": "^6.0.0-RC.13",
     "@slack/oauth": "^2.0.1",
     "@slack/web-api": "^6.2.4",
     "@tsed/common": "^6.43.0",

+ 2 - 2
packages/ui/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/ui",
-  "version": "6.0.0-RC.9",
+  "version": "6.0.0-RC.13",
   "description": "GROWI UI Libraries",
   "license": "MIT",
   "keywords": ["growi"],
@@ -17,7 +17,7 @@
     "test": "jest --verbose"
   },
   "dependencies": {
-    "@growi/core": "^6.0.0-RC.9"
+    "@growi/core": "^6.0.0-RC.13"
   },
   "devDependencies": {
     "eslint-plugin-regex": "^1.8.0",

Разница между файлами не показана из-за своего большого размера
+ 155 - 432
yarn.lock


Некоторые файлы не были показаны из-за большого количества измененных файлов