Skip to content

feat: add PromptSuggestions, Reasoning, ToolCall, Field and JsonViewer - #76

Merged
Shewart merged 4 commits into
mainfrom
feat/ai-chat-components
Oct 23, 2026
Merged

Shewart merged 4 commits into
mainfrom
feat/ai-chat-components

Conversation

@Shewart

@Shewart Shewart commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

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.

PromptSuggestions shows clickable chips for an empty chat. Reasoning
streams a model's thinking, open while IsStreaming and folded to
"Thought for N seconds" after. ToolCall shows a tool's name and a
pending, running, done or error badge, and opens to its arguments,
result or error. Field puts a label, control, description and
validation message together, vertical or horizontal. JsonViewer renders
a highlighted, foldable JSON tree from a string or an object, with a
copy button; it recurses through a hidden json-viewer-node part.

Each ships as a package component and a CLI template. Safelist
regenerated.

Closes #62
Sync-checks the six new templates and adds behaviour tests: suggestion
clicks, Reasoning opening and folding with streaming, ToolCall states
and content, Field's label, description and error, and JsonViewer's
folding and invalid-JSON message.
The registry has 252 entries (98 direct, 154 hidden). The docs said 243
because the variants and models templates from #68 were never counted.
Adds the missing input, textarea and stepper-models dependency rows.
The chat offers suggestions while empty, a Run button streams reasoning
into a tool call, and new sections show a validated Field form and a
JSON viewer. app.css is rebuilt; it predated the new classes.
Copilot AI balanced review requested due to automatic review settings October 22, 2026 21:13

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 5a4bb14 into main Oct 23, 2026
1 check passed
@Shewart
Shewart deleted the feat/ai-chat-components branch October 23, 2026 04:08
@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

Development

Successfully merging this pull request may close these issues.

New components: PromptSuggestions, Reasoning, ToolCall, Field, JsonViewer

2 participants