560 textfilter window layout is broken#631
Merged
Merged
Conversation
added 3 commits
June 22, 2026 13:51
…ntrols ("Search", the checkboxes, and especially "Show advanced...") were pushed outside the app.
Root cause: filterSplitContainer's Panel2 holds the "Show advanced..." button whose right edge is at x=649, but Panel2MinSize was only 550. Two code paths grew Panel1 (the text filter) without respecting Panel2's real needs:
OnFilterSplitContainerMouseMove clamped only to 0 < e.X < Width.
AutoResizeFilterBox sized to the widest filter-history entry with no upper bound.
TDD'd fix — extracted the bounds math into a pure, tested helper:
New FilterSplitterLayout.cs — ClampSplitterDistance(...) keeps the splitter within [panel1Min, containerWidth − splitterWidth − panel2Min], with a guard for the degenerate "container too small for both minimums" case (no Math.Clamp min>max throw).
New FilterSplitterLayoutTests.cs — 4 tests written red→green one at a time: within-bounds passthrough, clamp-down (Panel2 keeps min), clamp-up (Panel1 keeps min), degenerate no-throw.
Wired in (LogWindow.cs):
OnFilterSplitContainerMouseMove: now clamps via the helper (also simplified the vertical/horizontal branches).
AutoResizeFilterBox: clamps the auto-size result.
Panel2MinSize 550 → 660 so the "Show advanced" button (right edge 649) always fits, and the framework enforces it too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The text filter could be grown until the Panel2 controls ("Search", the checkboxes, and especially "Show advanced...") were pushed outside the app.
Root cause: filterSplitContainer's Panel2 holds the "Show advanced..." button whose right edge is at x=649, but Panel2MinSize was only 550. Two code paths grew Panel1 (the text filter) without respecting Panel2's real needs:
OnFilterSplitContainerMouseMove clamped only to 0 < e.X < Width.
AutoResizeFilterBox sized to the widest filter-history entry with no upper bound.
TDD'd fix — extracted the bounds math into a pure, tested helper:
New FilterSplitterLayout.cs — ClampSplitterDistance(...) keeps the splitter within [panel1Min, containerWidth − splitterWidth − panel2Min], with a guard for the degenerate "container too small for both minimums" case (no Math.Clamp min>max throw).
New FilterSplitterLayoutTests.cs — 4 tests written red→green one at a time: within-bounds passthrough, clamp-down (Panel2 keeps min), clamp-up (Panel1 keeps min), degenerate no-throw.
Wired in (LogWindow.cs):
OnFilterSplitContainerMouseMove: now clamps via the helper (also simplified the vertical/horizontal branches).
AutoResizeFilterBox: clamps the auto-size result.
Panel2MinSize 550 → 660 so the "Show advanced" button (right edge 649) always fits, and the framework enforces it too.
Added Doublebuffering, so the splitcontainer does not flicker while resizing