Repository navigation
feat(home): add random game discovery to desktop and mobile - #284
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.
Summary
首页“发现游戏”从可见的已发布游戏中独立随机抽取,单批不重复,不足上限时展示全部;进入或刷新首页时重新抽取。
复用
/api/v1/games,新增sort=random,先选取候选再组装媒体和标签。两端共用栏目组件,独立加载、局部重试;同步更新 OpenAPI 类型、界面契约和设计评审源。Evidence
Before: 手机固定展示标题排序的前 6 款,PC 首页没有“发现游戏”。
After: 手机随机最多 6 款,PC 在指定位置随机最多 12 款;使用 18 款项目自有 MIT NES 游戏,经正常扫描和审核验证了数量、去重、详情链接和横向滚动。
make backend-check、make integration-test、make web-check、make api-check全部通过;Web 为 112 个文件、579 项测试。make acceptance-case CASE=ACC-RF-BROWSER:四视口共 40 项通过,0 跳过、失败或 flaky,包含真实运行、存档和新实例恢复。已人工检查 1280px 桌面、390px 手机、3840×2160/150% 的实际页面,以及空态、封面比例、长标题和底部导航;PFB validate/verify 通过。
本地 PostgreSQL、单客户端、2 万款无媒体/标签的模拟数据,每种查询 30 次:随机 6 款中位 9.87ms / p95 11.84ms,随机 12 款中位 10.69ms / p95 14.79ms(含总数查询)。
GitHub CI 与 branch-image 全部通过;实际浏览器验收与截图:1280px、1440p、4K/150%、手机。
Merge Danger
Door: two-way
无需数据库迁移或持久化格式变更,可通过回退提交撤销。随机模式每次请求独立,跨请求可能重合,不提供稳定分页;原有标题和最近排序保持不变。
Blast Radius: 首页
影响两端首页内容与新增随机列表查询。复用现有已发布、目录启用及用户数据边界;卡片 CSS、导航和默认游戏库排序保持不变。