I tried to edit the metadata_controller.rb file, but with ./launcher rebuild app it just reset to having the setting for this field empty (as in the user can choose). So, is there any way I can force portrait mode with PWAs, or does only the Discourse team decide in core for all Discourse instances?
AI-generated summary
The discussion revolves around setting orientation to portrait mode in a PWA’s manifest.webmanifest file. MrDavis97 attempted to edit the file but was unable to force portrait mode. Falco explained that the Discourse team does not set a default orientation due to past complaints, and instead suggested writing a plugin to change the manifest for a specific site. MrDavis97 shared their motivation for wanting portrait-only mode, citing issues with the Meta Discourse PWA on iPhone when rotating the screen. Falco responded that iOS has poor support for the Web App Manifest, making it unlikely that the orientation property would be respected.
You may want to read history about this somehow controversial topic:
People always complain, so we don’t set anything anymore. If you want your phone to not rotate you can lock the rotation on the Android quick access button in the notification drawer.
That said, if you still want to change the manifest for your site you will need to write a plugin.
Thanks. Perhaps I’ll write a plug-in.
I’d also like to let you know the reason I’d like portrait only. Let’s take Meta Discourse as an example. I’m using an iPhone, so I go to meta.discourse.org on Safari and click on
and then add to home screen. So everything works fine, and this is what it looks like:
However, when I rotate the screen into landscape mode, and then rotate back to portrait mode, this happens (notice the banner becomes cut off, and it doesn’t go back to normal)
I wouldn’t bet on that property being respected in iOS considering their support for the Web App Manifest is almost non-existent.

