Skip to content

fix: serve raster PNG for pi.dev preview image instead of SVG - #701

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-11_pi-dev-logo-raster
Sep 11, 2026
Merged

fix: serve raster PNG for pi.dev preview image instead of SVG#701
ranxianglei merged 1 commit into
masterfrom
2026-09-11_pi-dev-logo-raster

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Follow-up to #698 (pi.dev listing).

The avatar/preview on pi.dev renders from pi.image through a raster-image pipeline, and every other working listed package uses png/jpg (e.g. pi-web-codex .jpg, @janvitos/pi-plan-build .png). Pointing it at the SVG rendered unreliably (screenshot feedback from @Dog).

Changes:

  • repoint pi.image -> docs/logo.png
  • ship a crisp 16:10 raster render of the logo (docs/logo.svg, rendered at 1600x1000) to match the pi.dev preview-frame aspect ratio

No version bump (content change); ships in the next release once merged.
Pre-flight: metadata-only change; typecheck/test/build unaffected.

@ranxianglei ranxianglei mentioned this pull request Sep 11, 2026
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

📦 Built Package Artifact

Branch: 2026-09-11_pi-dev-logo-raster (eb88da9)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-701

Each push to this PR publishes a new version under the pr-701 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr701.tgz
npm install -g package

This comment is automatically updated on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 收到,正在 review #701。初步核对:diff 只有两处(package.jsonpi.image 改指 docs/logo.png + 替换 docs/logo.png 为 1600×1000 位图),无版本号变更,符合内容分支规范。先做几项验证(PNG 有效性、与 SVG 源的一致性、CI 状态、查重),马上回完整结论。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review 完成,结论:可以合并。以下是完整核查记录。

查重

无重复。开放 issue/PR 里没有其它涉及 pi.dev 头像/预览图的条目;相关项只有父 issue #698(优化请求)、#699(已合,原始 SVG 方案)、#700(已合,v0.1.104 发布)。本 PR 是针对「SVG 在 pi.dev 栅格管线里渲染不稳」这一独立缺陷的后续修复,目的与上述条目不同,单独处理合理。

审核(bug 类三步)

  1. 查证:症状成立——pi dev首页优化 #698@Dog 的截图显示 v0.1.104 上线后头像仍显示异常(当时 pi.image 指向 SVG)。佐证:pi.dev 上正常显示预览的包(pi-web-codex .jpg、@janvitos/pi-plan-build .png)全部走位图格式。
  2. 层次判断:用户看到的「头像不对」是表面现象;根因是 pi.dev 的预览图管线按位图处理,SVG 不在其稳定支持范围内。本 PR 直接修根因(换位图源),不是治标。
  3. 方案评估:指向 16:10 的 PNG 且尺寸 1600×1000,与预览框 aspect-ratio: 16/10 + object-fit: cover 精确匹配——填满不裁切、渲染清晰。方案成立。

资产核验(本地实际执行)

  • docs/logo.png1600×1000 RGBA 8-bit,用纯 Python 解码器全量解包验证——所有 chunk CRC、zlib 流、扫描线 filter 全部合法,无损坏;264KB,对预览图合理。
  • feat: add pi.dev preview image and improve package description #699 时期你已在 thread 里看过的那张 800×500 预览 PNG 对比:新图恰好是其 2 倍分辨率,2× 盒式降采样后逐像素比对 mean abs diff = 0.106/255,仅 0.42% 通道样本差 >5(两次渲染的抗锯齿边缘差异),主色直方图完全一致(深藏青底 + 白色字标 + 青→靛渐变)。即同一套已确认过的 artwork 的高清重渲,没有换设计。
  • docs/logo.svg blob 未动(两侧都是 da1af1e),矢量源保留为唯一事实来源。
  • 全仓 grep:除 package.json:66 外没有任何代码/文档引用 logo.png/logo.svg,改尺寸不影响其他消费方。
  • pi.image 是 GitHub raw 绝对 URL,合并进 master 后该路径即刻可用;pi.dev 读 npm 元数据里的这个字段值,所以要等下一次 release 才会真正生效

Diff 整洁度

干净。仅 2 个文件:package.json 一行(URL .svg.png)+ docs/logo.png 二进制替换。无跑题文件、无空格噪音、未动 version(version-guard 检查也通过)。无需在分支上补任何小修。

CI

初跑 6 项里 5 绿,test (windows-latest, 22) 失败一项。我拉了日志定位:

not ok 1034 - SessionStore routes write failures through the EPERM detector (no false alert on non-lock error)
  location: tests/proxy-persist.test.ts
  error: 'timed out after 5000ms waiting for kernel write-failure line to reach the wrapped log'
  [persist] write failed for wire-1 (total 1x): ENOTDIR: not a directory, mkdir '...\Temp\bili-eperm-wire-SDdTnT'

这是已知 flake 模式而非回归:tests/proxy-persist.test.ts:55-59waitFor 注释明确写了 acp-kernel 会对 CI Windows temp sweep 产生的 ENOENT/ENOTDIR 做退避重试,debounced flush 可能晚于固定等待窗口;master HEAD(v0.1.104)同一矩阵全绿;且本 PR 只改了一个 URL 字符串和一个 PNG 二进制,逻辑上不可能影响 SessionStore 测试。我已触发该 job 重跑,结果通过——flake 坐实。属轻微问题,先只在此报告不另开 issue;若后续再复现就值得单开一条跟进(把 5s deadline 或退避参数调稳)。

后续(需要你操作)

  1. 合并 fix: serve raster PNG for pi.dev preview image instead of SVG #701(合并只能人来)。
  2. 合并后我切 v0.1.105 纯版本 release PR,CI 自动发 npm;发布后 pi.dev 读到新的 pi.image,头像即切换为这张 PNG。

中文小结:PR 把 pi.dev 头像从 SVG 换成 1600×1000 的栅格 PNG(与预览框 16:10 精确匹配),我逐像素核验了图片完整性与 artwork 一致性、diff 干净无版本号变更、CI 唯一的 windows-22 失败经日志定位为已知时序 flake 且重跑已通过,可以合并。

Replace the generated geometric logo with the provided hero artwork (glowing crystal gem + wordmark + tagline) as the pi.dev listing preview.

- docs/logo.png -> provided 1024x639 hero image (ratio 1.603 ~ 16:10, matches the pi.dev preview frame, no crop)
- drop the now-superseded generated docs/logo.svg
- pi.image -> docs/logo.png (raster, consistent with other listed packages)

Content change, no version bump; ships in the next release once merged.
@ranxianglei
ranxianglei force-pushed the 2026-09-11_pi-dev-logo-raster branch from 7fbfca2 to eb88da9 Compare September 11, 2026 06:57
@ranxianglei
ranxianglei merged commit 056af3a into master Sep 11, 2026
6 checks passed
antclt pushed a commit to antclt/billion-context that referenced this pull request Sep 11, 2026
pi.dev's stored record for billion-context still points pi.image at docs/logo.svg (the value as of v0.1.104), but ranxianglei#701 deleted that file -> 404 -> broken image on https://pi.dev/packages/billion-context. npm 0.1.105 already correctly points at docs/logo.png, but pi.dev has not re-indexed to it yet and exposes no self-serve re-index.

Restore the SVG so the currently-cached reference resolves immediately (no new publish needed; raw.githubusercontent.com serves master directly). The hero PNG takes over automatically once pi.dev re-indexes 0.1.105.

Lesson: don't delete an asset that a published version's metadata may still reference.
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