Add Firefox for Android PWA support #634

closed
opened by vielle.dev targeting master from vielle.dev/core: pwa

the images could be generated from the dolly svg but that would probably require bringing in a large dependency like inkscape and wouldn't bring huge benifits imo (&& just sticking it in tree was mentioned as best in the discord)

+3
appview/pages/templates/layouts/base.html
···
<link rel="preconnect" href="https://avatar.tangled.sh" />
<link rel="preconnect" href="https://camo.tangled.sh" />
+
<!-- pwa manifest -->
+
<link rel="manifest" href="/pwa-manifest.json" />
+
<!-- preload main font -->
<link rel="preload" href="/static/fonts/InterVariable.woff2" as="font" type="font/woff2" crossorigin />
+1
appview/pages/templates/user/completeSignup.html
···
content="complete your signup for tangled"
/>
<script src="/static/htmx.min.js"></script>
+
<link rel="manifest" href="/pwa-manifest.json" />
<link
rel="stylesheet"
href="/static/tw.css?{{ cssContentHash }}"
+1
appview/pages/templates/user/login.html
···
<meta property="og:url" content="https://tangled.org/login" />
<meta property="og:description" content="login to for tangled" />
<script src="/static/htmx.min.js"></script>
+
<link rel="manifest" href="/pwa-manifest.json" />
<link rel="stylesheet" href="/static/tw.css?{{ cssContentHash }}" type="text/css" />
<title>login &middot; tangled</title>
</head>
+1
appview/pages/templates/user/signup.html
···
<meta property="og:url" content="https://tangled.org/signup" />
<meta property="og:description" content="sign up for tangled" />
<script src="/static/htmx.min.js"></script>
+
<link rel="manifest" href="/pwa-manifest.json" />
<link rel="stylesheet" href="/static/tw.css?{{ cssContentHash }}" type="text/css" />
<title>sign up &middot; tangled</title>
+1
appview/state/router.go
···
router.Use(middleware.TryRefreshSession())
router.Get("/favicon.svg", s.Favicon)
router.Get("/favicon.ico", s.Favicon)
+
router.Get("/pwa-manifest.json", s.PWAManifest)
userRouter := s.UserRouter(&middleware)
standardRouter := s.StandardRouter(&middleware)
appview/pages/pwa-icons/pwa-144.png

This is a binary file and will not be displayed.

appview/pages/pwa-icons/pwa-192.png

This is a binary file and will not be displayed.

appview/pages/pwa-icons/pwa-48.png

This is a binary file and will not be displayed.

appview/pages/pwa-icons/pwa-512.png

This is a binary file and will not be displayed.

appview/pages/pwa-icons/pwa-72.png

This is a binary file and will not be displayed.

appview/pages/pwa-icons/pwa-96.png

This is a binary file and will not be displayed.

+2
flake.nix
···
mkdir -p appview/pages/static
# no preserve is needed because watch-tailwind will want to be able to overwrite
cp -fr --no-preserve=ownership ${packages'.appview-static-files}/* appview/pages/static
+
cp -fr appview/pages/pwa-icons/* appview/pages/static
export TANGLED_OAUTH_JWKS="$(${packages'.genjwks}/bin/genjwks)"
'';
env.CGO_ENABLED = 1;
···
program = toString (pkgs.writeShellScript "watch-appview" ''
echo "copying static files to appview/pages/static..."
${pkgs.coreutils}/bin/cp -fr --no-preserve=ownership ${packages'.appview-static-files}/* appview/pages/static
+
${pkgs.coreutils}/bin/cp -fr appview/pages/pwa-icons/* appview/pages/static
${air-watcher "appview" ""}/bin/run
'');
};