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?
This should fix it:
Details inside commit message, will wait for robin approval before merging this next week. Thanks for detailed report ![]()
This is merged, let me know how it goes please.
Este tópico foi automaticamente fechado 3 dias após a última resposta. Novas respostas não são mais permitidas.
Após uma discussão com @bartv, investiguei mais e descobri que há, de fato, uma regressão.
Acho que ela vem de:
Basicamente, neste caso, scrollOnLoad está indefinido:
https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/components/topic-list.js.es6#L71
Sugiro a seguinte correção:
Você pode revisar na próxima semana, @markvanlan, por favor?
@bartv Acabei de mesclar a segunda correção. Por favor, me avise como ficou quando tiver um tempo.
Como observação lateral, me pergunto se não poderíamos melhorar ainda mais essa lógica? No momento, ela armazena a posição de um tópico a cada rolagem de página, mas especialmente no mobile, isso pode significar que, ao voltar, o tópico em que você clicou não está na viewport, mesmo que não esteja muito longe.
Aqui testei no Meta, mas não funcionou para mim: ao tocar em ‘voltar’ de um tópico, retorno ao topo da lista de tópicos.
E +1 para retornar à posição exata na lista de tópicos.
Funciona para mim, por favor, faça um vídeo quando tiver tempo.
Eu adicionei ao meu post. Espero que ajude. Me avise se precisar que eu inclua outras coisas.
O que o vídeo mostra é esperado: você não fez um « rolagem de página », ou seja, ele não carregou mais tópicos, então não atualizou a posição do último tópico visto.
É isso que minha nota lateral propôs melhorar.
Ah, posso confirmar que FUNCIONA quando rolo para baixo o suficiente para forçar o carregamento de novos tópicos. Não esperava essa limitação — para um usuário, isso é um pouco confuso/inconsistente.
Sim, eu também não gosto muito disso, por isso sugeri que melhorássemos. Mas, pelo que sei, isso não é uma regressão, ao contrário das outras coisas que corrigi.
Putz, realmente houve outra regressão nesse commit e acho que isso deve resolver:
e trazer o comportamento que estávamos falando!