Skip to content

Conversation

@msynk
Copy link
Member

@msynk msynk commented Oct 30, 2025

closes #11507

Summary by CodeRabbit

  • Refactor
    • Renamed the PreserveCalloutWidth parameter to FixedCalloutWidth in Callout and related dropdown/menu components. Update your code if currently using this parameter.

@coderabbitai
Copy link

coderabbitai bot commented Oct 30, 2025

Walkthrough

This PR systematically renames the PreserveCalloutWidth parameter to FixedCalloutWidth across the BitCallout component ecosystem, including the base component definition, related extension methods, TypeScript implementation, and all dependent components. The rename better reflects the parameter's semantic purpose of fixing the callout width.

Changes

Cohort / File(s) Summary
Component Parameter Rename
src/BlazorUI/Bit.BlazorUI/Components/Buttons/MenuButton/BitMenuButton.razor.cs, src/BlazorUI/Bit.BlazorUI/Components/Inputs/CircularTimePicker/BitCircularTimePicker.razor.cs, src/BlazorUI/Bit.BlazorUI/Components/Inputs/DatePicker/BitDatePicker.razor.cs, src/BlazorUI/Bit.BlazorUI/Components/Inputs/DateRangePicker/BitDateRangePicker.razor.cs, src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs, src/BlazorUI/Bit.BlazorUI/Components/Inputs/SearchBox/BitSearchBox.razor.cs, src/BlazorUI/Bit.BlazorUI/Components/Inputs/TimePicker/BitTimePicker.razor.cs, src/BlazorUI/Bit.BlazorUI/Components/Navs/Breadcrumb/BitBreadcrumb.razor.cs, src/BlazorUI/Bit.BlazorUI/Components/Navs/DropMenu/BitDropMenu.razor.cs
Updated JS interop calls to use fixedCalloutWidth parameter instead of preserveCalloutWidth in BitCalloutToggleCallout invocations.
Base Component Update
src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Callout/BitCallout.razor.cs
Renamed public parameter from PreserveCalloutWidth to FixedCalloutWidth; updated corresponding JS interop call.
Extension Method Signature
src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/CalloutsJsRuntimeExtensions.cs
Renamed parameter from preserveCalloutWidth to fixedCalloutWidth in BitCalloutToggleCallout<T> method signature.
TypeScript Implementation
src/BlazorUI/Bit.BlazorUI/Scripts/Callouts.ts
Renamed parameter from preserveCalloutWidth to fixedCalloutWidth in Callouts.toggle method; logic unchanged.
Demo Component
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor.cs
Updated parameter metadata from PreserveCalloutWidth to FixedCalloutWidth; corrected documentation spelling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Rationale: Homogeneous, repetitive parameter renames across multiple files following a consistent pattern. Each change is straightforward and mechanical.
  • Area of focus:
    • Verify all dependent components were updated consistently
    • Confirm the base component parameter change in BitCallout.razor.cs aligns with public API documentation
    • Validate TypeScript implementation matches the new parameter name

Poem

🐰 A callout width renamed with care,
From "preserve" to "fixed" beyond compare,
Nine components now march in line,
With better names that truly shine,
The semantic soul now sings so bright! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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.
Title Check ✅ Passed The PR title "Rename PreserveCalloutWidh parameter to FixedCalloutWidth in callouts (#11507)" directly and clearly describes the primary change in the changeset. The title accurately reflects that the PR renames a parameter from PreserveCalloutWidth to FixedCalloutWidth across multiple callout-related components. Although there is a minor typo in the title ("PreserveCalloutWidh" instead of "PreserveCalloutWidth"), the title is still clear, concise, and specifically conveys the main objective of the changeset.
Linked Issues Check ✅ Passed The pull request fully satisfies the objective specified in linked issue #11507. The parameter has been systematically renamed from PreserveCalloutWidth to FixedCalloutWidth across all relevant files including component files (BitMenuButton, BitCircularTimePicker, BitDatePicker, BitDateRangePicker, BitDropdown, BitSearchBox, BitTimePicker, BitBreadcrumb, BitDropMenu, and BitCallout), the JS interop extension (CalloutsJsRuntimeExtensions.cs), the TypeScript implementation (Callouts.ts), and the demo component. The public API has been properly updated in BitCallout where the old parameter was removed and the new one added.
Out of Scope Changes Check ✅ Passed The changes are predominantly aligned with the stated objective of renaming the PreserveCalloutWidth parameter to FixedCalloutWidth. All modified files contain parameter renames that directly support this objective across the component layer, interop layer, and TypeScript implementation. The raw summary notes a minor spelling correction in the BitCalloutDemo.razor.cs documentation ("openning" to "opening"), which is a trivial incidental fix within a file being updated for the parameter rename and does not introduce unexpected functionality 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.

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

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/Components/Inputs/Dropdown/BitDropdown.razor.cs (1)

253-253: Rename the public parameter to match the new naming convention.

While the interop call has been updated to use fixedCalloutWidth, this component still exposes a public parameter named PreserveCalloutWidth. For consistency with the broader rename, this should also be updated to FixedCalloutWidth.

Apply this change to rename the parameter:

     /// <summary>
-    /// Disables automatic setting of the callout width and preserves its original width.
+    /// Forces the callout to preserve its component's original width.
     /// </summary>
-    [Parameter] public bool PreserveCalloutWidth { get; set; }
+    [Parameter] public bool FixedCalloutWidth { get; set; }

And update its usage at line 1189:

             headerId: CalloutHeaderTemplate is not null ? _headerId : "",
             footerId: CalloutFooterTemplate is not null ? _footerId : "",
-            setCalloutWidth: PreserveCalloutWidth is false,
+            setCalloutWidth: FixedCalloutWidth is false,
             fixedCalloutWidth: false,
             maxWindowWidth: 0);
🧹 Nitpick comments (1)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor.cs (1)

61-66: Consider updating the description to align with the new parameter name.

The parameter was renamed from PreserveCalloutWidth to FixedCalloutWidth, but the description still uses "preserve its component's original width." This creates a semantic mismatch that could confuse developers.

Consider revising the description to better reflect "fixed" semantics:

-            Description = "Forces the callout to preserve its component's original width."
+            Description = "Forces the callout to use a fixed width matching its component's width."
📜 Review details

Configuration used: CodeRabbit 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 cc68567 and 9e33ae7.

📒 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 (1 hunks)
  • src/BlazorUI/Bit.BlazorUI/Components/Inputs/SearchBox/BitSearchBox.razor.cs (1 hunks)
  • src/BlazorUI/Bit.BlazorUI/Components/Inputs/TimePicker/BitTimePicker.razor.cs (1 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 (3 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 (2 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 (12)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor.cs (1)

107-107: LGTM!

Good catch fixing the typo "openning" → "opening".

src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/CalloutsJsRuntimeExtensions.cs (1)

7-44: LGTM!

The parameter rename from preserveCalloutWidth to fixedCalloutWidth is correctly applied in both the method signature and the JS interop invocation.

src/BlazorUI/Bit.BlazorUI/Components/Inputs/CircularTimePicker/BitCircularTimePicker.razor.cs (1)

539-556: LGTM!

The parameter rename from preserveCalloutWidth to fixedCalloutWidth is correctly applied in the BitCalloutToggleCallout invocation.

src/BlazorUI/Bit.BlazorUI/Components/Navs/DropMenu/BitDropMenu.razor.cs (1)

206-223: LGTM!

The parameter rename from preserveCalloutWidth to fixedCalloutWidth is correctly applied in the BitCalloutToggleCallout invocation.

src/BlazorUI/Bit.BlazorUI/Components/Inputs/TimePicker/BitTimePicker.razor.cs (1)

435-452: LGTM!

The parameter rename from preserveCalloutWidth to fixedCalloutWidth is correctly applied in the BitCalloutToggleCallout invocation.

src/BlazorUI/Bit.BlazorUI/Components/Buttons/MenuButton/BitMenuButton.razor.cs (1)

581-598: LGTM!

The parameter rename from preserveCalloutWidth to fixedCalloutWidth is correctly applied in the BitCalloutToggleCallout invocation.

src/BlazorUI/Bit.BlazorUI/Components/Inputs/SearchBox/BitSearchBox.razor.cs (1)

523-540: LGTM!

The parameter rename from preserveCalloutWidth to fixedCalloutWidth is correctly applied in the BitCalloutToggleCallout invocation.

src/BlazorUI/Bit.BlazorUI/Components/Inputs/DateRangePicker/BitDateRangePicker.razor.cs (1)

1927-1944: LGTM!

The parameter rename from preserveCalloutWidth to fixedCalloutWidth is correctly applied in the BitCalloutToggleCallout invocation.

src/BlazorUI/Bit.BlazorUI/Components/Navs/Breadcrumb/BitBreadcrumb.razor.cs (1)

625-625: LGTM! Parameter rename applied correctly.

The interop call has been updated to use fixedCalloutWidth instead of preserveCalloutWidth, maintaining the same value (false) and behavior.

src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs (1)

1190-1190: Interop call parameter updated correctly.

The call to BitCalloutToggleCallout now uses fixedCalloutWidth instead of preserveCalloutWidth, maintaining the same behavior.

src/BlazorUI/Bit.BlazorUI/Components/Inputs/DatePicker/BitDatePicker.razor.cs (1)

1419-1419: LGTM! Parameter rename applied correctly.

The interop call has been updated to use fixedCalloutWidth instead of preserveCalloutWidth, maintaining the same value and behavior.

src/BlazorUI/Bit.BlazorUI/Scripts/Callouts.ts (1)

22-22: LGTM! TypeScript parameter rename aligns with C# changes.

The parameter has been renamed from preserveCalloutWidth to fixedCalloutWidth in both the function signature (line 22) and its usage (line 98). The logic remains unchanged, and the new name better describes the behavior of constraining the callout width to the minimum of the component and callout widths.

Also applies to: 98-102

@msynk msynk merged commit e18d8df into bitfoundation:develop Oct 30, 2025
3 checks passed
@msynk msynk deleted the 11507-blazorui-callout-fixedcalloutwidth branch October 30, 2025 05:42
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 PreserveCalloutWidth is not a proper name for the specific new option of the BitCallout

1 participant