feat(web): save the post you are writing as a draft
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 87/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, react, typescript
- Ambito
- frontend, full-stack
Direzione di ricerca
Leggi apps/web/src/components/Composer.tsx e verifica come ricava l’ID dell’utente attuale da apps/web/src/store/auth.ts. Poi segui il modello di archiviazione delle ricerche recenti in SearchPage.tsx ed esegui i test del componente Composer. Il lavoro è concluso quando le bozze vengono ripristinate per utente dopo il rimontaggio, eliminate quando vengono pubblicate o scartate e gli errori di archiviazione non causano il crash di Composer.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 6
- Fork
- 6
- Merge medio
- 6h 7m
- PR unite (30g)
- 167
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Haseeb-MernStack/commune
-
documentation good first issue help wanted security
Difficoltà 2/5 Mezza giornata Idoneità per principianti 74/100
Haseeb-MernStack/commune#607 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue help wanted tooling
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
Haseeb-MernStack/commune#525 ·
I maintainer di solito rispondono entro 1 giorno
-
docs(api): document each controller function with its route, auth and errorsForse già presa @abedinm l’ha presa 1 giorno fa. Apertaapi documentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Haseeb-MernStack/commune#501 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
a11y(web): check focus outlines in both themes and fix any that are hard to seeForse già presa @pawan76542987 l’ha presa 1 giorno fa. Apertaaccessibility frontend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
Haseeb-MernStack/commune#498 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Haseeb-MernStack/commune#395 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Haseeb-MernStack/commune
Issue simili
-
Translate the appApertagood first issue help wanted
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
Mikiyas-Meles-Assefa/opensourcebook#154 ·
I maintainer di solito rispondono entro 1 giorno
-
usersim
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WenyuChiou/agent-board#2315 ·
I maintainer di solito rispondono entro 1 giorno
-
bug data-types
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/clickhouse-js#1293 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
sidebandstudio/clawtrate#1863 ·
I maintainer di solito rispondono entro 1 giorno
-
area: middleware enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100