RFC: SharpConsoleUI command center for the interactive shell#735
Draft
nickprotop wants to merge 1 commit into
Draft
RFC: SharpConsoleUI command center for the interactive shell#735nickprotop wants to merge 1 commit into
nickprotop wants to merge 1 commit into
Conversation
Replace the prompt-first Spectre.Console SelectionPrompt loop (bare `dotnet skills` / `agents`) with a retained-mode SharpConsoleUI shell built on ConsoleWindowSystem + NavigationView. The classic prompt loop is preserved as RunClassicShellAsync and used automatically when stdin/stdout is redirected (CI, pipes, dumb terminals). InteractiveConsoleApp.Shell.cs (new) adds the command center: - NavigationView with pages for every HomeAction surface (Home, Skills, Installed, Collections, Bundles, Packages, Agents, Project, Analysis, Remove-all, Update-all, Settings, About) driven by the existing NavigationSurfaceManifest. - Page content reuses the existing BuildRich* Spectre renderables verbatim via SpectreRenderableControl - no rendering rewrite. - Selection flows are ListControl activation -> modal Windows with a ToolbarControl row of ButtonControls. Mutations call the Runtime installers (SkillInstaller / AgentInstaller / ProjectSkillRecommender) directly and re-render the affected page in place. - Interactive bottom status bar (StatusBarControl): per-page dynamic hints, clickable items, shortcut highlighting, ticking clock, live catalog summary, toast slot for action results. Ctrl+R / Ctrl+U / Ctrl+I shortcuts are also wired in the window key handler. - Main window: rounded subtle border, hidden title, Maximized; Esc and OnClosed both call ws.Shutdown(0). Modals: centered, non-minimizable / non-maximizable, Esc dismisses. - List selection theme is pinned so keyboard, mouse hover, and click all paint the same solid selection bar (otherwise the three list states render in three different colors). SharpConsoleUI 2.4.55 -> 2.4.61, and added to ManagedCode.DotnetSkills (the main tool had no SharpConsoleUI reference yet; the dep was only declared in the agents / dotnet-agents wrappers, which compile the same sources). All four projects build clean. All 613 tests pass. `dotnet skills <subcommand>` (list / install / recommend / ...) is unchanged - only the bare interactive invocation is affected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
A working prototype that replaces the prompt-first interactive shell (bare
dotnet skills/agents) with a retained-mode SharpConsoleUI command center — the direction yourdocs/cli-rewrite-plan.mdflagged as a possible later phase.Opening as a draft for feedback on direction, not as a merge-ready change.
Demo
![SharpConsoleUI command center — Bundles page with bundle-detail modal]
How it works
InteractiveConsoleApp→partial. The originalSpectre.Console.SelectionPromptloop is preserved asRunClassicShellAsyncand used automatically when stdin/stdout is redirected (CI, pipes, dumb terminals). The newRunAsyncis the SharpConsoleUI shell.InteractiveConsoleApp.Shell.csadds theConsoleWindowSystem+NavigationViewwith pages for everyHomeActionsurface (Home, Skills, Installed, Collections, Bundles, Packages, Agents, Project, Analysis, Remove-all, Update-all, Settings, About) — driven by the existingNavigationSurfaceManifest.BuildRich*Spectre renderables verbatim, hosted inSpectreRenderableControl— no rendering rewrite in this PR.ListControlactivation → modalWindows with aToolbarControlrow ofButtonControls. Mutations call theRuntime/*installers (SkillInstaller,AgentInstaller,ProjectSkillRecommender) directly and re-render the page in place.StatusBarControl, lazynuget / cxfiles style): dynamic per-page hints, clickable items, shortcut highlighting, ticking clock, live catalog summary, toast slot for action results.Ctrl+R/Ctrl+U/Ctrl+Ishortcuts are also wired through the window's key handler so they actually fire.Maximized(); Esc andOnClosedboth callws.Shutdown(0). Modals: centered, non-minimizable / non-maximizable, Esc dismisses.HighlightBackgroundColor,ListHoverBackgroundColor, andListUnfocusedHighlightBackgroundColorpaint three different colours).SharpConsoleUI2.4.55 → 2.4.61, and added toManagedCode.DotnetSkills.csproj— the main tool had no SharpConsoleUI reference yet; the dep was only declared in theagents/dotnet-agentswrappers, which compile the same sources.Status
ManagedCode.DotnetSkills,ManagedCode.Agents,ManagedCode.DotnetAgents,ManagedCode.DotnetSkills.Tests).dotnet skills <subcommand>(list/install/recommend/bundle list/agent install/ …) is unchanged — only the bare interactive invocation is affected.What's next if you like the direction
This PR keeps the Spectre
Panel/Grid/Tablerenderables behindSpectreRenderableControlso the visual identity is preserved with minimum churn. Phase 2 — only worth doing if you want to commit to this surface — is replacing those with native SharpConsoleUI controls (PanelControl,TableControl,HorizontalGridControl,MarkupControl, …). That buys: per-row mouse interactivity, proper layout reflow, theme integration, no Spectre-renderable-in-a-buffer-cell quirks. Same page contracts, swap the leaf builders.Questions for the maintainers
dotnet-skillsto take, given thecli-rewrite-plan.mdframing?--ui/--shell)? Today CI and pipes already fall through to the classic shell automatically; the question is what a real-terminal user sees by default.