Repository navigation
docs(readme): 按新界面重拍截图,截图 workflow 转正 - #35
Merged
Merged
Conversation
- .github/workflows/readme-screenshots.yml:手动触发,或推送 chore/readme-screenshots* 分支时触发;打包后端(默认 H2 profile + 演示种子)、生产构建前端,按角色登录截图并 提交回该分支;不允许在 main 上直接运行 - .github/screenshots/shots.mjs 记录要拍的页面和等待的选择器,take.mjs 负责截图; 选择器改用 data-* 属性和新界面的类名 - 测试:shots.mjs 里的选择器必须在前端组件里存在,截图清单必须与 README 引用的图一致, 防止界面改版后截图工具悄悄过时
- README 注明截图由 readme-screenshots workflow 生成,审计页说明补上筛选 - AGENTS.md 增加「README 截图」一节:只用真实服务截图、如何触发重拍、 shots.mjs 与防过时测试的关系
页面上的日期每天都变,每次运行都会产生新的截图提交;推送即触发会在每次推送后 追加一个截图提交。改为手动运行,README 与 AGENTS.md 同步说明用法。
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.
#31、#33、#34 改完之后,README 的 8 张截图有 6 张还是旧界面。这个 PR 重拍全部截图,并把截图工具从临时分支转成正式 workflow,以后改界面能直接重拍。
截图
8 张全部在 GitHub Actions 里实拍,文件名不变:
start-fullstack.ps1相同配置)、写入演示种子,再用生产构建起前端,按角色登录截取截图 workflow 转正
上次(#30)用的是
tmp/readme-screenshots分支上的一次性 workflow。它的选择器还是改版前的(button.primary.wide、.equipment-card、.timeline article),现在直接跑会全部超时。这次改成:.github/workflows/readme-screenshots.yml:只手动触发(Actions → README 截图 → Run workflow,或gh workflow run readme-screenshots.yml --ref <分支>),截图提交回运行的那个分支;在 main 上运行会直接报错退出.github/screenshots/shots.mjs记录要拍哪些页面、每页等哪个选择器;take.mjs负责登录和截图。选择器改用data-*属性和新界面的类名vinext start(原来是 dev 模式)为什么只手动触发:页面上有「今天」这类日期,每次运行截出来都不一样,推送即触发的话每推一次就会多一个截图提交(这个分支上就实际发生了一次,所以有两个截图提交)。
注意:
workflow_dispatch要等 workflow 文件进了 main 才能在界面上手动运行,所以这次是先用推送触发拍的,合并后就只能手动了。防止跑偏的约束
frontend/tests/readme-screenshots.test.mjs,跟着 CI 的前端测试一起跑:shots.mjs里每个选择器依赖的类名或data-*属性必须还在前端组件里——改界面时如果把它们删了,普通测试就会红,不用等下次重拍才发现(把设备页的等待选择器改回旧的.equipment-card,测试失败,已验证)docs/screenshots里的文件一一对应AGENTS.md 新增「README 截图」一节:只用真实服务截图、怎么触发重拍、
shots.mjs和测试的关系。README 注明截图由这个 workflow 生成,审计页说明补上筛选。验证
npm run lint、TZ=UTC npm test(84 项)全部通过合并后
tmp/readme-screenshots临时分支可以删掉了。