Skip to content

560 textfilter window layout is broken#631

Merged
Hirogen merged 4 commits into
Developmentfrom
560-textfilter-window-layout-is-broken
Jun 22, 2026
Merged

560 textfilter window layout is broken#631
Hirogen merged 4 commits into
Developmentfrom
560-textfilter-window-layout-is-broken

Conversation

@Hirogen

@Hirogen Hirogen commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

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

BRUNER Patrick 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.
@Hirogen Hirogen linked an issue Jun 22, 2026 that may be closed by this pull request
@Hirogen Hirogen merged commit 70c09f6 into Development Jun 22, 2026
1 check passed
@Hirogen Hirogen deleted the 560-textfilter-window-layout-is-broken branch June 22, 2026 13:07
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.

Textfilter window layout is broken

1 participant