Skip to content

fix(updater): keep update indicator until install - #33

Merged
LRainner merged 1 commit into
masterfrom
codex/keep-update-indicator-until-installed
Jul 31, 2026
Merged

fix(updater): keep update indicator until install#33
LRainner merged 1 commit into
masterfrom
codex/keep-update-indicator-until-installed

Conversation

@LRainner

@LRainner LRainner commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • Keep the orange update indicator visible for as long as an update is available.
  • Opening the About page no longer acknowledges or hides the indicator.
  • Keep the indicator visible while the package is downloading and waiting to be installed.
  • Clear the indicator only after installation succeeds, immediately before relaunch.

Why

The indicator previously represented an unseen update. Merely opening the About page marked the update as seen and removed the orange dot, even though the update had not been downloaded or installed. This made the persistent update signal disappear too early and made it easy to forget that an update was still pending.

The indicator now represents update availability instead of whether the user has viewed the notification.

Compatibility

Existing version 1 update state remains readable. A previously persisted seenVersion value no longer suppresses the indicator, so users who already opened the About page will still see the dot while that update is available. The state is invalidated normally after the app version changes.

Behavior

  • Update discovered: indicator appears.
  • About page opened: indicator remains visible.
  • Update downloaded and ready: indicator remains visible.
  • Installation succeeds: indicator is cleared.
  • No update is available, or the installed app version changes: indicator is not shown.

Tests

  • npm.cmd test -- src/update-indicator.test.ts — 4 tests passed.
  • npm.cmd run test:e2e with the two updater indicator/install scenarios — 2 tests passed.
  • npm.cmd run build — TypeScript checking and production build passed.
  • git diff --check passed.

Summary by CodeRabbit

  • New Features
    • Update indicators now remain visible while an update is available, even after viewing the About page.
    • The About page displays available update details when opened or refreshed.
  • Bug Fixes
    • Update indicators now remain visible after an update is downloaded until installation is complete.
    • Outdated persisted update information is cleared when the app version changes.
    • Indicators are hidden when no update is available.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The update indicator now remains visible while an update is available. Opening About does not acknowledge the update. Successful installation clears the persisted update state. Unit and end-to-end tests cover this behavior.

Changes

Update indicator lifecycle

Layer / File(s) Summary
Available-update state contract
src/update-indicator.ts, src/update-indicator.test.ts
Replaced seen-state helpers with hasAvailableUpdate. Tests cover persisted availability, version invalidation, and the no-update case.
Settings update-state integration
src/settings.ts
About-page rendering no longer marks updates as seen. Successful installation clears the persisted available-update state.
End-to-end indicator validation
e2e/settings.e2e.ts
Tests verify that the indicator remains visible after opening About and after download preparation, then disappears after installation and restart.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • LRainner/AgentCat#9: Both changes refine update indicator behavior in settings and end-to-end coverage.
  • LRainner/AgentCat#29: This change revises the update-indicator state and settings behavior introduced there.
🚥 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 clearly summarizes the main change: the update indicator remains visible until installation.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
e2e/settings.e2e.ts (1)

174-179: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Wait for relaunch before asserting the indicator is hidden.

The test waits only for plugin:updater|install. If relaunch fails after the indicator is cleared, this test still passes. Also verify that plugin:process|restart is invoked after installation.

Suggested assertion
   await expect.poll(() => page.evaluate(() => (
     window as unknown as { __TAURI_TEST_COMMANDS__: string[] }
   ).__TAURI_TEST_COMMANDS__)).toContain("plugin:updater|install");
+  await expect.poll(() => page.evaluate(() => {
+    const commands = (window as unknown as {
+      __TAURI_TEST_COMMANDS__: string[];
+    }).__TAURI_TEST_COMMANDS__;
+    return commands.indexOf("plugin:process|restart") >
+      commands.indexOf("plugin:updater|install");
+  })).toBe(true);
   await expect(page.locator("`#about-update-dot`")).toBeHidden();
🤖 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 `@e2e/settings.e2e.ts` around lines 174 - 179, Update the updater flow
assertions after clicking “安装并重启” to wait for both the installation command and
the subsequent “plugin:process|restart” command, then assert `#about-update-dot`
is hidden only after the restart command is observed. Keep the existing
installation assertion and locator behavior unchanged.
🤖 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.

Nitpick comments:
In `@e2e/settings.e2e.ts`:
- Around line 174-179: Update the updater flow assertions after clicking “安装并重启”
to wait for both the installation command and the subsequent
“plugin:process|restart” command, then assert `#about-update-dot` is hidden only
after the restart command is observed. Keep the existing installation assertion
and locator behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e4370e3e-b54f-48d5-be45-381adfca86ff

📥 Commits

Reviewing files that changed from the base of the PR and between 5dd9931 and 7d8f7ac.

📒 Files selected for processing (4)
  • e2e/settings.e2e.ts
  • src/settings.ts
  • src/update-indicator.test.ts
  • src/update-indicator.ts

@LRainner
LRainner merged commit 5265901 into master Jul 31, 2026
8 checks passed
@LRainner
LRainner deleted the codex/keep-update-indicator-until-installed branch July 31, 2026 03:03
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