Parent Issue
Part of #109 - Window resize behavior conflicts with component sizing
Problem
The new resize system interacts with multiple existing sizing mechanisms without clear precedence rules:
- FlexLayout's
grow and shrink factors
- Component's
withSize() initial dimensions
- Layout manager's
setBounds() calls
- Parent/child resize propagation
AxisResizeBehavior settings
These systems were not designed to work together and have unclear precedence rules, leading to conflicts.
Tasks
-
Document the intended precedence in CLAUDE.md:
- When does FlexLayout override component size?
- When does AxisResizeBehavior take precedence?
- How do grow/shrink factors interact with FIXED behavior?
- What happens when layout says one size but resize behavior says another?
-
Implement the precedence rules consistently:
- Modify
Component::setBounds() to respect precedence
- Modify
FlexLayout::layout() to respect precedence
- Ensure
onParentResize() follows the rules
-
Add tests that validate precedence:
- FlexLayout with FIXED components
- FlexLayout with FILL components and grow factors
- Conflicting size specifications
Possible Approaches
- Layout managers always win:
setBounds() from layout overrides everything, resize behavior only applies to parent window resizes
- Resize behavior as constraints: Layout managers work within constraints set by resize behavior
- Two-pass system: Calculate layout first, then apply resize behaviors as modifications
- Explicit priority flags: Add priority parameter to resolve conflicts
Success Criteria
Related Code
include/bombfork/prong/core/component.h
include/bombfork/prong/layout/flex_layout.h
CLAUDE.md - Resize Behavior section
Dependencies
Should be worked on after #109.1 and #109.2 are resolved, as it builds on understanding gained from fixing those issues.
Parent Issue
Part of #109 - Window resize behavior conflicts with component sizing
Problem
The new resize system interacts with multiple existing sizing mechanisms without clear precedence rules:
growandshrinkfactorswithSize()initial dimensionssetBounds()callsAxisResizeBehaviorsettingsThese systems were not designed to work together and have unclear precedence rules, leading to conflicts.
Tasks
Document the intended precedence in CLAUDE.md:
Implement the precedence rules consistently:
Component::setBounds()to respect precedenceFlexLayout::layout()to respect precedenceonParentResize()follows the rulesAdd tests that validate precedence:
Possible Approaches
setBounds()from layout overrides everything, resize behavior only applies to parent window resizesSuccess Criteria
Related Code
include/bombfork/prong/core/component.hinclude/bombfork/prong/layout/flex_layout.hCLAUDE.md- Resize Behavior sectionDependencies
Should be worked on after #109.1 and #109.2 are resolved, as it builds on understanding gained from fixing those issues.