feat: help TUI viewer, markdown rendering, rename ExampleApp to greet#7
Merged
Merged
Conversation
- HelpCommand.RunAsync launches a TUI Markdown viewer (Runnable + Markdown + StatusBar) matching clet's pattern, instead of returning raw text in CommandResult - MetadataHelpProvider.GetRootHelp emits markdown (tables, headers) instead of plain text - CliHost.WriteRootFlag passes --help output through MarkdownRenderer.RenderToAnsi for ANSI-styled stdout - Rename examples/Terminal.Gui.Cli.ExampleApp to examples/greet with AssemblyName=greet - Add README.md for the greet example app - Add visual UI tests (CommandUiHarness + golden-file assertions) ported from clet's CletUiHarness pattern - Add MetadataHelpProviderTests and CliHost help rendering tests Closes #5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ab8f359a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Port clet's MarkdownHelpRenderer approach: set Console.OutputEncoding to UTF-8 before rendering, use a full TG ANSI driver with proper layout/draw cycle, and restore encoding afterward. Fixes garbled box-drawing chars. - Add FarewellCommand with --until option for navigation testing - Add embedded markdown help files (help.md, greet.md, farewell.md, info.md) - Configure EmbeddedMarkdownHelpProvider in greet example - Fix InfoCommand to properly launch TUI viewer (was returning text without calling app.RunAsync, causing terminal to hang until Enter pressed) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… args - Add DefaultCommand option to CliHostOptions so bare args/options are retried as the default command (e.g. 'greet World' == 'greet greet World') - Refactor CliHost.RunAsync into DispatchCommandAsync/ExecuteCommandAsync - Add help:topic link navigation in HelpCommand via Markdown.LinkClicked - Add 'Back to main help' links in all sub-topic help files - Add help:command anchors in root help.md for topic navigation - Make GreetCommand and FarewellCommand accept positional args for name - Set greet example DefaultCommand = 'greet' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add BrowseBar (ported from clet) with back/forward history stacks, Ctrl+Left/Right shortcuts, and proper statusbar styling - Rewrite HelpCommand.RunAsync to match clet's HelpClet pattern: BrowseBar, LinkClicked handler, NavigateTo, viewport reset - Add TextMateSyntaxHighlighter for code block coloring - Add horizontal scrollbar to markdown view - Update golden file for new status bar layout Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- HelpBrowserUiTests: proves BrowseBar back/forward arrows render, embedded help content displays, subcommand view shows options, and golden file assertion for the browser layout - GreetExampleTests: proves every documented example in the help files actually works (greet World, --formal Alice, farewell Bob, farewell --until tomorrow Bob, default command dispatch, etc.) - Add embedded help.md resource to integration test assembly - Total: 24 integration tests, 17 unit tests (41 total, all passing) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pipe characters and newlines in command/option descriptions would break the generated markdown table structure. Add EscapeCell helper that replaces | with \| and collapses newlines to spaces. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ReSharper cannot infer target type for 'new' inside collection expressions, so use explicit 'new CommandOptionDescriptor(...)' instead of 'new (...)'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Addresses #5 — the
helpcommand and--helpflag now render markdown properly.Help rendering fixes
HelpCommand.RunAsynclaunches a fullscreen TUI Markdown viewer (usingRunnable+Markdownview +StatusBarwith Quit shortcut), matching clet'sHelpCletpatternMetadataHelpProvider.GetRootHelpnow emits markdown (tables + headers) instead of plain textCliHost.WriteRootFlagpasses--helpoutput throughMarkdownRenderer.RenderToAnsifor ANSI-styled stdoutExample app rename
examples/Terminal.Gui.Cli.ExampleApp→examples/greetAssemblyName=greet, updated namespaces, solution file, CLAUDE.md, agent-guide resourceREADME.mdwith usage examplesVisual UI tests
CommandUiHarness(ported from clet'sCletUiHarness) for in-process TUI rendering with golden-file assertionshelprenders correctly (ANSI snapshot, text content, subcommand help, golden comparison)UPDATE_SNAPSHOTS=1to regenerate golden filesTest summary
Closes #5