Improve language in local-main sync suggestion toast (#4938)

This commit is contained in:
Jinjing
2026-06-08 20:16:04 -07:00
committed by GitHub
parent 143c5de1a9
commit fc850a3f4e
2 changed files with 10 additions and 8 deletions
@@ -1343,10 +1343,12 @@ describe('createWorktree base status merge', () => {
'Local main is behind origin/main',
expect.objectContaining({
id: 'local-base-ref-update-suggestion:origin/main:main',
description: expect.stringContaining('local main is 2 commits behind'),
description: expect.stringContaining(
'Your new worktree is current, but local main is 2 commits behind. AI diffs may miss recent commits.'
),
duration: Infinity,
dismissible: true,
action: expect.objectContaining({ label: 'Turn On' }),
action: expect.objectContaining({ label: 'Keep main up to date' }),
cancel: expect.objectContaining({ label: 'Dismiss' })
})
)
@@ -1490,8 +1492,8 @@ describe('createWorktree base status merge', () => {
await Promise.resolve()
expect(toast.dismiss).not.toHaveBeenCalled()
expect(toast.error).toHaveBeenCalledWith('Could not turn on Keep Local Main Up to Date', {
description: 'Open Settings and try again.'
expect(toast.error).toHaveBeenCalledWith('Could not keep local main up to date', {
description: 'Open Settings > Git and try again.'
})
})
+4 -4
View File
@@ -125,14 +125,14 @@ function showLocalBaseRefUpdateSuggestionToast(
// the user acts, so a ~4s auto-expire can't bury this one-time, opt-in nudge.
toast.warning(`Local ${suggestion.localBranch} is behind ${suggestion.baseRef}`, {
id: toastId,
description: `Your new workspace used the latest ${suggestion.baseRef}, but local ${suggestion.localBranch} is ${suggestion.behind} ${commitNoun} behind. Turn this on so Orca keeps local ${suggestion.localBranch} current for future workspaces.`,
description: `Your new worktree is current, but local ${suggestion.localBranch} is ${suggestion.behind} ${commitNoun} behind. AI diffs may miss recent commits.`,
duration: Infinity,
dismissible: true,
// Fires for the close (X) button and swipe; the Dismiss button uses its own
// handler since sonner's cancel action does not trigger onDismiss.
onDismiss: persistDismissal,
action: {
label: 'Turn On',
label: `Keep ${suggestion.localBranch} up to date`,
onClick: () => {
void Promise.resolve(
updateSettings({
@@ -147,8 +147,8 @@ function showLocalBaseRefUpdateSuggestionToast(
toast.success(`Keeping local ${suggestion.localBranch} up to date`)
})
.catch(() => {
toast.error('Could not turn on Keep Local Main Up to Date', {
description: 'Open Settings and try again.'
toast.error(`Could not keep local ${suggestion.localBranch} up to date`, {
description: 'Open Settings > Git and try again.'
})
})
}