Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

Plan: Add Progressive Web App (PWA) Support to Emoncms

  • Create web app manifest file (manifest.json) with app metadata, icons, and display settings
  • Create PWA icon files in multiple sizes (192x192, 512x512) for proper mobile display
  • Create service worker (service-worker.js) for offline capabilities and caching
  • Update Theme/theme.php to include manifest link and theme-color meta tags in HTML head
  • Register service worker in the main JavaScript initialization
  • Address code review feedback (path validation, CORS support, better offline handling)
  • Fix manifest icon purpose format and improve caching for opaque responses
  • Pass CodeQL security checks
  • Update icons with OpenEnergyMonitor logo per maintainer request
  • Complete implementation

Summary of Implementation

Files Created:

  1. manifest.json - Web app manifest with metadata and icon references
  2. service-worker.js - Service worker for offline caching and functionality
  3. Theme/pwa-icon-192.png - 192x192 app icon with OpenEnergyMonitor logo
  4. Theme/pwa-icon-512.png - 512x512 app icon with OpenEnergyMonitor logo

Files Modified:

  1. Theme/theme.php - Added manifest link, theme-color, and apple-mobile-web-app-capable meta tags
  2. Lib/emoncms.js - Added service worker registration with proper validation

PWA Features:

  • ✅ Installable on mobile and desktop devices
  • ✅ Standalone display mode
  • ✅ Offline functionality with intelligent caching
  • ✅ CORS and opaque response support
  • ✅ Smart offline fallback for navigation and resources
  • ✅ Theme color integration (#44b3e2)
  • ✅ OpenEnergyMonitor branded icons
  • ✅ Multiple icon purposes (any and maskable)

Security:

  • ✅ No vulnerabilities detected by CodeQL
  • ✅ Proper error handling in service worker
  • ✅ Safe caching strategy
Original prompt

This section details on the original issue you should resolve

<issue_title>Add progressive web app (PWA) support</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 15, 2025 22:37
Co-authored-by: glynhudson <758844+glynhudson@users.noreply.github.com>
Co-authored-by: glynhudson <758844+glynhudson@users.noreply.github.com>
Co-authored-by: glynhudson <758844+glynhudson@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for progressive web app (PWA) Add Progressive Web App (PWA) support Dec 15, 2025
Copilot AI requested a review from glynhudson December 15, 2025 22:43
Co-authored-by: glynhudson <758844+glynhudson@users.noreply.github.com>
@glynhudson
Copy link
Member

@copilot please use this image for the logos: https://avatars.githubusercontent.com/u/2532311?s=280&v=4

Co-authored-by: glynhudson <758844+glynhudson@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 15, 2025

@copilot please use this image for the logos: https://avatars.githubusercontent.com/u/2532311?s=280&v=4

Updated the PWA icons with the OpenEnergyMonitor logo in commit bc6b1ce.

PWA Icons Preview

@emoncms emoncms deleted a comment from Copilot AI Dec 15, 2025
@glynhudson glynhudson requested review from TrystanLea and removed request for glynhudson December 15, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add progressive web app (PWA) support

2 participants