Skip to content

feat: route update checks to Nexus and refine updates page#259

Merged
TalexDreamSoul merged 1 commit intomasterfrom
codex/optimize-nexus-overall-functionality
May 8, 2026
Merged

feat: route update checks to Nexus and refine updates page#259
TalexDreamSoul merged 1 commit intomasterfrom
codex/optimize-nexus-overall-functionality

Conversation

@TagZxia
Copy link
Copy Markdown
Collaborator

@TagZxia TagZxia commented May 6, 2026

Motivation

  • 统一版本监测入口为 Nexus 官方源,避免同时依赖 GitHub 导致的多源不一致和回落策略复杂化。
  • 优化 updates 页面信息架构,使“版本更新”优先可见并把“公告”独立成 tab,提升内容可读性与运营灵活性。
  • 规范交互样式,确保页面中使用的按钮与项目标准 TxButton 风格一致,减少视觉/交互差异。

Description

  • 将更新检查默认 source 从 GitHub 切为 Nexus 官方(getTuffBaseUrl()),并在 UpdateService.fetchLatestRelease 中当 source.type === UpdateProviderType.OFFICIAL 时直接调用 fetchLatestReleaseFromOfficial,不再回落到 GitHub;变更文件为 apps/core-app/src/main/modules/update/UpdateService.ts
  • apps/nexus/app/pages/updates.vue 中将版本 channel 选择器上移到要闻区之前,新增 release / announcement 的 tabs(通过 selectedNewsTabactiveNewsListcomputed 实现),并把公告列表改为独立 tab 渲染,循环列表从 updateList 改为 activeNewsList
  • 统一交互控件使用 TxButton,并新增样式类 news-tab-btn / news-tab-btn--active 以匹配标准按钮视觉语言;同时对相关 DOM 结构做适配(移位、样式调整与动画时机微调)。
  • 更新发布说明文档 docs/plan-prd/01-project/CHANGES.md,记录此次行为与页面结构调整。

Testing

  • 已对修改的前端文件运行 ESLint 检查:pnpm -C "apps/nexus" exec eslint "app/pages/updates.vue",检查通过。
  • 已对修改的主进程文件运行 ESLint 检查:pnpm -C "apps/core-app" exec eslint "src/main/modules/update/UpdateService.ts",检查通过。
  • 本次变更在提交时触发的 lint-staged 钩子(包含上述 eslint --fix 任务)已执行并通过。

Codex Task

Summary by CodeRabbit

Release Notes

  • New Features

    • Added tabs to filter updates by type: Release News and Announcements
    • Channel selection now available on the Updates page
  • Improvements

    • Updated default update source to Official Nexus Releases

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 6, 2026

Deploying tuff with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0180a30
Status:🚫  Build failed.

View logs

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

📝 Walkthrough

Walkthrough

This PR modifies the update system to source releases from Official Nexus instead of GitHub and adds a news filtering UI that separates release announcements from general updates. The update sourcing logic is simplified to remove GitHub fallback for official sources, while the UI introduces tabbed filtering for different news categories.

Changes

Update Sourcing and Display Refinement

Layer / File(s) Summary
Update Source Configuration
apps/core-app/src/main/modules/update/UpdateService.ts (lines 2041–2049)
Default update source changed from GitHub Releases to Official Nexus Releases with type OFFICIAL, name "Nexus Releases", and url derived from getTuffBaseUrl().
Update Fetching Logic
apps/core-app/src/main/modules/update/UpdateService.ts (lines 1416–1422)
fetchLatestRelease now directly delegates to fetchLatestReleaseFromOfficial when source type is OFFICIAL, removing the prior GitHub fallback attempt.
News Filtering State and Lists
apps/nexus/app/pages/updates.vue (lines 159–163, 311–311)
News separated into releaseUpdates and announcementUpdates; activeNewsList selects between them based on selectedNewsTab state; v-for source switched from updateList to activeNewsList.
UI Components and Styling
apps/nexus/app/pages/updates.vue (lines 275–283, 284–284, 652–664)
Channel/news tab buttons introduced with .news-tab-btn and .news-tab-btn\--active styling; animation-delay adjusted to 100ms; replaces prior channel-tab styling.

Documentation Updates

Layer / File(s) Summary
Project Changes Log
docs/plan-prd/01-project/CHANGES.md
Extensive changelog entries documenting refactors, governance updates, and feature enhancements across core-app, nexus, pilot, and tuff-cli modules.

Sequence Diagram

sequenceDiagram
    actor User
    participant UpdatesUI as Updates Page
    participant UpdateService
    participant NexusServer as Nexus Server

    User->>UpdatesUI: Load updates page
    UpdatesUI->>UpdateService: fetchLatestRelease (source: OFFICIAL)
    UpdateService->>NexusServer: Request from Nexus Releases (getTuffBaseUrl)
    NexusServer-->>UpdateService: Return releases + announcements
    UpdateService-->>UpdatesUI: Update data (releaseUpdates, announcementUpdates)
    
    UpdatesUI->>UpdatesUI: Split into activeNewsList (release tab default)
    UpdatesUI-->>User: Display release news
    
    User->>UpdatesUI: Click announcements tab
    UpdatesUI->>UpdatesUI: Set selectedNewsTab = 'announcement'
    UpdatesUI->>UpdatesUI: Update activeNewsList = announcementUpdates
    UpdatesUI-->>User: Display announcement news
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hops excitedly
News from Nexus now takes the stage,
Release or announcement on the page,
Tabs divide what once was one,
The update dance has begun!
GitHub steps back, Nexus takes the show. 📰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main changes: routing update checks to Nexus and refining the updates page UI, which aligns with the changeset's primary objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/optimize-nexus-overall-functionality

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/core-app/src/main/modules/update/UpdateService.ts`:
- Around line 1418-1420: The OFFICIAL branch currently calls
fetchLatestReleaseFromOfficial directly and lacks retry/backoff; implement a
wrapper method (e.g., fetchLatestReleaseFromOfficialWithRetry) that loops up to
Math.max(1, this.settings.maxRetries || 1) attempts, calls
fetchLatestReleaseFromOfficial(channel, options) inside try/catch, on catch
record lastError, break if !this.isRetryableError(error) or on final attempt,
otherwise await this.sleep(this.calculateRetryDelay(attempt, baseDelay)) where
baseDelay = this.settings.retryDelay || 2000, and finally throw lastError (or
new Error("Failed to fetch official release") if non-Error); then replace the
direct return in the OFFICIAL branch to return
this.fetchLatestReleaseFromOfficialWithRetry(channel, options).

In `@docs/plan-prd/01-project/CHANGES.md`:
- Around line 6-14: The CHANGES.md header metadata still shows "更新时间:
2026-05-04" and a retained window ending at 2026-05-04 which now conflicts with
the new 2026-05-06 changelog entry; open docs/plan-prd/01-project/CHANGES.md and
update the top metadata timestamp and any "保留窗口"/end-date fields to 2026-05-06
(or a matching date range), so the header aligns with the new section; ensure
the file-level date is consistent with the new section referencing
apps/core-app/src/main/modules/update/UpdateService.ts and
apps/nexus/app/pages/updates.vue.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f0bf2e96-b8e3-4b31-9a01-072efaa0cb13

📥 Commits

Reviewing files that changed from the base of the PR and between 69887ae and 0180a30.

📒 Files selected for processing (3)
  • apps/core-app/src/main/modules/update/UpdateService.ts
  • apps/nexus/app/pages/updates.vue
  • docs/plan-prd/01-project/CHANGES.md

Comment on lines 1418 to 1420
if (this.settings.source?.type === UpdateProviderType.OFFICIAL) {
try {
const officialResult = await this.fetchLatestReleaseFromOfficial(channel, options)
if (officialResult.result.hasUpdate || !officialResult.result.error) {
return officialResult
}
} catch (error) {
updateLog.warn('Official update source failed, falling back to GitHub', { error })
}
return this.fetchLatestReleaseFromGitHub(channel, options)
return this.fetchLatestReleaseFromOfficial(channel, options)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Restore retry/backoff resilience for the OFFICIAL path.

Now that OFFICIAL is routed directly, transient upstream failures no longer get retry behavior parity with the GitHub path, which can cause avoidable “no update” outcomes on cold cache clients.

Proposed fix
 private async fetchLatestRelease(
   channel: AppPreviewChannel,
   options?: { force?: boolean }
 ): Promise<UpdateFetchResult> {
   if (this.settings.source?.type === UpdateProviderType.OFFICIAL) {
-    return this.fetchLatestReleaseFromOfficial(channel, options)
+    return this.fetchLatestReleaseFromOfficialWithRetry(channel, options)
   }

   return this.fetchLatestReleaseFromGitHub(channel, options)
 }
private async fetchLatestReleaseFromOfficialWithRetry(
  channel: AppPreviewChannel,
  options?: { force?: boolean }
): Promise<UpdateFetchResult> {
  const maxRetries = Math.max(1, this.settings.maxRetries || 1)
  const baseDelay = this.settings.retryDelay || 2000
  let lastError: unknown

  for (let attempt = 0; attempt < maxRetries; attempt += 1) {
    try {
      return await this.fetchLatestReleaseFromOfficial(channel, options)
    } catch (error) {
      lastError = error
      if (!this.isRetryableError(error) || attempt >= maxRetries - 1) break
      await this.sleep(this.calculateRetryDelay(attempt, baseDelay))
    }
  }

  throw lastError instanceof Error ? lastError : new Error("Failed to fetch official release")
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/core-app/src/main/modules/update/UpdateService.ts` around lines 1418 -
1420, The OFFICIAL branch currently calls fetchLatestReleaseFromOfficial
directly and lacks retry/backoff; implement a wrapper method (e.g.,
fetchLatestReleaseFromOfficialWithRetry) that loops up to Math.max(1,
this.settings.maxRetries || 1) attempts, calls
fetchLatestReleaseFromOfficial(channel, options) inside try/catch, on catch
record lastError, break if !this.isRetryableError(error) or on final attempt,
otherwise await this.sleep(this.calculateRetryDelay(attempt, baseDelay)) where
baseDelay = this.settings.retryDelay || 2000, and finally throw lastError (or
new Error("Failed to fetch official release") if non-Error); then replace the
direct return in the OFFICIAL branch to return
this.fetchLatestReleaseFromOfficialWithRetry(channel, options).

Comment on lines +6 to +14
## 2026-05-06

### feat(core-app/nexus): 更新检查统一走 Nexus 与 updates 信息架构调整

- `apps/core-app/src/main/modules/update/UpdateService.ts`
- `apps/nexus/app/pages/updates.vue`
- UpdateService 默认 source 从 GitHub Releases 切换为 Nexus Official(`getTuffBaseUrl()`),且官方源检查失败时不再回落到 GitHub,后续版本监测统一请求 Nexus。
- Nexus `updates` 页面将版本 channel 选择上移至要闻区之前;要闻区新增“更新 / 公告”tabs,公告改为单独分栏展示,并统一使用 `TxButton` 交互样式保持按钮规范一致。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the changelog header metadata to match the new entry date.

After adding the 2026-05-06 section, the top metadata still says 更新时间: 2026-05-04 and the retained window ends at 2026-05-04, which now conflicts with this update and can mislead readers.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/plan-prd/01-project/CHANGES.md` around lines 6 - 14, The CHANGES.md
header metadata still shows "更新时间: 2026-05-04" and a retained window ending at
2026-05-04 which now conflicts with the new 2026-05-06 changelog entry; open
docs/plan-prd/01-project/CHANGES.md and update the top metadata timestamp and
any "保留窗口"/end-date fields to 2026-05-06 (or a matching date range), so the
header aligns with the new section; ensure the file-level date is consistent
with the new section referencing
apps/core-app/src/main/modules/update/UpdateService.ts and
apps/nexus/app/pages/updates.vue.

@TalexDreamSoul TalexDreamSoul merged commit 7961dc9 into master May 8, 2026
4 of 5 checks passed
@TalexDreamSoul TalexDreamSoul deleted the codex/optimize-nexus-overall-functionality branch May 8, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants