-
Notifications
You must be signed in to change notification settings - Fork 17
feat: cascade negative deltas #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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);
There was a problem hiding this 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. |
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