6 Commits

Author SHA1 Message Date
xfy
c92ba6d648 docs(plan): editor image upload placeholder implementation plan
13 个任务的实现计划,对应 upload-placeholder spec:
- Task 1-3: UploadCoordinator(pending map / runUpload+retry / notifyRust)
- Task 4: 自定义 Image 扩展 + NodeView 类(三种态)
- Task 5-6: index.ts 接线 + slash-command 走 coordinator
- Task 7: NodeView 样式(遮罩/spinner/错误卡片)
- Task 8-12: write.rs(signal/轮询/提示/保存拦截/fetch 改造)
- Task 13: 全量验证(cargo test/clippy/dx check + 手动清单)

每个任务含完整代码、行号、构建/测试命令、commit。
2026-06-22 15:19:01 +08:00
xfy
055329107e docs(spec): editor image upload placeholder and failure feedback design
Some checks failed
CI / check (push) Failing after 4m45s
CI / build (push) Has been skipped
文章编辑器图片上传占位符与失败提示的设计文档

经 brainstorming 流程产出的 spec,涵盖:
- 自定义 Image 扩展 + NodeView 承载上传状态(uploading/error/done)
- UploadCoordinator 集中管理三个上传入口,按 upload-id 定位节点更新
- JS→Rust 轮询通道(window.__tiptap_uploads)传递上传事件与计数
- 顶部多条堆叠失败提示 + 编辑器内失败卡片(重试/移除)
- 保存拦截双重防护(counts 检查 + markdown 兜底扫描 blob:)
- write.rs fetch 改造,透传服务端中文错误消息

不含实现,仅设计。验收标准 11 条。
2026-06-22 15:09:38 +08:00
xfy
28fd38e6b8 docs(plan): remove stale references to removed comment APIs 2026-06-17 13:11:53 +08:00
xfy
d1c9cea683 refactor(cache): remove unused per-post comment count cache 2026-06-17 11:52:57 +08:00
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