docs(plans): 记录 K9 首页剧目网格实施回执
This commit is contained in:
1 parent
496d27334a
commit
a5dad549f8
2 files changed
+207
-1
No files matched your search
@@ -2355,3 +2355,183 @@ Running Gradle task 'assembleDebug'...
|
||||
有一次 light impact。
|
||||
|
||||
设备侧截图、日志与最终视觉验收结论由用户执行。
|
||||
|
||||
---
|
||||
|
||||
## 2026-10-17 K9 首页 2 列全部剧目
|
||||
|
||||
### 24.1 范围、分支与计划
|
||||
|
||||
叙述:按 INBOX K9 条目移除首页「继续观看」,在分类 chips 下方展示当前分类的
|
||||
全部剧目。只改发现页、三语 l10n、首页相关测试与 `docs/plans/`;不改接口、
|
||||
数据模型、轮播、通知或其他页面。
|
||||
|
||||
- 客户端:从 `develop 99f64ab` 创建 `feature/flutter-k9-home-grid`。
|
||||
- 文档:从 K9 任务书 `b434f65` 创建 `docs/k9-home-grid`。
|
||||
|
||||
开工前先写并提交计划:
|
||||
|
||||
```text
|
||||
496d273 docs(plans): 增加 K9 首页剧目网格实施计划
|
||||
```
|
||||
|
||||
### 24.2 先红:首页网格测试
|
||||
|
||||
叙述:先新增 `test/discover/home_all_dramas_grid_test.dart`,未改实现与既有测试。
|
||||
|
||||
```text
|
||||
$ flutter test test/discover/home_all_dramas_grid_test.dart
|
||||
Expected: no matching candidates
|
||||
Actual: Found 1 widget with text "Continue Watching"
|
||||
|
||||
Found 0 widgets with key [<'home-drama-card-city-lights-demo'>]: []
|
||||
|
||||
Found 0 widgets with text "All Dramas": []
|
||||
|
||||
00:02 +0 -5: Some tests failed.
|
||||
```
|
||||
|
||||
解读:继续观看仍存在,「全部剧目」标题、2 列网格和卡片 Key 尚不存在,红灯与
|
||||
K9 范围一致。
|
||||
|
||||
### 24.3 实现与定向绿灯
|
||||
|
||||
`discover_view.dart` 改为外层 `CustomScrollView`,首页 sliver 顺序为:
|
||||
轮播、分类与标题、剧目网格、底部留白。网格代码拆到:
|
||||
|
||||
- `lib/pages/discover/widgets/home_drama_grid.dart`
|
||||
|
||||
关键参数:
|
||||
|
||||
```text
|
||||
crossAxisCount: 2
|
||||
mainAxisSpacing: 16
|
||||
crossAxisSpacing: 12
|
||||
childAspectRatio: 2 / 3
|
||||
horizontal padding: 16
|
||||
```
|
||||
|
||||
卡片使用 `RemoteImage`、14px 圆角、底部深色渐变;标题 2 行、类型 1 行。
|
||||
点击直接调用现有 `logic.openCard(...)`。分类数据直接使用
|
||||
`CategoryController.visibleDramas`。
|
||||
|
||||
新增三语 `allDramas` 并执行 `flutter gen-l10n`:
|
||||
|
||||
```text
|
||||
$ rg -n "allDramas" lib/l10n
|
||||
lib/l10n/app_localizations_en.dart:161: String get allDramas => 'All Dramas';
|
||||
lib/l10n/app_zh.arb:58: "allDramas": "全部剧目",
|
||||
lib/l10n/app_en.arb:58: "allDramas": "All Dramas",
|
||||
lib/l10n/app_localizations_zh.dart:158: String get allDramas => '全部剧目';
|
||||
lib/l10n/app_id.arb:58: "allDramas": "Semua Drama",
|
||||
lib/l10n/app_localizations_id.dart:161: String get allDramas => 'Semua Drama';
|
||||
```
|
||||
|
||||
定向绿灯:
|
||||
|
||||
```text
|
||||
$ flutter test test/discover/home_all_dramas_grid_test.dart
|
||||
00:01 +5: All tests passed!
|
||||
```
|
||||
|
||||
覆盖:无继续观看、全部剧目标题、2 列 delegate、左右/行列间距、2:3 封面、
|
||||
分类切换、无剧目空态、分类缺失空态、失败重试与 320px 小屏。
|
||||
|
||||
文件规模:
|
||||
|
||||
```text
|
||||
487 lib/pages/discover/discover_view.dart
|
||||
167 lib/pages/discover/widgets/home_drama_grid.dart
|
||||
245 test/discover/home_all_dramas_grid_test.dart
|
||||
```
|
||||
|
||||
解读:改造前 `discover_view.dart` 为 649 行;删除继续观看旧实现并拆分网格后
|
||||
降到 500 行以内。首页源码已无 `continueWatching`、`_continueTile`、
|
||||
`_ShowcaseCard`、`_cardsFor` 或嵌套 `GridView`。
|
||||
|
||||
### 24.4 既有壳层断言更新
|
||||
|
||||
`test/widget_test.dart` 原有 5 处断言首页出现 `Continue Watching`。K9 明确要求
|
||||
该文案彻底消失,因此该断言与 `find.text('Continue Watching'), findsNothing`
|
||||
不可能同时成立。
|
||||
|
||||
处理:保留全部既有用例、测试名称和导航流程,仅把 5 处已作废的可见文案断言
|
||||
原位改为 `All Dramas`;没有删除测试用例。
|
||||
|
||||
```text
|
||||
$ flutter test test/widget_test.dart
|
||||
00:05 +17: All tests passed!
|
||||
```
|
||||
|
||||
### 24.5 全量门禁与构建
|
||||
|
||||
首次静态分析发现新增测试有一个未使用 import:
|
||||
|
||||
```text
|
||||
warning - test/discover/home_all_dramas_grid_test.dart:10:8
|
||||
Unused import: 'package:fruitshorts/core/data/repositories/catalog_repository.dart'.
|
||||
1 issue found.
|
||||
```
|
||||
|
||||
移除后:
|
||||
|
||||
```text
|
||||
$ dart analyze lib test
|
||||
Analyzing lib, test...
|
||||
No issues found!
|
||||
```
|
||||
|
||||
```text
|
||||
$ flutter test
|
||||
00:18 +297 ~1: All tests passed!
|
||||
```
|
||||
|
||||
解读:297 项通过,1 项联调测试因客户端接口服务未启动按设计跳过;输出中的
|
||||
`[WatchRecordsController]` 堆栈来自既有故意注入失败的测试。
|
||||
|
||||
构建前检查:
|
||||
|
||||
```text
|
||||
$ ps -axo pid=,etime=,args= | rg 'flutter_tools.snapshot (run|build)|xcodebuild|gradlew'
|
||||
```
|
||||
|
||||
输出仅有当前检查命令自身,没有并发 Flutter run/build 后执行:
|
||||
|
||||
```text
|
||||
$ flutter build apk --debug
|
||||
Running Gradle task 'assembleDebug'... 8.4s
|
||||
✓ Built build/app/outputs/flutter-apk/app-debug.apk
|
||||
```
|
||||
|
||||
### 24.6 Git
|
||||
|
||||
```text
|
||||
cf03178 feat(flutter): 首页改为两列全部剧目网格
|
||||
2c381be merge: 合并 K9 首页全部剧目网格
|
||||
99f64ab..2c381be develop -> develop
|
||||
```
|
||||
|
||||
功能提交与合并提交 author/committer 均为
|
||||
`Zhou Weidong <502333560@qq.com>`。
|
||||
|
||||
### 24.7 用户真机验证步骤与预期
|
||||
|
||||
以下设备侧取证由用户执行,Codex 未跑真机。
|
||||
|
||||
1. 使用最新客户端 `develop` 进入首页「Home/发现」tab。
|
||||
预期:页面不再出现「继续观看」标题或横向卡片。
|
||||
2. 向下查看分类 chips。
|
||||
预期:chips 下方显示当前语言对应的「全部剧目」/ `All Dramas` /
|
||||
`Semua Drama`。
|
||||
3. 观察列表布局。
|
||||
预期:一行 2 个剧目,左右各 16,列间距 12、行间距 16;封面为 2:3 圆角。
|
||||
4. 向下滚动长列表。
|
||||
预期:继续按 2 列懒加载,滚动中无整页白屏或卡顿。
|
||||
5. 依次点击「为你推荐 / 热门 / 最新 / 服务端分类」。
|
||||
预期:网格内容随分类更新;「为你推荐」显示去重后的全部剧目。
|
||||
6. 点击任意剧目卡片。
|
||||
预期:沿用原详情流程打开对应剧目。
|
||||
7. 在有长标题或空分类数据时检查卡片。
|
||||
预期:标题最多 2 行、类型最多 1 行,不横向溢出;空态和失败重试文案保留。
|
||||
|
||||
设备侧截图、日志与最终验收结论由用户执行。
|
||||
Reference in new issue
Block a user