Skip to content

Conversation

@msynk
Copy link
Member

@msynk msynk commented Jul 11, 2025

closes #10628

Summary by CodeRabbit

  • New Features

    • Enhanced the callout component with new options for specifying header and footer IDs, maximum window width, scroll container ID, scroll offset, and the ability to set callout width.
    • Added a demo showcasing scrollable content within the callout using the new scroll container property.
  • Documentation

    • Updated demo examples to illustrate the new callout features and usage scenarios.

@msynk msynk requested a review from Cyrus-Sushiant July 11, 2025 11:18
@coderabbitai
Copy link

coderabbitai bot commented Jul 11, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The BitCallout component and related code have been updated to introduce new parameters for enhanced scroll and sizing control, including support for specifying scroll container IDs and offsets. The JavaScript and C# interop signatures were updated for consistency. Demo examples were added to illustrate the new scroll handling capabilities.

Changes

File(s) Change Summary
src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Callout/BitCallout.razor.cs Added new public parameters: FooterId, HeaderId, MaxWindowWidth, SetCalloutWidth, ScrollContainerId, ScrollOffset; updated JS interop call to use these.
src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/CalloutsJsRuntimeExtensions.cs Renamed parameter from maxWidth to maxWindowWidth in BitCalloutToggleCallout and JS interop call.
src/BlazorUI/Bit.BlazorUI/Scripts/Callouts.ts Renamed toggle method parameter from maxWidth to maxWindowWidth; updated logic to use new parameter.
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor Refactored demo layout; added new example demonstrating ScrollContainerId usage.
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor.cs Added new parameters for demo: FooterId, HeaderId, SetCalloutWidth, ScrollContainerId, ScrollOffset; added Razor code for new scroll demo.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BlazorApp
    participant BitCallout (C#)
    participant JSInterop
    participant Callouts (JS)

    User->>BlazorApp: Interacts to open BitCallout
    BlazorApp->>BitCallout (C#): ToggleCallout()
    BitCallout (C#)->>JSInterop: Invoke BitCalloutToggleCallout with new parameters
    JSInterop->>Callouts (JS): Call toggle with FooterId, HeaderId, MaxWindowWidth, SetCalloutWidth, ScrollContainerId, ScrollOffset
    Callouts (JS)-->>JSInterop: Handles positioning and scroll logic
    JSInterop-->>BitCallout (C#): JS operation completes
Loading

Assessment against linked issues

Objective Addressed Explanation
Prevent scrolling content overflow inside BitCallout from closing the callout (#10628)
Add ability to specify scroll container and offset for BitCallout positioning (#10628)
Demo and document new scroll handling features in BitCallout (#10628)

Poem

In the meadow of code, a scroll did appear,
No more will a callout vanish in fear!
With IDs and offsets, the content stays bright,
Rabbits can scroll through the day and the night.
🐇✨
Hooray for a fix that keeps popups in sight!

✨ Finishing Touches
🧪 Generate unit tests
  • 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (3)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor (1)

120-120: Fix typo in demo description

There's a typo in the demo description: "Utilizaing" should be "Utilizing".

-        <div>Utilizaing the ScrollContainerId one can enable scrolling the content of the callout.</div>
+        <div>Utilizing the ScrollContainerId one can enable scrolling the content of the callout.</div>
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor.cs (1)

61-66: Fix typos in parameter descriptions

Several typos need correction in the parameter descriptions:

-            Description = "The id of the footer element that renders at the end of the scrolling container of the callout contnet."
+            Description = "The id of the footer element that renders at the end of the scrolling container of the callout content."
-            Description = "The id of the header element that renders at the top of the scrolling container of the callout contnet."
+            Description = "The id of the header element that renders at the top of the scrolling container of the callout content."
-            Description = "Force the callout to set its content container width while openning it based on the available space and actual content."
+            Description = "Force the callout to set its content container width while opening it based on the available space and actual content."
-            Description = "The vertical offset of the scroll container to consider in the positining and height calculation of the callout."
+            Description = "The vertical offset of the scroll container to consider in the positioning and height calculation of the callout."

Also applies to: 68-73, 89-94, 96-101, 103-108

src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Callout/BitCallout.razor.cs (1)

53-56: Fix typos in parameter documentation

Several typos need correction in the XML documentation:

-    /// The id of the footer element that renders at the end of the scrolling container of the callout contnet.
+    /// The id of the footer element that renders at the end of the scrolling container of the callout content.
-    /// The id of the header element that renders at the top of the scrolling container of the callout contnet.
+    /// The id of the header element that renders at the top of the scrolling container of the callout content.
-    /// The max window width to consider when calculating the position of the callout before openning.
+    /// The max window width to consider when calculating the position of the callout before opening.
-    /// Force the callout to set its content container width while openning it based on the available space and actual content.
+    /// Force the callout to set its content container width while opening it based on the available space and actual content.
-    /// The vertical offset of the scroll container to consider in the positining and height calculation of the callout.
+    /// The vertical offset of the scroll container to consider in the positioning and height calculation of the callout.

Also applies to: 58-61, 71-74, 81-84, 86-89, 91-94

📜 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 17e153e and 81abf4b.

📒 Files selected for processing (5)
  • src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Callout/BitCallout.razor.cs (3 hunks)
  • src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/CalloutsJsRuntimeExtensions.cs (2 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 (1 hunks)
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor.cs (3 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 (6)
src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/CalloutsJsRuntimeExtensions.cs (1)

23-23: LGTM: Parameter rename improves clarity

The parameter rename from maxWidth to maxWindowWidth is more descriptive and aligns with the updated component API. The change maintains consistency across the interop boundary.

Also applies to: 40-40

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

22-22: LGTM: Consistent parameter renaming

The parameter rename from maxWidth to maxWindowWidth maintains consistency with the C# component changes. The logic remains functionally equivalent while using more descriptive naming.

Also applies to: 113-114

src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor (2)

82-116: LGTM: Improved demo structure

The refactoring to remove unnecessary wrapping divs improves code cleanliness while maintaining the same functionality.


119-138: LGTM: Well-structured ScrollContainerId demo

The new demo effectively demonstrates the ScrollContainerId functionality with a comprehensive example showing scrollable content within the callout.

src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Callout/BitCalloutDemo.razor.cs (1)

333-349: LGTM: New demo example code is well-structured

The new ScrollContainerId demo code properly demonstrates the functionality with clear markup and appropriate styling.

src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Callout/BitCallout.razor.cs (1)

188-203: LGTM: Well-structured JS interop call with named parameters

The updated ToggleCallout method properly passes all the new parameters to the JavaScript interop. The use of named parameters improves readability and maintainability. The null coalescing operators provide appropriate default values.

@msynk msynk merged commit 77ae48a into bitfoundation:develop Jul 11, 2025
3 checks passed
@msynk msynk deleted the 10628-blazorui-missing-callout-features branch July 11, 2025 14:11
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.

Scrolling content overflow inside BitCallout closes the callout

2 participants