feat(library): 收藏卡片展示简介

This commit is contained in:
Zhou Weidong committed 2026-10-22 12:45:27 +08:00
1 parent 9093700a04
commit 57f3029018
4 files changed
+117 -3

No files matched your search

@@ -0,0 +1,20 @@
# 收藏卡片简介
## 目标
- 收藏卡片在标题/标签下方显示后端 `synopsis`,最多 2 行并省略溢出。
- 空白简介不创建文本节点、不占高度,不显示 `null/undefined`。
- 保持封面 80x106 和现有卡片高度,不引入布局溢出。
## 实现
1. `_FavoriteCard` 对 synopsis 做 trim 后条件渲染。
2. 简介使用 `Flexible` 占据标题、标签与底部统计之间的剩余空间,
`maxLines: 2`、`TextOverflow.ellipsis`、次要文案色和字号。
3. 无简介时继续使用原 Spacer,保持原布局。
4. widget 测试覆盖有简介、空简介和卡片高度稳定性。
## 约束
- 不改接口、后端、收藏分页。
- 不新增依赖,不提交现有 `pubspec.lock`,不启停服务、不操作真机。
+32
View File
@@ -698,3 +698,35 @@ $ flutter test --no-pub
解读:有 dramaTitle 时不触发详情请求、点击时才加载详情、空标题兜底、
第 2 页追加去重和 hasMore 行为均通过;全量分析零告警,630 项通过、1 项旧服务
能力探测跳过。`pubspec.lock` 既有改动未提交。
## 2026-10-22 收藏卡片简介
- 分支:`feature/favorite-card-synopsis`
- 基线:`develop` / `origin/develop` = `9093700`
- 计划:`docs/plans/2026-10-22-favorite-card-synopsis.md`
### 实现
- `_FavoriteCard` 在标题/标签下方条件渲染 `drama.synopsis.trim()`。
- 简介最多 2 行、`TextOverflow.ellipsis`,使用 `AppColors.muted`、12 号字和
`1.15` 行高,由 `Flexible` 占据剩余空间,保持封面与卡片原高度。
- 简介为空或纯空白时不创建文本节点,继续使用原 Spacer,不占高度。
- 未改接口、后端和收藏分页逻辑。
### 门禁
```text
$ flutter test --no-pub test/library/favorites_page_test.dart
00:01 +7: All tests passed!
$ dart analyze lib test
Analyzing lib, test...
No issues found!
$ flutter test --no-pub
00:51 +631 ~1: All tests passed!
```
解读:有简介时文本最多 2 行并省略,空简介不渲染且卡片高度与正常卡片一致;
全量静态分析零告警,631 项通过、1 项运行中旧后端能力探测跳过。
`pubspec.lock` 既有改动未提交。