From e8009599e04cd38752909a5e14280ed468b6ac14 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 21 Aug 2026 10:55:38 +0200 Subject: [PATCH] Demonstrate that toggling whitespace undims the panel beneath the main view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- pkg/integration/tests/test_list.go | 1 + ...espace_keeps_unfocused_selection_dimmed.go | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 pkg/integration/tests/ui/toggle_whitespace_keeps_unfocused_selection_dimmed.go diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 67a39e25c..0d25ddba6 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -530,6 +530,7 @@ var tests = []*components.IntegrationTest{ ui.SwitchRepoMovesTheSelection, ui.SwitchTabFromMenu, ui.SwitchTabWithPanelJumpKeys, + ui.ToggleWhitespaceKeepsUnfocusedSelectionDimmed, ui.UnfocusedListHidesSelectionWhenEmptied, ui.UnfocusedListShowsSelectionWhenFilled, undo.UndoCheckoutAndDrop, diff --git a/pkg/integration/tests/ui/toggle_whitespace_keeps_unfocused_selection_dimmed.go b/pkg/integration/tests/ui/toggle_whitespace_keeps_unfocused_selection_dimmed.go new file mode 100644 index 000000000..30223c3b8 --- /dev/null +++ b/pkg/integration/tests/ui/toggle_whitespace_keeps_unfocused_selection_dimmed.go @@ -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() + }, +})