Skip to content

Integrated: CLI, layout inspection, readiness, charts, offline catalog, concise options, task-status rename (#4–#10) - #14

Merged
albertwoo merged 20 commits into
mainfrom
pr/issues-integration
Nov 11, 2026
Merged

albertwoo merged 20 commits into
mainfrom
pr/issues-integration

Conversation

@albertwoo

@albertwoo albertwoo commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Merges reviewed issue branches #4–#10, live NamedPipe window control, and main (PR #12 feat/design-tokens, PR #13 investigate/frame-alloc-flake) into a single integration branch.

What this adds

  • Live Window Control over NamedPipe (LiveSession, LiveClient, dotnet cui --attach / ps):
    • Opt-in live attach for running windows on Windows (--live, CUISHARP_LIVE=1, or CuiAppOptions.LiveAttach).
    • Listens on a user-only local named pipe (cui-live-<pid>-<nonce>, PipeOptions.CurrentUserOnly | PipeOptions.Asynchronous) and publishes a discovery record under %LOCALAPPDATA%\cuisharp\live (overridable via CUISHARP_LIVE_DIR).
    • Executes the full headless command set (tree, layout, find, click, type, key, focus, move, wheel, frame, pulse, wait, waittext, faults, png, quit) at CUI's frame boundaries via a message-only window (CuiSharpLiveMessage) without taking the loop from CUI, leaving the live window open between CLI invocations until quit.
    • Hardened with callback-depth nesting guards across RunThunk, deferred canvas PaintThunk, and FrameCallbacks, live-resize modal loop deferral, WM_DESTROY/WM_NCDESTROY quiescing before native cui_app_destroy, multi-frame capture re-arming, and post-injection frame waits before cancellation acknowledgement.
    • Refactored src/CuiSharp.Tools/Cli.cs from first principles into a single unified option parser supporting dotnet cui ps [--json] and -a / --attach / --attach=<pid|title>.
  • cui cannot drive file-based apps, and dotnet cui is not the installed command #4 File-based apps and dotnet cui: AppLocator resolves .cs and .csproj apps from the app directory (dotnet build -getProperty), installed-tool shim dotnet-cui, UTF-8 console streams, bounded MSBuild diagnostics and child-process cleanup.
  • Add cui layout: container tree with rects and overflow markers #5 Layout inspector: LayoutFormatter.Print(frame) and layout command; named identity tracking (HasOwnRect), lower-bound union>= reporting, floating-layer exclusion, extent:UNKNOWN for scrolled/virtualized content, OVERFLOW(observed bounds) checks.
  • Headless: add a readiness signal and let cui png --wait use it #6 Readiness-aware waits: ui.MarkReady() (published after EndFrame completes), HeadlessApp.WaitReady/WaitFor, protocol wait/waittext, CLI preconditions --wait ready, --wait-text, --wait-timeout.
  • Make the API queryable: ship api.json, add cui api / cui icons, document the traps #7 Offline API and icon catalog: tools/export-api.cs exports 692 types / 4,920 members / 5,558 summaries; dotnet cui api <Name> [--json] and dotnet cui icons [filter] [--json] answered offline from the embedded catalog.
  • Charts: timestamp x-axis, normalize mode, and explicit label control #8 Managed chart normalization: ChartNormalizer (None/Index100/Percent), ChartOpts.Normalize for line/area/bar/stacked bars; donut rejection, Count-clipped validation, odd-MaxPoints buffer fix, pixel/allocation tests.
  • Add optional-parameter overloads for common layout and text widgets #9 Concise option constructors: hot-field constructors on Box, Card, TextOpts, BadgeOpts with no overload ambiguity.
  • CuiSharp.TaskStatus collides with System.Threading.Tasks.TaskStatus #10 Task status enum rename: CuiSharp.TaskStatus -> CuiSharp.CuiTaskStatus.

Verification

  • pwsh tools/regen.ps1 -NoNative -NoDiff: passed — bindgen 13/13, export-api --check no diff, dotnet build -c Release -warnaserror 0 W / 0 E, CuiSharp.Tests 891/891, CuiSharp.App.Tests 28/28.
  • dotnet format CuiSharp.slnx --verify-no-changes: no changes.
  • pwsh tools/verify-template.ps1 -NoPublish: passed (58 s) — pack, cui-app build/test, CUI002 analyzer check, dotnet-cui.exe install + dotnet cui api ChartOpts --json, cui-mini headless + UTF-8 round-trip, native window smoke.

contributor and others added 20 commits November 11, 2026 10:35
A begin that returns a cui_id now hands it to the recorder (generated),
and a named scroll recomputes the pure cui_make_id hash CUI derived,
only while recording. No synthetic ids, no native change: a named
Box/Row/Column/Scroll reports its own rect instead of the last
widget's. Generated files changed via tools/regen.ps1 only.
…known

LayoutFormatter renders a recorded frame with verified rects only where
the widget owns the id it was laid out under, observed bounds labelled
union>= (a lower bound of recorded rects, never a content extent),
extent:UNKNOWN for scrolled/virtualized content CUI keeps private, and
a header warning above every view. HeadlessApp.PrintLayout and a
headless 'layout' command expose it; the tree and query ranking are
untouched.
ui.Row(new(gap: 12, align: Align.Center)), ui.Column(new(pad: 18, gap: 12,
height: Size.Fill)), ui.Text("Live", new(size: 12, color: ...)),
ui.Badge("Updating", new(Tone.Danger)) and ui.Card(new(pad: 16, gap: 12,
dir: Dir.Column)) as partial-struct constructors on Box, Card, TextOpts and
BadgeOpts. Constructors rather than optional-parameter overloads: no new
candidate competes with the generated wrappers, so Row(), Row(default),
Card(new()) and Text("x", default) keep their exact current binding, which
ConvenienceCompilerTests pins with real-compiler symbol assertions. Layout
parity, native byte parity, post-throw sibling placement and steady-state
0 B are asserted on real surfaces.

Co-Authored-By: pi <pi@localhost>
…t rejection

Normalization rescales chart series against their first finite nonzero sample.
A requested mode rejects nonfinite samples, a baseline-less series, out-of-range
results and unknown enum values rather than draw a line that silently lies;
None keeps the old pass-through copy. Allocation-free like SeriesDecimator.
…tdown, wait deadlines, and publish-size exclusion
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.

2 participants