Skip to content

fix: bring the Stepper, Input, Textarea, Sheet and Drawer templates up to the package - #68

Merged
Shewart merged 4 commits into
mainfrom
fix/template-drift-4
Oct 18, 2026
Merged

Shewart merged 4 commits into
mainfrom
fix/template-drift-4

Conversation

@Shewart

@Shewart Shewart commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Part of #52. The last batch where the package copy wins. After this, 210 of 217 components match their CLI template, and the rest are recorded as allowed drift (CopyButton, CommandPalette, InputOTP, SidebarProvider, AppSidebar, and Resizable, which is #67).

  • Stepper, StepperStep, StepperContent: the CLI Stepper gains the data-driven StepItems mode. The parts read ActiveStep instead of the CurrentStep parameter, so the stepper stops overwriting a parameter it doesn't own. StepItem ships in a new hidden stepper-models template that stepper depends on.
  • Input, Textarea: the Input template nested InputVariant inside the component, so you had to write Input.InputVariant.Error. Textarea had no variants. Both now use new input-variants / textarea-variants templates in Components/UI/Variants, like button-variants. Textarea also gains ReadOnly, OnFocus and OnBlur. If someone wrote Input.InputVariant.Error, that becomes InputVariant.Error when they re-add input.
  • Sheet, Drawer: the templates switch to compositional mode on their own when Title and Description are empty, like the package does. Compositional="true" still works but isn't needed.

Tests: 426 passing, 0 warnings. All five are now in both sync theories, the three new templates are in the parse test, and there's a behaviour test for the compositional Stepper.

Checked in a real app (a fresh dotnet new blazor in %TEMP%, local CLI init --yes + add stepper input textarea sheet drawer): builds with 0 warnings. Sheet and Drawer open from their parts with no flag. Both Stepper modes advance and show Confirm on the last step. InputVariant.Error resolves without the nesting.

Known issue, not new: the Error variant's red border loses to border-input, because Shell.Cn keeps both border colours. The old template had the same issue, and #51 fixes it.

The CLI Stepper gains the data-driven StepItems mode, and the parts
read ActiveStep instead of the CurrentStep parameter, so the stepper
no longer overwrites a parameter it doesn't own. StepItem ships as a
new stepper-models template that stepper depends on.

Part of #52
The Input template nested InputVariant inside the component, so callers
had to write Input.InputVariant.Error, and Textarea had no variant at
all. Both now match the package: input-variants and textarea-variants
templates in Components/UI/Variants, like button-variants, and Textarea
gains Variant, ReadOnly, OnFocus and OnBlur.

Part of #52
…hemselves

Like the package, they now use the compositional parts when Title and
Description are both empty, so Compositional="true" is no longer
needed. The flag still works.

Part of #52
Adds them to both sync theories, parses the new stepper-models,
input-variants and textarea-variants templates, and checks that the
compositional Stepper shows the active step after Next.

Part of #52
Copilot AI balanced review requested due to automatic review settings October 18, 2026 16:05

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 3cee3d3 into main Oct 18, 2026
1 check passed
@Shewart
Shewart deleted the fix/template-drift-4 branch October 18, 2026 17:10
Shewart added a commit that referenced this pull request Oct 20, 2026
Release notes and version references for 0.4.0-alpha.3. The first
release published with NuGet Trusted Publishing (#71).

**In this release** (already on main)
- #69: a component's `Class` overrides its own conflicting classes
(`Shell.Cn` merges like tailwind-merge)
- #64: Dialog, AlertDialog, Sheet and Drawer keep keyboard focus inside
and return it on close
- #70: `add` never downgrades a NuGet package the project already
references
- #71: `init` supports Razor class libraries, plus a guide; release
workflow on Trusted Publishing
- #63, #65, #66, #68: CLI templates reconciled with the package
(RadioGroup, ScrollArea, DatePicker, TimePicker, Pagination, Toast,
Skeleton, Sheet/Drawer and more)

**Breaking for CLI template users** (after `shellui update`, all in the
notes with upgrade steps): `Input.InputVariant` becomes `InputVariant`
(new `input-variants` template); Stepper parts read `ActiveStep` instead
of taking `CurrentStep`; `ScrollArea` drops its `scrollbar-*` classes.
`update` installs the new templates automatically.

**This PR**
- `Directory.Build.props` suffix `alpha.3`; README, VERSIONING_STRATEGY,
CLI_INSTALLATION, CLI_SYNTAX, FAQ, QUICKSTART and the version fallbacks
move to `0.4.0-alpha.3`
- `docs/RELEASE_NOTES.md`: the 0.4.0-alpha.3 section;
`scripts/extract-release-notes.sh 0.4.0-alpha.3` extracts it

**Release checks**
- Release build has 0 warnings, and all 484 tests pass
- An app set up with the released 0.4.0-alpha.2 CLI, updated with the
packed alpha.3 CLI: 36 components updated, `input-variants`,
`textarea-variants` and `stepper-models` installed, builds 0/0
- CLI templates in a browser: RadioGroup selects (disabled items
ignored), ScrollArea scrolls, Pagination `@bind-CurrentPage`, Stepper
Next, DatePicker puts 1 October 2026 under Thursday, TimePicker
`Step="15"` lists 00/15/30/45, `Class="px-8 bg-destructive"` replaces
the button's own `px-4 bg-primary`, `InputVariant.Error` applies
- Focus trap with real key presses (templates and package): Tab cycles
inside the dialog and wraps, Shift+Tab goes back, Escape closes and
returns focus to the trigger
- All 93 direct targets together in `my-app` build 0/0 on net8.0, net9.0
and net10.0 (244 registry entries)
- The packed `ShellUI.Components` in a browser: the class override,
TimePicker, dark mode with `color-scheme`, Popover Escape, Command
`Action`, the dialog focus trap; no console errors
Shewart added a commit that referenced this pull request Oct 23, 2026
#76)

Closes #62 (the docs pages are separate, in shellui-shelldocs).

Five new direct targets, each with a package component, a CLI template,
a sync test and behaviour tests:

- **PromptSuggestions**: clickable chips for an empty chat. `OnSelect`
gives you the suggestion text.
- **Reasoning**: a collapsible block for a model's thinking. While
`IsStreaming` it's open with a pulsing "Thinking…" label. When streaming
ends it folds to "Thought for N seconds" (`Duration`), and you can click
to reopen it.
- **ToolCall**: a tool's name with a `pending`, `running` (spinner),
`done` or `error` badge. It opens to show `Arguments`, `Result` or
`Error`.
- **Field**: label (with `Required` asterisk and `LabelFor`), control,
description and error as one unit. `For` shows the `EditForm`'s
validation messages through the existing `FormMessage`.
`Orientation="horizontal"` is for switches and checkboxes.
- **JsonViewer**: a highlighted JSON tree from `Json` (string) or
`Value` (any object). `ExpandDepth` levels start open (default 2), each
object or array folds, there's a copy button (the existing
`CopyButton`), and invalid JSON shows a message. It recurses through a
hidden `json-viewer-node` part.

Registry: 252 entries, 98 direct and 154 hidden. The docs said 243
because the variants and models templates from #68 were never counted.
That's corrected, along with the missing `input`, `textarea` and
`stepper-models` dependency rows.

Demo (`/components/new`): the chat shows suggestions while empty, a Run
button streams reasoning into a tool call, and there are sections for a
validated Field form and the JSON viewer. Its `app.css` is rebuilt,
since it predated these classes.

Tests: 524 passing on net8.0 and net10.0, 0 warnings. Checked in the
demo through the local CLI's `add`: suggestions send, reasoning streams
and folds, the tool call goes running to done, Field validation shows on
submit, and JSON nodes fold. The copy button couldn't be exercised in
the embedded browser, which blocks clipboard writes.
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