Skip to content

fix: preserve user-selected half screen mode when clearing filters#5361

Open
SergioChan wants to merge 1 commit intojesseduffield:masterfrom
SergioChan:fix-5179-preserve-half-screen
Open

fix: preserve user-selected half screen mode when clearing filters#5361
SergioChan wants to merge 1 commit intojesseduffield:masterfrom
SergioChan:fix-5179-preserve-half-screen

Conversation

@SergioChan
Copy link

Summary

Fixes a screen-mode regression when exiting commit filtering.

Closes #5179.

When users start filtering from screenMode: half, clearing the filter should keep the UI in half mode. Instead, Lazygit switched back to normal mode.

Root cause

ModeHelper.ClearFiltering() always converted SCREEN_HALF -> SCREEN_NORMAL on exit, without distinguishing:

  • half mode that was entered automatically for filtering, vs
  • half mode explicitly configured by the user.

What changed

  • Track whether entering filtering actually changed screen mode (normal -> half) using a new screenModeChanged flag in filtering mode state.
  • Only restore half -> normal on filter clear when that flag is true.
  • Preserve this flag while changing filter type/path during an active filtering session.
  • Added a unit test for filtering-mode state reset behavior.

Validation

  • go test ./pkg/gui/modes/filtering ./pkg/gui/controllers/...

All tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

screenMode: half does not apply after the filter is reset

1 participant