feat(web): save the post you are writing as a draft
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 87/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, react, typescript
- Lĩnh vực
- frontend, full-stack
Hướng nghiên cứu
Đọc apps/web/src/components/Composer.tsx và kiểm tra cách thành phần này lấy ID người dùng hiện tại từ apps/web/src/store/auth.ts. Sau đó, làm theo mẫu lưu trữ tìm kiếm gần đây trong SearchPage.tsx và chạy các bài kiểm tra của thành phần Composer. Công việc hoàn tất khi bản nháp được khôi phục theo từng người dùng sau khi gắn lại, bị xóa khi đăng hoặc hủy, và lỗi lưu trữ không làm Composer gặp sự cố.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
If someone closes the tab or refreshes while writing a post, the text is lost today. Save it locally and restore it.
Why this matters
Losing a long post is frustrating and makes people stop writing. A draft that survives a refresh or a flaky mobile connection is a basic quality of a production app.
Proposed solution
- Save the composer text to
localStorage(debounced, about 500 ms) under a key that includes the user id, for examplecommune:draft:<userId>. - Restore it when the composer mounts, show a small "Draft restored" note with a Discard button, and remove it after a successful post.
- Do not save empty text, and wrap every storage call in try/catch because storage can be blocked.
Where to start in the code
apps/web/src/components/Composer.tsxapps/web/src/store/auth.tsfor the current user id- Follow the same storage pattern used by recent searches in
SearchPage.tsx
Acceptance criteria
- Refreshing the page keeps the text.
- Posting clears the draft; discarding clears it too.
- Another account on the same browser never sees someone else's draft.
- Nothing breaks when
localStoragethrows.
Tests
- Component test: typing, remounting the composer and finding the restored text.
- Test that a failing
localStoragedoes not crash the composer.
Want to work on this?
Comment on this issue to claim it, then follow First contribution and CONTRIBUTING.md. Keep the pull request to this one feature, use a conventional title (for example feat(web): save the post you are writing as a draft), write Closes #<this issue> in the description, and run npx prettier --write on the files you changed before pushing. Questions are welcome here or on Discord.
Generated by Claude Code
- Ngôn ngữ chính
- TypeScript
- Star
- 6
- Fork
- 6
- Merge trung bình
- 6 giờ 7 phút
- Pull request đã merge (30 ngày)
- 167
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Haseeb-MernStack/commune
-
documentation good first issue help wanted security
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 74/100
Haseeb-MernStack/commune#607 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue help wanted tooling
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
Haseeb-MernStack/commune#525 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs(api): document each controller function with its route, auth and errorsCó thể đã có người làm @abedinm đã nhận 1 ngày trước. Đang mởapi documentation good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Haseeb-MernStack/commune#501 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
a11y(web): check focus outlines in both themes and fix any that are hard to seeCó thể đã có người làm @pawan76542987 đã nhận 1 ngày trước. Đang mởaccessibility frontend good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Haseeb-MernStack/commune#498 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Haseeb-MernStack/commune#395 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Haseeb-MernStack/commune
Issue tương tự
-
Translate the appĐang mởgood first issue help wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Mikiyas-Meles-Assefa/opensourcebook#154 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
usersim
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
WenyuChiou/agent-board#2315 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
rowbinary: typeStringToReader keeps Variant members in text order, so Variant(Int64, Float64) reads 7 as 3.5e-323Có thể đã có người làm @rwits08 đã nhận hôm nay. Đang mởbug data-types
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
ClickHouse/clickhouse-js#1293 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
sidebandstudio/clawtrate#1863 ·
Maintainer thường phản hồi trong vòng 1 ngày