Fixed the "Show More" button issue in the subject details page where the button was not responding correctly when clicked.#2499
Open
GeneralK1ng wants to merge 1 commit intomainfrom
Open
Fixed the "Show More" button issue in the subject details page where the button was not responding correctly when clicked.#2499GeneralK1ng wants to merge 1 commit intomainfrom
GeneralK1ng wants to merge 1 commit intomainfrom
Conversation
StageGuard
approved these changes
Sep 17, 2025
Member
|
这个居然不是服务器问题吗 |
Member
Author
好像确实,服务端返回tag不够 |
Member
|
看了下服务端代码, tags 应该是全的 (全部读了 bangumi archive 给的 tags) mapping 全都是 1:1 的 |
Him188
requested changes
Sep 17, 2025
app/shared/ui-subject/src/commonMain/kotlin/ui/subject/details/components/DetailsTab.kt
Show resolved
Hide resolved
Contributor
|
感觉提 issue 的人可能是想展开介绍部分而不是 tag 列表 |
Mystery406
reviewed
Sep 18, 2025
Comment on lines
270
to
276
| isExpanded -> allTags | ||
| allTags.size <= 6 -> allTags | ||
| else -> { | ||
| val filteredByCount = allTags.filter { it.count > 100 } | ||
| if (filteredByCount.size < ALWAYS_SHOW_TAGS_COUNT) { | ||
| allTags.take(ALWAYS_SHOW_TAGS_COUNT) | ||
| } else { | ||
| if (filteredByCount.size <= ALWAYS_SHOW_TAGS_COUNT) { | ||
| filteredByCount | ||
| } else { | ||
| allTags.take(ALWAYS_SHOW_TAGS_COUNT) | ||
| } |
Contributor
There was a problem hiding this comment.
感觉可以把这部分逻辑抽出来跟上面是否显示 hasMore 的逻辑匹配上,比如
val collapsedTags by remember { derivedStateOf { xxx } }
val hasMoreTags by remember { derivedStateOf { collapsedTags.size < allTags.size } }
Member
Author
我这里log发现所有剧集的tags的数量都是11个,感觉可能是是服务端问题 看了下接口确实只返回11个 "tags": [
{
"name": "搞笑",
"count": 4821
},
{
"name": "颜艺",
"count": 2670
},
{
"name": "漫画改",
"count": 2348
},
{
"name": "2018年7月",
"count": 1666
},
{
"name": "A-1Pictures",
"count": 1479
},
{
"name": "TV",
"count": 1381
},
{
"name": "碧蓝之海",
"count": 1001
},
{
"name": "日常",
"count": 991
},
{
"name": "漫改",
"count": 986
},
{
"name": "爆笑",
"count": 956
},
{
"name": "2018",
"count": 755
}
]对比完整tags,猜测为服务端过滤了小于100的tag |
Member
|
确定是bangumi archive只给了11个tag,他们不太愿意给更多tags |
Member
Author
|
那现在是否还需要“显示更多”,感觉可以去掉了 |
Member
|
可以想办法在服务端 workaround 其实 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixed the "Show More" button issue in subject details page tags section.
Why
The button was not responding correctly due to incorrect logic in presentTags computation using hardcoded values instead of
ALWAYS_SHOW_TAGS_COUNTconstant.Where
In the TagsList composable component in
DetailsTab.ktfile.Related
Closes #2498