2 Commits

Author SHA1 Message Date
xfy
03054d83e8 docs: add implementation plan for comment localStorage feature
8 tasks covering:
1. CommentResponse: add comment_id/avatar_url/depth fields
2. CheckPendingStatus server function
3. comment_storage hook (localStorage CRUD + TTL)
4. CommentSection: pending state in CommentContext
5. CommentList: merge approved + pending
6. PendingCommentItem component
7. CommentForm: auto-fill + save pending
8. Build + test verification

Fixes from subagent review:
- avatar_url/depth computed server-side (md5 not in WASM)
- Fix double mutable borrow in prune_all_expired
- Remove unused wasm_bindgen::JsCast imports
- Remove redundant is_expired filter in section.rs
- Fix double localStorage read in load_pending_comments
- Remove unused private helpers import in form.rs
2026-06-11 14:07:58 +08:00
xfy
fbda6373cc docs: add comment localStorage persistence + pending visibility design spec
Two features:
- Auto-fill comment form (name/email/url) from localStorage
- Show pending comments with '审核中' badge to the submitting user

Key decisions:
- Two separate localStorage keys (author info + pending comments)
- Pending comments stored by server-returned ID, not user identity
- 7-day TTL with cleanup on page load via check_pending_status API
- Separate PendingCommentItem component (no PublicComment pollution)
- content_md only (no HTML in localStorage for XSS safety)
2026-06-11 13:52:28 +08:00