feat(web): save the post you are writing as a draft
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 87/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, react, typescript
- Domain
- frontend, full-stack
Research direction
Read apps/web/src/components/Composer.tsx and check how it gets the current user id from apps/web/src/store/auth.ts. Then follow the recent-search storage pattern in SearchPage.tsx and run the composer component tests. Done means drafts restore per user after remounting, clear on posting or discard, and storage errors do not crash the composer.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 6
- Forks
- 6
- Avg merge
- 6h 7m
- Merged PRs (30d)
- 167
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Haseeb-MernStack/commune
-
documentation good first issue help wanted security
Difficulty 2/5 Half a day Newbie friendliness 74/100
Haseeb-MernStack/commune#607 ·
Maintainers usually reply within 1 day
-
good first issue help wanted tooling
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
Haseeb-MernStack/commune#525 ·
Maintainers usually reply within 1 day
-
docs(api): document each controller function with its route, auth and errorsPossibly taken @abedinm claimed this 1 day ago. Openapi documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Haseeb-MernStack/commune#501 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
a11y(web): check focus outlines in both themes and fix any that are hard to seePossibly taken @pawan76542987 claimed this 1 day ago. Openaccessibility frontend good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Haseeb-MernStack/commune#498 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Haseeb-MernStack/commune#395 ·
Maintainers usually reply within 1 day
All issues in Haseeb-MernStack/commune
Similar issues
-
Translate the appOpengood first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Mikiyas-Meles-Assefa/opensourcebook#154 ·
Maintainers usually reply within 1 day
-
usersim
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
WenyuChiou/agent-board#2315 ·
Maintainers usually reply within 1 day
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/clickhouse-js#1293 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sidebandstudio/clawtrate#1863 ·
Maintainers usually reply within 1 day
-
area: middleware enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100