This document specifies a “ControlsDemo” app showcasing XenoAtom.Terminal.UI controls and composition patterns. It should feel like a polished, modern application and be the primary place to:
Discover controls and styles quickly.
Copy/paste practical usage patterns (fluent API + state + events).
Strong ergonomics: every demo is interactive and shows typical usage; minimal boilerplate for adding a demo.
Integrated documentation: a demo should link to its source and (when relevant) to docs/specs.
Diagnostics-friendly: show event logs, focus path, hovered element, popup stack, and basic render stats.
Repeatable: easy to run locally, in CI, and as a global tool; deterministic demos (no random unless seeded).
Unique strengths to highlight
XenoAtom.Terminal.UI is not just a collection of controls: it is a bindable, composable UI system that enables “live UI” without a diff engine and without asking the user to manually refresh.
The demo should explicitly showcase these “killer” features across the app (not hidden in a single page):
Everything is bindable: bindable properties (and routed events) allow concise wiring with the fluent API.
State<T> for live UI: State<T> is a first-class binding source; changing state drives UI updates smoothly.
Inline and fullscreen hosting: the same visuals can be used for Terminal.Write(...) (flow output), Terminal.Live(...) (inline live region), and Terminal.Run(...) (fullscreen app).
Dynamic composition via state: build “functional” composite UIs by switching subtrees based on state (e.g. ContentSwitcher.SelectedIndex bound to State<int>).
var view = new State<int>(0);
new ContentSwitcher()
.SelectedIndex(view)
.Add(
new TextBlock("View A"),
new VStack().Add(new TextBlock("View B"), new Spinner()),
new Table() /* ... */);
Non-goals (for v1)
No external dependencies beyond what the repo already uses.
No recording/export pipeline beyond simple "copy markup"/"copy screenshot as text" primitives.
No full-blown "property grid" reflection editor (can be added later as a bonus).
App shell & navigation
Layout
Header: app title, current demo name, search box (or “Ctrl+P” hint), theme selector, and optional small status icons.
Body: resizable SplitView (HSplitter):
Left: navigation sidebar.
Right: demo content area.
Footer: key hints and status (focused control name, mouse coordinates when available, errors).
The app should keep a clean, modern look: avoid heavy background fills; reserve backgrounds for surfaces/inputs.