diff --git a/locales/index.d.ts b/locales/index.d.ts
index cb632dfb25..22d3e31526 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -2158,6 +2158,26 @@ export interface Locale extends ILocale {
* {x}を上限に
*/
"limitTo": ParameterizedString<"x">;
+ /**
+ * ノートを畳む大きさ
+ */
+ "collapsingNoteSize": string;
+ /**
+ * ノートを畳む条件
+ */
+ "collapsingNoteCondition": string;
+ /**
+ * 高精度の算出方法
+ */
+ "detailedCalculation": string;
+ /**
+ * 旧式の算出方法
+ */
+ "legacyCalculation": string;
+ /**
+ * 実際の表示サイズに基づく
+ */
+ "seeRenderedSize": string;
/**
* フォロー申請はありません
*/
diff --git a/packages/frontend-embed/src/components/EmNote.vue b/packages/frontend-embed/src/components/EmNote.vue
index ab29f91e83..1eefa2e786 100644
--- a/packages/frontend-embed/src/components/EmNote.vue
+++ b/packages/frontend-embed/src/components/EmNote.vue
@@ -125,7 +125,6 @@ import EmUserName from '@/components/EmUserName.vue';
import EmTime from '@/components/EmTime.vue';
import { userPage } from '@/utils.js';
import { i18n } from '@/i18n.js';
-import { shouldCollapsed } from '@@/js/collapsed.js';
function getAppearNote(note: Misskey.entities.Note) {
return Misskey.note.isPureRenote(note) ? note.renote : note;
diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue
index bfad09b776..0278f2ddd4 100644
--- a/packages/frontend/src/components/MkNote.vue
+++ b/packages/frontend/src/components/MkNote.vue
@@ -84,6 +84,7 @@ SPDX-License-Identifier: AGPL-3.0-only
+
@@ -181,7 +182,7 @@ import { computed, inject, onMounted, ref, useTemplateRef, watch, provide } from
import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js';
import { isLink } from '@@/js/is-link.js';
-import { shouldCollapsed } from '@@/js/collapsed.js';
+import { shouldCollapsedLegacy, shouldCollapsed } from '@@/js/collapsed.js';
import { host } from '@@/js/config.js';
import type { Ref } from 'vue';
import type { MenuItem } from '@/types/menu.js';
@@ -218,7 +219,6 @@ import { claimAchievement } from '@/utility/achievements.js';
import { getNoteSummary } from '@/utility/get-note-summary.js';
import MkRippleEffect from '@/components/MkRippleEffect.vue';
import { showMovedDialog } from '@/utility/show-moved-dialog.js';
-import { shouldCollapsedLegacy, shouldCollapsed } from '@@/js/collapsed.js';
import { isEnabledUrlPreview } from '@/instance.js';
import { focusPrev, focusNext } from '@/utility/focus.js';
import { getAppearNote } from '@/utility/get-appear-note.js';
@@ -249,17 +249,6 @@ const currentClip = inject[ | null>('currentClip', nul
const note = ref(deepClone(props.note));
-// used later
-const collapsingNoteCondition = defaultStore.state.collapsingNoteCondition;
-if (collapsingNoteCondition === 'seeRenderedSize') {
- onMounted(() => {
- const current = collapsibleArea.value.clientHeight;
- const limit = collapseSize * parseFloat(getComputedStyle(collapsibleArea.value).fontSize);
- isLong.value = current > limit;
- collapsed.value &&= isLong.value;
- });
-}
-
// plugin
const noteViewInterruptors = getPluginHandlers('note_view_interruptor');
if (noteViewInterruptors.length > 0) {
@@ -310,8 +299,9 @@ const renoteCollapsed = ref(
);
// oversized note collapsing
-const collapsibleArea = ref(null);
-const collapseSize = defaultStore.state.collapsingNoteSize;
+const collapsibleArea = useTemplateRef('collapsibleArea');
+const collapsingNoteCondition = prefer.s.collapsingNoteCondition;
+const collapseSize = prefer.s.collapsingNoteSize;
const isLong = ref(true);
switch (collapsingNoteCondition) {
case 'detailedCalculation':
@@ -326,6 +316,15 @@ switch (collapsingNoteCondition) {
break;
}
const collapsed = ref(appearNote.value.cw == null && isLong.value);
+// v-sizeディレクティブを使ったほうがよい?
+if (collapsingNoteCondition === 'seeRenderedSize') {
+ onMounted(() => {
+ const current = collapsibleArea.value.clientHeight;
+ const limit = collapseSize * parseFloat(getComputedStyle(collapsibleArea.value).fontSize);
+ isLong.value = current > limit;
+ collapsed.value &&= isLong.value;
+ });
+}
const pleaseLoginContext = computed(() => ({
type: 'lookup',
diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue
index 79b3d26a46..07bbf69470 100644
--- a/packages/frontend/src/components/MkSubNoteContent.vue
+++ b/packages/frontend/src/components/MkSubNoteContent.vue
@@ -32,14 +32,14 @@ SPDX-License-Identifier: AGPL-3.0-only
]