diff --git a/pkg/gui/information_panel.go b/pkg/gui/information_panel.go index 3eac1e77c..03e4dd878 100644 --- a/pkg/gui/information_panel.go +++ b/pkg/gui/information_panel.go @@ -14,8 +14,8 @@ func (gui *Gui) informationStr() string { } if gui.g.Mouse { - donate := style.FgMagenta.SetUnderline().Sprint(gui.c.Tr.Donate) - askQuestion := style.FgYellow.SetUnderline().Sprint(gui.c.Tr.AskQuestion) + donate := style.FgMagenta.Sprint(style.PrintHyperlink(gui.c.Tr.Donate, constants.Links.Donate)) + askQuestion := style.FgYellow.Sprint(style.PrintHyperlink(gui.c.Tr.AskQuestion, constants.Links.Discussions)) return fmt.Sprintf("%s %s %s", donate, askQuestion, gui.Config.GetVersion()) } else { return gui.Config.GetVersion() @@ -39,28 +39,5 @@ func (gui *Gui) handleInfoClick() error { return activeMode.Reset() } - var title, url string - - // if we're not in an active mode we show the donate button - if cx <= utils.StringWidth(gui.c.Tr.Donate) { - url = constants.Links.Donate - title = gui.c.Tr.Donate - } else if cx <= utils.StringWidth(gui.c.Tr.Donate)+1+utils.StringWidth(gui.c.Tr.AskQuestion) { - url = constants.Links.Discussions - title = gui.c.Tr.AskQuestion - } - err := gui.os.OpenLink(url) - if err != nil { - // Opening the link via the OS failed for some reason. (For example, this - // can happen if the `os.openLink` config key references a command that - // doesn't exist, or that errors when called.) - // - // In that case, rather than crash the app, fall back to simply showing a - // dialog asking the user to visit the URL. - placeholders := map[string]string{"url": url} - message := utils.ResolvePlaceholderString(gui.c.Tr.PleaseGoToURL, placeholders) - return gui.c.Alert(title, message) - } - return nil } diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index cdc1017c0..b1eff335e 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -785,7 +785,6 @@ type TranslationSet struct { MarkAsBaseCommitTooltip string MarkedCommitMarker string FailedToOpenURL string - PleaseGoToURL string InvalidLazygitEditURL string NoCopiedCommits string DisabledMenuItemPrefix string @@ -1773,7 +1772,6 @@ func EnglishTranslationSet() *TranslationSet { MarkAsBaseCommitTooltip: "Select a base commit for the next rebase. When you rebase onto a branch, only commits above the base commit will be brought across. This uses the `git rebase --onto` command.", MarkedCommitMarker: "↑↑↑ Will rebase from here ↑↑↑", FailedToOpenURL: "Failed to open URL %s\n\nError: %v", - PleaseGoToURL: "Please go to {{.url}}", InvalidLazygitEditURL: "Invalid lazygit-edit URL format: %s", DisabledMenuItemPrefix: "Disabled: ", NoCopiedCommits: "No copied commits", diff --git a/pkg/integration/tests/ui/open_link_failure.go b/pkg/integration/tests/ui/open_link_failure.go index 0bb45fb59..c4b27241e 100644 --- a/pkg/integration/tests/ui/open_link_failure.go +++ b/pkg/integration/tests/ui/open_link_failure.go @@ -17,8 +17,8 @@ var OpenLinkFailure = NewIntegrationTest(NewIntegrationTestArgs{ t.Views().Information().Click(0, 0) t.ExpectPopup().Confirmation(). - Title(Equals("Donate")). - Content(Equals("Please go to https://github.com/sponsors/jesseduffield")). + Title(Equals("Error")). + Content(Equals("Failed to open URL https://github.com/sponsors/jesseduffield\n\nError: exit status 42")). Confirm() }, })