收藏夹「过滤无效收藏」开关真正控制插画失效作品过滤 - #1077
Merged
Merged
Conversation
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.
收藏夹「过滤无效收藏」开关真正控制插画失效作品过滤
背景
filterInvalidBookmarks(收藏夹过滤已失效作品)默认关闭,文案是“开启后将隐藏已删除或不可见的收藏作品”,因此关闭时应能看到失效/不可见条目。但在插画收藏页,
IllustFeedItem.passesContentFilters()里有一行无条件过滤:导致
visible != true的插画无论开关开/关都被过滤,设置项在插画收藏里实际表现为“始终开启”。小说收藏页则不同:NovelFeedItem通用过滤链不含visible,只有开关开启时才按visible == false过滤。插画/小说行为不一致,且与设置文案矛盾。改动内容
1.
IllustFeedItem增加skipVisibleFilterof(...)/passesContentFilters(...)新增skipVisibleFilter: Boolean = false。false,其它 feed 列表行为不变。2. 插画收藏页按开关传递
LikeIllustFeedFragment.mapLikePage()改为:visible != true+ user 缺失 /id == 0;visible != true的失效/不可见条目,与小说侧及设置文案对齐。3. 补
IllustNovelFilter.judgeUserID(Illust)null 保护user == null的失效条目,judgeUserID原先会直接illust.getUser().getId()触发 NPE。user == null时返回false。4. 注释收敛
LikeIllustFeedFragment/LikeNovelFeedFragment的 KDoc 同步为“开关关闭时不过滤 visible”的语义。涉及文件
app/src/main/java/ceui/pixiv/ui/common/IllustFeedItem.ktapp/src/main/java/ceui/pixiv/ui/collection/LikeIllustFeedFragment.ktapp/src/main/java/ceui/pixiv/ui/collection/LikeNovelFeedFragment.ktapp/src/main/java/ceui/lisa/helper/IllustNovelFilter.java注意
关闭“过滤无效收藏”后,插画收藏页会显示
visible != true的失效/不可见条目;这类条目可能缺图、作者信息不全或无法打开详情,这是关闭过滤的预期表现。后续如需更友好体验,可另加“已失效”占位卡样式。提交
cf5c53976fix(collection): 收藏夹过滤无效收藏开关真正控制插画 visible 过滤