Skip to content

MudDialog: Fix Inline Dialog Title Refresh#11504

Merged
ScarletKuro merged 4 commits intoMudBlazor:devfrom
Anu6is:MudDialog-InlineTitleRefresh
Jun 23, 2025
Merged

MudDialog: Fix Inline Dialog Title Refresh#11504
ScarletKuro merged 4 commits intoMudBlazor:devfrom
Anu6is:MudDialog-InlineTitleRefresh

Conversation

@Anu6is
Copy link
Contributor

@Anu6is Anu6is commented Jun 16, 2025

Description

When using an inline dialog, users are unable to access the DialogInstance parameter which is required for refreshing the Dialog Title via a StateHasChanged call. This change automatically calls StateHasChanged on the DialogInstance in cases of inline dialogs, similar to how StateHasChanged is automatically called on the IDialogReference

How Has This Been Tested?

Visually + Unit test

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added the bug Unexpected behavior or functionality not working as intended label Jun 16, 2025
@Anu6is Anu6is requested a review from ScarletKuro June 16, 2025 13:52
@danielchalmers danielchalmers requested a review from Copilot June 16, 2025 19:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds automatic calls to StateHasChanged for inline dialogs so that their title and content update correctly, and includes a new unit test to verify title and progress updates.

  • Forward StateHasChanged calls to inline dialog instances in MudDialog.razor.cs.
  • Add a unit test (Dialog_TitleContent_And_ProgressBar_ShouldUpdate) in DialogTests.cs.
  • Introduce a test component (InlineDialogTitleRefreshTest.razor) to simulate inline dialog behavior.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/MudBlazor/Components/Dialog/MudDialog.razor.cs Forwards render updates to inline DialogInstance.
src/MudBlazor.UnitTests/Components/DialogTests.cs Adds a new test for inline dialog title and progress updates.
src/MudBlazor.UnitTests.Viewer/TestComponents/Dialog/InlineDialogTitleRefreshTest.razor New test component that drives dialog visibility, progress, and title changes.
Comments suppressed due to low confidence (1)

src/MudBlazor.UnitTests/Components/DialogTests.cs:1365

  • Uncomment or replace this with comp1.Render(); after the state changes to force a re-render before assertions—otherwise the title and progress updates may not appear in the DOM.
//comp.Render();

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.16%. Comparing base (5d37790) to head (1cae091).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #11504   +/-   ##
=======================================
  Coverage   91.15%   91.16%           
=======================================
  Files         466      466           
  Lines       14499    14499           
  Branches     2815     2815           
=======================================
+ Hits        13217    13218    +1     
  Misses        644      644           
+ Partials      638      637    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ScarletKuro ScarletKuro merged commit 17e0e56 into MudBlazor:dev Jun 23, 2025
6 checks passed
@Anu6is Anu6is deleted the MudDialog-InlineTitleRefresh branch June 23, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants