Skip to content

支持独立文章封面取景并贯穿保存、发布和SSR - #92

Merged
13304930782 merged 5 commits into
mainfrom
codex/article-cover-framing
Oct 13, 2026
Merged

13304930782 merged 5 commits into
mainfrom
codex/article-cover-framing

Conversation

@13304930782

@13304930782 13304930782 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

竖图或主体偏离中心的封面此前只能使用固定裁切,容易隐藏主体。现在作者可以为首页/文章列表卡片和详情头图分别保存取景位置与缩放;支持拖动、触摸、键盘、缩放和手机预览,取消保留原设置。原图和正文引用保持原样。

新增可空 JSON 字段 posts.cover_crop,贯穿草稿、编辑、发布/审核快照、修订历史、公开接口、SSR 和前端显示。旧文章继续使用居中卡片与顶部头图;更换或移除封面清除旧参数。后端验证结构、数值范围和编辑权限。保留现有文章页、统一订阅区、SEO、DeepSeek 简介及保存修复。

专属离线发布工具仅携带九个必要后台文件、单个增量迁移及专属运行器、配套 dist/SSR 和验证回滚脚本;海外节点只同步静态资源。生产不访问 GitHub/npm、不安装或构建依赖。备份五个相关表、完整旧 SSR 和受影响文件,迁移前后核对完整快照防止覆盖并发更新;失败自动恢复代码与入口,保留可空字段及取景数据。API/worker 加载发布逻辑需重启,但保留现有内存、Node 参数和环境。

验证保留完整 CI:真实 MySQL 取景保存/权限/发布审核/历史恢复、新装数据库基线、迁移中断恢复与 hostile DB 环境回归;SSR 与取景框 Portal/取消确认/焦点交互回归;离线包范围、缺件、字节篡改、LF、资源引用及备份完整性回归。生产验收仅公开读取及内存中的取景渲染,不发布测试文章或发送测试通知。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T15:47:53.523953Z 9590027 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.

@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: 9590027c53

ℹ️ 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".

const content = (
<article className="blog-card">
{src && <img {...responsiveImage(src)} alt="" loading="lazy" decoding="async" />}
{src && (frame ? <span className="blog-card-cover"><CoverImage {...responsiveImage(src)} frame={frame} alt="" loading="lazy" decoding="async" /></span> : <img {...responsiveImage(src)} alt="" loading="lazy" decoding="async" />)}

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 Account for zoom when selecting card image variants

When a local upload uses a frame with zoom > 1, the card still calls responsiveImage(src) with a fixed 180px/88px sizes value. Browsers therefore select a variant based on the untransformed layout width—for example, the 180w asset at DPR 1—then the CSS enlarges it by as much as 3×, making framed cards visibly blurry even though larger variants exist. Use the crop zoom when calculating sizes or bypass the undersized variant for zoomed covers.

Useful? React with 👍 / 👎.

@13304930782
13304930782 merged commit 782fecc into main Oct 13, 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