Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: ページ機能の改善【作業中】 #14916

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

kakkokari-gtyih
Copy link
Contributor

@kakkokari-gtyih kakkokari-gtyih commented Nov 7, 2024

What

※一通りやったらPRを分割する予定(maintainerアクセスのためにPRを立てている)

  • ページブロックの変更
    • セクションブロックを非推奨に
    • 代わりに見出しブロックを追加
  • pages api周辺の改善
    • featuredでページネーションが可能に(フロントエンドも同様)
    • ページブロックのバリデーションを追加
    • ページslugのバリデーションを追加(スラッシュ入りは弾くようにした)
    • ページブロックの容量制限を追加(1.5MBまでのハードリミットにしたけど500kBくらいでもいい可能性はある)
    • 未使用プロパティscriptとvariablesは変更が効かないように
  • ページエディタの改善
    • 全体的に本物のページと近いデザインにして完成時のイメージに近づけるようにした
    • スマホでドラッグしにくいのを改善(上下移動ボタンを別途設けた)
    • ブロックとブロックのあいだにブロックを追加できるように
    • 削除ボタンをクリックしたら確認ダイアログを出すように
    • テキストブロック上でMFMプレビューができるように
    • いろいろ(ほかのブロックのデザインも全面的に変更作業中)

Why

Fix #13844
Fix #12558

Additional info (optional)

まだ新エディタには保存処理とかを実装してないのでマージできない

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

- featuredでページネーションが可能に
- ページブロックのバリデーションを追加
- ページslugのバリデーションを追加
- ページブロックの容量制限を追加
- 未使用プロパティscriptとvariablesは変更が効かないように
@github-actions github-actions bot added packages/frontend Client side specific issue/PR packages/backend Server side specific issue/PR packages/misskey-js labels Nov 7, 2024
Copy link
Contributor

github-actions bot commented Nov 7, 2024

このPRによるapi.jsonの差分

差分はこちら
--- base
+++ head
@@ -62462,6 +62462,7 @@
                   },
                   "name": {
                     "type": "string",
+                    "pattern": "^[a-zA-Z0-9_-]{1,256}$",
                     "minLength": 1
                   },
                   "summary": {
@@ -62514,9 +62515,7 @@
                 "required": [
                   "title",
                   "name",
-                  "content",
-                  "variables",
-                  "script"
+                  "content"
                 ]
               }
             }
@@ -62560,6 +62559,15 @@
                       }
                     }
                   },
+                  "CONTENT_TOO_LARGE": {
+                    "value": {
+                      "error": {
+                        "message": "Content is too large.",
+                        "code": "CONTENT_TOO_LARGE",
+                        "id": "2a93fcc9-4cd7-4885-9e5b-be56ed8f4d4f"
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {
@@ -62859,6 +62867,29 @@
         "tags": [
           "pages"
         ],
+        "requestBody": {
+          "required": true,
+          "content": {
+            "application/json": {
+              "schema": {
+                "type": "object",
+                "properties": {
+                  "offset": {
+                    "type": "integer",
+                    "minimum": 0,
+                    "default": 0
+                  },
+                  "limit": {
+                    "type": "integer",
+                    "minimum": 1,
+                    "maximum": 100,
+                    "default": 10
+                  }
+                }
+              }
+            }
+          }
+        },
         "responses": {
           "200": {
             "description": "OK (with results)",
@@ -63532,6 +63563,7 @@
                   },
                   "name": {
                     "type": "string",
+                    "pattern": "^[a-zA-Z0-9_-]{1,256}$",
                     "minLength": 1
                   },
                   "summary": {
@@ -63633,6 +63665,15 @@
                       }
                     }
                   },
+                  "CONTENT_TOO_LARGE": {
+                    "value": {
+                      "error": {
+                        "message": "Content is too large.",
+                        "code": "CONTENT_TOO_LARGE",
+                        "id": "2a93fcc9-4cd7-4885-9e5b-be56ed8f4d4f"
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {
@@ -80422,6 +80463,32 @@
             ]
           },
           {
+            "type": "object",
+            "properties": {
+              "id": {
+                "type": "string"
+              },
+              "type": {
+                "type": "string",
+                "enum": [
+                  "heading"
+                ]
+              },
+              "level": {
+                "type": "number"
+              },
+              "text": {
+                "type": "string"
+              }
+            },
+            "required": [
+              "id",
+              "type",
+              "level",
+              "text"
+            ]
+          },
+          {
             "type": "object",
             "properties": {
               "id": {

Get diff files from Workflow Page

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 17.40042% with 1182 lines in your changes missing coverage. Please review.

Project coverage is 40.99%. Comparing base (a896c39) to head (ccdc861).
Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
...es/frontend/src/pages/page-editor/page-editor_.vue 0.00% 383 Missing and 1 partial ⚠️
...ntend/src/pages/page-editor/page-editor.blocks.vue 0.00% 251 Missing ⚠️
...ges/frontend/src/pages/page-editor/page-editor.vue 0.00% 198 Missing ⚠️
...nd/src/pages/page-editor/page-editor.container.vue 0.00% 168 Missing ⚠️
.../src/pages/page-editor/els/page-editor.el.text.vue 0.00% 63 Missing ⚠️
packages/backend/src/core/PageService.ts 46.47% 38 Missing ⚠️
...s/backend/src/server/api/endpoints/pages/update.ts 45.71% 19 Missing ⚠️
.../src/pages/page-editor/els/page-editor.el.note.vue 0.00% 18 Missing ⚠️
...s/backend/src/server/api/endpoints/pages/create.ts 51.51% 16 Missing ⚠️
...c/pages/page-editor/els/page-editor.el.section.vue 0.00% 8 Missing ⚠️
... and 4 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #14916      +/-   ##
===========================================
+ Coverage    39.47%   40.99%   +1.52%     
===========================================
  Files         1559     1565       +6     
  Lines       196948   203718    +6770     
  Branches      2583     3689    +1106     
===========================================
+ Hits         77743    83515    +5772     
- Misses      118633   119628     +995     
- Partials       572      575       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR packages/misskey-js
Projects
None yet
1 participant