Demonstrate that toggling whitespace undims the panel beneath the main view

Toggling whitespace re-focuses the side panel to re-render the diff, which
also re-derives that panel's highlight — as though the panel had the focus,
which it doesn't.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stefan Haller 2026-08-21 10:55:38 +02:00
parent dd01d67879
commit e8009599e0
2 changed files with 35 additions and 0 deletions

View file

@ -530,6 +530,7 @@ var tests = []*components.IntegrationTest{
ui.SwitchRepoMovesTheSelection,
ui.SwitchTabFromMenu,
ui.SwitchTabWithPanelJumpKeys,
ui.ToggleWhitespaceKeepsUnfocusedSelectionDimmed,
ui.UnfocusedListHidesSelectionWhenEmptied,
ui.UnfocusedListShowsSelectionWhenFilled,
undo.UndoCheckoutAndDrop,

View file

@ -0,0 +1,34 @@
package ui
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var ToggleWhitespaceKeepsUnfocusedSelectionDimmed = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Toggling whitespace from the main view leaves the panel beneath it showing a dimmed selection",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.CreateFileAndAdd("file1", "one\n")
shell.Commit("one")
shell.UpdateFile("file1", " one\n")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
IsFocused().
Lines(Contains("file1")).
Press(keys.Universal.FocusMainView)
t.Views().Main().
IsFocused().
Press(keys.Universal.ToggleWhitespaceInDiffView)
t.Views().Files().
/* EXPECTED:
SelectionIsInactive()
ACTUAL: */
SelectionIsActive()
},
})