Skip to content

公众号图文:同稿预览与交付包 - #3

Merged
webkubor merged 1 commit into
mainfrom
feat/wechat-preview
Nov 25, 2026
Merged

webkubor merged 1 commit into
mainfrom
feat/wechat-preview

Conversation

@webkubor

Copy link
Copy Markdown
Owner

Facet 生成手机正文与订阅卡片的本地预览,并导出同一份正文 HTML、素材和校验清单。现有 PDF/长图模板不变。该功能不接入微信账号、不入草稿箱、不发布文章。

已验证:源码与编译后 CLI、正文逐字节一致、素材校验、缺图和防覆盖;360px / 390px 本地 Chrome 卡片、正文与三张图片显示正常,无横向溢出。微信真机验收属于公众号业务项目,尚未执行。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T09:46:00.497814Z b362c51 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@webkubor
webkubor merged commit 10d9be8 into main Nov 25, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b362c5124f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/wechat.ts
const summary = entries.get("digest");
const cover = entries.get("cover");
if (!title || !summary || !cover) throw new Error("公众号稿件需要 title、digest 和 cover");
if (Buffer.byteLength(title, "utf8") > 64) throw new Error("公众号标题超过 64 字节");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Count title width instead of UTF-8 bytes

For Chinese titles, Buffer.byteLength(..., "utf8") counts each Han character as three bytes, so any all-Chinese title longer than 21 characters is rejected. WeChat's title allowance is based on characters/display-width rather than raw UTF-8 storage bytes, so otherwise valid 22–32-character titles cannot be previewed or exported; validate using the platform's character-width rule instead.

Useful? React with 👍 / 👎.

@webkubor
webkubor deleted the feat/wechat-preview branch November 30, 2026 14:21
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