1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-03 11:26:14 +02:00

enhance(frontend): ファイルアップロード前にキャプション設定を行えるように

Resolve #16210
This commit is contained in:
syuilo
2025-06-25 10:49:58 +09:00
parent 36fde67992
commit 32d4c312ef
4 changed files with 24 additions and 4 deletions

View File

@@ -82,6 +82,7 @@ export type UploaderItem = {
file: File;
watermarkPresetId: string | null;
isSensitive?: boolean;
caption?: string | null;
abort?: (() => void) | null;
};
@@ -193,6 +194,21 @@ export function useUploader(options: {
get: () => item.isSensitive ?? false,
set: (value) => item.isSensitive = value,
}),
}, {
text: i18n.ts.describeFile,
icon: 'ti ti-text-caption',
action: async () => {
const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkFileCaptionEditWindow.vue').then(x => x.default), {
default: item.caption ?? null,
}, {
done: caption => {
if (caption != null) {
item.caption = caption.trim().length === 0 ? null : caption;
}
},
closed: () => dispose(),
});
},
}, {
type: 'divider',
});
@@ -408,6 +424,7 @@ export function useUploader(options: {
name: item.uploadName ?? item.name,
folderId: options.folderId,
isSensitive: item.isSensitive ?? false,
caption: item.caption ?? null,
onProgress: (progress) => {
if (item.progress == null) {
item.progress = { max: progress.total, value: progress.loaded };