From 605d10ae02362679ec9428a1444df567b641d12e Mon Sep 17 00:00:00 2001 From: Ricky Stretch Date: Tue, 10 Mar 2026 12:08:49 -0400 Subject: [PATCH] v0.5.1 fixed mobile PWA refesh --- .env.example | 2 +- backend/package.json | 2 +- build.sh | 2 +- frontend/package.json | 2 +- frontend/src/index.css | 5 +++++ frontend/src/main.jsx | 22 ++++++++++++++++++++++ 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 3372668..8e31511 100644 --- a/.env.example +++ b/.env.example @@ -7,7 +7,7 @@ TZ=UTC # Copy this file to .env and customize # Image version to run (set by build.sh, or use 'latest') -JAMA_VERSION=0.5.0 +JAMA_VERSION=0.5.1 # Default admin credentials (used on FIRST RUN only) ADMIN_NAME=Admin User diff --git a/backend/package.json b/backend/package.json index ff08cf6..04d28d2 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "jama-backend", - "version": "0.5.0", + "version": "0.5.1", "description": "TeamChat backend server", "main": "src/index.js", "scripts": { diff --git a/build.sh b/build.sh index bdd566d..d0cb072 100644 --- a/build.sh +++ b/build.sh @@ -13,7 +13,7 @@ # ───────────────────────────────────────────────────────────── set -euo pipefail -VERSION="${1:-0.5.0}" +VERSION="${1:-0.5.1}" ACTION="${2:-}" REGISTRY="${REGISTRY:-}" IMAGE_NAME="jama" diff --git a/frontend/package.json b/frontend/package.json index a47ae25..dc7df7b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "jama-frontend", - "version": "0.5.0", + "version": "0.5.1", "private": true, "scripts": { "dev": "vite", diff --git a/frontend/src/index.css b/frontend/src/index.css index fce7c7d..02f4af2 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -30,6 +30,11 @@ html, body, #root { height: 100%; min-width: 320px; font-family: var(--font); color: var(--text-primary); background: var(--background); } +/* Disable pull-to-refresh in PWA standalone mode — prevents viewport shift bug */ +html { + overscroll-behavior-y: none; +} + button { font-family: var(--font); cursor: pointer; border: none; background: none; } input, textarea { font-family: var(--font); } a { color: inherit; text-decoration: none; } diff --git a/frontend/src/main.jsx b/frontend/src/main.jsx index fc7b896..841ab1b 100644 --- a/frontend/src/main.jsx +++ b/frontend/src/main.jsx @@ -17,6 +17,28 @@ if ('serviceWorker' in navigator) { } + +// Disable pull-to-refresh in PWA standalone mode to prevent viewport shift bug. +// The CSS overscroll-behavior-y:none handles most browsers; this catches the rest. +(function () { + const isStandalone = window.matchMedia('(display-mode: standalone)').matches + || window.navigator.standalone === true; + if (!isStandalone) return; + + let startY = 0; + document.addEventListener('touchstart', e => { + startY = e.touches[0].clientY; + }, { passive: true }); + + document.addEventListener('touchmove', e => { + // Only block downward pull at the very top of the document + const dy = e.touches[0].clientY - startY; + if (dy > 0 && (document.documentElement.scrollTop === 0 || document.body.scrollTop === 0)) { + e.preventDefault(); + } + }, { passive: false }); +})(); + // Clear badge count when user focuses the app window.addEventListener('focus', () => { if (navigator.clearAppBadge) navigator.clearAppBadge().catch(() => {});