Skip to content

fix(templates,ci,docs): unblock chart/pie-chart/dashboard-02, fix preview pipeline, correct component count#13

Merged
Shewart merged 6 commits into
mainfrom
fix/critical-template-bugs
Jun 17, 2026
Merged

fix(templates,ci,docs): unblock chart/pie-chart/dashboard-02, fix preview pipeline, correct component count#13
Shewart merged 6 commits into
mainfrom
fix/critical-template-bugs

Conversation

@Shewart

@Shewart Shewart commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Three things that needed to land together before tagging 0.3.0-alpha.4:

  1. Three CLI templates have shipped uncompilable C# since 0.3.0-alpha.1. After shellui add chart, pie-chart, or dashboard-02, consumer projects fail dotnet build immediately. Root cause: incorrect quote escaping inside C# verbatim strings emitted by template Content strings.
  2. Preview-pages workflow has been red for two weeks with Get Pages site failed. HttpError: Not Foundactions/configure-pages@v4 was failing because Pages isn't enabled on the repo and the action wasn't asked to enable it.
  3. Every doc claimed "100 components" when the registry actually exposes 68 installable top-level components — the "100" was inflated by counting sub-components (SidebarTrigger, DialogContent, …) and variants (ButtonVariants, …) that auto-install as dependencies.

Maps to Fixes 2, 9, 10 in shellui-fixes-for-lib.md plus the preview-pipeline failure and the count audit you requested.

Changes

Template escape bugs (Fixes 2, 9, 10)

  • src/ShellUI.Templates/Templates/ChartVariantsTemplate.cs — 16 JS-attribute quotes inside the tooltip Custom = @"..." block: ""x""""""x"""" (so the generated .cs carries the proper ""x"" verbatim-string escape).
  • src/ShellUI.Templates/Templates/PieChartTemplate.cs — was using \""x\"" which decoded to \"x\" and produced both a compile error and visible backslashes in rendered HTML. Fixed to """"x"""".
  • src/ShellUI.Templates/Templates/DashboardLayout02Template.cs:86 — unterminated empty-string literal: segments[0] == ""))segments[0] == """")).
  • src/ShellUI.Components/Components/PieChart.razor — same backslash bug in the live library; NuGet consumers were seeing class=\"custom-tooltip\" in rendered HTML.

Regression guard

  • ShellUI.Tests/TemplateCompileTests.cs — Roslyn CSharpSyntaxTree.ParseText over each template's generated Content. Pure-C# templates parse whole content; Razor templates extract @code { … } via a quote/comment-aware brace-balancing tokenizer. When extraction fails (unterminated string ate the closing brace) it falls back to a class-wrapped parse filtered to literal-related Roslyn diagnostic IDs (CS1010, CS1002, CS1003, CS1026, CS1513, CS1525, CS1056) so the failure points right at the offending line.
  • ShellUI.Tests/ShellUI.Tests.csprojMicrosoft.CodeAnalysis.CSharp 4.11.0.
  • .github/workflows/ci.yml — smoke-test step packs the CLI, installs it, runs dotnet new blazorshellui initshellui add chart pie-chart dashboard-02dotnet build as an end-to-end guard for anything the syntactic check misses.

Preview-pages pipeline

  • .github/workflows/preview-pages.ymlactions/configure-pages@v4 now passes enablement: true so the action creates the Pages site on first run instead of erroring with HttpError: Not Found. Requires pages: write on GITHUB_TOKEN, already set.

⚠️ Note: the preview app still has independent issues (hardcoded <base href="/"> won't work at /shellui/, hardcoded dark mode, only ~25 of 68 components covered). Those are scoped to fix/preview-app (branch 8) and not part of this PR. This PR only unblocks the workflow run itself.

Component count audit

Authoritative count from ComponentRegistry (IsAvailable = true, top-level only): 68 installable = 17 Form + 12 Layout + 7 Navigation + 8 Overlay + 13 Data Display + 9 Feedback + 2 Utility. Updated every doc that claimed otherwise:

  • README.md — main banner, status section, category breakdowns (was internally inconsistent: section header claimed 14 Form but listed 13), shellui list example, comparison table, footer status line.
  • docs/ARCHITECTURE.md — registry-stats line, category counts table.
  • docs/COMPONENT_ROADMAP.md — status header, completed-list breakdown, timeline entry.
  • docs/PROJECT_STATUS.md — version line, registry stats, category breakdowns, milestone targets.
  • docs/CLI_SYNTAX.md, docs/QUICKSTART.md, docs/COMPARISON.md, docs/FAQ.md — inline "100" / "100+" references.
  • VERSIONING_STRATEGY.md — current-release facts, single-source-of-truth list.
  • src/ShellUI.CLI/README.md, src/ShellUI.Components/README.md, src/ShellUI.Templates/README.md — package-level claims.

Intentionally left alone:

  • docs/RELEASE_NOTES.md historical sections — frozen archive of what we said at the time of each release.
  • docs/PROJECT_STATUS.md future-state goals ("100+ components", "100+ community members") — aspirational, not current state.
  • CSS color values like 0 0% 100% — those are HSL lightness, not counts.

Verification

  • dotnet test ShellUI.Tests15/15 passing.
  • Stash-and-retest of DashboardLayout02Template.cs:86 (removed the fix only) → test red-bars with CS1010: Newline in constant at 26,76. Restoring the fix returns to green. Confirms the guard bites.
  • grep -n '\b100\b' **/*.md — remaining hits are all intentional (CSS values, future-state goals, historical release notes).

Test plan

  • CI green (build + tests + smoke-test step)
  • Preview-pages workflow runs to completion (Setup Pages step succeeds)
  • Manual repro: pack CLI locally, install as tool, scaffold a fresh dotnet new blazor, run shellui init + shellui add chart pie-chart dashboard-02, then dotnet build — expect 0 errors
  • Render a <PieChart> and confirm the hover tooltip's HTML no longer shows literal \" characters
  • shellui list count matches the docs (68)

Shewart added 6 commits June 17, 2026 16:08
Updated the tooltip HTML structure in PieChart.razor, ChartVariantsTemplate.cs, and PieChartTemplate.cs to ensure proper rendering by fixing quotation marks. This change enhances the display of tooltips in the charts, improving user experience.
…late

Updated the breadcrumb item label quotation in DashboardLayout02Template.cs to use proper syntax, ensuring consistent rendering of the home link in the dashboard layout.
Introduced a new test class, TemplateCompileTests, to ensure that the generated content of C# and Razor templates parses correctly. This addition helps catch potential syntax errors in templates, improving the reliability of the component library. Also, added Microsoft.CodeAnalysis.CSharp package for syntax tree parsing.
Added a new smoke test step in the CI workflow to validate the CLI scaffolding process, ensuring that generated projects function correctly. This includes packing the CLI project, installing it as a tool, and running a series of commands to verify the setup. Additionally, enabled automatic deployment of GitHub Pages in the preview workflow to streamline the publishing process.
…8 installable components

This commit updates the README, versioning strategy, and various documentation files to accurately represent the current status of ShellUI, which now includes 68 installable components. Changes include adjustments to component counts, installation instructions, and examples throughout the documentation to ensure clarity for users. The version has been bumped to v0.3.0-alpha.3 to reflect these updates.
…for smoke tests

Updated comments in the CI workflow to clarify the purpose of the smoke tests for CLI scaffolding. Additionally, explicitly added the Blazor-ApexCharts package to the smoke test setup to isolate and address specific bug classes related to template escapes, ensuring a more robust testing process.
@Shewart Shewart merged commit ab224f0 into main Jun 17, 2026
1 check passed
@Shewart Shewart deleted the fix/critical-template-bugs branch June 17, 2026 14:24
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.

1 participant