Skip to content

Feat: ドライブ周りのUIの強化 #16011

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

Open
wants to merge 73 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
a7339c7
wip
syuilo Mar 28, 2025
8fea2c4
Merge branch 'develop' into drive-bulk
syuilo Mar 30, 2025
f2f3fea
Merge branch 'develop' into drive-bulk
syuilo May 10, 2025
28856ac
Merge branch 'develop' into drive-bulk
syuilo May 10, 2025
8ce2f43
wip
syuilo May 10, 2025
eccd27d
Update MkDrive.vue
syuilo May 10, 2025
5a84789
Merge branch 'develop' into drive-bulk
syuilo May 10, 2025
b21b287
wip
syuilo May 10, 2025
293aa95
Update MkDrive.vue
syuilo May 10, 2025
f25bc9b
Update MkDrive.vue
syuilo May 10, 2025
c98d72e
wip
syuilo May 10, 2025
796b0c3
Update MkDrive.vue
syuilo May 10, 2025
9d6eb95
Update MkDrive.vue
syuilo May 10, 2025
8a072b1
wip
syuilo May 10, 2025
5149e1c
Update MkDrive.vue
syuilo May 10, 2025
6d5e950
wip
syuilo May 10, 2025
90ac029
wip
syuilo May 10, 2025
ade38bf
wip
syuilo May 10, 2025
40c5cd0
wip
syuilo May 10, 2025
4d185b4
Update MkDrive.vue
syuilo May 11, 2025
db09744
wip
syuilo May 11, 2025
4ff3cdd
wip
syuilo May 11, 2025
9bf9b10
wip
syuilo May 11, 2025
e9ee571
wip
syuilo May 11, 2025
f239e6f
wip
syuilo May 11, 2025
cf701f3
wip
syuilo May 11, 2025
a9422d6
wip
syuilo May 11, 2025
69f5314
Merge branch 'develop' into drive-bulk
syuilo May 11, 2025
8d1a181
Merge branch 'develop' into drive-bulk
syuilo May 11, 2025
0a0ff87
Merge branch 'develop' into drive-bulk
syuilo May 11, 2025
4828fba
Merge branch 'develop' into drive-bulk
syuilo May 11, 2025
d448f26
Merge branch 'develop' into drive-bulk
syuilo May 11, 2025
9010c97
Merge branch 'develop' into drive-bulk
syuilo May 12, 2025
0dd2242
Merge branch 'develop' into drive-bulk
syuilo May 13, 2025
73a83c0
feat(frontend): upload dialog (#16032)
syuilo May 13, 2025
6c7f24f
wip
syuilo May 13, 2025
90c40cd
wip
syuilo May 13, 2025
566f729
Update MkPostForm.vue
syuilo May 13, 2025
37f846a
wip
syuilo May 13, 2025
a96e998
Update room.form.vue
syuilo May 13, 2025
48f2d2b
Update os.ts
syuilo May 13, 2025
0cb7289
wiop
syuilo May 13, 2025
7c06558
wip
syuilo May 13, 2025
edeeca8
wip
syuilo May 13, 2025
0397a50
wip
syuilo May 13, 2025
df2971e
wip
syuilo May 13, 2025
7997ecb
wip
syuilo May 13, 2025
0e2a3eb
wip
syuilo May 13, 2025
4103296
wip
syuilo May 13, 2025
6f530b7
Update select-file.ts
syuilo May 13, 2025
01976c0
wip
syuilo May 13, 2025
292d004
wip
syuilo May 13, 2025
6573b2b
Update MkDrive.vue
syuilo May 13, 2025
7725107
Update drag-and-drop.ts
syuilo May 13, 2025
052df8f
wip
syuilo May 13, 2025
41f149a
wip
syuilo May 13, 2025
cfd95ce
wop
syuilo May 13, 2025
0126523
wip
syuilo May 13, 2025
7b8f455
wip
syuilo May 13, 2025
37c37df
Merge branch 'develop' into drive-bulk
syuilo May 13, 2025
6c83545
Update MkDrive.vue
syuilo May 13, 2025
10f6919
Update CHANGELOG.md
syuilo May 13, 2025
928d941
wipo
syuilo May 14, 2025
abb8e6c
Merge branch 'develop' into drive-bulk
syuilo May 14, 2025
3a874dd
Update MkDrive.folder.vue
syuilo May 14, 2025
2d87794
wip
syuilo May 14, 2025
291659f
Update MkUploaderDialog.vue
syuilo May 14, 2025
0c2c568
wip
syuilo May 14, 2025
0f789a5
wip
syuilo May 14, 2025
36725b3
Update MkUploaderDialog.vue
syuilo May 14, 2025
4f57fd3
wip
syuilo May 14, 2025
3902fe8
Update MkDrive.vue
syuilo May 14, 2025
bff910c
Update MkDrive.vue
syuilo May 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
- デフォルト値は「ローカルのコンテンツだけ公開」になっています

### Client
- Feat: ドライブのUIが強化されました
- 複数のファイルをまとめて移動できるようになりました
- Feat: ファイルのアップロードUIが一新されました
- アップロード前にファイル情報を確認できるようになりました
- 圧縮の品質を選択できるようになりました
- アップロードに失敗したときに再試行できるようになりました
- アップロード前に画像のクロッピングを行えるようになりました
- ファイルサイズのチェックは圧縮後の実際にアップロードされるサイズで行われるようになりました
- Feat: サーバー初期設定ウィザードが実装されました
- 簡単なウィザードに従うだけで、サーバーに最適な設定が適用されます
- Feat: Websocket接続を行わずにMisskeyを利用するNo Websocketモードが実装されました(beta)
Expand Down
46 changes: 26 additions & 20 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,10 @@ export interface Locale extends ILocale {
* アップロードが完了するまで時間がかかる場合があります。
*/
"uploadFromUrlMayTakeTime": string;
/**
* {n}個のファイルをアップロード
*/
"uploadNFiles": ParameterizedString<"n">;
/**
* みつける
*/
Expand Down Expand Up @@ -8531,10 +8535,6 @@ export interface Locale extends ILocale {
* 入力ボックスの縁取り
*/
"inputBorder": string;
/**
* ドライブフォルダーの背景
*/
"driveFolderBg": string;
/**
* バッジ
*/
Expand Down Expand Up @@ -11449,22 +11449,6 @@ export interface Locale extends ILocale {
* ディレクトリをドラッグ・ドロップした時に、ディレクトリ名を"category"に入力します。
*/
"directoryToCategoryCaption": string;
/**
* いずれかの方法で登録する絵文字を選択してください。
*/
"emojiInputAreaCaption": string;
/**
* この枠に画像ファイルまたはディレクトリをドラッグ&ドロップ
*/
"emojiInputAreaList1": string;
/**
* このリンクをクリックしてPCから選択する
*/
"emojiInputAreaList2": string;
/**
* このリンクをクリックしてドライブから選択する
*/
"emojiInputAreaList3": string;
/**
* リストに表示されている絵文字を新たなカスタム絵文字として登録します。よろしいですか?(負荷を避けるため、一度の操作で登録可能な絵文字は{count}件までです)
*/
Expand Down Expand Up @@ -11898,6 +11882,28 @@ export interface Locale extends ILocale {
"text3": string;
};
};
"_uploader": {
/**
* {x}に圧縮
*/
"compressedToX": ParameterizedString<"x">;
/**
* {x}%節約
*/
"savedXPercent": ParameterizedString<"x">;
/**
* アップロードされていないファイルがありますが、中止しますか?
*/
"abortConfirm": string;
/**
* アップロードされていないファイルがありますが、完了しますか?
*/
"doneConfirm": string;
/**
* アップロード可能な最大ファイルサイズは{x}です。
*/
"maxFileSizeIsX": ParameterizedString<"x">;
};
"_clientPerformanceIssueTip": {
/**
* バッテリー消費が多いと感じたら
Expand Down
13 changes: 8 additions & 5 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ uploadFromUrl: "URLアップロード"
uploadFromUrlDescription: "アップロードしたいファイルのURL"
uploadFromUrlRequested: "アップロードをリクエストしました"
uploadFromUrlMayTakeTime: "アップロードが完了するまで時間がかかる場合があります。"
uploadNFiles: "{n}個のファイルをアップロード"
explore: "みつける"
messageRead: "既読"
noMoreHistory: "これより過去の履歴はありません"
Expand Down Expand Up @@ -2236,7 +2237,6 @@ _theme:
buttonBg: "ボタンの背景"
buttonHoverBg: "ボタンの背景 (ホバー)"
inputBorder: "入力ボックスの縁取り"
driveFolderBg: "ドライブフォルダーの背景"
badge: "バッジ"
messageBg: "チャットの背景"
fgHighlighted: "強調された文字"
Expand Down Expand Up @@ -3052,10 +3052,6 @@ _customEmojisManager:
uploadSettingDescription: "この画面で絵文字アップロードを行う際の動作を設定できます。"
directoryToCategoryLabel: "ディレクトリ名を\"category\"に入力する"
directoryToCategoryCaption: "ディレクトリをドラッグ・ドロップした時に、ディレクトリ名を\"category\"に入力します。"
emojiInputAreaCaption: "いずれかの方法で登録する絵文字を選択してください。"
emojiInputAreaList1: "この枠に画像ファイルまたはディレクトリをドラッグ&ドロップ"
emojiInputAreaList2: "このリンクをクリックしてPCから選択する"
emojiInputAreaList3: "このリンクをクリックしてドライブから選択する"
confirmRegisterEmojisDescription: "リストに表示されている絵文字を新たなカスタム絵文字として登録します。よろしいですか?(負荷を避けるため、一度の操作で登録可能な絵文字は{count}件までです)"
confirmClearEmojisDescription: "編集内容を破棄し、リストに表示されている絵文字をクリアします。よろしいですか?"
confirmUploadEmojisDescription: "ドラッグ&ドロップされた{count}個のファイルをドライブにアップロードします。実行しますか?"
Expand Down Expand Up @@ -3182,6 +3178,13 @@ _serverSetupWizard:
text2: "今後も開発を続けられるように、よろしければぜひカンパをお願いいたします。"
text3: "支援者向け特典もあります!"

_uploader:
compressedToX: "{x}に圧縮"
savedXPercent: "{x}%節約"
abortConfirm: "アップロードされていないファイルがありますが、中止しますか?"
doneConfirm: "アップロードされていないファイルがありますが、完了しますか?"
maxFileSizeIsX: "アップロード可能な最大ファイルサイズは{x}です。"

_clientPerformanceIssueTip:
title: "バッテリー消費が多いと感じたら"
makeSureDisabledAdBlocker: "アドブロッカーを無効にしてください"
Expand Down
17 changes: 16 additions & 1 deletion packages/backend/src/core/DriveService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as fs from 'node:fs';
import { Inject, Injectable } from '@nestjs/common';
import sharp from 'sharp';
import { sharpBmp } from '@misskey-dev/sharp-read-bmp';
import { IsNull } from 'typeorm';
import { In, IsNull } from 'typeorm';
import { DeleteObjectCommandInput, PutObjectCommandInput, NoSuchKey } from '@aws-sdk/client-s3';
import { DI } from '@/di-symbols.js';
import type { DriveFilesRepository, UsersRepository, DriveFoldersRepository, UserProfilesRepository, MiMeta } from '@/models/_.js';
Expand Down Expand Up @@ -720,6 +720,21 @@ export class DriveService {
return fileObj;
}

@bindThis
public async moveFiles(fileIds: MiDriveFile['id'][], folderId: MiDriveFolder['id'] | null, userId: MiUser['id']) {
const folder = folderId ? await this.driveFoldersRepository.findOneByOrFail({
id: folderId,
userId: userId,
}) : null;

await this.driveFilesRepository.update({
id: In(fileIds),
userId: userId,
}, {
folderId: folder ? folder.id : null,
});
}

@bindThis
public async deleteFile(file: MiDriveFile, isExpired = false, deleter?: MiUser) {
if (file.storedInternal) {
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/server/api/endpoint-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export * as 'drive/files/find' from './endpoints/drive/files/find.js';
export * as 'drive/files/find-by-hash' from './endpoints/drive/files/find-by-hash.js';
export * as 'drive/files/show' from './endpoints/drive/files/show.js';
export * as 'drive/files/update' from './endpoints/drive/files/update.js';
export * as 'drive/files/move-bulk' from './endpoints/drive/files/move-bulk.js';
export * as 'drive/files/upload-from-url' from './endpoints/drive/files/upload-from-url.js';
export * as 'drive/folders' from './endpoints/drive/folders.js';
export * as 'drive/folders/create' from './endpoints/drive/folders/create.js';
Expand Down
43 changes: 43 additions & 0 deletions packages/backend/src/server/api/endpoints/drive/files/move-bulk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { Inject, Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js';
import { DI } from '@/di-symbols.js';
import { DriveService } from '@/core/DriveService.js';
import { ApiError } from '../../../error.js';

export const meta = {
tags: ['drive'],

requireCredential: true,

kind: 'write:drive',

errors: {
},

res: {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: #15904 と同様の理由で不要です

Suggested change
res: {},

} as const;

export const paramDef = {
type: 'object',
properties: {
fileIds: { type: 'array', uniqueItems: true, minItems: 1, maxItems: 100, items: { type: 'string', format: 'misskey:id' } },
folderId: { type: 'string', format: 'misskey:id', nullable: true },
},
required: ['fileIds'],
} as const;

@Injectable()
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
constructor(
private driveService: DriveService,
) {
super(meta, paramDef, async (ps, me) => {
await this.driveService.moveFiles(ps.fileIds, ps.folderId ?? null, me.id);
});
}
}
3 changes: 0 additions & 3 deletions packages/frontend-embed/@types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ declare const _VERSION_: string;
declare const _ENV_: string;
declare const _DEV_: boolean;
declare const _PERF_PREFIX_: string;
declare const _DATA_TRANSFER_DRIVE_FILE_: string;
declare const _DATA_TRANSFER_DRIVE_FOLDER_: string;
declare const _DATA_TRANSFER_DECK_COLUMN_: string;

// for dev-mode
declare const _LANGS_FULL_: string[][];
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend-embed/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ export default [
_VERSION_: false,
_ENV_: false,
_PERF_PREFIX_: false,
_DATA_TRANSFER_DRIVE_FILE_: false,
_DATA_TRANSFER_DRIVE_FOLDER_: false,
_DATA_TRANSFER_DECK_COLUMN_: false,
},
parser,
parserOptions: {
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend-shared/@types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ declare const _VERSION_: string;
declare const _ENV_: string;
declare const _DEV_: boolean;
declare const _PERF_PREFIX_: string;
declare const _DATA_TRANSFER_DRIVE_FILE_: string;
declare const _DATA_TRANSFER_DRIVE_FOLDER_: string;
declare const _DATA_TRANSFER_DECK_COLUMN_: string;

// for dev-mode
declare const _LANGS_FULL_: string[][];
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend-shared/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ export default [
_VERSION_: false,
_ENV_: false,
_PERF_PREFIX_: false,
_DATA_TRANSFER_DRIVE_FILE_: false,
_DATA_TRANSFER_DRIVE_FOLDER_: false,
_DATA_TRANSFER_DECK_COLUMN_: false,
},
parser,
parserOptions: {
Expand Down
1 change: 0 additions & 1 deletion packages/frontend-shared/themes/_dark.json5
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
switchOnFg: '@accent',
inputBorder: 'rgba(255, 255, 255, 0.1)',
inputBorderHover: 'rgba(255, 255, 255, 0.2)',
driveFolderBg: ':alpha<0.3<@accent',
badge: '#31b1ce',
messageBg: '@bg',
success: '#86b300',
Expand Down
1 change: 0 additions & 1 deletion packages/frontend-shared/themes/_light.json5
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
switchOnFg: '@fgOnAccent',
inputBorder: 'rgba(0, 0, 0, 0.1)',
inputBorderHover: 'rgba(0, 0, 0, 0.2)',
driveFolderBg: ':alpha<0.3<@accent',
badge: '#31b1ce',
messageBg: '@bg',
success: '#86b300',
Expand Down
1 change: 0 additions & 1 deletion packages/frontend-shared/themes/d-astro.json5
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
navIndicator: '@accent',
buttonGradateA: '@accent',
buttonGradateB: ':hue<-20<@accent',
driveFolderBg: ':alpha<0.3<@accent',
fgHighlighted: ':lighten<3<@fg',
panelHeaderBg: ':lighten<3<@panel',
panelHeaderFg: '@fg',
Expand Down
1 change: 0 additions & 1 deletion packages/frontend-shared/themes/d-u0.json5
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
inputBorder: 'rgba(255, 255, 255, 0.1)',
panelBorder: '" solid 1px var(--MI_THEME-divider)',
navIndicator: '@indicator',
driveFolderBg: ':alpha<0.3<@accent',
fgHighlighted: ':lighten<3<@fg',
panelHeaderBg: ':lighten<3<@panel',
panelHeaderFg: '@fg',
Expand Down
1 change: 0 additions & 1 deletion packages/frontend-shared/themes/l-u0.json5
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
panelBorder: '" solid 1px var(--MI_THEME-divider)',
navIndicator: '@indicator',
buttonHoverBg: '#0000001a',
driveFolderBg: ':alpha<0.3<@accent',
fgHighlighted: ':lighten<3<@fg',
panelHeaderBg: ':lighten<3<@panel',
panelHeaderFg: '@fg',
Expand Down
1 change: 0 additions & 1 deletion packages/frontend-shared/themes/l-vivid.json5
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
inputBorderHover: 'rgba(0, 0, 0, 0.2)',
panelBorder: '" solid 1px var(--MI_THEME-divider)',
navIndicator: '@accent',
driveFolderBg: ':alpha<0.3<@accent',
fgHighlighted: ':darken<3<@fg',
fgOnWhite: '@accent',
panelHeaderBg: ':lighten<3<@panel',
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend/@types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ declare const _VERSION_: string;
declare const _ENV_: string;
declare const _DEV_: boolean;
declare const _PERF_PREFIX_: string;
declare const _DATA_TRANSFER_DRIVE_FILE_: string;
declare const _DATA_TRANSFER_DRIVE_FOLDER_: string;
declare const _DATA_TRANSFER_DECK_COLUMN_: string;

// for dev-mode
declare const _LANGS_FULL_: string[][];
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ export default [
_VERSION_: false,
_ENV_: false,
_PERF_PREFIX_: false,
_DATA_TRANSFER_DRIVE_FILE_: false,
_DATA_TRANSFER_DRIVE_FOLDER_: false,
_DATA_TRANSFER_DECK_COLUMN_: false,
},
parser,
parserOptions: {
Expand Down
Loading
Loading