-
-
Notifications
You must be signed in to change notification settings - Fork 254
Add PreserveCalloutWidth option to callout infrastructure (#11505) #11506
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
Add PreserveCalloutWidth option to callout infrastructure (#11505) #11506
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis PR introduces a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Component as Callout Component
participant Interop as JS Interop
participant Callouts as Callouts.ts
User->>Component: ToggleCallout()
Component->>Interop: BitCalloutToggleCallout(..., preserveCalloutWidth, ...)
Interop->>Callouts: toggle(..., preserveCalloutWidth, ...)
rect rgb(220, 240, 255)
Note over Callouts: New Width Preservation Logic
alt preserveCalloutWidth == true
Callouts->>Callouts: newWidth = min(componentWidth, calloutWidth)
Callouts->>Callouts: Apply newWidth to callout
end
end
Callouts->>Callouts: Handle visibility & positioning
Callouts->>Component: Return result
Component->>User: Callout toggled with preserved width
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
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.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/CalloutsJsRuntimeExtensions.cs (1)
26-42: Critical: MissingpreserveCalloutWidthparameter in JS invocation.The
preserveCalloutWidthparameter is declared in the method signature (line 23) but is not passed to the JavaScript function. This will cause the width preservation feature to not work at all.Apply this diff to include the missing parameter:
return jsRuntime.Invoke<bool>("BitBlazorUI.Callouts.toggle", dotnetObj, componentId, component, calloutId, callout, isCalloutOpen, responsiveMode, dropDirection, isRtl, scrollContainerId, scrollOffset, headerId, footerId, setCalloutWidth, + preserveCalloutWidth, maxWindowWidth);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (13)
src/BlazorUI/Bit.BlazorUI/Components/Buttons/MenuButton/BitMenuButton.razor.cs(1 hunks)src/BlazorUI/Bit.BlazorUI/Components/Inputs/CircularTimePicker/BitCircularTimePicker.razor.cs(1 hunks)src/BlazorUI/Bit.BlazorUI/Components/Inputs/DatePicker/BitDatePicker.razor.cs(1 hunks)src/BlazorUI/Bit.BlazorUI/Components/Inputs/DateRangePicker/BitDateRangePicker.razor.cs(1 hunks)src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs(2 hunks)src/BlazorUI/Bit.BlazorUI/Components/Inputs/SearchBox/BitSearchBox.razor.cs(1 hunks)src/BlazorUI/Bit.BlazorUI/Components/Inputs/TimePicker/BitTimePicker.razor.cs(2 hunks)src/BlazorUI/Bit.BlazorUI/Components/Navs/Breadcrumb/BitBreadcrumb.razor.cs(1 hunks)src/BlazorUI/Bit.BlazorUI/Components/Navs/DropMenu/BitDropMenu.razor.cs(1 hunks)src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Callout/BitCallout.razor.cs(2 hunks)src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/CalloutsJsRuntimeExtensions.cs(1 hunks)src/BlazorUI/Bit.BlazorUI/Scripts/Callouts.ts(2 hunks)src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor.cs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build and test
🔇 Additional comments (11)
src/BlazorUI/Bit.BlazorUI/Scripts/Callouts.ts (1)
22-22: LGTM! Width preservation logic is correct.The new
preserveCalloutWidthparameter and its implementation look good. The logic correctly computes the minimum of component and callout width to ensure the callout doesn't exceed the component's width when preservation is enabled.Also applies to: 98-102
src/BlazorUI/Bit.BlazorUI/Components/Navs/DropMenu/BitDropMenu.razor.cs (1)
206-223: LGTM! Consistent parameter passing.The addition of
preserveCalloutWidth: falseis consistent with the broader refactor and correctly uses named parameters for clarity.src/BlazorUI/Bit.BlazorUI/Components/Inputs/SearchBox/BitSearchBox.razor.cs (1)
523-540: LGTM! Named parameters improve readability.The refactor to named parameters makes the interop call much clearer and easier to maintain. The addition of width-related parameters is consistent with the PR objectives.
src/BlazorUI/Bit.BlazorUI/Components/Inputs/DateRangePicker/BitDateRangePicker.razor.cs (1)
1927-1944: LGTM! Consistent refactor to named parameters.The change follows the same pattern as other components in the PR, improving code clarity through named parameters.
src/BlazorUI/Bit.BlazorUI/Components/Buttons/MenuButton/BitMenuButton.razor.cs (1)
581-598: LGTM! Named parameters improve maintainability.The refactor to named parameters is consistent with the broader changes in this PR and makes the code more maintainable.
src/BlazorUI/Bit.BlazorUI/Components/Inputs/DatePicker/BitDatePicker.razor.cs (1)
1404-1421: LGTM! Consistent with project-wide refactor.The change to named parameters is consistent and correct, aligning with the broader improvements in this PR.
src/BlazorUI/Bit.BlazorUI/Components/Inputs/CircularTimePicker/BitCircularTimePicker.razor.cs (1)
539-556: LGTM! Final component refactored consistently.The refactor to named parameters completes the consistent pattern across all components, improving code quality and maintainability.
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor.cs (1)
96-101: LGTM!The new
PreserveCalloutWidthparameter is well-documented and correctly defined.src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Callout/BitCallout.razor.cs (1)
82-84: LGTM!The
PreserveCalloutWidthparameter is correctly defined and properly passed to the JS interop layer.Also applies to: 208-208
src/BlazorUI/Bit.BlazorUI/Components/Navs/Breadcrumb/BitBreadcrumb.razor.cs (1)
610-626: LGTM!The refactoring to named parameters improves clarity. The default values for
setCalloutWidth: falseandpreserveCalloutWidth: falseare appropriate for this component.src/BlazorUI/Bit.BlazorUI/Components/Inputs/TimePicker/BitTimePicker.razor.cs (1)
435-451: LGTM!The refactoring to named parameters improves clarity. The values
setCalloutWidth: trueandpreserveCalloutWidth: falseare appropriate for the TimePicker component.
closes #11505
Summary by CodeRabbit