Skip to content

Preview Features for Next Major Version#11377

Closed
danielchalmers wants to merge 30 commits intoMudBlazor:devfrom
danielchalmers:preview-features
Closed

Preview Features for Next Major Version#11377
danielchalmers wants to merge 30 commits intoMudBlazor:devfrom
danielchalmers:preview-features

Conversation

@danielchalmers
Copy link
Member

@danielchalmers danielchalmers commented May 20, 2025

Description

This introduces a way to commit breaking changes ahead of time without locking the branch to v9. In this PR, it's used to modernize UI/UX elements based on Material Design 3.

How Has This Been Tested?

visually

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)

Before/After

Which changes do you like?

Sentence-cased buttons & increased border radius

image

image

Snackbar with faster and eased animation

Video3.mp4
Video4.mp4

Re-themed tooltips for readability

image

image

image

image

Rounded square chips

image

image

More tooltips

image

Appropriately sized adornments

image

image

Don't shrink text in dense mode

image

image

Softer borders

image

image

Modal popovers

Video5.mp4
Video6.mp4

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 enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library label May 20, 2025
@danielchalmers
Copy link
Member Author

danielchalmers commented May 20, 2025

@henon @ScarletKuro What do you think about this approach? (the preview switch itself, not the ui changes)

@codecov
Copy link

codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 91.04%. Comparing base (673f6f7) to head (176600b).
Report is 78 commits behind head on dev.

Files with missing lines Patch % Lines
src/MudBlazor/Components/List/MudListItem.razor.cs 33.33% 1 Missing and 1 partial ⚠️
...lazor/Components/Snackbar/CommonSnackbarOptions.cs 0.00% 0 Missing and 2 partials ⚠️
...Components/ThemeProvider/MudThemeProvider.razor.cs 50.00% 1 Missing and 1 partial ⚠️
src/MudBlazor/Services/MudGlobal.cs 33.33% 0 Missing and 2 partials ⚠️
...Blazor/Components/Snackbar/SnackBarMessageState.cs 66.66% 0 Missing and 1 partial ⚠️
...lazor/Components/Snackbar/SnackbarConfiguration.cs 50.00% 0 Missing and 1 partial ⚠️
src/MudBlazor/Themes/Models/LayoutProperties.cs 0.00% 0 Missing and 1 partial ⚠️
src/MudBlazor/Themes/Models/Palette.cs 50.00% 0 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (60.00%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #11377      +/-   ##
==========================================
- Coverage   91.12%   91.04%   -0.08%     
==========================================
  Files         465      466       +1     
  Lines       14409    14427      +18     
  Branches     2788     2799      +11     
==========================================
+ Hits        13130    13135       +5     
- Misses        641      643       +2     
- Partials      638      649      +11     

☔ 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.

@danielchalmers danielchalmers changed the title Preview Features Introduce Preview Features for the Next Major Version May 22, 2025
@danielchalmers danielchalmers changed the title Introduce Preview Features for the Next Major Version Preview Features for Next Major Version May 22, 2025
@henon
Copy link
Contributor

henon commented May 22, 2025

This idea works only for things that can co-exist. Most breaking changes can't or else we'd make them in a non-breaking way in the first place (i.e. using the ObsoleteAttribute and forwarding to the new properties, etc). So I see only limited use in this and we'll still have to enter a preview mode where we apply breaking changes that can not be switched off.

Edit: But I think it is still a good idea for those changes that can be switched off.

@danielchalmers
Copy link
Member Author

This idea works only for things that can co-exist. Most breaking changes can't or else we'd make them in a non-breaking way in the first place (i.e. using the ObsoleteAttribute and forwarding to the new properties, etc). So I see only limited use in this and we'll still have to enter a preview mode where we apply breaking changes that can not be switched off.

Edit: But I think it is still a good idea for those changes that can be switched off.

Right, I don't mean this as an ultimate solution. I just need a way of turning on and off UI elements. Then by the time we're all ready it will cut down the beta period by a good chunk.

@ScarletKuro
Copy link
Member

This only allows a very limited set of 'breaking changes,' like visuals one (returning Typo.body1 as in your example, or changes in delays).
I'd say that we could push this kind of change without waiting for the next major version, if the changes make sense.

@danielchalmers
Copy link
Member Author

This only allows a very limited set of 'breaking changes,' like visuals one (returning Typo.body1 as in your example, or changes in delays). I'd say that we could push this kind of change without waiting for the next major version, if the changes make sense.

@ScarletKuro I have to disagree, these changes are breaking by nature and I don't think they should be included in point releases.

@danielchalmers danielchalmers requested a review from Copilot May 22, 2025 21:00
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 introduces preview features to facilitate a smooth transition to the next major version by conditionally enabling new UI/UX behaviors. Key changes include the introduction of the EnablePreviewFeatures flag, updated visual element defaults (such as focus handling, modal behavior, and snackbar animations), and modifications to resource labels used across components.

Reviewed Changes

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

Show a summary per file
File Description
src/MudBlazor/Services/MudGlobal.cs Added the EnablePreviewFeatures flag and updated default settings that use it.
src/MudBlazor/Resources/LanguageResource.resx Updated resource values for color picker view labels.
src/MudBlazor/Components/ThemeProvider/MudThemeProvider.razor.cs Modified theme generation to add preview-specific styling.
src/MudBlazor/Components/Snackbar/* Adjusted snackbar configuration and transition durations based on preview features.
src/MudBlazor/Components/Select, Picker, Overlay, Menu, Autocomplete Inverted Modal property values when preview features are enabled.
src/MudBlazor/Components/List/MudListItem.razor.cs Updated text typography selection when preview features are active.
src/MudBlazor/Components/Input/MudInput.razor.cs Added a new class for input adornment under preview mode.
src/MudBlazor/Components/ColorPicker/MudColorPicker.razor Wrapped icon buttons in tooltips based on preview feature flag.
src/MudBlazor/Components/Chip/MudChip.razor.cs Forced the addition of a CSS class on chips when preview features are enabled.
Docs and UnitTest files Updated initialization and theme settings to reflect preview behavior.
Comments suppressed due to low confidence (1)

src/MudBlazor/Components/ColorPicker/MudColorPicker.razor:265

  • Ensure that the resource key 'MudColorPicker_ModeSwitch' is defined in the localization resources, as it is used when preview features are enabled.
<MudTooltip Text="@((MudGlobal.EnablePreviewFeatures ? Localizer[LanguageResource.MudColorPicker_ModeSwitch] : null))">

@henon
Copy link
Contributor

henon commented May 23, 2025

This only allows a very limited set of 'breaking changes,' like visuals one (returning Typo.body1 as in your example, or changes in delays). I'd say that we could push this kind of change without waiting for the next major version, if the changes make sense.

@ScarletKuro I have to disagree, these changes are breaking by nature and I don't think they should be included in point releases.

I sense a misunderstanding here. I think Kuro meant that we could release the preview changes (switched off) in minor releases, right? And if so, I would agree with that.

@danielchalmers
Copy link
Member Author

I sense a misunderstanding here. I think Kuro meant that we could release the preview changes (switched off) in minor releases, right? And if so, I would agree with that.

v8 needs more time to cook, so the idea is to begin staging these changes ahead of time by including them in minor releases, flagged off, so we can develop v8 and v9 in parallel. When we’re ready to switch to the v9 branch, we’ll remove the flag and enable everything at once while making larger breaking changes.

The docs can be the playground to have the features enabled. Having a toggle is difficult because they're low level features.

This PR is the initial batch. I'll follow up on more PRs of the same type over the next weeks. If I identify anything that could be released now without disruption I'll make separate PRs, but the ones here are breaking UI/UX changes. https://github.com/orgs/MudBlazor/projects/5

@sonarqubecloud
Copy link

@danielchalmers danielchalmers marked this pull request as ready for review May 26, 2025 18:31
@danielchalmers danielchalmers requested a review from Garderoben May 26, 2025 18:31
@danielchalmers danielchalmers marked this pull request as draft June 11, 2025 16:03
@danielchalmers
Copy link
Member Author

Other changes to make:

  • Round the button much more
  • Round paper, menu, etc to hardcoded 4px
  • Generate a MD3_2025 theme from a single source color

All the changes will probably not be merged like this because we might target a new palette first, and then these can be tied directly to the palette instead of a feature flag. We don't want to make major changes like these to the classic MudBlazor palette.

I think developing the new theme in the v8 branch with the changes marked experimental would be good because then we can keep the fixes coming, then release it when it's considered ready as a defining v9 feature along with necessary breaking changes needed to finalize the new theme.

@danielchalmers danielchalmers removed the request for review from Garderoben June 23, 2025 20:32
@danielchalmers
Copy link
Member Author

Parts of this will be extracted in a separate PR dedicated to the new MD3E theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants