Skip to content

feat: add hide/show methods to ResizableController#99

Merged
andyhorn merged 5 commits into
mainfrom
hide-show-methods
May 19, 2026
Merged

feat: add hide/show methods to ResizableController#99
andyhorn merged 5 commits into
mainfrom
hide-show-methods

Conversation

@andyhorn
Copy link
Copy Markdown
Owner

Summary

  • Adds hide, show, setHidden, isHidden, and hiddenIndices to ResizableController — collapses a child and its adjacent divider without removing it from the widget tree.
  • The previous ResizableSize is remembered and restored when the child is shown again. setSizes calls while a child is hidden update the saved size but keep the child collapsed until show is called.
  • setChildren clears any hidden state.
  • Drag logic is intentionally unchanged — hidden children don't participate in resizing (v1 scope per the issue).

Closes #92.

Test plan

  • very_good test passes (existing + new controller tests)
  • dart analyze clean
  • Manual: hide a middle / first / last child and confirm the adjacent divider disappears
  • Manual: setSizes while hidden, then show, restores the most recent set size

🤖 Generated with Claude Code

andyhorn and others added 5 commits May 18, 2026 20:56
Closes #92.

Adds `hide`, `show`, `setHidden`, `isHidden`, and `hiddenIndices` to
`ResizableController`. Hiding a child collapses it to zero size and
omits its adjacent divider; the previous `ResizableSize` is remembered
and restored on `show`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
IDE-style three-pane layout (Explorer / Editor / Outline) with AppBar
buttons that toggle the left and right panels via setHidden, and a
button that calls setSizes while one panel is hidden to demonstrate
that the new size is applied when the panel is shown again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous approach skipped the ResizableContainerDivider entirely
for hidden-adjacent boundaries, which broke ResizableLayout's
performLayout (it iterates children stride-2, assuming strict
child/divider/.../child interleaving). Hiding a child then threw
RangeError when sizes[i ~/ 2] over-indexed the sizes list.

Now: always interleave child + divider in both layout and Flex branches.
ResizableLayout takes a hiddenIndices set and lays out hidden-adjacent
dividers with zero size; the Flex branch swaps them for SizedBox.shrink
so they are invisible and non-interactive. The visual result is the
same (no divider, no space taken) without breaking the layout loop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The resize button used to overwrite all three panels' sizes, snapping the
right panel back to 240px and clobbering any manual drag. Keep the center
as expand so it absorbs the delta, and freeze the right panel at its
current pixel size so the user's drag is preserved. Refs #103.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@andyhorn andyhorn merged commit 6e466da into main May 19, 2026
1 check passed
@andyhorn andyhorn deleted the hide-show-methods branch May 19, 2026 04:53
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.

Make a hide and show method.

1 participant