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

limit depth of reply posts #7979

Merged
merged 3 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ muteThread: "スレッドをミュート"
unmuteThread: "スレッドのミュートを解除"
ffVisibility: "つながりの公開範囲"
ffVisibilityDescription: "自分のフォロー/フォロワー情報の公開範囲を設定できます。"
continueThread: "さらにスレッドを見る"
deleteAccountConfirm: "アカウントが削除されます。よろしいですか?"

_emailUnavailable:
Expand Down
32 changes: 21 additions & 11 deletions packages/client/src/components/note.sub.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="wrpstxzv" :class="{ children }" v-size="{ max: [450] }">
<div class="wrpstxzv" :class="{ children: depth > 1 }" v-size="{ max: [450] }">
<div class="main">
<MkAvatar class="avatar" :user="note.user"/>
<div class="body">
Expand All @@ -15,12 +15,18 @@
</div>
</div>
</div>
<XSub v-for="reply in replies" :key="reply.id" :note="reply" class="reply" :detail="true" :children="true"/>
<template v-if="depth < 5">
<XSub v-for="reply in replies" :key="reply.id" :note="reply" class="reply" :detail="true" :depth="depth + 1"/>
</template>
<div v-else class="more">
<MkA class="text _link" :to="notePage(note)">{{ $ts.continueThread }} <i class="fas fa-angle-double-right"></i></MkA>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import notePage from '@/filters/note';
import XNoteHeader from './note-header.vue';
import XSubNoteContent from './sub-note-content.vue';
import XCwButton from './cw-button.vue';
Expand All @@ -45,16 +51,12 @@ export default defineComponent({
required: false,
default: false
},
children: {
type: Boolean,
// how many notes are in between this one and the note being viewed in detail
depth: {
type: Number,
required: false,
default: false
default: 1
},
// TODO
truncate: {
type: Boolean,
default: true
}
},

data() {
Expand All @@ -74,6 +76,10 @@ export default defineComponent({
});
}
},

methods: {
notePage,
}
});
</script>

Expand Down Expand Up @@ -138,9 +144,13 @@ export default defineComponent({
}
}

> .reply {
> .reply, > .more {
border-left: solid 0.5px var(--divider);
margin-top: 10px;
}

> .more {
padding: 10px 0 0 16px;
}
}
</style>