diff --git a/TODO.md b/TODO.md index 8118807..e67569c 100644 --- a/TODO.md +++ b/TODO.md @@ -5,11 +5,11 @@ Backlog of bugs + long-term items. Milestones live in REWORK_PLAN.md. ## Open -caff doent work on fron tpage or big tablet +x caff doent work on fron tpage or big tablet -max/caff need to float or at least be availabe in combagt popout +x max/caff need to float or at least be availabe in combagt popout -save needs bigger save button on char editor +x save needs bigger save button on char editor x fullscreen and dont lock on main app dm view and the no-game-player view ...and doesnt actually prevent lock on android diff --git a/public/display-manifest.json b/public/display-manifest.json index 369bc38..7e5ed8a 100644 --- a/public/display-manifest.json +++ b/public/display-manifest.json @@ -1,27 +1,25 @@ { + "id": "/display", "short_name": "TTRPG Display", - "name": "TTRPG Initiative Tracker — Player Display", + "name": "TTRPG Initiative Tracker - Player Display", "icons": [ { - "src": "favicon.ico", + "src": "player-favicon.ico", "sizes": "64x64 32x32 24x24 16x16", "type": "image/x-icon" }, { - "src": "logo192.png", + "src": "player-logo192.png", + "note": "this image intentionally missing from filesystem - keeping manfiest and having broken icon allows android to _shortcut_ which user can control name of.", "type": "image/png", "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" } ], "start_url": "/display", - "scope": "/", - "display": "standalone", - "orientation": "landscape", + "scope": "/display", + "note:" "none of the display stuff actually works, even when it properly installs a pwa (which user cant control name of...)", + "display": "fullscreen", + "orientation": "portrait", "theme_color": "#1A202C", "background_color": "#1A202C" } diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..bff275c Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html index f945035..400b585 100644 --- a/public/index.html +++ b/public/index.html @@ -19,4 +19,4 @@
- \ No newline at end of file + diff --git a/public/logo192.png-not b/public/logo192.png-not new file mode 100644 index 0000000..5a2c400 Binary files /dev/null and b/public/logo192.png-not differ diff --git a/public/logo512.png-not b/public/logo512.png-not new file mode 100644 index 0000000..806cc77 Binary files /dev/null and b/public/logo512.png-not differ diff --git a/public/manifest.json b/public/manifest.json index e93417c..0f0ecff 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,4 +1,5 @@ { + "id": "/", "short_name": "TTRPG Tracker", "name": "TTRPG Initiative Tracker", "icons": [ @@ -9,17 +10,16 @@ }, { "src": "logo192.png", + "note": "this image intentionally missing from filesystem - keeping manfiest and having broken icon allows android to _shortcut_ which user can control name of.", "type": "image/png", "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" } ], - "start_url": ".", - "display": "standalone", + "start_url": "/", + "scope": "/", + "note:" "none of the display stuff actually works, even when it properly installs a pwa (which user cant control name of...)", + "display": "fullscreen", + "orientation": "portrait", "theme_color": "#2D3748", "background_color": "#1A202C" -} \ No newline at end of file +} diff --git a/public/player-favicon.ico b/public/player-favicon.ico new file mode 100644 index 0000000..96951e6 Binary files /dev/null and b/public/player-favicon.ico differ diff --git a/public/player-logo192.png-not b/public/player-logo192.png-not new file mode 100644 index 0000000..e474366 Binary files /dev/null and b/public/player-logo192.png-not differ diff --git a/public/player-logo512.png-not b/public/player-logo512.png-not new file mode 100644 index 0000000..d182d35 Binary files /dev/null and b/public/player-logo512.png-not differ diff --git a/src/App.js b/src/App.js index 28a87e1..e28cd5a 100644 --- a/src/App.js +++ b/src/App.js @@ -4142,6 +4142,8 @@ function App() { // swap manifest so Android home-screen installs launch /display const link = document.querySelector('link[rel="manifest"]'); if (link) link.href = `${process.env.PUBLIC_URL || ''}/display-manifest.json`; + const favicon = document.querySelector('link[rel="icon"]'); + if (favicon) favicon.href = `${process.env.PUBLIC_URL || ''}/player-favicon.ico`; } if (window.location.pathname === '/logs') { setIsLogsMode(true); diff --git a/src/tests/DisplayView.characterization.test.js b/src/tests/DisplayView.characterization.test.js index c367bca..144610c 100644 --- a/src/tests/DisplayView.characterization.test.js +++ b/src/tests/DisplayView.characterization.test.js @@ -39,6 +39,10 @@ function participant(status) { describe('DisplayView characterization', () => { beforeEach(() => { + const favicon = document.createElement('link'); + favicon.rel = 'icon'; + favicon.href = '/favicon.ico'; + document.head.appendChild(favicon); window.history.replaceState({}, '', '/display'); global.alert = jest.fn(); window.open = jest.fn(); @@ -46,9 +50,18 @@ describe('DisplayView characterization', () => { Element.prototype.scrollIntoView = jest.fn(); }); afterEach(() => { + document.querySelectorAll('link[rel="icon"]').forEach(link => link.remove()); window.history.replaceState({}, '', '/'); }); + test('display route swaps browser favicon to player icon', async () => { + seedActiveDisplay(); + render(); + await waitFor(() => { + expect(document.querySelector('link[rel="icon"]')).toHaveAttribute('href', '/player-favicon.ico'); + }); + }); + test('DisplayView subscribes via adapter.subscribeDoc (not raw SDK)', async () => { seedActiveDisplay(); render();