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

feat: ノートの下書き(draft of note) #15298

Open
wants to merge 56 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
25a5f42
WIp (backend)
tai-cha Jan 14, 2025
233a5d5
Remove unused
tai-cha Jan 15, 2025
d7d6209
下書きbackend 続き
tai-cha Jan 16, 2025
0884aee
Merge branch 'develop' of https://github.com/misskey-dev/misskey into…
tai-cha Jan 16, 2025
fb03e78
fix(backedn): visibilityが下書きに反映されない
tai-cha Jan 16, 2025
d3e8c44
Update packages/backend/src/postgres.ts
tai-cha Jan 16, 2025
f5e5c30
Fix : import order
tai-cha Jan 16, 2025
d5d897a
fix(backend) : createでcwが効かない
tai-cha Jan 16, 2025
4e31869
FIX FOREGIN KEY
tai-cha Jan 16, 2025
e80e655
wip: frontend(既存の下書きを挿入)
tai-cha Jan 16, 2025
ac77804
WIP: ノート選択ダイアログ
tai-cha Jan 16, 2025
0868065
Promiseに変更
tai-cha Jan 16, 2025
7f9f51d
連合なし、チャンネルも表示
tai-cha Jan 16, 2025
5aba6c2
Hashtagの値抜け漏れ
tai-cha Jan 16, 2025
740d087
hasthagを0文字でも作成可能に
tai-cha Jan 16, 2025
9f27814
下書きの保存機構
tai-cha Jan 16, 2025
7aa76b8
chore(misskey-js): build types
tai-cha Jan 16, 2025
efb3d4a
localOnly抜け漏れ
tai-cha Jan 16, 2025
c0d3b1d
チャンネル情報の書き換え
tai-cha Jan 16, 2025
168450b
enhance(frontend): ヘッダ部の表示改善
tai-cha Jan 16, 2025
e6464b6
fix(frontend): ファイル添付できない
tai-cha Jan 16, 2025
cda8dda
fix: no file
tai-cha Jan 16, 2025
ebab433
fix(frontend): 投票が反映されない
tai-cha Jan 16, 2025
4e20127
ハッシュタグの展開(コメントアウト外し忘れ)
tai-cha Jan 16, 2025
f47a94a
fix: visibleUserIdsが反映されない
tai-cha Jan 16, 2025
528dfc9
enhance: APIの型を整備
kakkokari-gtyih Jan 16, 2025
888038d
refactor: 型が整備できたのでasを削除
kakkokari-gtyih Jan 16, 2025
84c4ff4
Add userhost
tai-cha Jan 16, 2025
f8c8bcf
Merge branch 'feat/draft-note' of https://github.com/tai-cha/misskey …
tai-cha Jan 16, 2025
8cda0a5
fix
kakkokari-gtyih Jan 16, 2025
12ec6b8
enhance: paginationを使う
kakkokari-gtyih Jan 17, 2025
7854b34
fix
kakkokari-gtyih Jan 17, 2025
f9557c0
fix: 自分のアカウントでの投稿でしか下書きを利用できないように
kakkokari-gtyih Jan 17, 2025
faf49e4
:art:
kakkokari-gtyih Jan 17, 2025
394a692
APIのエラーIDを追加
kakkokari-gtyih Jan 17, 2025
ded7a80
enhance: スタイル調整
kakkokari-gtyih Jan 17, 2025
a76fd91
remove unused code
kakkokari-gtyih Jan 17, 2025
1700cd6
:art:
kakkokari-gtyih Jan 17, 2025
93422ec
fix: ロールポリシーの型
kakkokari-gtyih Jan 17, 2025
ef12216
ロールの編集画面
kakkokari-gtyih Jan 17, 2025
253c8fd
ダイアログの挙動改善
kakkokari-gtyih Jan 17, 2025
099c2c9
下書き機能が利用できない場合は表示しないように
kakkokari-gtyih Jan 17, 2025
ef98421
refactor
kakkokari-gtyih Jan 17, 2025
14f4776
fix: ダブルクリックが効かない問題を修正
kakkokari-gtyih Jan 17, 2025
50f8ecc
add comments
kakkokari-gtyih Jan 17, 2025
d69b830
fix
kakkokari-gtyih Jan 17, 2025
9d88b3a
fix: 保存時のエラーの種別にかかわらずmodalを閉じないように
kakkokari-gtyih Jan 17, 2025
f71bd5d
fix()backend: NoteDraftのreply, renoteの型が間違ってたので修正 (migtrationはあってた)
tai-cha Jan 17, 2025
343042f
Merge branch 'feat/draft-note' of https://github.com/tai-cha/misskey …
tai-cha Jan 17, 2025
39df8f3
fix: 投稿フォームを空白にして通常リノートできるやつは下書きとしては弾くように
kakkokari-gtyih Jan 17, 2025
aff8a05
fix(backend): テキストが0文字でも下書きは保存できるように
tai-cha Jan 17, 2025
232cd62
Fix(backend): replyIdの型定義がミスっているのを修正
tai-cha Jan 19, 2025
2abd244
Merge branch 'develop' of https://github.com/misskey-dev/misskey into…
tai-cha Jan 20, 2025
833a2ad
chore(misskey-js): update types
tai-cha Jan 20, 2025
5d33204
Merge branch 'develop' of https://github.com/misskey-dev/misskey into…
tai-cha Jan 28, 2025
1443263
Add CHANGELOG
tai-cha Jan 28, 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Unreleased

### General
-
- Feat: ノートの下書き機能

### Client
-
Expand Down
50 changes: 50 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ export interface Locale extends ILocale {
* 保存
*/
"save": string;
/**
* 保存しない
*/
"dontSave": string;
/**
* ユーザー
*/
Expand Down Expand Up @@ -5254,6 +5258,10 @@ export interface Locale extends ILocale {
* このサーバーは連合が無効化されています。他のサーバーのユーザーとやり取りすることはできません。
*/
"federationDisabled": string;
/**
* 下書き
*/
"draft": string;
"_accountSettings": {
/**
* コンテンツの表示にログインを必須にする
Expand Down Expand Up @@ -7033,6 +7041,10 @@ export interface Locale extends ILocale {
* リストのインポートを許可
*/
"canImportUserLists": string;
/**
* サーバーサイドのノートの下書きの作成可能数
*/
"noteDraftLimit": string;
};
"_condition": {
/**
Expand Down Expand Up @@ -10956,6 +10968,44 @@ export interface Locale extends ILocale {
};
};
};
"_drafts": {
/**
* 下書きを選択
*/
"select": string;
/**
* サーバーに下書きを保存しますか?
*/
"saveConfirm": string;
/**
* ここで「保存しない」を選択しても、下書きは端末内に保存されます。
*/
"saveConfirmDescription": string;
/**
* 下書きを削除
*/
"delete": string;
/**
* 下書きを削除しますか?
*/
"deleteAreYouSure": string;
/**
* 下書きはありません
*/
"noDrafts": string;
/**
* {user}への返信
*/
"replyTo": ParameterizedString<"user">;
/**
* {user}のノートへの引用
*/
"quoteOf": ParameterizedString<"user">;
/**
* {channel}への投稿
*/
"postTo": ParameterizedString<"channel">;
};
}
declare const locales: {
[lang: string]: Locale;
Expand Down
14 changes: 14 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ logout: "ログアウト"
signup: "新規登録"
uploading: "アップロード中"
save: "保存"
dontSave: "保存しない"
users: "ユーザー"
addUser: "ユーザーを追加"
favorite: "お気に入り"
Expand Down Expand Up @@ -1309,6 +1310,7 @@ availableRoles: "利用可能なロール"
acknowledgeNotesAndEnable: "注意事項を理解した上でオンにします。"
federationSpecified: "このサーバーはホワイトリスト連合で運用されています。管理者が指定したサーバー以外とやり取りすることはできません。"
federationDisabled: "このサーバーは連合が無効化されています。他のサーバーのユーザーとやり取りすることはできません。"
draft: "下書き"

_accountSettings:
requireSigninToViewContents: "コンテンツの表示にログインを必須にする"
Expand Down Expand Up @@ -1817,6 +1819,7 @@ _role:
canImportFollowing: "フォローのインポートを許可"
canImportMuting: "ミュートのインポートを許可"
canImportUserLists: "リストのインポートを許可"
noteDraftLimit: "サーバーサイドのノートの下書きの作成可能数"
_condition:
roleAssignedTo: "マニュアルロールにアサイン済み"
isLocal: "ローカルユーザー"
Expand Down Expand Up @@ -2930,3 +2933,14 @@ _captcha:
_unknown:
title: "CAPTCHAエラー"
text: "想定外のエラーが発生しました。"

_drafts:
select: "下書きを選択"
saveConfirm: "サーバーに下書きを保存しますか?"
saveConfirmDescription: "ここで「保存しない」を選択しても、下書きは端末内に保存されます。"
delete: "下書きを削除"
deleteAreYouSure: "下書きを削除しますか?"
noDrafts: "下書きはありません"
replyTo: "{user}への返信"
quoteOf: "{user}のノートへの引用"
postTo: "{channel}への投稿"
91 changes: 91 additions & 0 deletions packages/backend/migration/1736686850345-createNoteDraft.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class CreateNoteDraft1736686850345 {
name = 'CreateNoteDraft1736686850345'

async up(queryRunner) {
await queryRunner.query(`
CREATE TABLE "note_draft" (
"id" varchar NOT NULL,
"replyId" varchar NULL,
"renoteId" varchar NULL,
"text" text NULL,
"cw" varchar(512) NULL,
"userId" varchar NOT NULL,
"localOnly" boolean DEFAULT false,
"reactionAcceptance" varchar(64) NULL,
"visibility" varchar NOT NULL,
"fileIds" varchar[] DEFAULT '{}',
"visibleUserIds" varchar[] DEFAULT '{}',
"hashtag" varchar(128) NULL,
"channelId" varchar NULL,
"hasPoll" boolean DEFAULT false,
"pollChoices" varchar(256)[] DEFAULT '{}',
"pollMultiple" boolean NULL,
"pollExpiresAt" TIMESTAMP WITH TIME ZONE NULL,
"pollExpiredAfter" bigint NULL,
PRIMARY KEY ("id")
)`);

await queryRunner.query(`
CREATE INDEX "IDX_NOTE_DRAFT_REPLY_ID" ON "note_draft" ("replyId")
`);

await queryRunner.query(`
CREATE INDEX "IDX_NOTE_DRAFT_RENOTE_ID" ON "note_draft" ("renoteId")
`);

await queryRunner.query(`
CREATE INDEX "IDX_NOTE_DRAFT_USER_ID" ON "note_draft" ("userId")
`);

await queryRunner.query(`
CREATE INDEX "IDX_NOTE_DRAFT_FILE_IDS" ON "note_draft" USING GIN ("fileIds")
`);

await queryRunner.query(`
CREATE INDEX "IDX_NOTE_DRAFT_VISIBLE_USER_IDS" ON "note_draft" USING GIN ("visibleUserIds")
`);

await queryRunner.query(`
CREATE INDEX "IDX_NOTE_DRAFT_CHANNEL_ID" ON "note_draft" ("channelId")
`);

await queryRunner.query(`
ALTER TABLE "note_draft"
ADD CONSTRAINT "FK_NOTE_DRAFT_REPLY_ID" FOREIGN KEY ("replyId") REFERENCES "note"("id") ON DELETE CASCADE
`);

await queryRunner.query(`
ALTER TABLE "note_draft"
ADD CONSTRAINT "FK_NOTE_DRAFT_RENOTE_ID" FOREIGN KEY ("renoteId") REFERENCES "note"("id") ON DELETE CASCADE
`);

await queryRunner.query(`
ALTER TABLE "note_draft"
ADD CONSTRAINT "FK_NOTE_DRAFT_USER_ID" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE
`);

await queryRunner.query(`
ALTER TABLE "note_draft"
ADD CONSTRAINT "FK_NOTE_DRAFT_CHANNEL_ID" FOREIGN KEY ("channelId") REFERENCES "channel"("id") ON DELETE CASCADE
`);
}

async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "note_draft" DROP CONSTRAINT "FK_NOTE_DRAFT_CHANNEL_ID"`);
await queryRunner.query(`ALTER TABLE "note_draft" DROP CONSTRAINT "FK_NOTE_DRAFT_USER_ID"`);
await queryRunner.query(`ALTER TABLE "note_draft" DROP CONSTRAINT "FK_NOTE_DRAFT_RENOTE_ID"`);
await queryRunner.query(`ALTER TABLE "note_draft" DROP CONSTRAINT "FK_NOTE_DRAFT_REPLY_ID"`);
await queryRunner.query(`DROP INDEX "IDX_NOTE_DRAFT_CHANNEL_ID"`);
await queryRunner.query(`DROP INDEX "IDX_NOTE_DRAFT_VISIBLE_USER_IDS"`);
await queryRunner.query(`DROP INDEX "IDX_NOTE_DRAFT_FILE_IDS"`);
await queryRunner.query(`DROP INDEX "IDX_NOTE_DRAFT_USER_ID"`);
await queryRunner.query(`DROP INDEX "IDX_NOTE_DRAFT_RENOTE_ID"`);
await queryRunner.query(`DROP INDEX "IDX_NOTE_DRAFT_REPLY_ID"`);
await queryRunner.query(`DROP TABLE "note_draft"`);
}
}
12 changes: 12 additions & 0 deletions packages/backend/src/core/CoreModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { NoteCreateService } from './NoteCreateService.js';
import { NoteDeleteService } from './NoteDeleteService.js';
import { NotePiningService } from './NotePiningService.js';
import { NoteReadService } from './NoteReadService.js';
import { NoteDraftService } from './NoteDraftService.js';
import { NotificationService } from './NotificationService.js';
import { PollService } from './PollService.js';
import { PushNotificationService } from './PushNotificationService.js';
Expand Down Expand Up @@ -119,6 +120,7 @@ import { RenoteMutingEntityService } from './entities/RenoteMutingEntityService.
import { NoteEntityService } from './entities/NoteEntityService.js';
import { NoteFavoriteEntityService } from './entities/NoteFavoriteEntityService.js';
import { NoteReactionEntityService } from './entities/NoteReactionEntityService.js';
import { NoteDraftEntityService } from './entities/NoteDraftEntityService.js';
import { NotificationEntityService } from './entities/NotificationEntityService.js';
import { PageEntityService } from './entities/PageEntityService.js';
import { PageLikeEntityService } from './entities/PageLikeEntityService.js';
Expand Down Expand Up @@ -189,6 +191,7 @@ const $NoteCreateService: Provider = { provide: 'NoteCreateService', useExisting
const $NoteDeleteService: Provider = { provide: 'NoteDeleteService', useExisting: NoteDeleteService };
const $NotePiningService: Provider = { provide: 'NotePiningService', useExisting: NotePiningService };
const $NoteReadService: Provider = { provide: 'NoteReadService', useExisting: NoteReadService };
const $NoteDraftService: Provider = { provide: 'NoteDraftService', useExisting: NoteDraftService };
const $NotificationService: Provider = { provide: 'NotificationService', useExisting: NotificationService };
const $PollService: Provider = { provide: 'PollService', useExisting: PollService };
const $ProxyAccountService: Provider = { provide: 'ProxyAccountService', useExisting: ProxyAccountService };
Expand Down Expand Up @@ -268,6 +271,7 @@ const $RenoteMutingEntityService: Provider = { provide: 'RenoteMutingEntityServi
const $NoteEntityService: Provider = { provide: 'NoteEntityService', useExisting: NoteEntityService };
const $NoteFavoriteEntityService: Provider = { provide: 'NoteFavoriteEntityService', useExisting: NoteFavoriteEntityService };
const $NoteReactionEntityService: Provider = { provide: 'NoteReactionEntityService', useExisting: NoteReactionEntityService };
const $NoteDraftEntityService: Provider = { provide: 'NoteDraftEntityService', useExisting: NoteDraftEntityService };
const $NotificationEntityService: Provider = { provide: 'NotificationEntityService', useExisting: NotificationEntityService };
const $PageEntityService: Provider = { provide: 'PageEntityService', useExisting: PageEntityService };
const $PageLikeEntityService: Provider = { provide: 'PageLikeEntityService', useExisting: PageLikeEntityService };
Expand Down Expand Up @@ -340,6 +344,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
NoteDeleteService,
NotePiningService,
NoteReadService,
NoteDraftService,
NotificationService,
PollService,
ProxyAccountService,
Expand Down Expand Up @@ -419,6 +424,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
NoteEntityService,
NoteFavoriteEntityService,
NoteReactionEntityService,
NoteDraftEntityService,
NotificationEntityService,
PageEntityService,
PageLikeEntityService,
Expand Down Expand Up @@ -487,6 +493,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
$NoteDeleteService,
$NotePiningService,
$NoteReadService,
$NoteDraftService,
$NotificationService,
$PollService,
$ProxyAccountService,
Expand Down Expand Up @@ -566,6 +573,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
$NoteEntityService,
$NoteFavoriteEntityService,
$NoteReactionEntityService,
$NoteDraftEntityService,
$NotificationEntityService,
$PageEntityService,
$PageLikeEntityService,
Expand Down Expand Up @@ -635,6 +643,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
NoteDeleteService,
NotePiningService,
NoteReadService,
NoteDraftService,
NotificationService,
PollService,
ProxyAccountService,
Expand Down Expand Up @@ -713,6 +722,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
NoteEntityService,
NoteFavoriteEntityService,
NoteReactionEntityService,
NoteDraftEntityService,
NotificationEntityService,
PageEntityService,
PageLikeEntityService,
Expand Down Expand Up @@ -781,6 +791,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
$NoteDeleteService,
$NotePiningService,
$NoteReadService,
$NoteDraftService,
$NotificationService,
$PollService,
$ProxyAccountService,
Expand Down Expand Up @@ -858,6 +869,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
$NoteEntityService,
$NoteFavoriteEntityService,
$NoteReactionEntityService,
$NoteDraftEntityService,
$NotificationEntityService,
$PageEntityService,
$PageLikeEntityService,
Expand Down
Loading
Loading