Discourse PWA で Android の自動回転無効設定が反映されない

This only happens with Discourse after you “add to homepage” (creating a Progressive Web App), once added, they don’t respect Auto-Rotate settings and keep rotating even when the setting is disabled on Android.

It’s incredibly frustrating since I always have “auto-rotate” turned off and it’s constantly switching between landscape and portrait view, especially when laying down on the couch or in bed on Discourse communities (Asana, Airtable, this community, etc.).

Edit: Video showing issue compared to non-Discourse PWA - https://photos.app.goo.gl/MZRm8gCMQS2AfJWP6

「いいね!」 2

Sounds like a problem with Android. The obvious solution is to just use your browser that works instead of the one that doesn’t. It’s unclear whether this can be solved on the Discourse side.

That’s what I thought at first, but it is only happening with Discourse PWA’s, not happening with any other PWA’s we have set up and are using which brought me back to guessing it’s an issue with Discourse.

I rely incredibly heavily on the PWA’s for Discourse, jumping into each community from the home screen so simply just “using chrome directly” isn’t easy and a painful “workaround”.

I wouldn’t have posted in this community if I wasn’t fairly sure that it’s a Discourse issue moreso than an Android issue.

「いいね!」 1

I’ve seen a similar report before, but I don’t remember it being so well-described.

Here’s a video showing off the issue. As you can see, the only PWA that I open which respects screen-lock is the non-Discourse forum. You can see specifically when I visit the non-Discourse PWA for the 2nd time, the bottom-right corner shows the Android Pie screen-lock override control, whereas all of the Discourse forums just automatically rotate and it’s incredibly jarring :sweat_smile:

We had this enabled and people complained, as I recall. You can check with @Falco

Thanks for the reply!

When you say that you had this enabled, what exactly did you have enabled? I’d assume that auto-rotate would be controlled by Android at a system-level across the board, why should a specific site be able to override it? If you take a look at the video I attached, you can see how jarring it is to the end-user. Discourse specifically is ignoring the auto-rotate setting.

And with Android Pie, they make it so easy to switch to landscape mode to temporarily override your auto-rotate setting by prompting you in the bottom-right corner:

So those who want to switch to landscape when they have auto-rotate turned off get the best of both worlds when just letting the system control this functionality.

「いいね!」 1

@Falco さんの最後の返信を確認しました:

彼はOSの設定で回転を停止させるよう提案しています。しかし、ここで報告されている問題(私も再現可能)は、OSの設定が尊重されていないというものです。私には#contribute:bug(コントリビューション:バグ)のように見えます。

@codinghorror さん、あなたの記憶は逆ではないでしょうか。

「いいね!」 3

その通りです:ok_hand::ok_hand: @Falco の返信を読むと、まさに私が期待する動作であり、人々が不満を漏らす理由も理解できます。実際、それが最近私をイライラさせている原因です。自動回転をオンにしてもオフにしても、Discourseは常に自動回転が「オン」になっているかのように動作します。Androidのクイック設定オプションを完全に無視しており、これが一定時間ごとに回転するのを止めるために示唆された解決策です。バグでなければなりません。

「いいね!」 3

The actual last response is:

What is the orientation value you think we should use this time?

「いいね!」 4

Whoops, sorry for finding the wrong post @Falco. Looks like you did remember correctly @codinghorror, apologies!

In my mind the correct value is whatever one respects the OS setting. If I have rotation lock on, the app shouldn’t be rotating. If I have auto-rotate on, the app should rotate like the OS does. Given that Android 9 supports locking the device in landscape, this will (hopefully) make everyone happy.

Side note, the Discourse Hub app functions as I just described above - it respects the OS.

「いいね!」 1

This is exactly how I feel as well.

「いいね!」 2

Duplicate