Add tuirec recording guide and hero-gif docs#5396
Conversation
Add hero-gif.md as a minimal pointer to the recording guide. Add Scripts/tuirec.md with the full recording workflow, validation checklist, agent guidance, and TBD sections for UICatalog scenarios, EnableForDesign views, and standalone example apps. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rewrote Scripts/tuirec.md with comprehensive agent-oriented guidance for recording UICatalog scenarios using gui-cs/tuirec - Includes install steps, keystroke composition, PowerShell quoting, --kitty-keyboard decision tree, troubleshooting, and validation checklist - Added working CharMap scenario recording (docfx/images/charmap.gif) - Updated hero-gif.md with quick-reference recording command Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Corrected the framing: this is a tuirec encoding bug (sends fabricated CSI u codepoints for nav keys), not a Terminal.Gui parsing issue. Filed gui-cs/tuirec#54 with full spec analysis. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Superseded by PR #5393 which consolidates all Spectre interop work. |
Re-recorded with a focused demo script that: - Scrolls briefly to show charmap responsiveness - Uses CollectionNavigator typing to jump to Box Drawing category - Jumps to Emojis Symbols category to show emoji rendering - Opens context menu (Shift+F10) on a glyph - Updates tuirec.md example to document these techniques Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Feedback from using tuirec guidance to record SpectreView scenarioThe recording succeeded first try using For "Recording UICatalog Scenarios" section:
For "Recording Individual View Sub-classes with EnableForDesign":
For "Recording Standalone Example Apps":
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Re-record using Box Drawing + Arrows instead of Emojis (wide glyphs cause misaligned rendering in agg output) - Add 'Avoid wide glyphs' principle to recording guidance - Add 'Output File Placement' section: GIFs go alongside scenario code at Examples/UICatalog/Scenarios/<Dir>/<Name>.gif - Add wide-glyph troubleshooting entry - Use PascalCase --name matching the scenario class name Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Move Scripts/tuirec.md -> Scripts/tuirec/README.md - Move hero-gif.md -> Scripts/tuirec/hero-gif.md - Update file placement guidance: GIFs and optional *-tuirec.ps1 scripts live alongside the .cs file they document - Fix quit key: Escape is the default (not Ctrl+Q) - Add guidance for View-derived class GIF placement Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Agents should follow the general workflow in README.md rather than creating per-scenario tuirec scripts. If something is unclear enough that an agent creates a bespoke script, the README should be improved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
New sequence: Tab to category list, A (Arrows), Bo (Box Drawing), E (Emoji), Tab back to grid, context menu, quit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8a10345 to
4b736a5
Compare
Sequence: Tab to categories, Arrows -> Box Drawing -> Emoji, Tab back to grid, context menu, quit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4b736a5 to
156dfbe
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
93e763f to
53b53ec
Compare
- Add GetDemoKeyStrokes() to IDesignable interface returning tuirec-format keystroke strings for recording demo GIFs of each view - Implement for: Button, TextField, ListView, OptionSelector, DropDownList, Tabs, SpinnerView, ProgressBar - Add --live and --keystrokes flags to OutputView: --live: keeps app running for tuirec recording --keystrokes: queries view's demo keystrokes and prints to stdout - Rewrite generate-views-doc.ps1 to use tuirec instead of ANSI->HTML rendering. GIFs go to docfx/images/views/ and views.md embeds them as markdown images. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Added GetDemoKeyStrokes() to: FlagSelector, TextView, TreeView, TableView, DateEditor, TimeEditor, HexView, ColorPicker - Fixed OptionSelector: added Space to activate selected item - Fixed DropDownList: use F4 to open, made override of TextField's virtual method - Fixed TextView: use backtick-wrapped literal text for tuirec - Generated 39 view GIFs in docfx/images/views/ with trimmed pre/postroll 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: 0ee7561f88
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
Adds a tuirec-based workflow for capturing consistent Terminal.Gui demo recordings (GIFs/casts), and wires up view-level “demo keystroke” metadata so tooling can automatically drive interactive captures (not just static renders).
Changes:
- Add
IDesignable.GetDemoKeyStrokes()(tuirec token string) and implement it across multiple built-in views. - Extend the DocFX
OutputViewtool with--live(interactive run) and--keystrokes(query demo script) modes. - Add
Scripts/tuirecdocumentation and update the DocFX view-doc generator to record per-view GIFs usingtuirec.
Reviewed changes
Copilot reviewed 21 out of 61 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| Terminal.Gui/ViewBase/IDesignable.cs | Adds GetDemoKeyStrokes() default interface method + docs. |
| Terminal.Gui/Views/Button.cs | Provides demo keystroke script for recording. |
| Terminal.Gui/Views/Color/ColorPicker.cs | Provides demo keystroke script for recording. |
| Terminal.Gui/Views/DropDownList.cs | Provides demo keystroke script for recording. |
| Terminal.Gui/Views/HexView.cs | Adds demo keystrokes (explicit interface impl). |
| Terminal.Gui/Views/ListView/ListView.cs | Provides demo keystroke script for recording. |
| Terminal.Gui/Views/ProgressBar.cs | Adds GetDemoKeyStrokes() override (currently returns null). |
| Terminal.Gui/Views/Selectors/FlagSelector.cs | Provides demo keystroke script for recording. |
| Terminal.Gui/Views/Selectors/OptionSelector.cs | Provides demo keystroke script for recording. |
| Terminal.Gui/Views/SpinnerView/SpinnerView.cs | Adds demo keystrokes (explicit interface impl) for animation recording. |
| Terminal.Gui/Views/TableView/TableView.cs | Adds demo keystrokes (explicit interface impl). |
| Terminal.Gui/Views/Tabs.cs | Provides demo keystroke script for recording. |
| Terminal.Gui/Views/TextInput/DateEditor.cs | Adds demo keystrokes (explicit interface impl). |
| Terminal.Gui/Views/TextInput/TextField/TextField.cs | Provides demo keystroke script for recording. |
| Terminal.Gui/Views/TextInput/TextView/TextView.cs | Provides demo keystroke script for recording. |
| Terminal.Gui/Views/TextInput/TimeEditor.cs | Adds demo keystrokes (explicit interface impl). |
| Terminal.Gui/Views/TreeView/TreeView.cs | Provides demo keystroke script for recording. |
| Scripts/tuirec/README.md | Comprehensive tuirec recording guide. |
| Scripts/tuirec/hero-gif.md | Short “hero GIF” pointer/quick reference to the guide. |
| docfx/scripts/OutputView/OutputView.cs | Adds --live run mode + --keystrokes query mode for tooling. |
| docfx/scripts/generate-views-doc.ps1 | Switches from static render capture to tuirec-driven GIF generation per view. |
…solution, cross-platform paths - Remove redundant ProgressBar.GetDemoKeyStrokes() (default returns null) - Add app.Dispose() on early return in OutputView non-live path - Fix generic view type resolution (e.g. ListView`1) via assembly scan - Replace hard-coded .exe paths with cross-platform dotnet <dll> invocation - Remove unused $repoRoot variable in generate-views-doc.ps1 - Use built binary instead of dotnet run for keystroke queries - Fix --startup-delay from 1500 to 0 in generate-views-doc.ps1 - Add GetDemoKeyStrokesTests covering all IDesignable implementations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Note this is a new API added in v2 - Clarify that both null and empty string mean no interactive demo Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Upgrade to tuirec v0.4.2 which has built-in --trim for preroll/postroll - Fix Code.gif: skip white-on-black scheme override in live mode so syntax highlighting colors are preserved - Add wait:500 before final Escape so last meaningful frame has dwell time - Prevent child Accept from bubbling up in live mode (CommandsToBubbleUp = []) - Script retries with --trim=false when validation fails (1-frame GIFs) - Re-record all 39 view GIFs with improved pipeline Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…r all views OutputView now writes a concealed ANSI character before TG renders, creating a 500ms time gap that guarantees 2+ visually distinct frames for --trim. This eliminates the dark first-frame preroll artifact for ALL views without needing the --trim=false fallback. Added GetDemoKeyStrokes() to 12 views: Bar, CharMap, Code, GraphView, Label, Link, MenuBar, ProgressBar, ScrollBar, Shortcut, StatusBar, Wizard. All 39 GIFs now record with --trim successfully (zero fallbacks). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The concealed attribute (\x1b[8m) isn't honored by agg, causing a visible white dot in the first GIF frame. Fix by setting the dot's foreground color to match the monokai theme background (#272822 = RGB 39,40,34), making it truly invisible. Also switch static-view fallback from Tab to click:40:10 which more reliably triggers visual changes (fixes PopoverMenu). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The 500ms Thread.Sleep created a visible ~1s blank gray screen at the start of each GIF. Reduced to 50ms which is enough for --trim frame detection but imperceptible in the final GIF. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…FileDialog - CharMap: page down 40x then context menu (Shift+F10) - Tabs: navigate to Settings tab, press Alt+I 4x, select RoundedDotted style - TreeView: expand nodes with Space - Markdown: scroll down 50x to show content - FileDialog: navigate type filter, filter by .md, select file - Add --mouse-pointer none to all recordings - Add GetDemoKeyStrokes() to Markdown and FileDialog Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove .cast files, local_packages, and artifacts/ directories. Remove --cast-output from generate script (not needed in repo). Add --mouse-pointer none to fallback retry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add <img> tags referencing view GIFs in the <remarks> section of 38 view class XML docs. These will display animated demos in the published API documentation. Also: - Remove PopoverMenu GIF (can't render in isolation as a popover) - Add GetDemoKeyStrokes() to Markdown and FileDialog - Fix test to use ImageView for null-returning default interface check - Add Markdown and ProgressBar to non-null keystroke test cases Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BDisp
left a comment
There was a problem hiding this comment.
Impressive work. The idea of automating preview recordings is very good.
Summary
Adds
IDesignable.GetDemoKeyStrokes()to the framework and implements automated GIF recording infrastructure for Terminal.Gui views documentation.API Changes
IDesignable.GetDemoKeyStrokes()— new default interface method returning a tuirec-format keystroke string (ornullfor static views). Implemented on 15 views: Button, TextField, TextView, ListView, OptionSelector, FlagSelector, DropDownList, Tabs, SpinnerView, TreeView, TableView, DateEditor, TimeEditor, HexView, ColorPicker.Tooling Changes
docfx/scripts/OutputView/): Added--livemode (runs withoutStopAfterFirstIterationfor tuirec recording) and--keystrokesmode (queriesGetDemoKeyStrokes()for a view type). Fixed generic type resolution.dotnet <dll>invocation.Documentation
Scripts/tuirec/README.md— comprehensive recording guideScripts/tuirec/hero-gif.md— quick reference.exereferences replaced with cross-platformdotnet <dll>invocationCtrl+Q→EscapethroughoutGIFs
docfx/images/views/(373KB total)Examples/UICatalog/Scenarios/CharacterMap/Upstream Issues Filed