Skip to content

fix: fill the iOS standalone PWA viewport - #547

Merged
agegr merged 1 commit into
agegr:mainfrom
epheien:fix/ios-standalone-full-viewport
Aug 25, 2026
Merged

fix: fill the iOS standalone PWA viewport#547
agegr merged 1 commit into
agegr:mainfrom
epheien:fix/ios-standalone-full-viewport

Conversation

@epheien

@epheien epheien commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Use the full screen height while Pi Web is running as an installed iOS standalone PWA.
  • Preserve the existing visualViewport.height override while the software keyboard is open.
  • Add a regression assertion for the standalone viewport rule.

Problem

When Pi Web is launched from the iOS Home Screen, WebKit can report 100dvh and window.innerHeight without the status-bar strip even though the page layout still starts at the top of the screen. The app shell currently falls back to 100dvh, so its resting height is too short. The composer and bottom controls end early, leaving a visible unused area above the Home indicator.

This only reproduces in installed standalone mode; the regular browser viewport behavior should remain unchanged.

Reproduction

  1. Add Pi Web to the Home Screen on iOS.
  2. Launch it from the Home Screen so it runs in standalone mode.
  3. Open a chat with the software keyboard dismissed.
  4. Observe that the app shell does not fill the available screen height and unused space remains below the composer.

Expected: the shell fills the screen while its content continues to respect the safe-area insets.

Fix

Set --app-viewport-height: 100vh only under @media (display-mode: standalone). Standalone mode has no browser toolbar, so vh is stable there and includes the strip omitted by dvh/innerHeight on affected iOS versions.

The existing keyboard hook still writes visualViewport.height as an inline custom-property value while an editor is focused. That inline value overrides this stylesheet default, so the composer remains above the keyboard. Non-standalone browser mode continues to use the existing 100dvh fallback.

This is the upstream-based transplant of epheien/pi-web@d0168ab.

Verification

  • node --test components/MobilePwaLayout.test.mjs hooks/useViewportHeight.test.mjs (9 tests passed)
  • node_modules/.bin/tsc --noEmit
  • npm run lint

Screenshots

Before

Before fix: unused space below the composer in iOS standalone mode

After

After fix: the composer fills the iOS standalone viewport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants