Skip to content

improvement(desktop): install updates on one click, asking only about real in-flight work - #9505

Merged
waleedlatif1 merged 5 commits into
stagingfrom
improvement/desktop-one-click-update
Oct 31, 2026
Merged

waleedlatif1 merged 5 commits into
stagingfrom
improvement/desktop-one-click-update

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • "Restart to update" (toast, sidebar, menu) now installs immediately — the generic "Restart to install? Later / Restart and update" dialog (default: Later) is gone
  • Asks only when a restart would interrupt real work, and names it: a running terminal command, an agent action, computer use, or a window with unsaved edits (probed through each page's own beforeunload guards). Restart is the default; Not Now keeps the update ready and it still installs on quit
  • Previously, confirming the old dialog bypassed every unsaved-edits guard and dropped edits silently; those edits now block with a specific prompt
  • The minimum-version gate passes { mandatory: true } and never offers to wait (older shells ignore the option)
  • An update relaunch reopens every app window, not only the main one
  • Fixes the menu's "you will be prompted to restart" copy, which promised a prompt that never came

Type of Change

  • Improvement

Testing

  • apps/desktop/src/main/updater.test.ts (37 pass): one click installs with no dialog; running work prompts once with restart as default; Not Now keeps ready + install-on-quit; mandatory never prompts
  • apps/desktop/e2e/updater.spec.ts (real MacUpdater + real renderer beforeunload): terminal-only prompt, unsaved-edits prompt, a non-cancelling listener does not count as unsaved, and a clean install shows no dialog
  • Red→green: pre-fix updater.ts fails 8 unit tests and the e2e; forcing the unsaved-edits probe either way fails the e2e
  • tsc --noEmit (desktop), biome on changed files; full gate in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 31, 2026 9:10am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 13 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/desktop/src/main/in-flight-work.ts Resolved
@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Ready updates install with one click unless a restart would interrupt detected work.

  • Ready updates restart at once unless real work could be interrupted.
  • Update restarts reopen the app windows you had open.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Click[Restart to update] --> Required{Required update?}
  Required -->|Yes| Install[Commit relaunch and install]
  Required -->|No| Check[Check windows and running work]
  Check --> Work{Work detected?}
  Work -->|No| Install
  Work -->|Yes| Prompt[Name the work and ask]
  Prompt -->|Not Now| Ready[Keep update ready]
  Prompt -->|Restart and Update| Install
  Install --> Restore[Reopen remembered windows]
Loading

Reviews (4) · Last reviewed commit: "fix(desktop): ask the OS about terminals..." · Reviewed by Greptile

Comment thread apps/desktop/src/main/in-flight-work.ts Resolved
Comment thread apps/desktop/src/main/in-flight-work.ts Resolved
Comment thread apps/desktop/src/main/index.ts Resolved
@waleedlatif1
waleedlatif1 force-pushed the improvement/desktop-one-click-update branch from d42c197 to 80f071b Compare October 31, 2026 08:15
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/desktop/src/main/index.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 16 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/desktop/src/main/in-flight-work.ts Resolved
Comment thread apps/desktop/src/main/index.ts Resolved
@waleedlatif1
waleedlatif1 force-pushed the improvement/desktop-one-click-update branch from 80f071b to 539c09b Compare October 31, 2026 08:39
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 17 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/desktop/src/main/index.ts Resolved
Comment thread apps/desktop/src/main/terminal/index.ts Resolved
… real in-flight work

- Restart to update installs immediately; the generic Later/Restart dialog is gone
- Prompt only when a terminal command, agent action, computer use, or unsaved edit would be interrupted, naming it, with restart as the default
- The minimum-version gate never offers to wait
- Reopen every app window after an update relaunch
- Fix the menu's downloading copy, which promised a prompt that never came
…n update restart

- A window that doesn't answer the unsaved-edits check counts as possibly unsaved instead of clean
- A running browser-agent action counts as work a restart would interrupt
- The queued-send claim is cleared on pagehide only, so the check (or a cancelled unload) can't strand a queued message
… queued browser actions

- Read terminal, computer-use, browser and agent activity after the unsaved-edits probes finish, so work started meanwhile still prompts
- A browser action waiting in the queue counts as running
- A window whose probe errors counts as possibly unsaved, like one that times out
…fore an update restart

Shells that announce nothing (fish, sh) now count as busy when their tty's
foreground process group is not the shell's own. Live windows are recorded
for relaunch without the cap, which only bounds persisted routes on read.
@waleedlatif1
waleedlatif1 force-pushed the improvement/desktop-one-click-update branch from 539c09b to da77a69 Compare October 31, 2026 08:56
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 18 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/desktop/src/main/terminal/index.ts Resolved

This branch was previously deployed

1 inactive deployment
Preview — 2720423f Deployed Oct 31, 2026 by vercel[bot]
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