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

**URL:** https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400
**Category:** Bug
**Created:** [2017年四月21日 18:20 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400 "2017-04-21T18:20:30Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2017年四月21日 18:20 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/1 "2017-04-21T18:20:30Z")

</div>

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

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

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

问题演示视频：

**默认设置 - 5 个推荐主题：**

 ![](https://global.discourse-cdn.com/meta/original/3X/d/8/d88c42000c4ba9900dcf958d72e76922adddc958.GIF)

**0 个推荐主题：**

 ![](https://global.discourse-cdn.com/meta/original/3X/9/a/9aa5e73b00d86939765eb96411b38ae1cd49173f.GIF)

**20 个推荐主题：**

 ![](https://global.discourse-cdn.com/meta/original/3X/4/c/4c69603550c3e9edadd598122e61b30ce3e8e4ec.GIF)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2017年四月21日 18:32 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/2 "2017-04-21T18:32:58Z")

</div>

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

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2017年四月24日 17:22 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/4 "2017-04-24T17:22:28Z")

</div>

This should fix it:

[https://github.com/discourse/discourse/commit/4e1f8ec72b791006fca7c6c3347c8347d27e4dc6](https://github.com/discourse/discourse/commit/4e1f8ec72b791006fca7c6c3347c8347d27e4dc6)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2017年四月24日 17:22 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/5 "2017-04-24T17:22:36Z")

</div>



---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2017年四月27日 16:21 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/6 "2017-04-27T16:21:45Z")

</div>



---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2017年四月27日 16:22 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/7 "2017-04-27T16:22:09Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2017年四月27日 20:23 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/9 "2017-04-27T20:23:29Z")

</div>

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](https://github.com/discourse/discourse/commit/cb8f91ca215a5dc85a771b3691b334a89c54664a)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2017年四月27日 20:24 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/10 "2017-04-27T20:24:13Z")

</div>

Happy to test once this reaches tests\_passed!

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2017年四月27日 21:35 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/11 "2017-04-27T21:35:35Z")

</div>

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.

 ![](https://global.discourse-cdn.com/meta/original/3X/1/2/12e9b74df5dbed8817f783d89a8fee508ee1fc83.jpg)

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…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017年四月27日 21:37 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/12 "2017-04-27T21:37:39Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017年十一月11日 10:30 UTC](https://meta.discourse.org/t/topic-timeline-is-affected-by-non-default-suggested-topics-value/61400/13 "2017-11-11T10:30:10Z")

</div>


