Skip to content

feat: .NET 8 support, shellui add all, shellui doctor, Sonner Clear; fix safelist - #74

Merged
Shewart merged 6 commits into
mainfrom
feat/net8-add-all-api-gaps
Oct 22, 2026
Merged

Shewart merged 6 commits into
mainfrom
feat/net8-add-all-api-gaps

Conversation

@Shewart

@Shewart Shewart commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Four issues on one branch, one commit each, plus a safelist bug found along the way.

#57: .NET 8 support

  • The CLI (with Core and Templates) targets net8.0;net10.0, so the tool runs on the .NET 8 runtime.
  • ShellUI.Components targets net8.0;net9.0;net10.0. The net9.0 build is needed: a .NET 9 app restoring the net8.0 build fails with NU1605, because Blazor-ApexCharts asks for Components.Web 9.0.2 there.
  • Tests and the safelist generator run on both frameworks; CI and the release workflow install the 8.0.x SDK; CI also builds .NET 8 and 9 apps that use the package.

Safelist fix
.razor class attributes were read only up to their first quote, so classes passed to Shell.Cn("..."), and literals in ternaries and switch arms, never reached shellui-classes.txt. 198 classes were missing for apps that build their own Tailwind CSS from the package (the dialog's translate-x/y-[-50%], sm:rounded-lg, the Sonner variant colours, ...). The precompiled bundle was fine, since Tailwind scans the .razor files itself. The same bug is on release/v0.3.

#61

  • SonnerService.Clear(). Dismissed toasts (Clear, Remove, auto-dismiss) fade out over 300 ms, matching their duration-300 transition, then are removed.
  • Destructive on ContextMenuItem and ContextMenuOption: destructive text, hover and focus colours.

#54: shellui add all
Every target shellui list shows except the dashboard-* and auth-* blocks, which rewire the app. --except also drops anything that depends on an excluded component, so --except chart adds no Blazor-ApexCharts.

#55: shellui doctor
Checks shellui.json, the Tailwind CLI and Build/ShellUI.targets, a stale app.css, the host page (app.css, shellui.js, theme script), the render mode, installed files and dependencies, _Imports.razor usings, and the package and CLI used together. Each problem comes with a fix; exits 1 on errors, so it can run in CI.

Docs: main names 0.3.5 as the latest stable and gets its release notes; .NET 8 wording throughout; add all, --except and doctor in the CLI reference.

Checks

  • Release build 0 warnings; 502 tests on net8.0 and net10.0
  • The packed package in fresh .NET 8, 9 and 10 apps builds 0/0, each restoring its own lib/ folder
  • .NET 8 app in a browser: stylesheet, Class override, DatePicker, TimePicker, ApexCharts, dialog focus trap (real key presses), Sonner Clear and fade (checked by hand: 4 s auto-dismiss, stay-open toasts until Clear or ×), red Delete item; no console errors
  • The CLI's net8.0 build on the .NET 8 runtime runs init and add in a .NET 8 app, which builds 0/0
  • shellui add all (88 targets) and add all --except chart,qr-code (no chart files, no ApexCharts, no QRCoder) build 0/0
  • shellui doctor on real apps: all checks pass on a healthy app (exit 0), a removed shellui.js is an error (exit 1), per-page render mode is a warning

Fixes #57, fixes #61, fixes #54, fixes #55

Shewatipa Tseisi added 6 commits October 22, 2026 11:53
The CLI and ShellUI.Components only targeted net10.0, so teams on .NET 8
(LTS) could use neither the package nor the tool.

- ShellUI.CLI (with Core and Templates) targets net8.0 and net10.0, so
  the tool runs on the .NET 8 runtime. ContentHash avoids the
  .NET 9-only Convert.ToHexStringLower.
- ShellUI.Components targets net8.0, net9.0 and net10.0, with
  Microsoft.AspNetCore.Components.Web 8.0.13, 9.0.2 and 10.0.0. The
  net9.0 build is needed because Blazor-ApexCharts asks for 9.0.2 in a
  .NET 9 app, which a net8.0 build would downgrade.
- Tests and the safelist generator run on net8.0 and net10.0; CI and the
  release workflow install both SDKs, and CI builds .NET 8 and 9 apps
  that use the package.
- Docs drop the .NET 10-only requirement.

Fixes #57
The generator read a .razor class attribute only up to its first quote,
so class="@Shell.Cn("...", Class)" contributed nothing, and C# literals
in ternaries and switch arms were skipped too. 198 classes components
render were missing from shellui-classes.txt, which apps building
their own Tailwind CSS from the package depend on: the dialog's centring
(translate-x/y-[-50%]), sm:rounded-lg, the Sonner variant colours and
more. The precompiled bundle was not affected, because Tailwind scans
the .razor files itself, except for the data-[state=...] classes the
safelist exists for.

The generator now also harvests string literals that follow (, ,, ?, :,
= or => in .razor files, with the same class-list filter as .cs files,
and accepts class lists up to 2000 characters (DialogContent's is 545).
- SonnerService.Clear() dismisses every toast. Dismissed toasts (Remove,
  Clear, auto-dismiss) now fade out over 300 ms before they're removed,
  instead of disappearing at once; SonnerToastItem.Dismissing marks them.
- ContextMenuItem.Destructive and ContextMenuOption's Destructive
  parameter draw the item in the destructive colour, with matching
  hover and focus colours, for actions like Delete.

Package and CLI templates alike, with tests.

Fixes #61
`shellui add all` adds every target `shellui list` shows except the
layout blocks (dashboard-*, auth-*), which rewire the app and stay
explicit. Installed components are skipped as before, and the per-file
"requires" lines are left out for a run this size.

`--except` leaves components out, along with anything that depends on
them, so `--except chart` also drops the chart types and
Blazor-ApexCharts isn't added. Unknown names are reported.

Fixes #54
Most setup problems are silent: no render mode, shellui.js not loaded,
a stale app.css, a component missing a dependency. `shellui doctor`
checks shellui.json and ComponentsPath, the Tailwind CLI and
Build/ShellUI.targets, whether app.css is newer than input.css and the
components, the host page (app.css, shellui.js, theme script), the
render mode, installed files and dependencies, the _Imports.razor
usings, and the package and CLI used together. Each problem comes with
a fix; it exits 1 on errors, so it can run in CI. A Razor class
library skips the host page checks.

Fixes #55
README, CLI_INSTALLATION, FAQ and VERSIONING_STRATEGY point at 0.3.5
instead of 0.3.4, RELEASE_NOTES gets the v0.3.5 section from
release/v0.3, and the CLI reference, CONTRIBUTING and the Templates
README no longer say .NET 10 only.
Copilot AI balanced review requested due to automatic review settings October 22, 2026 12:29

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.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Shewart
Shewart merged commit 942f106 into main Oct 22, 2026
1 check passed
@Shewart
Shewart deleted the feat/net8-add-all-api-gaps branch October 22, 2026 12:35
@Shewart Shewart mentioned this pull request Oct 22, 2026
Shewart added a commit that referenced this pull request Oct 22, 2026
A small patch for both packages, cherry-picked from main.

**Package icon** (`6d480f1` on main)
0.3.5 shipped without `PackageIcon`, so nuget.org shows its default icon
for `ShellUI.CLI` and `ShellUI.Components`, and the package list uses
the latest stable's icon. Both now carry `assets/icon.png`.

**Safelist** (`145997e` on main, from #74)
The safelist generator read `.razor` class attributes only up to their
first quote, so classes passed to `Shell.Cn("...")` and literals in
ternaries never reached `shellui-classes.txt`. On 0.3, 181 classes were
missing for apps that build their own Tailwind CSS from the package,
including the dialog's centring (`translate-x/y-[-50%]`),
`sm:rounded-lg` and the Sonner variant colours. The precompiled
`shellui-all.css` wasn't affected. The safelist is regenerated from
0.3's own components: 369 to 550 classes, none removed.

**This PR also**
- Bumps `Directory.Build.props` and the version references to `0.3.6`
- Adds the `# ShellUI v0.3.6` section to `docs/RELEASE_NOTES.md`;
`scripts/extract-release-notes.sh 0.3.6` extracts it

**Checks**
- Release build 0 warnings; 251 tests pass
- Both packed nupkgs contain `icon.png` and declare
`<icon>icon.png</icon>`
- A .NET 10 app on the packed `ShellUI.Components` writes all 550
classes to `wwwroot/shellui-classes.txt`, and Tailwind built from that
file generates `translate-x/y-[-50%]`, `sm:rounded-lg` and
`bg-green-500/20`
@Shewart Shewart mentioned this pull request Oct 30, 2026
Shewart added a commit that referenced this pull request Oct 30, 2026
Release notes and version references for 0.4.0, the 0.4 stable release.

It fixes a hang in `shellui add` on .NET 8 and 9 apps that this
release's smoke test found, and the 0.4.0 notes describe those fixes.

**In this release** (on main, plus #80)
- #76: PromptSuggestions, Reasoning, ToolCall, Field, JsonViewer
- #77: a real resizable panel group (`ResizablePanelGroup` / `Panel` /
`Handle`)
- #78: `shellui migrate`
- #74: .NET 8 support, `shellui add all`, `shellui doctor`,
`SonnerService.Clear`, destructive context menu items, safelist fix
- the whole 0.4 alpha line (alpha.1 to alpha.3), summed up for people
upgrading from 0.3.6
- #80: `add` no longer hangs on .NET 8/9, the CLI rolls forward to newer
runtimes, `doctor` stops calling a fresh `app.css` stale, `list` counts
fixed

Not in it: #79 (ShellCharts instead of ApexCharts) stays a draft for a
later release.

**This PR**
- `Directory.Build.props`: empty suffix, so both packages build as
`0.4.0`
- README, VERSIONING_STRATEGY, CLI_INSTALLATION, CLI_SYNTAX, FAQ,
QUICKSTART and the version fallbacks move to `0.4.0`. The latest stable
was still listed as 0.3.5, so 0.3.6 is now the previous stable. Installs
no longer need `--version`.
- `docs/RELEASE_NOTES.md`: the 0.4.0 section.
`scripts/extract-release-notes.sh 0.4.0` extracts it.

**Release checks.** Packed 0.4.0, with #80, installed from a local
folder into a private tool path, using a throwaway NuGet cache so
nothing local shadows the published packages.
- Release build: 0 warnings. 540 tests on net8.0 and net10.0 (542 with
#80).
- Every command in a fresh .NET 10 app: `init --yes`, `add all` (244
files), `list`, `remove`, `update`, `migrate --dry-run`, `theme apply`,
`theme update`, `doctor`. Builds 0/0.
- `init` and `add all` in fresh .NET 8 and .NET 9 apps build 0/0 and
`doctor` is clean. Before #80, `add all` hung on both.
- All 98 direct targets together, including the `dashboard-*` and
`auth-*` blocks, in `my-app` (.NET 10): 0/0, `doctor` clean.
- Upgrade from the published 0.4.0-alpha.3:
  - An app with a page using the old APIs builds on alpha.3.
- 0.4.0 `update` rewrites 55 components and replaces the targets file,
and the app builds 0/0.
- `migrate` rewrites the page (DatePicker, TimePicker, Pagination), it
builds 0/0, and `doctor` is clean.
- CLI templates in a browser:
- suggestion chips; Reasoning folds to "Thought for 2 seconds"; Field
shows the EditForm error; JSON tree folds
  - Resizable drags from 30/70 to 55/45
  - no console errors
- Packed `ShellUI.Components` in a .NET 8 app with `shellui-all.css`, in
light and dark mode:
- the new components render; the resizable drag and suggestion chips
work
  - Dialog focus trap: Tab stays inside, Escape closes and returns focus
- `shellui.js` loads through the package's JS initializer, with no
console errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants