# 主题列表预览（TLP）

**URL:** <https://meta.discourse.org/t/topic-list-previews-tlp/209973>\
**Category:** Theme component\
**Created:** [2021年十一月23日 12:25 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973 "2021-11-23T12:25:59Z")\
**Posts on this page:** 20\
**Page:** 19

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年十月5日 21:41 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/367 "2023-10-05T21:41:04Z")

</div>

是的，在 TLP 的情况下，这是有必要的，因为它的覆盖级别非常高，而且砌体尚未原生支持 CSS。一旦砌体在所有官方支持的浏览器中被 CSS\* 原生支持，我打算：

1. 尝试降低覆盖级别，特别是避免覆盖 topic-list-item。
2. 移除对性能造成高消耗的 JavaScript 网格刷新。

\*当然，很有可能到时候我已经老了，无法足够快地打字。

---

<div class="post-metadata">

**Author:** ![Niels\_Dewitte](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/niels_dewitte/32/331846_2.png) [@Niels\_Dewitte](https://meta.discourse.org/u/Niels_Dewitte)\
**Post date:** [2023年十月11日 07:24 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/368 "2023-10-11T07:24:42Z")

</div>

> 将站点主题列表显示设置设为类别主题列表的默认设置。

启用此复选框后，我可以通过为最新主题列表启用它，来获取类别默认列表视图以显示缩略图。

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/2/2/d2292119c3e7c832d599bd77d0f0260d96f7a5f1.png)

但是，如果我随后通过按“最新列表”按钮显式转到“最新”视图，缩略图就会消失。

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/f/f/dff836b4596cf8649b8e5a807c83f3064ebd6199.jpeg)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/d/8/d/d8d92cdcbbdf4f68bbc5c8599d5d0b28bb23742a.png)

这是预期的行为吗？

* * *

顺便说一句，当该复选框未启用时，行为是相反的。  
缩略图未在默认列表视图中显示，但在转到“最新”时显示。

我使用的是最新版本的插件，并通过主题创建者进行预览。

控制台中没有错误。

抱歉，如果之前有人报告过，我找了一会儿但找不到任何提及。

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年十月11日 08:54 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/369 "2023-10-11T08:54:59Z")

</div>

哦，抓得好，我之前不知道这个 bug。我可以复现。感谢你的报告。我会尽快查看。

---

<div class="post-metadata">

**Author:** ![flash](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flash](https://meta.discourse.org/u/flash)\
**Post date:** [2023年十月25日 12:06 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/370 "2023-10-25T12:06:17Z")

</div>

您好 @merefield。我今天刚更新了，页面顶部出现了这个错误，供您参考。

 ![topic-list-warning](https://global.discourse-cdn.com/meta/original/4X/3/4/0/34006fbdc42956e7bc9662f780b45c5d0aec1ac7.png)

它已更新到最新版本，并且至少从我的计算机来看，一切正常。当我在后端进行更新时，比平时花费了更长的时间。

---

<div class="post-metadata">

**Author:** ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)\
**Post date:** [2023年十月25日 12:59 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/371 "2023-10-25T12:59:12Z")

</div>

我也是。一切似乎运行良好，但我看到了这些：

`Topic List Previews 主题/组件正在抛出错误：TypeError: e.capitalize is not a function`

和

`Topic List Previews 主题/组件正在抛出错误：TypeError: e.capitalize is not a function. (在 'e.capitalize()' 中，'e.capitalize' 是未定义的)`

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年十月25日 13:02 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/372 "2023-10-25T13:02:25Z")

</div>

你们是否已将站点和主题组件都更新到最新版本？

在过去 24 小时内已进行了更改以适应弃用，但它们已在最新版本上进行了测试。

---

<div class="post-metadata">

**Author:** ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)\
**Post date:** [2023年十月25日 13:03 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/373 "2023-10-25T13:03:04Z")

</div>

大约 45 分钟前我完成了操作，之后出现了这个。

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年十月25日 13:05 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/374 "2023-10-25T13:05:35Z")

</div>

我将在几个小时内查看一下

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年十月25日 14:22 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/375 "2023-10-25T14:22:32Z")

</div>

好的，看起来这是在过去 24 小时内引入的，并且是 Core 的重大变更，因为 StarZen 昨天已更新并且没有错误。

---

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [2023年十月25日 16:28 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/376 "2023-10-25T16:28:32Z")

</div>

@merefield

我认为这与以下内容有关：

> String 原型扩展已弃用。请改从 ‘@ember/string’ 导入 capitalize。 [deprecation id: ember-string.prototype-extensions] 有关更多详细信息，请参阅 [Ember.js - Deprecations](https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions%E3%80%82)

但不确定为什么 😅，此行为更改是在此处引入的（在开发安装中测试）：

> <https://github.com/discourse/discourse/pull/24034>
>
> \`@ember/jquery\` was necessary to automate the \`app.import()\` but that is no long…er necessary with \`ember-auto-import\`. A secondary thing it does is bringing back the \`this.$\` feature, but with a deprecation. It is my understanding that the deprecation has long be fully absorbed into both core and plugins so we shouldn't need this pakage anymore.

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年十月25日 16:29 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/377 "2023-10-25T16:29:26Z")

</div>

这应该已经修复了，请更新。

> <https://github.com/merefield/discourse-tc-topic-list-previews/commit/d38ca4bc80bfcecf05f88d225f00f66fcf660421>

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年十月25日 16:30 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/378 "2023-10-25T16:30:41Z")

</div>

太棒了，看看我们现在的混乱！

`filter.charAt(0).toUpperCase() + filter.slice(1);` 👀

太棒了 🤦‍♂️

---

<div class="post-metadata">

**Author:** ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)\
**Post date:** [2023年十月25日 17:00 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/380 "2023-10-25T17:00:48Z")

</div>

太好了！是的，它奏效了。谢谢。

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2023年十月26日 10:01 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/381 "2023-10-26T10:01:59Z")

</div>

3 个帖子已被拆分为新主题：[移除 Ember 字符串原型扩展](https://meta.discourse.org/t/removal-of-ember-string-prototype-extensions/283513)

---

<div class="post-metadata">

**Author:** ![Ryan121](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryan121/32/335977_2.png) [@Ryan121](https://meta.discourse.org/u/Ryan121)\
**Post date:** [2023年十一月1日 15:47 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/382 "2023-11-01T15:47:59Z")

</div>

我为什么无法导航到任何类别并遇到错误？

 ![捕获11](https://global.discourse-cdn.com/meta/original/4X/f/2/9/f29f01ec48e58b35dada6756ed6e52e109048755.jpeg)

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年十一月1日 21:34 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/383 "2023-11-01T21:34:09Z")

</div>

啊，抱歉，@Ryan121。我认为这个主题组件与我们代码中的一项新更改存在冲突，而该更改尚未在自托管站点上推出（这可能让 Robert 感到意外 😬）。

这里也有一个类似的报告 - [All links to categories broken?](https://meta.discourse.org/t/all-links-to-categories-broken/284144)

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年十一月1日 23:45 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/384 "2023-11-01T23:45:28Z")

</div>

> [@JammyDodger](#):
>
> 自托管网站上还没有

对这个有点困惑——你是说这个破坏性更改还没有在 tests-passed 上吗？

我只支持此组件的 tests-passed（并且通常会固定到稳定版，这对于当前稳定版来说似乎是有效的）。

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2023年十一月2日 15:49 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/385 "2023-11-02T15:49:09Z")

</div>

（供记录：组件已更新以适应即将到来的核心更改 🎉）

> [@All links to categories broken?](https://meta.discourse.org/t/all-links-to-categories-broken/284144/17?u=david):
>
> Just closing the loop here - @merefield has now made the necessary updates to the Pavilion theme component, so it should work well both before and after the incoming core change heart_eyes

---

<div class="post-metadata">

**Author:** ![raghukamath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raghukamath/32/160330_2.png) [@raghukamath](https://meta.discourse.org/u/raghukamath)\
**Post date:** [2023年十二月1日 03:51 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/386 "2023-12-01T03:51:12Z")

</div>

对于我们 [krita-artists.org](http://krita-artists.org) 来说，特色行比主页的其余部分加载稍晚一些。这会导致帖子列表向下跳动，有点刺眼。有什么解决方案吗，还是我做错了什么？

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年十二月1日 07:19 UTC](https://meta.discourse.org/t/topic-list-previews-tlp/209973/387 "2023-12-01T07:19:41Z")

</div>

我相信这部分是由于核心的变化所致，这些变化迫使我们在“特色组件”中检索数据，而不是像以前那样在“路由”中检索，因此发生得更晚。这确实令人遗憾。也许可以通过部分 CSS 解决方案来减轻这种突兀感。欢迎提交 PR，或者您可以赞助我来查看。

[上一頁](https://meta.discourse.org/t/topic-list-previews-tlp/209973.md?page=18)

[下一頁](https://meta.discourse.org/t/topic-list-previews-tlp/209973.md?page=20)
