feat: 增加版本更新提示与社区入口 - #438
Conversation
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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/hometo include anupdatepayload (admin-only; AccessKey always receivesnull) 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.
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
关联 Issue / Related Issue
无 / None
变更内容 / Change Content
GET /api/system/update:仅在接口请求时按需读取公开 GitHub Releases;成功结果缓存 6 小时,失败缓存 30 分钟,并发请求合并。正式版只匹配更高正式 V2,测试版匹配任意更高 V2,并始终忽略 V3。/api/home保持原有数据合同,不包含更新字段,也不参与版本检查。管理员进入首页时并行请求一次独立更新接口;不轮询、不自动重试,AccessKey 不请求且无权访问。/api/home合同保持不变。make check通过(前端 lint/格式/类型/生产构建、Go vet/build/全量测试及 diff check)。自查清单 / Checklist
make check,或在说明中写明无法运行的原因和未验证范围。 / I ranmake check, or documented why it could not run and what remains unverified.