Skip to content

feat(cli): dashboard setup in init, stock page cleanup, ShellUI terminal loaders - #34

Merged
Shewart merged 6 commits into
mainfrom
feat/init-dashboard
Sep 29, 2026
Merged

Shewart merged 6 commits into
mainfrom
feat/init-dashboard

Conversation

@Shewart

@Shewart Shewart commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

shellui init can now set up a working dashboard app in one step. Adding a dashboard layout wires it into the app instead of leaving the layout unused. The CLI also cleans up after removing Bootstrap and uses ShellUI's own loaders in the terminal.

Dashboard setup

  • init asks: sticky header (dashboard-02, recommended), scrolling header (dashboard-01), or no.
  • Flags: --dashboard 01|02|none on init and theme init. --yes alone means none; an invalid value exits 1 before anything is written.
  • --replace-layout on init and add switches even when the app has a custom layout.
  • init --dashboard and shellui add dashboard-0x share the same wiring (DashboardSetup):
    • Routes.razor: DefaultLayout → the dashboard. <AuthorizeRouteView> (Identity apps) is supported, and switching between 01 and 02 is automatic.
    • Custom or modified layouts: the CLI asks before switching. With no terminal it leaves the layout alone and prints a --replace-layout hint.
    • Stock MainLayout / NavMenu (and their .razor.css) are deleted only if byte-identical to dotnet new blazor output for .NET 8/9/10 and not referenced elsewhere. The stock set was generated across interactivity × all-interactive × auth × empty, and 8.0.0/9.0.0 GA template sources match the latest patches. Modified files are kept with a warning.
    • @layout MainLayout directives move to the dashboard: the .NET 10 NotFound page and Identity's ManageLayout. They follow later dashboard switches too.
    • blazor-error-ui moves from MainLayout into App.razor, styled with Tailwind.
    • AppSidebar links are built from the app's @page routes. Parameterized routes, /Account/*, /Error and /not-found are skipped, and links you've edited are left alone.
    • ReconnectModal is untouched. Re-running is idempotent and prints a summary of what changed.
  • The AppSidebar template renders from a Links list, replacing the dead /dashboard and /settings links.

Bootstrap cleanup and sample pages

  • .NET 8 kept Bootstrap fully loaded: the template's wwwroot/bootstrap/ was never deleted, so its reset fought Tailwind. It is removed now.
  • The local Bootstrap <link> is removed from App.razor, which fixes a 404 on every page load on .NET 9/10. CDN links are kept.
  • Unmodified stock pages (Home, Counter, Weather, Error, NotFound, Auth) are restyled with Tailwind classes that match ShellUI's Button and Table. Edited pages are kept and listed if they still use Bootstrap classes; Identity Account/ pages get one summary note.
  • The stock Home becomes a "Make it yours" card pointing to tweakcn themes (shellui theme apply), shellui add/list, and the docs.
  • init's next steps include the tweakcn theme command.

Terminal

  • init shows the ShellUI dot logo as a header and runs setup under an animated 5×5 logo loader. add, update and the theme fetch use a one-line Braille "snake" grid spinner. Both mirror the web Loading variants.
  • list uses the same header, drops columns on narrow terminals, and reports 90 direct targets instead of 194 registry entries.
  • Output is UTF-8. Windows' default OEM code page made Spectre fall back to an ASCII spinner and print ✅ as ?.
  • Without an interactive terminal (CI, piped output) the loaders fall back to plain lines.

Fixes

  • shellui add avatar|alert|badge|sonner|toggle on their own broke the build. Those Variants files declare .Components.UI, but EnsureImports added @using ….Components.UI.Variants based on the folder. Imports are now based on the namespace each installed file declares. This bug is also in v0.3.0-rc.3.
  • An init failure now exits 1.

Tests and CI

  • DashboardSetupTests, StockPagesTests and LoadersTests, with real dotnet new blazor output as fixtures (ShellUI.Tests/Fixtures/StockBlazor). RequiredImports now has a regression test for the Variants namespace.
  • CI: init --yes --dashboard 02, then assert the wiring and build.
  • 213 tests pass.
  • E2E: net8 and net10 apps, a modified layout (with and without --replace-layout), Identity auth, a 01↔02 switch, an idempotent re-run, and all 90 targets in one app. All build with 0 warnings.

Follow-ups (not in this PR)

  • Backport the imports fix to release/v0.3 before v0.3.0.
  • Identity apps: the dashboard sidebar has no Login/Register/Logout, and the Account/ pages still use Bootstrap.

Shewatipa Tseisi added 6 commits September 29, 2026 08:26
…tructure

- Added steps to the CI workflow for initializing a Blazor application with a dashboard layout.
- Implemented checks to ensure the correct removal of default layouts and the addition of necessary components in the application structure.
- Enhanced the build process to validate the integration of the new dashboard layout and sidebar links.
…gement

- Added options for `--dashboard` and `--replace-layout` to `shellui init` and `shellui add` commands, allowing users to specify dashboard layouts during initialization and component addition.
- Updated documentation to reflect new command options and their functionalities, including details on dashboard layout configurations and the impact on existing layouts.
- Improved the initialization process to handle Bootstrap removal and restyling of sample pages with Tailwind classes, ensuring a smoother setup experience for users.
…tialization

- Added `--dashboard` and `--replace-layout` options to `shellui init` and `shellui add` commands for better dashboard layout management.
- Updated the initialization process to set console output encoding to UTF-8 for improved character display.
- Enhanced the `InitService` to prompt for dashboard layout selection during initialization.
- Introduced a new `DashboardSetup` service to manage dashboard layout configurations and updates.
- Implemented a custom loading spinner for better user experience during CLI operations.
- Refactored component installation logic to accommodate new layout options and ensure proper integration with existing components.
- Replaced static sidebar menu items with a dynamic generation of links using a `NavLink` record.
- Introduced a `Links` array to manage sidebar items, allowing for easier updates and maintenance.
- Enhanced icon rendering based on the link type, improving the flexibility of the sidebar structure.
@Shewart
Shewart merged commit 28c5a6b into main Sep 29, 2026
1 check passed
@Shewart
Shewart deleted the feat/init-dashboard branch September 29, 2026 07:39
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