Improve the offline page and reconnect automatically

Aperta Adatta ai principianti
#141 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
78/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
html, javascript
Ambito
frontend

Direzione di ricerca

Inizia da apps/web/public/offline.html, la pagina che il service worker mostra quando sei offline, e da apps/web/public/sw.js, dove si trova la versione della cache. Riprogetta la pagina con CSS inline, un pulsante "Try again" e un listener window sull'evento 'online' che ricarica la pagina. Se il file sw.js cambia, incrementa la versione della cache. È completato quando la pagina si carica con la rete disattivata in DevTools, si ricarica da sola appena torni online e non registra errori in console né richieste esterne.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement good first issue web

Difficulty: Beginner · Estimated size: 2 to 4 hours

Context

apps/web/public/offline.html is shown by the service worker when there is no connection. It is plain.

Problem or goal

Make it look like Commune and recover on its own.

Suggested approach

  • Add the logo and a friendly message, a "Try again" button, and an online event listener that reloads the page when the connection returns.
  • Keep the page self-contained (inline CSS, no external requests) so it works offline. Respect light and dark themes and prefers-reduced-motion.
  • Keep the file small and update the service worker's cache version if the file changes (see apps/web/public/sw.js).

Where to look

  • apps/web/public/offline.html
  • apps/web/public/sw.js

Acceptance criteria

  • Works with the network switched off in DevTools.
  • Reloads on its own when online again.
  • No console errors and no external requests.

How to work on it

  1. Comment here to claim it, so two people do not do the same work.
  2. Fork the repo and branch from main (feat/short-name or fix/short-name). Setup steps are in docs/DEVELOPMENT.md.
  3. Keep the change focused and add tests for backend logic.
  4. Run npm run typecheck, npm test and npm run lint and npm run format before opening the pull request.
  5. Use a Conventional Commits title (for example feat(web): add bookmarks). More in CONTRIBUTING.md.

Stuck? Ask in this issue. Questions are welcome.


Generated by Claude Code

Lingua principale
TypeScript
Stelle
6
Fork
6
Merge medio
1h 59m
PR unite (30g)
59

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Haseeb-MernStack/commune

Tutte le issue di Haseeb-MernStack/commune

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.