Skip to content

feat: 增加版本更新提示与社区入口 - #438

Merged
tbphp merged 3 commits into
v2from
feat/version-update-community
Aug 20, 2026
Merged

feat: 增加版本更新提示与社区入口#438
tbphp merged 3 commits into
v2from
feat/version-update-community

Conversation

@tbphp

@tbphp tbphp commented Aug 19, 2026

Copy link
Copy Markdown
Owner

关联 Issue / Related Issue

无 / None

变更内容 / Change Content

  • Bug 修复 / Bug fix
  • 新功能 / New feature
  • 其他改动 / Other changes
  • 新增管理员专用 GET /api/system/update:仅在接口请求时按需读取公开 GitHub Releases;成功结果缓存 6 小时,失败缓存 30 分钟,并发请求合并。正式版只匹配更高正式 V2,测试版匹配任意更高 V2,并始终忽略 V3。
  • Release 客户端有界分页读取历史记录,继续使用固定 GitHub 地址、逐页响应上限和严格 Release URL 校验;超过安全页数时整次检查失败,不对截断集合做成功判断。
  • /api/home 保持原有数据合同,不包含更新字段,也不参与版本检查。管理员进入首页时并行请求一次独立更新接口;不轮询、不自动重试,AccessKey 不请求且无权访问。
  • 只有更新接口成功且确认有更新时才显示紧凑图标;失败、超时和无更新均无界面提示。Tooltip 展示当前/最新版本和发布时间,点击打开对应 Release。
  • 全局菜单增加 GitHub、Telegram 与克制的 Star 引导,并同步中、英、日三种界面文案及 README 社区入口。
  • 兼容性:新增只读管理接口,无数据库迁移、无新增依赖、无自动升级行为;原有 /api/home 合同保持不变。
  • 验证:make check 通过(前端 lint/格式/类型/生产构建、Go vet/build/全量测试及 diff check)。

自查清单 / Checklist

  • 我已运行 make check,或在说明中写明无法运行的原因和未验证范围。 / I ran make check, or documented why it could not run and what remains unverified.
  • 本 PR 范围聚焦,未包含无关改动。 / This PR is focused and contains no unrelated changes.
  • 我已更新必要的公开文档或发布说明。 / I updated any required public documentation or release notes.
  • 我已确认提交、日志和测试数据不包含敏感信息。 / I confirmed that commits, logs, and fixtures contain no sensitive data.
  • 如适用,我已说明兼容性或数据迁移影响。 / Where applicable, I documented compatibility or data-migration impact.

@tbphp
tbphp marked this pull request as ready for review August 19, 2026 15:51
Copilot AI lite review requested due to automatic review settings August 19, 2026 15:51

@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: c566b8ff9b

ℹ️ 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 internal/releasecheck/client.go Outdated
@tbphp tbphp self-assigned this Aug 19, 2026
@tbphp tbphp added the enhancement New feature or request label Aug 19, 2026

Copilot AI 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.

Pull request overview

This PR adds an automated “new version available” signal sourced from public GitHub Releases, exposes it via the control-plane /api/home response, and surfaces it in the web UI alongside new community entry points.

Changes:

  • Add backend release-checking subsystem (fetch, select, cache) and wire it into the control runtime/container.
  • Extend /api/home to include an update payload (admin-only; AccessKey always receives null) and add corresponding frontend DTO projection + periodic refresh.
  • Add UI affordances (compact update icon + tooltip) and community links (GitHub/Telegram + Star copy) with i18n + README updates.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
web/src/i18n/locales/zh-CN/core.ts Add community/menu strings and update tooltip/label translations (ZH).
web/src/i18n/locales/ja-JP/core.ts Add community/menu strings and update tooltip/label translations (JA).
web/src/i18n/locales/en-US/core.ts Add community/menu strings and update tooltip/label translations (EN).
web/src/features/preferences/PreferencesControl.vue Add GitHub/Telegram links and Star invitation in preferences panel.
web/src/features/home/HomeWelcome.vue Show update icon next to welcome title when base.update exists.
web/src/features/home/HomeView.vue Pass base into HomeWelcome when base query is available.
web/src/features/home/HomeSummary.vue Show update icon next to version in the home summary.
web/src/features/home/HomeReleaseUpdateLink.vue New reusable component rendering the compact update link + tooltip.
web/src/app/resources/home.ts Add update to HomeBaseDto, validate it defensively, and poll /api/home every 5 minutes.
README.md Add Telegram community link (EN).
README_JP.md Add Telegram community link (JP).
README_CN.md Add Telegram community link (CN).
internal/releasecheck/selection.go New release selection logic (SemVer-ish parsing, V2-only, stable vs prerelease rules, URL/published validation).
internal/releasecheck/selection_test.go Tests for selection eligibility and precedence rules.
internal/releasecheck/client.go New GitHub Releases HTTP client with strict response validation and size limits.
internal/releasecheck/client_test.go Tests for HTTP contract, error cases, and cancellation behavior.
internal/releasecheck/checker.go Cached periodic checker (6h success cache / 30m failure retry) with concurrency coalescing.
internal/releasecheck/checker_test.go Tests for caching policy, concurrency coalescing, and cancellation behavior.
internal/control/server.go Add optional ReleaseUpdateReader wiring point on the control server.
internal/control/runtime.go Run the release checker alongside other control runtimes.
internal/control/runtime_test.go Verify the runtime runs the release checker until cancellation.
internal/control/home.go Add update to /api/home response for admins (null for AccessKey).
internal/control/home_update_test.go Add HTTP tests for the new update behavior.
internal/control/home_statistics_test.go Update existing home base HTTP assertions to include update.
internal/container/container.go Wire release client/checker and inject checker into control server constructor.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/control/home_update_test.go Outdated

@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: a873e32bb2

ℹ️ 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 web/src/app/resources/home.ts Outdated
@tbphp

tbphp commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

@codex

Copilot AI 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.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

@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: 6f2b1132f0

ℹ️ 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 internal/releasecheck/client.go
@tbphp
tbphp merged commit 5d9b001 into v2 Aug 20, 2026
8 checks passed
@tbphp
tbphp deleted the feat/version-update-community branch August 20, 2026 04:52
@tbphp tbphp added this to the v2.0.0 milestone Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants