From d107596f6c277d6aa4616616cc4fe176f339a8f5 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 9 Nov 2026 20:01:41 +0100 Subject: feat: PWA manifest so Chrome installs deck-it fullscreen --- static/icon-192.png | Bin 0 -> 936 bytes static/icon-512.png | Bin 0 -> 3206 bytes static/index.html | 3 +++ static/manifest.json | 14 ++++++++++++++ tests/test_frontend.py | 9 +++++++++ 5 files changed, 26 insertions(+) create mode 100644 static/icon-192.png create mode 100644 static/icon-512.png create mode 100644 static/manifest.json diff --git a/static/icon-192.png b/static/icon-192.png new file mode 100644 index 0000000..30e1c5d Binary files /dev/null and b/static/icon-192.png differ diff --git a/static/icon-512.png b/static/icon-512.png new file mode 100644 index 0000000..8126f4d Binary files /dev/null and b/static/icon-512.png differ diff --git a/static/index.html b/static/index.html index 958580f..434e496 100644 --- a/static/index.html +++ b/static/index.html @@ -8,6 +8,9 @@ + + + diff --git a/static/manifest.json b/static/manifest.json new file mode 100644 index 0000000..1813283 --- /dev/null +++ b/static/manifest.json @@ -0,0 +1,14 @@ +{ + "name": "deck-it", + "short_name": "deck-it", + "description": "Tablet dashboard and stream-deck for this desktop.", + "start_url": "./", + "scope": "./", + "display": "fullscreen", + "background_color": "#24273a", + "theme_color": "#24273a", + "icons": [ + { "src": "icon-192.png", "sizes": "192x192", "type": "image/png" }, + { "src": "icon-512.png", "sizes": "512x512", "type": "image/png" } + ] +} diff --git a/tests/test_frontend.py b/tests/test_frontend.py index d86468d..1111f89 100644 --- a/tests/test_frontend.py +++ b/tests/test_frontend.py @@ -4,6 +4,7 @@ from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) import http.client +import json import os import socket import tempfile @@ -55,6 +56,14 @@ class Frontend(unittest.TestCase): for asset in ("app.js", "deck.css", "vendor/gridstack/gridstack-all.js"): self.assertIn(asset, text) + def test_pwa_manifest(self): + self.assertIn(b'rel="manifest"', self.get("/")[1]) + manifest = json.loads(self.get("/manifest.json")[1]) + self.assertEqual(manifest["display"], "fullscreen") + self.assertEqual(manifest["start_url"], "./") + for size in (192, 512): + self.assertEqual(self.get(f"/icon-{size}.png")[0], 200) + def test_vendor_assets_served(self): for path in ("/vendor/gridstack/gridstack-all.js", "/vendor/gridstack/gridstack.min.css"): self.assertEqual(self.get(path)[0], 200, path) -- cgit v1.2.3