Compare commits

...
Author SHA1 Message Date
094cb910aa
Merge remote-tracking branch 'origin/dev' into dev
Some checks failed
Dependency builds / Build web (pull_request) Has been skipped
Dependency builds / Build desktop (pull_request) Has been skipped
Dependency builds / Test native MTP (pull_request) Has been skipped
Dependency builds / Build mobile (pull_request) Has been skipped
/ build-web (push) Successful in 7m14s
/ build-mobile (push) Failing after 12m6s
/ build-desktop (linux) (push) Successful in 12m16s
/ release (push) Has been skipped
# Conflicts:
#	apps/pwa/src/runtime.tsx
#	flake.nix
#	packages/mtp/src/context.test.tsx
#	packages/mtp/src/context.tsx
2026-08-27 19:39:52 +02:00
cf17365c8f
Merge branch 'main' into dev 2026-08-27 19:36:41 +02:00
aa34bd962b
temp(mtp): temp commit stuff that needs to get a rework 2026-08-27 19:35:17 +02:00
1d1b304bcf
feat(workflows): remove env thing 2026-08-27 19:32:48 +02:00
forgejo-actions
0fbedf6733 (qol): update release flake hash
Some checks were skipped
Dependency builds / Build web (pull_request) Has been skipped
Dependency builds / Build desktop (pull_request) Has been skipped
Dependency builds / Build mobile (pull_request) Has been skipped
2026-08-27 12:59:08 +00:00
96b81d30b1
feat(pwa): keep service workers from getting registerd outside the pwa
Some checks failed
/ build-web (push) Successful in 5m32s
/ build-desktop (linux) (push) Successful in 9m55s
/ build-mobile (push) Successful in 18m33s
/ release (push) Failing after 1m42s
2026-08-27 14:38:53 +02:00
forgejo-actions
d0918ff384 (qol): update release flake hash 2026-08-18 20:46:44 +00:00
0ac20f09e4 Merge pull request 'Add pwa & stuff' (#75) from dev into main
All checks were successful
/ build-web (push) Successful in 5m44s
/ build-desktop (linux) (push) Successful in 10m41s
/ build-mobile (push) Successful in 20m49s
/ release (push) Successful in 1m46s
Reviewed-on: #75
2026-08-18 22:32:16 +03:00
73db7e6b2b Update flake.nix 2026-08-12 15:12:05 +02:00
forgejo-actions
ac1bdf5ac2 (qol): update release flake hash 2026-08-06 14:47:23 +00:00
5 changed files with 18 additions and 14 deletions

View file

@ -5,9 +5,6 @@ on:
paths-ignore: paths-ignore:
- flake.nix - flake.nix
env:
NIX_CONFIG: experimental-features = nix-command flakes
jobs: jobs:
build-web: build-web:
runs-on: nixos runs-on: nixos

View file

@ -6,9 +6,6 @@ on:
paths-ignore: paths-ignore:
- flake.nix - flake.nix
env:
NIX_CONFIG: experimental-features = nix-command flakes
jobs: jobs:
build-web: build-web:
runs-on: nixos runs-on: nixos

View file

@ -22,9 +22,10 @@ export function subscribeTuFileLaunch(listener: (file: File) => void) {
}; };
} }
function isStandalone() { function isInstalledPwa() {
return ( return (
window.matchMedia("(display-mode: standalone)").matches || window.matchMedia("(display-mode: standalone)").matches ||
window.matchMedia("(display-mode: window-controls-overlay)").matches ||
(navigator as Navigator & { standalone?: boolean }).standalone === true (navigator as Navigator & { standalone?: boolean }).standalone === true
); );
} }
@ -60,10 +61,9 @@ async function enablePush() {
await setDatabaseEntry("keys", "push-subscription", subscription.toJSON()); await setDatabaseEntry("keys", "push-subscription", subscription.toJSON());
} }
export default function PwaRuntime() { function InstalledPwaRuntime() {
useEffect(() => { useEffect(() => {
if ( if (
isTauri() ||
!("serviceWorker" in navigator) || !("serviceWorker" in navigator) ||
!["http:", "https:"].includes(window.location.protocol) !["http:", "https:"].includes(window.location.protocol)
) { ) {
@ -94,7 +94,15 @@ export default function PwaRuntime() {
if (worker.state !== "installed") return; if (worker.state !== "installed") return;
if (!navigator.serviceWorker.controller) { if (!navigator.serviceWorker.controller) {
toast.success("Tensamin is ready for offline startup"); toast.success("Tensamin is ready for offline startup");
return;
} }
toast("A Tensamin update is ready", {
duration: Infinity,
action: {
label: "Update",
onClick: () => worker.postMessage({ type: "SKIP_WAITING" }),
},
});
}); });
}; };
if (registration.installing) watchWorker(registration.installing); if (registration.installing) watchWorker(registration.installing);
@ -134,7 +142,6 @@ export default function PwaRuntime() {
useEffect(() => { useEffect(() => {
if ( if (
!isStandalone() ||
!("Notification" in window) || !("Notification" in window) ||
Notification.permission !== "default" || Notification.permission !== "default" ||
localStorage.getItem("pwa-push-hint") localStorage.getItem("pwa-push-hint")
@ -163,7 +170,6 @@ export default function PwaRuntime() {
useEffect(() => { useEffect(() => {
if ( if (
isStandalone() &&
"Notification" in window && "Notification" in window &&
Notification.permission === "granted" && Notification.permission === "granted" &&
import.meta.env.VITE_WEB_PUSH_PUBLIC_KEY import.meta.env.VITE_WEB_PUSH_PUBLIC_KEY
@ -176,3 +182,8 @@ export default function PwaRuntime() {
return null; return null;
} }
export default function PwaRuntime() {
if (isTauri() || !isInstalledPwa()) return null;
return <InstalledPwaRuntime />;
}

View file

@ -128,6 +128,7 @@ export function tensaminPwa(): Plugin[] {
filename: "serviceWorker.ts", filename: "serviceWorker.ts",
injectRegister: null, injectRegister: null,
registerType: "prompt", registerType: "prompt",
buildBase: "/",
manifestFilename: "manifest.json", manifestFilename: "manifest.json",
includeAssets: ["favicon.ico", "icons/*.png"], includeAssets: ["favicon.ico", "icons/*.png"],
manifest: { manifest: {

View file

@ -17,7 +17,7 @@
systems = [ "x86_64-linux" ]; systems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs.lib.genAttrs systems;
version = "0.0.11"; version = "0.0.11";
x86_64DebHash = "sha256-p/6boNv9uWTHsPTVa3EhGzr41EwRzCY/fJWlj854DVA="; x86_64DebHash = "sha256-iMEgdjY8Ghlx6K/YzKC5JAZbeHNJDIFHm8MKmM4efaI=";
forgejoBaseUrl = "https://git.methanium.net/tensamin/client/releases/download/${version}"; forgejoBaseUrl = "https://git.methanium.net/tensamin/client/releases/download/${version}";
in in
{ {
@ -63,7 +63,6 @@
pipewire pipewire
systemd systemd
wayland wayland
webkitgtk_4_1
libX11 libX11
libXScrnSaver libXScrnSaver
libXcomposite libXcomposite
@ -185,7 +184,6 @@
pipewire pipewire
systemd systemd
wayland wayland
webkitgtk_4_1
libX11 libX11
libXScrnSaver libXScrnSaver
libXcomposite libXcomposite