Repository navigation
The app window fits the display, a note points at the browser's install control, and the docs run it locally - #6
Merged
Merged
Conversation
…nstall control An installed app now opens as just the canvas, and pwa.js resizes its window to the display board_config asks for plus the window's frame: once when the display reports its size, again only if that size changes. Chrome and Edge allow resizeTo() in an installed app's window and refuse it in a tab, so a tab is never touched; a maximized window or one the user resized stays as it is. The canvas now shows at the display's own size in a tab too (it was capped at 320 px wide), shrinking only when the page is narrower. The Install app button is gone, with the beforeinstallprompt plumbing that only served it. In its place a small dismissible note near the top right points at the browser's own install control: up at the address-bar install icon in Chrome and Edge (only once the browser fires beforeinstallprompt), at the menu in Chrome on Android, and in words for Safari on iOS/iPadOS (Share, Add to Home Screen) and macOS 17+ (File, Add to Dock) and for other Android browsers. Firefox on the desktop gets nothing. It never shows in the installed app, and closing it is remembered in localStorage.
README, the PWA guide, the newcomer's guide and the docs index no longer mention GitHub Pages or deploying. They say how to run it with python3 -m http.server, why it has to be http://localhost (or https) for the service worker, and how to keep the service worker's cache from hiding edits: a hard reload, DevTools' Bypass for network, or a new VERSION in sw.js. deploy.yml existed only to publish a copy of the template to Pages (it skipped this repository), so it is removed. tests.yml vendors PyScript on its own and the local run uses scripts/vendor_pyscript.sh, so nothing else needed it. sw.js loses the deploy-time version stamp: VERSION is a plain string you change to replace the cache.
…led-app window, so the app fills it
Contributor
Author
|
Merged main in (the v0.7.0 pin from #9, which |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three changes from the roadmap (2026-10-07): the installed app's window fits the display, the Install button gives way to a note that points at the browser's own install control, and the docs only explain running it locally.
The app window fits the display
Installed and opened in its own window, the page is just the canvas, and
pwa.jsresizes the window to the displayboard_configasks for plus the window's frame and title bar (outer − inner). It fits once when PSDisplay writes the canvas size, and again only if that size changes. It never reacts to window resizes, so a window you resized stays put, and a maximized window is left alone. A display bigger than the screen is capped at the screen and the canvas scales down.resizeTo()in an installed app's window and refuse it in a tab (web.dev, Window management).The canvas in a tab now shows at the display's own size too. It used to be capped at 320 px wide, shrinking only when the page is narrower.
The Install button is gone; a note points at the browser's control
The button, its CSS and its
beforeinstallprompt/prompt()plumbing are removed. The page no longer callspreventDefault(), so Chrome on Android keeps its own install banner. A small note near the top right, closed with ×, says how this browser installs:beforeinstallpromptfires (that's when the icon is there)It never shows in the installed app (
display-modestandalone/minimal-ui/window-controls-overlay, or iOSnavigator.standalone), it hides onappinstalled, and closing it is remembered inlocalStorage(wrapped in try/catch).What it's modelled on: the platform detection and the Apple wording follow @khmyznikov/pwa-install, the component PWABuilder points to: its iPad-reports-as-Mac touch check, Safari ≥ 17 for Add to Dock, the Android-without-
BeforeInstallPromptEventfallback, and the standalone check. The behaviour follows web.dev's Patterns for promoting PWA installation: show it only afterbeforeinstallprompt, keep it out of the user's path, make it dismissible, and remember the dismissal. No dependency: it's about 60 lines inpwa.js.Docs: local http.server only
README,
docs/pwa-guide.md,docs/newcomers.mdanddocs/README.mdno longer mention GitHub Pages or deploying. They give./scripts/vendor_pyscript.shthenpython3 -m http.server 8000, open http://localhost:8000, and explain why it must be localhost or https (the service worker). They also cover how to keep the cache from hiding edits: Ctrl+Shift+R, DevTools' Bypass for network, a newVERSIONinsw.js, or Clear site data..github/workflows/deploy.ymlis removed. It existed only to publish copies of the template to Pages, and it skipped this repo. Nothing else needed it:tests.ymlvendors PyScript itself, and the local run uses the vendor script.sw.jsloses the deploy-time SHA stamp, soVERSIONis now a plain string you change.What I ran
Served with
python3 -m http.serverand driven with Playwright from the examples venv. Chromium ran headful under Xvfb.beforeinstallprompton localhost and the note appeared. Closing it stored the flag, and after a reload it stayed gone. The window size never changed, and a directresizeTo()in the tab was refused by the browser.--app=,display-mode: standalone): started at 1000×900, became 320×480 once Python made the display, and showed only the canvas, with no note even whenbeforeinstallpromptwas dispatched. Setting the canvas to 480×320 refit it to 480×320. A later resize to 800×700 was left alone.resizeTo(336, 519). Maximized: no call. A 1600×1200 display on a 1366×728 screen was clamped to 1366×728. The same size written twice made one call.navigator.standaloneshows nothing. macOS Safari 17 shows Add to Dock, Safari 16 nothing. Firefox desktop shows nothing. Firefox Android shows the menu note. Chrome Android shows the ⋮ note.main.py, Ctrl+Shift+R (ignoreCache) served the edit, and bumpingVERSIONshowed the edit on the second reload. The docs say exactly that.python3 -m unittest discover -s tests -v: 6 OK, including a new test that keeps the button andprompt()/preventDefault()out.Not checked
--arrow-rightinstyle.css.outerWidthdoesn't scale with zoom.