Skip to content

Improve BitMessageBox component (#12672)#12674

Merged
msynk merged 2 commits into
bitfoundation:developfrom
msynk:12672-blazorui-messagebox-improvements
Jul 17, 2026
Merged

Improve BitMessageBox component (#12672)#12674
msynk merged 2 commits into
bitfoundation:developfrom
msynk:12672-blazorui-messagebox-improvements

Conversation

@msynk

@msynk msynk commented Jul 16, 2026

Copy link
Copy Markdown
Member

closes #12672

Summary by CodeRabbit

  • New Features
    • Message boxes can now render via either the standard or Pro modal experience, automatically preferring the Pro option when available.
    • Added a way to detect whether a modal container is currently mounted before showing modals.
  • Bug Fixes
    • Improved message box close handling so the close callback consistently works across both modal service types.
  • Documentation
    • Expanded guidance for modal rendering behavior, container requirements, and updated the MessageBox demo with Pro examples and clearer descriptions.

@msynk
msynk requested a review from yasmoradi July 16, 2026 17:49
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0aee1f6d-4cbf-4781-bb30-8d278d3fd1c9

📥 Commits

Reviewing files that changed from the base of the PR and between 75568e2 and 0d58fbb.

📒 Files selected for processing (7)
  • src/BlazorUI/Bit.BlazorUI.Extras/Components/MessageBox/BitMessageBoxService.cs
  • src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModalService.cs
  • src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModalService.cs
  • src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModalServiceBase.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/MessageBox/BitMessageBoxDemo.razor
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/MessageBox/BitMessageBoxDemo.razor.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/MessageBox/BitMessageBoxDemo.razor.samples.cs

Walkthrough

BitMessageBoxService now supports both pro and standard modal services, selecting the mounted implementation and binding close handling to the created modal reference. The demo page and embedded samples add BitProModal and BitProModalService usage examples.

Changes

MessageBox improvements

Layer / File(s) Summary
Modal infrastructure and parameter flow
src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/*, src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModalService.cs
Modal services expose container availability, centralize modal-reference parameter factories, and document container requirements.
Modal service routing
src/BlazorUI/Bit.BlazorUI.Extras/Components/MessageBox/BitMessageBoxService.cs
The service accepts optional modal services, selects the available implementation, throws when neither is available, and wires OnClose to the specific modal reference.
Pro modal demo usage
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/MessageBox/*
The demo adds pro modal state and service flows, updates markup and embedded samples, and renumbers affected examples.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant BitMessageBoxService
  participant BitProModalService
  participant BitModalService
  Caller->>BitMessageBoxService: Show message box
  BitMessageBoxService->>BitProModalService: Show when pro container is available
  BitMessageBoxService->>BitModalService: Show when only classic container is available
  BitProModalService-->>BitMessageBoxService: Return modal reference
  BitModalService-->>BitMessageBoxService: Return modal reference
  BitMessageBoxService-->>Caller: Close callback closes modal reference
Loading

Suggested reviewers: yasmoradi

Poem

A rabbit hops through modal doors,
Pro service opens shiny floors.
Standard waits as fallback near,
Close callbacks make endings clear.
New demos bloom with carrot cheer! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and clearly reflects the main BitMessageBox improvement, though it's broad.
Linked Issues check ✅ Passed The PR adds BitProModalService support to BitMessageBoxService and updates the demo with BitProModal and BitProModalService usage.
Out of Scope Changes check ✅ Passed The additional modal base/service changes and docs support the message box update and don't appear unrelated.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@msynk

msynk commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full-review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

@msynk: I’ll perform a full review of all changes in this PR, including the BitMessageBoxService integration and demo updates.

✅ Action performed

Full review finished.

@msynk

msynk commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full-review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

@msynk: I’ll perform a full review of all changes in this PR, including the BitMessageBoxService integration and demo updates.

✅ Action performed

Full review finished.

@msynk
msynk merged commit d43cef3 into bitfoundation:develop Jul 17, 2026
3 checks passed
@msynk
msynk deleted the 12672-blazorui-messagebox-improvements branch July 17, 2026 13:02
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 BitMessageBox improvements

1 participant