Skip to content

Harden desktop update install flow#3

Merged
Derpedyea merged 2 commits into
mainfrom
feature/update-install-flow
May 5, 2026
Merged

Harden desktop update install flow#3
Derpedyea merged 2 commits into
mainfrom
feature/update-install-flow

Conversation

@Derpedyea
Copy link
Copy Markdown
Member

@Derpedyea Derpedyea commented May 5, 2026

Summary

  • Added a safer Windows desktop update path with explicit install-and-restart handling.
  • Prevented duplicate update install requests and added guarded fallback behavior when install cannot start.
  • Updated tray actions and app lifecycle handling so ready updates can be installed from the tray or on quit.
  • Added release notes to CHANGELOG.md for the 0.0.4 public release.

Testing

  • Not run.
  • Reviewed the update install flow for tray actions, IPC install requests, and app quit handling.
  • Verified the status updates now refresh the tray menu when update state changes.

Summary by CodeRabbit

  • New Features

    • Version 0.0.4 adds an account dashboard, desktop account pairing, automatic desktop updates, and dictionary support.
  • Bug Fixes

    • Improved update installation reliability and error handling.
    • Prevented multiple simultaneous app instances.
    • Tray menu now updates dynamically to reflect update state.
  • Style / UI

    • Updated dashboard logo, semantic color tokens, badge styles, and theme color palette.
  • Documentation

    • Added CHANGELOG entry for v0.0.4.

- Add tray and quit handling for installing downloaded updates
- Prevent duplicate install requests and show the window on install errors
- Add public release notes changelog
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 9f36bfa6-6d7c-4160-b74e-fe30a298fad8

📥 Commits

Reviewing files that changed from the base of the PR and between bd9f2a1 and b9a0efc.

📒 Files selected for processing (4)
  • apps/dashboard/src/App.tsx
  • apps/dashboard/src/components/ui/badge.tsx
  • apps/dashboard/src/index.css
  • apps/worker/src/dashboard-assets.ts
✅ Files skipped from review due to trivial changes (1)
  • apps/dashboard/src/App.tsx

📝 Walkthrough

Walkthrough

Desktop single-instance enforcement and a safer, validated update-install flow (including tray/menu integration and new helpers) were added. Release notes for v0.0.4 were created. Dashboard styling and theme tokens were migrated from specific emerald/amber/red palettes to semantic success/warning/destructive tokens and a refreshed dark HSL palette.

Changes

Release Documentation

Layer / File(s) Summary
Release Notes
CHANGELOG.md
Added v0.0.4 changelog with "What's new", "Improved", and "Notes" covering dashboard, pairing, automatic updates, dictionary support, and security/release-check items.

Desktop App Update Flow Refactoring

Layer / File(s) Summary
Single-Instance Enforcement & Startup
apps/desktop/main.cjs
Added app.requestSingleInstanceLock(), quit when lock not acquired, and moved app.whenReady() startup sequence inside the single-instance branch; routes "second-instance" events to update handling.
Lifecycle & Quit Handling
apps/desktop/main.cjs
Added before-quit handler to prevent unintended install unless packaged and ready; before-quit-for-update sets quit flag and marks install requested.
Validation & Helpers
apps/desktop/main.cjs
Added isUpdateReadyToInstall(), showMainWindow(reason), and installUpdateSafely(source) wrappers for centralized readiness checks, window/showing, and error-handled install attempts.
Core Installation Logic
apps/desktop/main.cjs
Refactored installUpdate(source) to accept a source, validate readiness, short-circuit duplicate requests via updateInstallRequested, and log sources.
Auto-Updater State Management
apps/desktop/main.cjs
Reset updateInstallRequested on relevant updater events; changed update-ready messaging and notification copy.
UI / Tray Wiring
apps/desktop/main.cjs
Added updateTrayMenu() to dynamically include update actions when isUpdateReadyToInstall(); patchStatus() now triggers updateTrayMenu().
IPC / Event Integration
apps/desktop/main.cjs
Renderer "updates:install" requests now call installUpdate("renderer"); tray actions call installUpdateSafely("tray"); status patches update tray menu.

Dashboard UI & Theme Tokens

Layer / File(s) Summary
Branding / Topbar
apps/dashboard/src/App.tsx
Replaced placeholder logo element with <img src={logoUrl}> in the dashboard top bar.
Component Token Migration
apps/dashboard/src/App.tsx, apps/dashboard/src/components/ui/badge.tsx
Switched NoticeBanner, UsageCard, and Badge variants to use semantic success, warning, and destructive token classes instead of hardcoded emerald/amber/red utilities.
Theme Variables & Palette
apps/dashboard/src/index.css
Added --color-success/--color-success-foreground and --color-warning/--color-warning-foreground to @theme inline; replaced dark :root HSL token values with a new purple/blue palette and adjusted background gradient layers.

Sequence Diagram

sequenceDiagram
    participant Renderer as Renderer Process
    participant IPC as IPC Handler
    participant UpdateLogic as Update Logic<br/>(installUpdateSafely)
    participant Validator as Readiness Validator<br/>(isUpdateReadyToInstall)
    participant Updater as Electron Auto-Updater
    participant MainWindow as Main Window
    participant Tray as Tray Menu

    Renderer->>IPC: updates:install request
    IPC->>UpdateLogic: installUpdate("renderer")
    UpdateLogic->>Validator: isUpdateReadyToInstall?
    Validator->>Updater: query state (available/downloaded/ready)
    Updater-->>Validator: readiness status

    alt ready && not already requested
        Validator-->>UpdateLogic: true
        UpdateLogic->>Updater: quitAndInstall()
        UpdateLogic->>Tray: update menu (installing)
    else not ready or already requested
        Validator-->>UpdateLogic: false
        UpdateLogic-->>MainWindow: show error / bring to front
        UpdateLogic->>Tray: refresh menu state
    end

    MainWindow-->>Renderer: notify status/result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 In a burrow of bytes I hop and sing,
One-instance rule keeps the bell from ring—
Helpers check readiness, tray buttons align,
Safe installs follow a tidy sign.
A tiny rabbit cheers the release spring!


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

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

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

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
laryn-transcribe b9a0efc May 05 2026, 01:24 AM

- Swap the topbar logo for the shared brand mark
- Add success and warning theme tokens and align UI states
- Update dark palette and background treatment for the dashboard
@Derpedyea
Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ 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".

@Derpedyea
Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ 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".

@Derpedyea
Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ 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".

@Derpedyea Derpedyea merged commit 8c04529 into main May 5, 2026
4 checks passed
@Derpedyea Derpedyea deleted the feature/update-install-flow branch May 5, 2026 01:46
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