话题时间线受非默认建议话题值影响

我将此内容发布到 Contribute > Bug,因为我认为这阻碍了 Discourse 的正常使用,但它可能更适合放在 #contribute:ux。

我注意到其中一个站点(内部站点,因此无法分享链接)的主题时间线有些异常,便开始尝试排查问题。基本上,当使用主题时间线跳转到较新的帖子(例如 6 个中的第 5 或第 6 个)时,帖子无法按预期滚动,且我滚动到的帖子实际上并未显示出来。我在 Meta、Stonehearth 以及开发环境中都无法复现此问题,于是开始调查这些站点之间的差异。最终我发现,我的站点禁用了“推荐主题”(suggested topics = 0),而 Meta、Stonehearth 和开发环境均未禁用。在开发环境中禁用推荐主题后,我便成功复现了该问题。

@eviltrout,主题时间线的滚动逻辑是否假设存在推荐主题?

问题演示视频:

默认设置 - 5 个推荐主题:

0 个推荐主题:

20 个推荐主题:

3 个赞

It very well could be a bug! I’ll look into it.

6 个赞

This should fix it:

https://github.com/discourse/discourse/commit/4e1f8ec72b791006fca7c6c3347c8347d27e4dc6

5 个赞

I’m re-opening this for now. Unfortunately my fix broke scrolling on meta a bit so I reverted it. I’ll have to come up with a more robust solution.

1 个赞

Okay, I think this fixes it for good. This is surprisingly complicated stuff to get right.

@jomaxro could you confirm it’s working for you?

https://github.com/discourse/discourse/commit/cb8f91ca215a5dc85a771b3691b334a89c54664a

4 个赞

Happy to test once this reaches tests_passed!

1 个赞

I hate to say this, but it’s “mostly” working. Just tested in the two topics I shared with you via PM. They both load correctly now (showing the last post) and using the timeline to go from a post to the last one work, but the timeline itself is very finicky.

Entering a fully read topic results in the browser being scrolled fully, but the timeline is not.

Also, moving via the timeline is incredibly jumpy. In topic 8022, moving the timeline to post 4 results in the timeline jumping to post 2 upon release. Post 3 also jumps to post 2. Post 5 jumps to post 6…etc.

Happy to change the password back if you’d like…

I would rather force everyone to use suggested topics rather than spend days of engineering effort on this unusual non-default settings scenario.

That said there are other places where suggested may not be there, such as PMs.