The ‘back’ function in Safari/iOS (iPhone 8, latest iOS version) is unreliable; when going from the topic list to a topic, it will often not take you back to the correct position in the topic list. On my own forum this happens pretty much always. On Meta, it sometimes works for me, but more often it doesn’t. This happens both when clicking the ‘back’ button and when swiping to the right.
Out of curiosity does it work in safe mode ?
Sorry I forgot to mention that: I tested safe mode both on my own forum and here on Meta with the same result.
In the iOS hub app or in native mobile safari? I can’t repro any problem using the back button or back swipe from the topic list here on meta.
Do you have specific repro steps?
Oh wait, I can repro for back swipe, but not back button. Back swipe doesn’t seem to remember the actual scroll position in the topic list, but back button always does.
In native mobile safari. At first I had a hunch it was related to the topic list refreshing, but that doesn’t seem to be the case. It happens 100% of the time for me on Meta now.
Repro steps:
- Log in to Meta
- Reload the Meta homepage (this step doesn’t seem necessary but I wanted to rule out the topic list refresh issue)
- Scroll one page down
- Select a topic
- Swipe right or click back
I also tried the following, all with the same result:
- Disabled the Crystal ad blocker in content blocking.
- Opened Meta in a private tab without logging in.
- Tested on an iPhone SE.
- Tested in Chrome on a Galaxy S6
That does seem to repro for me @eviltrout … perhaps we regressed here? @j.jaffeux?
これで修正されるはずです:
詳細はコミットメッセージをご覧ください。来週のマージ前にロビンの承認を待つ予定です。詳細なご報告ありがとうございます ![]()
マージされました。進捗をご報告ください。
このトピックは、最後の返信から3日後に自動的に閉鎖されました。新しい返信は許可されていません。
@bartv との議論の後、さらに調査したところ、確かに回帰が発生していることが分かりました。
原因はおそらく以下のコミットにあると思います:
このケースでは、scrollOnLoad が undefined になっています:
https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/components/topic-list.js.es6#L71
以下の修正を提案します:
来週、@markvanlan さんにごレビューいただけますでしょうか?
@bartv 2 番目の修正をマージしました。お時間のある際、結果をご報告ください。
余談ですが、このロジックをさらに改善できないか考えています。現在、ページをスクロールするたびにトピックの 1 つの位置を保存していますが、特にモバイル端末では、クリックしたトピックが戻ってきた際にビューポート内に表示されない場合があります(ごく近い場所にある場合でも)。
ここで Meta でテストしてみましたが、私の環境では動作しません。トピックから「戻る」をタップすると、トピック一覧の一番上に戻ってしまいます。
トピック一覧の正確な位置に戻る機能にも賛成です。
私の環境では動作します。お時間のある時に動画を作成してください。
投稿に追加しました。参考になれば幸いです。他に含める必要があるものがあれば、お知らせください。
動画が示しているのは予想通りです。「ページスクロール」、つまりさらにトピックが読み込まれなかったため、最後に閲覧したトピックの位置が更新されませんでした。
これは、私のサイドノートで改善を提案した点です。
ああ、確かに、新しいトピックが読み込まれるまで十分にスクロールすれば動作することを確認しました。その制限は予想外でした。ユーザーとしては、少し混乱を招くか、一貫性がないと感じます。
はい、僕もそれほど好きではありません。だから改善を提案したんです。ですが、私が修正した他の問題とは異なり、これは後退ではないと認識しています。
ああ、確かにこのコミットから別の回帰が発生していました。これで解決すると思います:
そして、私たちが話していた動作を取り戻せます!