Skip to content

fix: package component bugs (MultiSeriesChart, ThemeToggle, scroll lock, pickers, Calendar binding) - #38

Merged
Shewart merged 7 commits into
mainfrom
fix/package-component-bugs
Oct 2, 2026
Merged

Shewart merged 7 commits into
mainfrom
fix/package-component-bugs

Conversation

@Shewart

@Shewart Shewart commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the package component bugs found while moving the docs to ShellDocs. Each fix is in both the ShellUI.Components package and the CLI templates.

  • MultiSeriesChart crashed on every render. It declared ChildContent twice (already inherited from Chart) and passed Subtitle to ApexChart, which has no such parameter. Both are removed, and the chart now sits in the same card container as Chart.
  • window.ShellUI was missing for NuGet users. The package's shellui.js is an ES module and only ran if a component happened to import it, so ThemeToggle, dialog scroll lock and close-on-scroll silently did nothing. A Blazor JS initializer (ShellUI.Components.lib.module.js) now imports it at startup, with no setup needed. Added the missing addClassToDocument, removeClassFromDocument and setupFileDrop.
  • ThemeToggle no longer keeps a static instance list, which on Blazor Server was shared by every user's session. Each toggle watches the page's dark class, so all toggles stay in sync whoever changes the theme, and each starts from the page's actual theme.
  • DatePicker / DateRangePicker: the popover is w-max, so the calendar isn't squeezed in a flex row.
  • DataPicker / MultiSelect: option rows are text-left, so custom OptionTemplates align left.
  • Calendar (breaking): SelectedDateChanged is now EventCallback<DateTime?>, so @bind-SelectedDate works with a DateTime? field. Handlers typed DateTime need to accept DateTime?.
  • Removed the RCL template leftovers (Component1, ExampleJsInterop, exampleJsInterop.js, background.png).

Tests

  • New PackageRenderTests (bUnit) renders every package component and fails on parameter-binding errors. It fails on the old MultiSeriesChart for each of its two bugs.

Verification

  • dotnet build 0 warnings, 273 tests pass.
  • Packed the .nupkg and installed it in a fresh Blazor app. Checked in the browser:
    • window.ShellUI is defined with no <script> tag.
    • MultiSeriesChart renders both series.
    • ThemeToggle changes the page, and two toggles stay in sync, including when something else changes the theme.
    • Opening a dialog locks page scroll, and Escape releases it.
    • The DatePicker popover is 326px wide.
    • DataPicker options are left-aligned.
    • @bind-SelectedDate updates a DateTime? field.

Shewatipa Tseisi added 7 commits October 2, 2026 23:50
It redeclared ChildContent (already inherited from Chart) and passed Subtitle to ApexChart, which has no such parameter; either one threw on every render. It now also uses Chart's card container.
…unctions

The package's shellui.js is an ES module and only ran when a component happened to import it, so ThemeToggle, dialog scroll lock and close-on-scroll silently did nothing. A Blazor JS initializer now imports it at startup. Adds addClassToDocument, removeClassFromDocument and setupFileDrop, which ThemeToggle, ThemeService and FileUpload call.
The static instance list was shared by every circuit on Blazor Server. Each toggle now observes the page's dark class through ShellUI.observeTheme, which also reports the initial theme.
BREAKING CHANGE: SelectedDateChanged is now EventCallback<DateTime?>, so @bind-SelectedDate works with a DateTime? field. Handlers typed DateTime must accept DateTime?.
Copilot AI balanced review requested due to automatic review settings October 2, 2026 21:56

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Shewart
Shewart merged commit 8ae6d5c into main Oct 2, 2026
1 check passed
@Shewart
Shewart deleted the fix/package-component-bugs branch October 2, 2026 21:59
Shewart added a commit that referenced this pull request Oct 2, 2026
…ixes (#39)

## Summary
Backports the non-breaking fixes from main (#38) to the 0.3 line and
releases 0.3.2.

- **MultiSeriesChart** threw on every render in the package (duplicate
`ChildContent`, unknown `Subtitle` on `ApexChart`). It now renders
inside the same card as `Chart`.
- **`window.ShellUI` for package users:** a Blazor JS initializer loads
`shellui.js` at startup. This fixes ThemeToggle not changing the theme,
dialog/sheet/drawer scroll lock, and close-on-scroll. Adds the missing
`addClassToDocument`, `removeClassFromDocument` and `setupFileDrop`.
- **ThemeToggle** no longer keeps a static instance list shared across
Blazor Server users. Toggles follow the page's `dark` class and stay in
sync.
- **DatePicker / DateRangePicker** popover gets a width; **DataPicker /
MultiSelect** options are left-aligned.
- Removed the RCL template leftovers from the package.
- New bUnit test renders every package component and fails on
parameter-binding errors.
- Version 0.3.2: props, fallback versions, docs, package README links,
release notes.

Not included: the Calendar `SelectedDateChanged` type change (breaking,
0.4 only).

## Verification
- `dotnet build` 0 warnings, 156 tests pass.
- Packed `ShellUI.Components.0.3.2.nupkg`: the JS initializer ships and
the leftovers are gone.
- The same fixes were verified in a fresh app with a packed package on
main (#38).
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