feat: Discourse-style reply-to indicator (↩ @username)

- replies table: add reply_to_username column
- POST /api/replies: accept reply_to_username param
- GET /api/replies: LEFT JOIN users to return reply_to_username
- ReplyList: submit replyTo as reply_to_username on create
- UI: each reply shows '↩ 正在回复 @username' indicator (clickable,
  scrolls to target reply)
- data-username attribute on .reply-item for scroll targeting
This commit is contained in:
lezi-fun committed 2026-08-11 21:18:18 +08:00
1 parent 7bf9e37036
commit 4d0d5edec3
5 files changed
+56 -20

No files matched your search

+2 -2
View File
@@ -77,10 +77,10 @@ export const API = {
// 回复
getReplies(postId) { return apiFetch('/posts/' + postId + '/replies'); },
createReply(postId, content, captcha) {
createReply(postId, content, captcha, replyToUsername) {
return apiFetch('/posts/' + postId + '/replies', {
method: 'POST',
body: JSON.stringify({ content, captcha_id: captcha?.id, captcha_answer: captcha?.answer, captcha_sig: captcha?.sig }),
body: JSON.stringify({ content, captcha_id: captcha?.id, captcha_answer: captcha?.answer, captcha_sig: captcha?.sig, reply_to_username: replyToUsername || null }),
});
},
deleteReply(replyId) { return apiFetch('/replies/' + replyId, { method: 'DELETE' }); },