From 2396d6e738f034173b1802a793eedca835a9605c Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 15 Nov 2026 15:44:37 +0100 Subject: [PATCH] amend! Remind the user of an update when lazygit is idle Remind the user of an update when lazygit is idle The note in the bottom-right corner is easy to miss. Users need a notification to actually update, but one that pops up at startup gets in the way of the work that they started lazygit for. Show the update menu when the user hasn't pressed a key or used the mouse for a minute, and no other popup is open. After the user responds to the menu, don't show it again for a day. Users who never leave lazygit idle wouldn't see the menu at all, so also show it at startup if the update has been available for a week and the user never responded to the menu for it. The menu now has "Remind me tomorrow" and "Skip this version"; closing the menu does the same as the former. Skipping a version keeps lazygit quiet until a newer one comes out, but the note stays. If several lazygit instances are idle at the same time, e.g. in different terminal tabs, all of them show the menu. Otherwise a lazygit that the user forgot in some tab would get the reminder every day, and the others never. When the user responds to the menu in one of them, the others close theirs. If update.method is never, don't show the menu; only the note appears then. The menu tells the user about this setting. Co-Authored-By: Claude Opus 5.5 --- pkg/gui/controllers/helpers/update_helper.go | 2 ++ pkg/i18n/english.go | 2 ++ pkg/updates/updates.go | 9 ++++++++- pkg/updates/updates_test.go | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/gui/controllers/helpers/update_helper.go b/pkg/gui/controllers/helpers/update_helper.go index b58c7b34f..508253fd2 100644 --- a/pkg/gui/controllers/helpers/update_helper.go +++ b/pkg/gui/controllers/helpers/update_helper.go @@ -307,6 +307,8 @@ func (self *UpdateHelper) updateMenuOptions(newVersion *types.VersionNumber) typ }, }, ) + paragraphs = append(paragraphs, self.c.Tr.TurnOffUpdateReminders) + // Whatever the user chooses counts as a response, and so does closing the // menu for _, item := range items { diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 83fd9c907..c0e750df8 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -291,6 +291,7 @@ type TranslationSet struct { RestartToUseNewVersion string RemindMeTomorrow string SkipThisVersion string + TurnOffUpdateReminders string IntroPopupMessage string NonReloadableConfigWarningTitle string NonReloadableConfigWarning string @@ -1529,6 +1530,7 @@ func EnglishTranslationSet() *TranslationSet { RestartToUseNewVersion: "Restart to use {{.newVersion}}", RemindMeTomorrow: "Remind me tomorrow", SkipThisVersion: "Skip this version", + TurnOffUpdateReminders: "To turn off these reminders, set update.method to never in your config file.", IntroPopupMessage: englishIntroPopupMessage, NonReloadableConfigWarningTitle: "Config changed", NonReloadableConfigWarning: englishNonReloadableConfigWarning, diff --git a/pkg/updates/updates.go b/pkg/updates/updates.go index cb3a4709d..936e15183 100644 --- a/pkg/updates/updates.go +++ b/pkg/updates/updates.go @@ -256,6 +256,13 @@ func (u *Updater) IsStartingUp() bool { return u.now().Sub(u.startTime) < startupPeriod } +// RemindersEnabled returns whether lazygit reminds the user of available +// updates. With update.method set to never, it only shows the note in the +// bottom-right corner. +func (u *Updater) RemindersEnabled() bool { + return u.ChecksEnabled() && u.UserConfig().Update.Method != "never" +} + // DueReminder returns the version to remind the user of, or nil if no reminder // is due func (u *Updater) DueReminder(reminder Reminder) *types.VersionNumber { @@ -263,7 +270,7 @@ func (u *Updater) DueReminder(reminder Reminder) *types.VersionNumber { } func (u *Updater) dueReminder(state *config.AppState, reminder Reminder) *types.VersionNumber { - if !u.ChecksEnabled() { + if !u.RemindersEnabled() { return nil } diff --git a/pkg/updates/updates_test.go b/pkg/updates/updates_test.go index d624d7fa2..2f52e744a 100644 --- a/pkg/updates/updates_test.go +++ b/pkg/updates/updates_test.go @@ -351,7 +351,7 @@ func TestIsHandledAfter(t *testing.T) { assert.True(t, updater.IsHandledAfter(shownAt)) } -func TestRemindersAreOffWhenChecksAre(t *testing.T) { +func TestRemindersAreOffWithUpdateMethodNever(t *testing.T) { updater := newTestUpdater(t, nil, "0.66.2", Installation{Kind: InstallKindRelease, ExecutablePath: "/bin/lazygit"}) updater.appState.(*fakeAppStateStore).state.Updates = config.UpdatesState{LatestVersion: "v0.67.0"} updater.UserConfig().Update.Method = "never"