mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
fixup! Rewrite the update check that u in the status panel starts
Show the release notes as a link in the menu's first line instead of as a menu item. Choosing a menu item closes the menu. If lazygit opened the menu on its own, users might not know how to get it back after reading the release notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3e87e673a0
commit
b7c0fc7b69
2 files changed
+7
-7
No files matched your search
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/jesseduffield/lazygit/pkg/constants"
|
||||
"github.com/jesseduffield/lazygit/pkg/gocui"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/style"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/updates"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
@@ -91,11 +92,14 @@ func (self *UpdateHelper) CheckForUpdateInForeground() error {
|
||||
// a new version. Call it on a worker, because it accesses the file system.
|
||||
func (self *UpdateHelper) updateMenuOptions(newVersion *types.VersionNumber) types.CreateMenuOptions {
|
||||
installation := self.updater.Installation()
|
||||
// The release notes are a link rather than a menu item, because choosing a
|
||||
// menu item closes the menu
|
||||
paragraphs := []string{utils.ResolvePlaceholderString(
|
||||
self.c.Tr.NewVersionAvailable,
|
||||
map[string]string{
|
||||
"newVersion": newVersion.String(),
|
||||
"currentVersion": self.updater.CurrentVersion().String(),
|
||||
"releaseNotes": style.PrintHyperlink(self.c.Tr.ReleaseNotes, constants.Links.Releases),
|
||||
},
|
||||
)}
|
||||
items := []*types.MenuItem{}
|
||||
@@ -144,10 +148,6 @@ func (self *UpdateHelper) updateMenuOptions(newVersion *types.VersionNumber) typ
|
||||
items = append(items, self.openInstallationInstructionsMenuItem())
|
||||
}
|
||||
|
||||
items = append(items, &types.MenuItem{
|
||||
Label: self.c.Tr.OpenReleaseNotes,
|
||||
OnPress: func() error { return self.c.OS().OpenLink(constants.Links.Releases) },
|
||||
})
|
||||
paragraphs = append(paragraphs, self.c.Tr.TurnOffUpdateChecks)
|
||||
|
||||
return types.CreateMenuOptions{
|
||||
|
||||
+3
-3
@@ -284,7 +284,7 @@ type TranslationSet struct {
|
||||
CopyUpdateCommand string
|
||||
UpdateCommandCopiedToClipboard string
|
||||
OpenInstallationInstructions string
|
||||
OpenReleaseNotes string
|
||||
ReleaseNotes string
|
||||
InstallingUpdateStatus string
|
||||
UpdateInstalled string
|
||||
UpdateInstallFailed string
|
||||
@@ -1509,7 +1509,7 @@ func EnglishTranslationSet() *TranslationSet {
|
||||
NoUpdateAvailableTitle: "No update available",
|
||||
NoUpdateAvailable: "You have the latest version ({{.currentVersion}}).",
|
||||
UpdateAvailableTitle: "Update available",
|
||||
NewVersionAvailable: "lazygit {{.newVersion}} is available. You have {{.currentVersion}}.",
|
||||
NewVersionAvailable: "lazygit {{.newVersion}} is available ({{.releaseNotes}}). You have {{.currentVersion}}.",
|
||||
UpdateFolderNotWritable: "lazygit can't update itself because you don't have write access to {{.folder}}. If you install lazygit in a folder that you can write to, it will keep itself up to date from then on.",
|
||||
UpdateWithPackageManager: "You installed lazygit with {{.packageManager}}. To update it, run:\n\n{{.command}}",
|
||||
PackageManagersCanBeSlow: "Package managers sometimes take a few days to get a new version.",
|
||||
@@ -1519,7 +1519,7 @@ func EnglishTranslationSet() *TranslationSet {
|
||||
CopyUpdateCommand: "Copy command",
|
||||
UpdateCommandCopiedToClipboard: "Command copied to clipboard",
|
||||
OpenInstallationInstructions: "Open installation instructions",
|
||||
OpenReleaseNotes: "Open release notes",
|
||||
ReleaseNotes: "Release notes",
|
||||
InstallingUpdateStatus: "Installing {{.newVersion}}",
|
||||
UpdateInstalled: "lazygit {{.newVersion}} is installed. It takes effect the next time you start lazygit.",
|
||||
UpdateInstallFailed: "Couldn't install lazygit {{.newVersion}}: {{.error}}",
|
||||
|
||||
Reference in new issue
Block a user