feat(web): save the post you are writing as a draft
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 87/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, react, typescript
- Área
- frontend, full-stack
Línea de trabajo
Lee apps/web/src/components/Composer.tsx y comprueba cómo obtiene el ID del usuario actual de apps/web/src/store/auth.ts. Después, sigue el patrón de almacenamiento de búsquedas recientes de SearchPage.tsx y ejecuta las pruebas del componente Composer. El trabajo estará terminado cuando los borradores se restauren por usuario después de volver a montar el componente, se borren al publicar o descartar y los errores de almacenamiento no provoquen que Composer se bloquee.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 6
- Forks
- 6
- Merge medio
- 6 h 7 min
- PR fusionados (30 d)
- 167
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Haseeb-MernStack/commune
-
documentation good first issue help wanted security
Dificultad 2/5 Medio día Aptitud para principiantes 74/100
Haseeb-MernStack/commune#607 ·
Los mantenedores suelen responder en 1 día
-
good first issue help wanted tooling
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
Haseeb-MernStack/commune#525 ·
Los mantenedores suelen responder en 1 día
-
docs(api): document each controller function with its route, auth and errorsPosiblemente ocupada @abedinm la tomó hace 1 día. Abiertoapi documentation good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Haseeb-MernStack/commune#501 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
a11y(web): check focus outlines in both themes and fix any that are hard to seePosiblemente ocupada @pawan76542987 la tomó hace 1 día. Abiertoaccessibility frontend good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Haseeb-MernStack/commune#498 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Haseeb-MernStack/commune#395 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Haseeb-MernStack/commune
Issues similares
-
Translate the appAbiertogood first issue help wanted
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Mikiyas-Meles-Assefa/opensourcebook#154 ·
Los mantenedores suelen responder en 1 día
-
usersim
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
WenyuChiou/agent-board#2315 ·
Los mantenedores suelen responder en 1 día
-
bug data-types
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
ClickHouse/clickhouse-js#1293 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
sidebandstudio/clawtrate#1863 ·
Los mantenedores suelen responder en 1 día
-
area: middleware enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100