feat: reply chain view (sub-thread folding)
Build reply tree, show up to 3 children per reply. '继续此消息串' opens a dedicated chain view (only that reply + all descendants). '返回所有回复' goes back.
This commit is contained in:
1 parent
84616ff4a1
commit
4c0f146338
4 files changed
+122
-63
No files matched your search
@@ -30,6 +30,7 @@ export default function PostDetail({ postId, initialPost = null }) {
|
||||
const editImageInputRef = useRef(null);
|
||||
// 评论抽屉:帖子加载完成后自动展开(动画完整播放)
|
||||
const [repliesOpen, setRepliesOpen] = useState(false);
|
||||
const [chainParentId, setChainParentId] = useState(null);
|
||||
useEffect(() => {
|
||||
if (post && !repliesOpen) {
|
||||
// 延迟到帖子内容渲染后,让抽屉动画平滑播放
|
||||
@@ -196,7 +197,7 @@ export default function PostDetail({ postId, initialPost = null }) {
|
||||
{/* 评论抽屉:帖子加载完成后自动展开 */}
|
||||
<div className={'replies-drawer' + (repliesOpen ? ' open' : '')}>
|
||||
<div className="replies-drawer-inner">
|
||||
<ReplyList postId={postId} onRefresh={load} />
|
||||
<ReplyList postId={postId} onRefresh={load} chainParentId={chainParentId} onBack={setChainParentId} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user