Improve the offline page and reconnect automatically

Open Beginner friendly
#141 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
html, javascript
Domain
frontend

Research direction

Start with apps/web/public/offline.html, the page the service worker serves when offline, and with apps/web/public/sw.js, where the cache version lives. Redesign the page with inline CSS, a 'Try again' button, and a window 'online' listener that reloads the page, and bump the cache version in sw.js if the file changes. Done when the page loads with the network off in DevTools, reloads itself once back online, and logs no console errors or external requests.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
6
Forks
6
Avg merge
1h 59m
Merged PRs (30d)
59

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Haseeb-MernStack/commune

All issues in Haseeb-MernStack/commune

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.