Skip to content

A MenuItemControl silently ignored WithClass - #1045

Merged
rbuergi merged 4 commits into
mainfrom
fix/menuitem-honours-class
Aug 10, 2026
Merged

rbuergi merged 4 commits into
mainfrom
fix/menuitem-honours-class

Conversation

@rbuergi

@rbuergi rbuergi commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

MenuItemView never rendered the control's Class on any of its buttons, so WithClass on a MenuItemControl did nothing at all — no error, no warning, just a button that kept the default appearance while the caller believed it had styled it. That is the shape of bug this codebase treats as serious: a call that looks applied and is silently discarded.

How it surfaced

A plugin cover's install step became a split button (MenuItemControl with a click action and child items) and instantly lost the cover's cta-pill geometry and HeroCta palette that every plain button beside it still had — so the row restyled itself the moment something was installed, and only in that state.

The class has to be on the button itself, because the rule is:

fluent-button.cta-pill::part(control) { … }

Putting it on the wrapper div cannot match, so there was no workaround available to the caller.

The fix

Class now reaches the FluentButton in all four shapes the view renders — icon-only, split primary + chevron, expand-only, and the plain in-menu entry — matching what ButtonView has always done.

Style already worked and is unchanged: it lands on the wrapper, and CSS custom properties inherit through the shadow boundary from there, which is how the palette variables reach ::part(control) once the rule applies.

Release build clean with -warnaserror.

🤖 Generated with Claude Code

MenuItemView never rendered the control's Class on any of its buttons, so
WithClass on a MenuItemControl did nothing at all — no error, no warning, just a
button that kept the default appearance while the caller believed it had styled
it.

That is the shape of bug this codebase treats as serious: a call that looks
applied and is discarded. It surfaced on a plugin cover, where the install step
became a split button and instantly lost the cover's `cta-pill` geometry and
HeroCta palette that every plain button beside it still had — so a row restyled
itself the moment something was installed. The class must be on the button
itself, because the rule is `fluent-button.cta-pill::part(control)`; putting it
on the wrapper cannot match.

Class now reaches the FluentButton in all four shapes the view renders
(icon-only, split primary + chevron, expand-only, and the plain in-menu entry),
matching what ButtonView has always done. Style already worked: it lands on the
wrapper and CSS custom properties inherit through the shadow boundary from
there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 9, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a silent styling bug in the Blazor UI where MenuItemControl.WithClass(...) had no effect because MenuItemView never passed the bound Class through to its rendered FluentButton elements. Adds a corresponding “What’s New” entry documenting the user-visible behavior change.

Changes:

  • Render the control’s Class on FluentButton across all MenuItemView render shapes (icon-only, split button, expand-only, and plain menu entry).
  • Add a What’s New page describing the dropdown-button styling fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/MeshWeaver.Blazor/Components/MenuItemView.razor Passes Class through to the underlying FluentButton so WithClass(...) actually affects styling in every menu-item shape.
src/MeshWeaver.Documentation/Data/WhatsNew/2026-08-09-menu-buttons-keep-their-styling.md Documents the fix in the What’s New feed.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

690 tests  ±0   690 ✅ +1   13m 59s ⏱️ -1s
 10 suites ±0     0 💤 ±0 
 10 files   ±0     0 ❌  - 1 

Results for commit c7605ad. ± Comparison against base commit 5623efc.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

1 284 tests  ±0   1 279 ✅ ±0   6m 42s ⏱️ -29s
   11 suites ±0       5 💤 ±0 
   11 files   ±0       0 ❌ ±0 

Results for commit c7605ad. ± Comparison against base commit 5623efc.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

1 725 tests  ±0   1 533 ✅ ±0   5m 27s ⏱️ -26s
   11 suites ±0     192 💤 ±0 
   11 files   ±0       0 ❌ ±0 

Results for commit c7605ad. ± Comparison against base commit 5623efc.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

1 202 tests   1 202 ✅  6m 17s ⏱️
   11 suites      0 💤
   11 files        0 ❌

Results for commit c7605ad.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

1 948 tests  ±0   1 946 ✅ ±0   6m 33s ⏱️ +19s
   11 suites ±0       2 💤 ±0 
   11 files   ±0       0 ❌ ±0 

Results for commit c7605ad. ± Comparison against base commit 5623efc.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

   11 files     11 suites   5m 59s ⏱️
1 976 tests 1 868 ✅ 108 💤 0 ❌
2 123 runs  2 015 ✅ 108 💤 0 ❌

Results for commit c7605ad.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   65 files  ±0     65 suites  ±0   44m 59s ⏱️ - 1m 0s
8 825 tests ±0  8 518 ✅ +1  307 💤 ±0  0 ❌  - 1 
8 972 runs  +1  8 665 ✅ +2  307 💤 ±0  0 ❌  - 1 

Results for commit c7605ad. ± Comparison against base commit 5623efc.

♻️ This comment has been updated with latest results.

rbuergi and others added 2 commits August 9, 2026 23:00
WhatsNewEntryIntegrityTest requires Order to be the entry's date as
-YYYYMMDD; without it the doc tree sorts the entry into the wrong place
rather than failing loudly, which is why the test exists.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rbuergi
rbuergi merged commit ce821e0 into main Aug 10, 2026
17 checks passed
@rbuergi
rbuergi deleted the fix/menuitem-honours-class branch August 19, 2026 10:31
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.

2 participants