Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 13, 2025

This PR implements offline-first Progressive Web App (PWA) functionality for Coil Timer, enabling the app to work without internet connection after initial load and providing automatic update notifications.

Key Features

Offline-First Functionality:

  • Service worker automatically caches all static assets (JS, CSS, HTML, icons, fonts)
  • App works completely offline after first visit/installation
  • Shows "Ready for Offline Use" notification when offline capability is enabled
  • Cache-first strategy ensures fast performance even when online

Automatic Update Detection:

  • Git commit hash injected into HTML meta tag during build process
  • Service worker checks for updates every 10 minutes
  • When new version detected, shows blue "Update Available" notification
  • Users can update immediately or dismiss the notification
  • Seamless update experience with automatic page reload

Technical Implementation

  • vite-plugin-pwa: Automatic service worker generation with minimal configuration
  • Workbox: Robust caching strategies and update mechanisms
  • Git-based versioning: Reliable version tracking using commit hashes
  • TypeScript support: Proper types for PWA virtual modules
  • GitHub Pages compatible: Works with existing deployment pipeline

User Experience

Before: App shows "offline" message when no internet connection is available.

After:

  1. First visit automatically enables offline functionality
  2. Subsequent visits work instantly without internet
  3. Timer functions (start/stop/adjust) work offline
  4. Update notifications appear when new versions are deployed
  5. One-click updates with immediate availability

The implementation uses industry-standard PWA patterns and integrates seamlessly with the existing Vite build process and GitHub Pages deployment.

Fixes #14.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Should work offline Add offline-first PWA functionality with automatic update detection Aug 13, 2025
Copilot AI requested a review from z0u August 13, 2025 00:41
Copilot finished work on behalf of z0u August 13, 2025 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should work offline

2 participants