Skip to content

Conversation

@msynk
Copy link
Member

@msynk msynk commented Dec 19, 2025

closes #11884

Summary by CodeRabbit

Release Notes

  • New Features
    • BitStack component now supports cascading parameters for centralized layout configuration management. Ancestor components can propagate shared configuration including alignment settings (vertical and horizontal), spacing (gap), sizing options (AutoHeight, AutoWidth, AutoSize), growth behavior, wrapping, direction reversal, and element customization to all child BitStack components within the hierarchy.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

Walkthrough

This PR introduces cascading parameter infrastructure for the BitStack component. A new BitStackParams class is created to encapsulate stack configuration parameters, and BitStack is modified to receive these parameters via cascading and apply them through an OnParametersSet override.

Changes

Cohort / File(s) Summary
BitStack component modification
src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs
Adds a CascadingParameters property to receive BitStackParams via cascading parameter, and overrides OnParametersSet() to invoke UpdateParameters() for integrating cascading parameters into the component lifecycle.
BitStackParams class
src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStackParams.cs
New class that encapsulates configuration for BitStack, exposing 17+ parameter properties (Alignment, AutoHeight, AutoSize, AutoWidth, Element, FillContent, FitHeight, FitSize, FitWidth, Gap, Grow, Grows, Horizontal, HorizontalAlign, Reversed, VerticalAlign, Wrap, etc.) and implementing an UpdateParameters(BitStack) method to synchronize configuration into a BitStack instance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • BitStackParams property coverage: Verify that all 17+ property definitions correctly correspond to their equivalents on the BitStack component and that nullable types align with existing property signatures.
  • UpdateParameters logic: Review the repetitive conditional logic in UpdateParameters() to ensure consistent application of HasNotBeenSet() checks and proper builder resets across all properties.
  • Integration verification: Confirm that the cascading parameter name (BitStackParams.ParamName) is correctly set and that the OnParametersSet() override properly chains to base.OnParametersSet().

Poem

🐰 Parameters cascade like leaves in the fall,
BitStack now receives them, configuring all!
With cascading grace, the stacks align,
Shared configuration—a feature divine! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR fully implements the Params infrastructure for BitStack as required by issue #11884, including the new BitStackParams class and cascading parameter integration into BitStack.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing Params infrastructure for BitStack; no unrelated modifications detected.
Title check ✅ Passed The title 'Add Params infrastructure for BitStack (#11884)' clearly and concisely summarizes the main change: implementing Params infrastructure for the BitStack component, which aligns directly with the PR objectives and all code changes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@msynk msynk changed the title add Params infrastructure to BitStack (#11884) add Params infrastructure for BitStack (#11884) Dec 19, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 89d1cdd and 70649b2.

📒 Files selected for processing (2)
  • src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs (2 hunks)
  • src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStackParams.cs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs (3)
src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStackParams.cs (1)
  • BitStackParams (6-246)
src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Card/BitCard.razor.cs (1)
  • DynamicDependency (94-99)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/ChoiceGroup/BitChoiceGroup.razor.cs (1)
  • OnParametersSet (156-170)
src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStackParams.cs (5)
src/BlazorUI/Bit.BlazorUI/Utils/Params/BitComponentBaseParams.cs (2)
  • BitComponentBaseParams (6-144)
  • UpdateBaseParameters (80-143)
src/BlazorUI/Bit.BlazorUI/Utils/Params/BitParams.cs (1)
  • BitParams (8-65)
src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs (1)
  • BitStack (8-213)
src/BlazorUI/Bit.BlazorUI/Extensions/StringExtensions.cs (1)
  • HasValue (5-10)
src/BlazorUI/Bit.BlazorUI/Components/BitComponentBase.cs (1)
  • HasNotBeenSet (349-352)
🪛 GitHub Actions: bit platform CI - BlazorUI
src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs

[error] 177-177: CS0246: The type or namespace name 'DynamicDependencyAttribute' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: build Bit.BlazorUI
src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs

[failure] 177-177:
The type or namespace name 'DynamicDependencyAttribute' could not be found (are you missing a using directive or an assembly reference?)


[failure] 177-177:
The name 'DynamicallyAccessedMemberTypes' does not exist in the current context


[failure] 177-177:
The type or namespace name 'DynamicDependency' could not be found (are you missing a using directive or an assembly reference?)


[failure] 177-177:
The type or namespace name 'DynamicDependencyAttribute' could not be found (are you missing a using directive or an assembly reference?)


[failure] 177-177:
The name 'DynamicallyAccessedMemberTypes' does not exist in the current context


[failure] 177-177:
The type or namespace name 'DynamicDependency' could not be found (are you missing a using directive or an assembly reference?)


[failure] 177-177:
The type or namespace name 'DynamicDependencyAttribute' could not be found (are you missing a using directive or an assembly reference?)


[failure] 177-177:
The name 'DynamicallyAccessedMemberTypes' does not exist in the current context


[failure] 177-177:
The type or namespace name 'DynamicDependency' could not be found (are you missing a using directive or an assembly reference?)


[failure] 177-177:
The type or namespace name 'DynamicDependencyAttribute' could not be found (are you missing a using directive or an assembly reference?)

🔇 Additional comments (4)
src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs (1)

10-19: LGTM!

The cascading parameter property is well-documented and follows the established pattern used by other components like BitCard.

src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStackParams.cs (3)

1-20: LGTM!

The class structure correctly inherits from BitComponentBaseParams and implements IBitComponentParams. The ParamName constant and Name property follow the established pattern used by other component params in the codebase.


24-107: LGTM!

Property definitions correctly mirror the BitStack component parameters with proper nullable types (bool?, string?, BitAlignment?) to allow optional cascading values. Documentation is consistent with the source component.


122-245: LGTM!

The UpdateParameters method correctly follows the established pattern from BitComponentBaseParams.UpdateBaseParameters:

  • Null-guard on entry
  • Calls base UpdateBaseParameters first
  • For each parameter, checks both HasValue/HasValue() and HasNotBeenSet before applying
  • Resets the appropriate builders (StyleBuilder / ClassBuilder) matching the ResetStyleBuilder / ResetClassBuilder attributes on the corresponding BitStack properties

@msynk msynk changed the title add Params infrastructure for BitStack (#11884) Add Params infrastructure for BitStack (#11884) Dec 19, 2025
@msynk msynk merged commit d0155f6 into bitfoundation:develop Dec 19, 2025
3 checks passed
@msynk msynk deleted the 11884-blazorui-stack-params branch December 19, 2025 18:15
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.

The Params infrastructure for the BitStack component

2 participants