Skip to content

Conversation

@andyhorn
Copy link
Owner

@andyhorn andyhorn commented May 9, 2025

This PR adds a new feature that "cascades" negative deltas if the target child reaches its lower bound.

For example, if ChildA is resized down to its lower bound of 100px but the divider is dragged, this delta will be passed to its nearest sibling. If this sibling is at its lower bound, the delta will cascade to the next sibling, and so on.

This resolves #84

@andyhorn andyhorn requested a review from Copilot May 9, 2025 19:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new feature that cascades negative deltas when a resizable child reaches its lower bound, passing the remaining delta to its adjacent siblings. Key changes include:

  • Updating test cases in test/resizable_container_test.dart to validate the cascading behavior.
  • Enhancing the logic in lib/src/resizable_controller.dart to handle both leftward and rightward cascaded delta distribution.
  • Extending the ResizableContainer widget and example apps to enable and showcase the new cascadeNegativeDelta flag.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

File Description
test/resizable_container_test.dart Added tests verifying that negative deltas cascade to sibling containers.
lib/src/resizable_controller.dart Introduced cascadeNegativeDelta logic in delta distribution and refactored helper methods for left & right sibling adjustments.
lib/src/resizable_container.dart Updated widget API to accept the cascadeNegativeDelta flag and propagate it to the controller.
example/** Added new example screen and navigation updates to demonstrate the cascading delta feature.
Comments suppressed due to low confidence (1)

lib/src/resizable_controller.dart:228

  • Review the use of max() here to ensure it correctly computes the effective change, especially when both allowableChange and remainingDelta might be negative. Confirm that this logic meets the intended cascading behavior.
      final effectiveChange = max(allowableChange, remainingDelta);

@andyhorn andyhorn requested a review from Copilot May 9, 2025 19:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new feature that cascades negative deltas to sibling elements when a child reaches its lower bound. Key changes include new widget properties and controller logic to enable cascading behavior as well as updates to tests and example screens.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/resizable_container_test.dart Added tests to verify cascading behavior for negative deltas.
lib/src/resizable_controller.dart Updated controller logic to support negative delta cascading with new distribution functions.
lib/src/resizable_container.dart Introduced a new cascadeNegativeDelta property and updated state management.
example/pubspec.yaml Registered the new cascading_delta example screen.
example/lib/widgets/nav_drawer.dart Added a navigation entry for the cascading delta example.
example/lib/screens/cascading_delta/cascading_delta_screen.dart Created a new example screen demonstrating the cascading delta feature.
example/lib/screens/cascading_delta/cascading_delta_help_dialog.dart Added a help dialog with usage instructions for the new feature.
example/lib/main.dart Updated routes to include the cascading delta screen.
example/lib/file_asset_paths.dart Updated asset paths to include the cascading delta screen asset.

@andyhorn andyhorn merged commit 4b409a1 into main May 9, 2025
1 check passed
@andyhorn andyhorn deleted the feat/resize_cascade branch May 9, 2025 19:52
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.

Cannot adjust the size across subitems

2 participants