Skip to content

docs(miniapp): document the 16:9 screenshot ratio for market listings - #1933

Merged
bobleer merged 1 commit into
mainfrom
feat/miniapp-screenshot-ratio-docs
Jul 31, 2026
Merged

docs(miniapp): document the 16:9 screenshot ratio for market listings#1933
bobleer merged 1 commit into
mainfrom
feat/miniapp-screenshot-ratio-docs

Conversation

@bobleer

@bobleer bobleer commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

为什么

网页市场和 BitFun 桌面端都用 aspect-ratio: 16 / 9 + object-fit: cover 渲染上架截图,非 16:9 的图会被居中裁掉边缘。但这个契约此前只存在于 CSS 里——投稿的人不知道该按什么比例出图,调用 PublishMiniApp 的 Agent 也没有任何提示。

改了什么

把比例写到三类使用者各自会碰到的地方:

位置 面向谁
miniapp-dev SKILL.md(打包进客户端的 builtin 版 + 仓库内框架版)的「发布到市场」 生成 MiniApp 的 Agent
PublishMiniAppscreenshot_paths schema description 调用工具时的 Agent
src/miniapp-market-web/README.md 新增「上架截图比例」 改市场前端的人

README 那节列出了三处 16:9 CSS 的位置(网页卡片、网页详情页、桌面端卡片),要求改一处必须同步另外两处,否则同一张截图在两个界面里的裁剪结果会不一致。

推荐 1920×1080;标注 2560×1440 为有效上限,因为后端会把超过 2560px 的边缩到 2560。README 里额外说明 validate_screenshot 不校验宽高比——16:9 是显示契约不是上传门槛,避免以后有人误以为是硬校验去改后端。

验证

  • cargo check -p bitfun-core 通过
  • cargo test -p bitfun-core --lib skills::(21 passed)
  • cargo test -p bitfun-core --lib miniapp_publish(7 passed)

内置 skill 的 bundle hash 由 build.rs 自动重算,无需手动同步。

未包含

桌面端投稿界面的用户可见提示没动(market.submissions.* 那一带),加提示需要改三个 locale 的 i18n,与本 PR 的「skills + 文档」范围不同,可以单独提。

Both the web market and the desktop client render listing screenshots at
aspect-ratio 16/9 with object-fit: cover, so anything else gets
center-cropped. That contract lived only in CSS, and nothing told a
publisher — or an agent calling PublishMiniApp — what to aim for.

Record it where each audience will actually hit it:

- miniapp-dev SKILL.md (both the bundled builtin copy and the in-repo
  framework copy) in the publish section
- the PublishMiniApp screenshot_paths schema, which is what an agent
  reads at call time
- src/miniapp-market-web/README.md, which lists all three 16:9 CSS sites
  so a future change keeps them in sync

Recommend 1920x1080; note 2560x1440 as the useful ceiling since the
backend downsizes longer edges to 2560. The README also spells out that
validate_screenshot does not check aspect ratio — 16:9 is a display
contract, not an upload gate.
@bobleer
bobleer merged commit 33e6ec5 into main Jul 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant