diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go index de3bdbe9b..bcdc0edfc 100644 --- a/pkg/gui/layout.go +++ b/pkg/gui/layout.go @@ -154,7 +154,14 @@ func (gui *Gui) layout(g *gocui.Gui) error { if err != nil && !errors.Is(err, gocui.ErrUnknownView) { return err } - view.Visible = gui.helpers.Window.GetViewNameForWindow(context.GetWindowName()) == context.GetViewName() + // A transient view is visible if it is the view its window is currently + // showing — but only if that window is part of the layout at all. For a + // window without dimensions, setViewFromDimensions parks the view at full + // screen size in the background, so making it visible would cover all + // windows below it. + _, windowHasDimensions := viewDimensions[context.GetWindowName()] + view.Visible = windowHasDimensions && + gui.helpers.Window.GetViewNameForWindow(context.GetWindowName()) == context.GetViewName() } if gui.PrevLayout.Information != informationStr { diff --git a/pkg/integration/tests/ui/branches_not_first_tab.go b/pkg/integration/tests/ui/branches_not_first_tab.go index 0e60b5ed9..47e8a4fd5 100644 --- a/pkg/integration/tests/ui/branches_not_first_tab.go +++ b/pkg/integration/tests/ui/branches_not_first_tab.go @@ -25,10 +25,7 @@ var BranchesNotFirstTab = NewIntegrationTest(NewIntegrationTestArgs{ // drilling into a remote or a branch; at startup both must be hidden, // or they'd cover the side panels. t.Views().RemoteBranches(). - /* EXPECTED: IsInvisible() - ACTUAL: */ - IsVisible() t.Views().SubCommits().IsInvisible() }, }) diff --git a/pkg/integration/tests/ui/commits_not_first_tab.go b/pkg/integration/tests/ui/commits_not_first_tab.go index db50e4c08..505aa4307 100644 --- a/pkg/integration/tests/ui/commits_not_first_tab.go +++ b/pkg/integration/tests/ui/commits_not_first_tab.go @@ -24,9 +24,6 @@ var CommitsNotFirstTab = NewIntegrationTest(NewIntegrationTestArgs{ // The commit files view is only shown after drilling into a commit; at // startup it must be hidden, or it'd cover the side panels. t.Views().CommitFiles(). - /* EXPECTED: IsInvisible() - ACTUAL: */ - IsVisible() }, })