@@ -148,6 +149,7 @@
:replyLevel="replyLevel + 1"
:parentId="appearNote.id"
:detailedView="detailedView"
+ :forceExpandCw="props.forceExpandCw"
/>
@@ -211,6 +213,7 @@ const props = withDefaults(
conversation?: misskey.entities.Note[];
parentId?;
detailedView?;
+ forceExpandCw?: boolean;
// how many notes are in between this one and the note being viewed in detail
depth?: number;
diff --git a/packages/client/src/components/MkSubNoteContent.vue b/packages/client/src/components/MkSubNoteContent.vue
index b0fccc1f7..58ad5e5dc 100644
--- a/packages/client/src/components/MkSubNoteContent.vue
+++ b/packages/client/src/components/MkSubNoteContent.vue
@@ -215,6 +215,7 @@ const props = defineProps<{
conversation?;
detailed?: boolean;
detailedView?: boolean;
+ forceExpandCw?: boolean;
}>();
const emit = defineEmits<{
@@ -238,7 +239,14 @@ const urls = props.note.text
? extractUrlFromMfm(mfm.parse(props.note.text)).slice(0, 5)
: null;
-let showContent = $ref(false);
+let _showContent = $ref(null);
+let showContent = $computed({
+ set(val) { _showContent = val },
+ get() {
+ if (_showContent != null) return _showContent;
+ return props.forceExpandCw || false;
+ },
+})
const mfms = props.note.text
? extractMfmWithAnimation(mfm.parse(props.note.text))
diff --git a/packages/client/src/pages/note.vue b/packages/client/src/pages/note.vue
index 3e5059e5a..3079b3bfe 100644
--- a/packages/client/src/pages/note.vue
+++ b/packages/client/src/pages/note.vue
@@ -39,6 +39,7 @@
@@ -91,6 +92,7 @@ let showNext = $ref(false);
let error = $ref();
let isRenote = $ref(false);
let appearNote = $ref
();
+let expandAllCws = $ref(false);
const prevPagination = {
endpoint: "users/notes" as const,
@@ -160,11 +162,21 @@ function fetchNote() {
});
}
+function toggleAllCws() {
+ expandAllCws = !expandAllCws;
+}
+
watch(() => props.noteId, fetchNote, {
immediate: true,
});
-const headerActions = $computed(() => []);
+const headerActions = $computed(() => appearNote ? [
+ {
+ icon: `${expandAllCws ? "ph-eye" : "ph-eye-slash"} ph-bold ph-lg`,
+ text: expandAllCws ? i18n.ts.collapseAllCws : i18n.ts.expandAllCws,
+ handler: toggleAllCws,
+ },
+]:[]);
const headerTabs = $computed(() => []);