Skip to content

Fix usages of MudGlobal.Rounded#10957

Merged
henon merged 2 commits intoMudBlazor:devfrom
Devqon:fix/rounded-settings
Mar 4, 2025
Merged

Fix usages of MudGlobal.Rounded#10957
henon merged 2 commits intoMudBlazor:devfrom
Devqon:fix/rounded-settings

Conversation

@Devqon
Copy link
Contributor

@Devqon Devqon commented Mar 4, 2025

Description

Some components do not make use of the MudGlobal.Rounded property properly.
This is a follow-up for #10944 that was only targeted at the MudProgressLinear.

Added consistency for components:

  • MudAvatar (+ MudAvatarGroup)
  • MudNavMenu (documentation only)
  • MudProgressCircular
  • MudProgressLinear (documentation only)
  • MudTabs (documentation only)

How Has This Been Tested?

  • Tested manually using the MudBlazor.Docs.Server by setting the MudGlobal.Rounded to true

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 bug Unexpected behavior or functionality not working as intended PR: needs review labels Mar 4, 2025
@Devqon
Copy link
Contributor Author

Devqon commented Mar 4, 2025

@henon

Comment on lines +70 to 88
/// Can be overridden by <see cref="MudGlobal.Rounded"/>
/// When <c>true</c>, the <c>border-radius</c> CSS style is set to <c>0</c>.
/// </remarks>
[Parameter]
[Category(CategoryTypes.AvatarGroup.Appearance)]
public bool MaxSquare { get; set; }
public bool MaxSquare { get; set; } = MudGlobal.Rounded == false;

/// <summary>
/// Shows rounded corners when the number of avatars exceeds <see cref="Max"/>.
/// </summary>
/// <remarks>
/// Defaults to <c>false</c>. When <c>true</c>, the <c>border-radius</c> style is set to the theme's default value.
/// Defaults to <c>false</c>.
/// Can be overridden by <see cref="MudGlobal.Rounded"/>
/// When <c>true</c>, the <c>border-radius</c> style is set to the theme's default value.
/// </remarks>
[Parameter]
[Category(CategoryTypes.AvatarGroup.Appearance)]
public bool MaxRounded { get; set; }
public bool MaxRounded { get; set; } = MudGlobal.Rounded == true;

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we 100% sure of this automatism?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seemed to me that this uses the same concepts as other places; explicit squared styling when MudGlobal.Rounded is explicitly equal to false. I do not see why this one would be different?

@henon henon requested a review from Anu6is March 4, 2025 14:03
Copy link
Contributor

@Anu6is Anu6is left a comment

Choose a reason for hiding this comment

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

I'm ok with the changes in general except for MaxSquare.
Do you have a particular reason for that change?

[Parameter]
[Category(CategoryTypes.AvatarGroup.Appearance)]
public bool MaxSquare { get; set; }
public bool MaxSquare { get; set; } = MudGlobal.Rounded == false;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this change is necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seemed to me that this uses the same concepts as other places; explicit squared styling when MudGlobal.Rounded is explicitly equal to false. I do not see why this one would be different?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, I think my initial concern was it changes the default behavior, but since the global values is nullable, this should still result in the default being false.

@henon
Copy link
Contributor

henon commented Mar 4, 2025

The failing test seems unrelated:

  Failed Open_CloseBySelectingADate_CheckClosed_Check_DateChangedCount [117 ms]
  Error Message:
   Expected returnDate to be <2025-03-23>, but found <2025-02-23>.
  Stack Trace:

I wonder why the dates seem to be not the same and which PR messed this up.

@henon
Copy link
Contributor

henon commented Mar 4, 2025

Ah, I think @Anu6is already fixed it in #10961, merged base branch.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2025

@codecov
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.89%. Comparing base (089db1f) to head (d9e22d6).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #10957   +/-   ##
=======================================
  Coverage   91.89%   91.89%           
=======================================
  Files         427      427           
  Lines       13581    13585    +4     
  Branches     2603     2603           
=======================================
+ Hits        12480    12484    +4     
  Misses        526      526           
  Partials      575      575           

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

@henon henon merged commit 492aeec into MudBlazor:dev Mar 4, 2025
6 checks passed
@henon
Copy link
Contributor

henon commented Mar 4, 2025

Thanks @Devqon

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