diff --git a/app/globals.css b/app/globals.css index a903e85..d868c5c 100644 --- a/app/globals.css +++ b/app/globals.css @@ -3165,3 +3165,8 @@ a.btn-secondary { .reply-item[data-username]:has(.reply-to-indicator):hover { border-left-color: var(--primary); } + +/* ===== 帖子详情卡片 ===== */ +.post-detail-card { + border-radius: var(--radius); +} diff --git a/components/ReplyList.js b/components/ReplyList.js index 71c1b26..6046e76 100644 --- a/components/ReplyList.js +++ b/components/ReplyList.js @@ -76,6 +76,21 @@ export default function ReplyList({ postId, onRefresh }) { } }; + // 计算每条回复的嵌套深度(按 reply_to_username 追踪回复链) + const replyDepths = (() => { + const map = {}; + const getDepth = (r) => { + if (map[r.id] !== undefined) return map[r.id]; + if (!r.reply_to_username) { map[r.id] = 0; return 0; } + const parent = replies.find((x) => x.username === r.reply_to_username); + const d = parent ? getDepth(parent) + 1 : 0; + map[r.id] = d; + return d; + }; + replies.forEach((r) => getDepth(r)); + return map; + })(); + return ( <>