Skip to content

feat: surface the dialog response from makeUserNotifier#235

Draft
claude[bot] wants to merge 1 commit into
mainfrom
surface-later-response
Draft

feat: surface the dialog response from makeUserNotifier#235
claude[bot] wants to merge 1 commit into
mainfrom
surface-later-response

Conversation

@claude

@claude claude Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Requested by Samuel Attard · Slack thread

Before / After

Before: The function returned by makeUserNotifier showed the update dialog and only acted on the "Restart" button (response 0). The "Later" choice was silently discarded, so a caller had no way to know the user had dismissed the prompt and couldn't, for example, show their own "restart now" affordance later.

After: That function now takes an optional second argument, callback(response), which receives the index of the button the user clicked (0 = restart, 1 = later). Callers can react to either choice. The argument is optional, so existing usage is unchanged.

How

In src/index.ts, makeUserNotifier's returned closure gains an optional callback?: (response: number) => void parameter. After dialog.showMessageBox resolves, the existing quitAndInstall() branch is kept and the resolved response index is forwarded via callback?.(response). The helper's return type signature is widened to (info: IUpdateInfo, callback?: (response: number) => void) => void. This matches the patch proposed in the issue. Added two makeUserNotifier tests in test/index.test.ts asserting the callback receives the correct index for both buttons, and documented the callback under the API section of README.md.

Closes #194


Generated by Claude Code

The function returned by makeUserNotifier now accepts an optional
callback that receives the index of the button the user clicked
(0 = restart, 1 = later), letting callers react when the user
chooses "Later".

Closes #194

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qoymwe8fe4vauwoGPtTzwq
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.

Behavior when pressing later button

1 participant