Compare commits

..

5 commits

Author SHA1 Message Date
598b88b142 Merge pull request 'Replace notes(userId) index with (userId, id)' (#28) from sugar/forkey:replace-notes-user-id-index-with-user-id-id into main
All checks were successful
Lint / pnpm_install (push) Successful in 31s
Test (production install and build) / production (22.x) (push) Successful in 1m1s
Lint / lint (misskey-js) (push) Successful in 33s
Lint / lint (backend) (push) Successful in 1m17s
Test (backend) / validate-api-json (22.x) (push) Successful in 1m27s
Lint / lint (sw) (push) Successful in 30s
Lint / typecheck (misskey-js) (push) Successful in 31s
Test (backend) / unit (22.x) (push) Successful in 2m50s
Lint / typecheck (backend) (push) Successful in 1m22s
Test (backend) / e2e (22.x) (push) Successful in 6m49s
Lint / lint (frontend) (push) Successful in 7m49s
Reviewed-on: #28
Reviewed-by: leah <leah@noreply.woem.men>
2025-02-23 13:05:54 +00:00
884caa8c1e Merge branch 'main' into replace-notes-user-id-index-with-user-id-id
All checks were successful
Lint / pnpm_install (pull_request) Successful in 3m13s
Test (frontend) / vitest (22.x) (pull_request) Successful in 3m17s
Test (production install and build) / production (22.x) (pull_request) Successful in 2m42s
Test (backend) / validate-api-json (22.x) (pull_request) Successful in 4m7s
Lint / lint (backend) (pull_request) Successful in 3m11s
Lint / lint (misskey-js) (pull_request) Successful in 2m32s
Lint / lint (sw) (pull_request) Successful in 2m10s
Lint / lint (frontend) (pull_request) Successful in 9m52s
Lint / typecheck (backend) (pull_request) Successful in 3m38s
Lint / typecheck (misskey-js) (pull_request) Successful in 2m57s
Test (backend) / unit (22.x) (pull_request) Successful in 2m44s
Test (backend) / e2e (22.x) (pull_request) Successful in 12m44s
2025-01-19 07:56:10 +00:00
9f4a76a1d9 Merge branch 'main' into replace-notes-user-id-index-with-user-id-id
All checks were successful
Lint / pnpm_install (pull_request) Successful in 2m29s
Test (backend) / unit (22.x) (pull_request) Successful in 8m50s
Test (production install and build) / production (22.x) (pull_request) Successful in 2m38s
Test (frontend) / vitest (22.x) (pull_request) Successful in 3m30s
Test (backend) / validate-api-json (22.x) (pull_request) Successful in 3m2s
Lint / lint (backend) (pull_request) Successful in 2m58s
Lint / lint (misskey-js) (pull_request) Successful in 2m33s
Lint / lint (sw) (pull_request) Successful in 2m45s
Lint / typecheck (backend) (pull_request) Successful in 3m22s
Lint / lint (frontend) (pull_request) Successful in 9m16s
Lint / typecheck (misskey-js) (pull_request) Successful in 2m40s
Test (backend) / e2e (22.x) (pull_request) Successful in 9m36s
2025-01-19 06:06:19 +00:00
44edae531a Merge branch 'main' into replace-notes-user-id-index-with-user-id-id
Some checks failed
Lint / pnpm_install (pull_request) Successful in 2m44s
Test (backend) / unit (22.x) (pull_request) Successful in 8m16s
Test (backend) / e2e (22.x) (pull_request) Successful in 9m44s
Test (frontend) / vitest (22.x) (pull_request) Successful in 3m46s
Test (production install and build) / production (22.x) (pull_request) Successful in 3m5s
Test (backend) / validate-api-json (22.x) (pull_request) Successful in 5m21s
Lint / lint (backend) (pull_request) Successful in 4m9s
Lint / lint (misskey-js) (pull_request) Successful in 3m59s
Lint / lint (frontend) (pull_request) Failing after 9m38s
Lint / lint (sw) (pull_request) Successful in 4m49s
Lint / typecheck (backend) (pull_request) Successful in 3m41s
Lint / typecheck (misskey-js) (pull_request) Successful in 2m59s
2025-01-18 20:38:54 -08:00
93dba136ab Replace notes(userId) index with (userId, id)
Some checks failed
Lint / pnpm_install (pull_request) Successful in 2m14s
Test (backend) / unit (22.x) (pull_request) Successful in 7m8s
Test (backend) / e2e (22.x) (pull_request) Failing after 9m26s
Test (frontend) / vitest (22.x) (pull_request) Successful in 3m0s
Test (production install and build) / production (22.x) (pull_request) Successful in 2m37s
Test (backend) / validate-api-json (22.x) (pull_request) Successful in 3m16s
Lint / lint (backend) (pull_request) Successful in 3m1s
Lint / lint (frontend) (pull_request) Successful in 9m53s
Lint / lint (misskey-js) (pull_request) Successful in 2m22s
Lint / lint (sw) (pull_request) Successful in 3m24s
Lint / typecheck (backend) (pull_request) Successful in 3m17s
Lint / typecheck (misskey-js) (pull_request) Successful in 2m22s
This improves performance of queries searching posts by a given user,
optionally with a provided range of dates, and then using ORDER BY to
sort posts by date.

Examples of such queries include: viewing posts by a given user, as
well as checking when the last post by a given user was written for
Mastodon API.
2025-01-17 15:29:08 +00:00
14 changed files with 17 additions and 32 deletions

View file

@ -765,7 +765,6 @@ lockedAccountInfo: "Unless you set your note visiblity to \"Followers only\", yo
alwaysMarkSensitive: "Mark as sensitive by default"
loadRawImages: "Load original images instead of showing thumbnails"
disableCatSpeak: "Disable cat speak"
markIncomingMediaInCwedPostAsSensitive: "Mark incoming media in cwed posts as sensitive"
disableShowingAnimatedImages: "Don't play animated images"
highlightSensitiveMedia: "Highlight sensitive media"
verificationEmailSent: "A verification email has been sent. Please follow the included link to complete verification."

4
locales/index.d.ts vendored
View file

@ -3076,10 +3076,6 @@ export interface Locale extends ILocale {
*
*/
"disableCatSpeak": string;
/**
* cwed投稿の受信メディアを機密扱いとしてマークする
*/
"markIncomingMediaInCwedPostAsSensitive": string;
/**
*
*/

View file

@ -765,7 +765,6 @@ lockedAccountInfo: "フォローを承認制にしても、ノートの公開範
alwaysMarkSensitive: "デフォルトでメディアをセンシティブ設定にする"
loadRawImages: "添付画像のサムネイルをオリジナル画質にする"
disableCatSpeak: "猫の話し方を無効にする"
markIncomingMediaInCwedPostAsSensitive: "cwed投稿の受信メディアを機密扱いとしてマークする"
disableShowingAnimatedImages: "アニメーション画像を再生しない"
highlightSensitiveMedia: "メディアがセンシティブであることを分かりやすく表示"
verificationEmailSent: "確認のメールを送信しました。メールに記載されたリンクにアクセスして、設定を完了してください。"

View file

@ -0,0 +1,11 @@
export class NoteUserIdIdIndex1736888704471 {
name = 'NoteUserIdIdIndex1736888704471'
async up(queryRunner) {
await queryRunner.query(`CREATE INDEX "IDX_note_userId_id" ON "note" ("userId", "id") `);
}
async down(queryRunner) {
await queryRunner.query(`DROP INDEX "public"."IDX_note_userId_id"`);
}
}

View file

@ -15,6 +15,7 @@ import type { MiDriveFile } from './DriveFile.js';
@Index('IDX_NOTE_MENTIONS', { synchronize: false })
@Index('IDX_NOTE_FILE_IDS', { synchronize: false })
@Index('IDX_NOTE_VISIBLE_USER_IDS', { synchronize: false })
@Index('IDX_note_userId_id', ['userId', 'id'])
export class MiNote {
@PrimaryColumn(id())
public id: string;

View file

@ -39,13 +39,11 @@ import XVideo from '@/components/MkMediaVideo.vue';
import * as os from '@/os.js';
import { FILE_TYPE_BROWSERSAFE } from '@/const.js';
import { defaultStore } from '@/store.js';
import { $i } from "@/account";
const props = defineProps<{
mediaList: Misskey.entities.DriveFile[];
user?: Misskey.entities.UserLite;
raw?: boolean;
isNoteSensitive?: boolean;
}>();
const gallery = shallowRef<HTMLDivElement>();
@ -92,12 +90,6 @@ async function calcAspectRatio() {
}
onMounted(() => {
if (($i ? defaultStore.state.markIncomingMediaInCwedPostAsSensitive : true)) {
props.mediaList.forEach(media => {
media.isSensitive = props.isNoteSensitive;
});
}
calcAspectRatio();
lightbox = new PhotoSwipeLightbox({

View file

@ -79,7 +79,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
<div v-if="appearNote.files && appearNote.files.length > 0">
<MkMediaList :mediaList="appearNote.files" :user="appearNote.user" :isNoteSensitive="note.cw"/>
<MkMediaList :mediaList="appearNote.files" :user="appearNote.user"/>
</div>
<MkPoll v-if="appearNote.poll" :noteId="appearNote.id" :poll="appearNote.poll" :class="$style.poll"/>
<div v-if="isEnabledUrlPreview">

View file

@ -92,7 +92,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
<div v-if="appearNote.files && appearNote.files.length > 0">
<MkMediaList :mediaList="appearNote.files" :user="appearNote.user" :isNoteSensitive="note.cw"/>
<MkMediaList :mediaList="appearNote.files" :user="appearNote.user"/>
</div>
<MkPoll v-if="appearNote.poll" ref="pollViewer" :noteId="appearNote.id" :poll="appearNote.poll" :class="$style.poll"/>
<div v-if="isEnabledUrlPreview">

View file

@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<details v-if="note.files && note.files.length > 0">
<summary>({{ i18n.tsx.withNFiles({ n: note.files.length }) }})</summary>
<MkMediaList :mediaList="note.files" :user="note.user" :isNoteSensitive="note.cw"/>
<MkMediaList :mediaList="note.files" :user="note.user"/>
</details>
<details v-if="note.poll">
<summary>{{ i18n.ts.poll }}</summary>

View file

@ -64,7 +64,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="showGapBetweenNotesInTimeline">{{ i18n.ts.showGapBetweenNotesInTimeline }}</MkSwitch>
<MkSwitch v-model="loadRawImages">{{ i18n.ts.loadRawImages }}</MkSwitch>
<MkSwitch v-model="disableCatSpeak">{{ i18n.ts.disableCatSpeak }}</MkSwitch>
<MkSwitch v-model="markIncomingMediaInCwedPostAsSensitive">{{ i18n.ts.markIncomingMediaInCwedPostAsSensitive }}</MkSwitch>
<MkRadios v-model="reactionsDisplaySize">
<template #label>{{ i18n.ts.reactionsDisplaySize }}</template>
<option value="small">{{ i18n.ts.small }}</option>
@ -302,7 +301,6 @@ const disableShowingAnimatedImages = computed(defaultStore.makeGetterSetter('dis
const forceShowAds = computed(defaultStore.makeGetterSetter('forceShowAds'));
const loadRawImages = computed(defaultStore.makeGetterSetter('loadRawImages'));
const disableCatSpeak = computed(defaultStore.makeGetterSetter('disableCatSpeak'));
const markIncomingMediaInCwedPostAsSensitive = computed(defaultStore.makeGetterSetter('markIncomingMediaInCwedPostAsSensitive'));
const highlightSensitiveMedia = computed(defaultStore.makeGetterSetter('highlightSensitiveMedia'));
const imageNewTab = computed(defaultStore.makeGetterSetter('imageNewTab'));
const warnMissingAltText = computed(defaultStore.makeGetterSetter('warnMissingAltText'));

View file

@ -79,7 +79,6 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
'imageNewTab',
'dataSaver',
'disableCatSpeak',
'markIncomingMediaInCwedPostAsSensitive',
'disableShowingAnimatedImages',
'emojiStyle',
'disableDrawer',

View file

@ -33,8 +33,6 @@ import XVideo from '@/components/MkMediaVideo.vue';
import XImage from '@/components/MkMediaImage.vue';
import XBanner from '@/components/MkMediaBanner.vue';
import { i18n } from '@/i18n.js';
import { $i } from "@/account";
import { defaultStore } from "@/store";
const props = defineProps<{
user: Misskey.entities.UserDetailed;
@ -53,11 +51,7 @@ onMounted(() => {
limit: 15,
}).then(notes => {
for (const note of notes) {
for (let file of note.files) {
if (($i ? defaultStore.state.markIncomingMediaInCwedPostAsSensitive : true)) {
file.isSensitive = note.cw !== null;
}
for (const file of note.files) {
medias.value.push({
note,
file,

View file

@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkA v-if="note.renoteId" class="rp" :to="`/notes/${note.renoteId}`">RN: ...</MkA>
</div>
<div v-if="note.files.length > 0" :class="$style.richcontent">
<MkMediaList :mediaList="note.files" :user="note.user" :isNoteSensitive="note.cw"/>
<MkMediaList :mediaList="note.files" :user="note.user"/>
</div>
<div v-if="note.poll">
<MkPoll :noteId="note.id" :poll="note.poll" :readOnly="true"/>

View file

@ -263,10 +263,6 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'account',
default: false,
},
markIncomingMediaInCwedPostAsSensitive: {
where: 'account',
default: true,
},
emojiStyle: {
where: 'device',
default: 'twemoji', // twemoji / fluentEmoji / native