Skip to content

Make the API queryable: ship api.json, add cui api / cui icons, document the traps #7

Closed

Description

@albertwoo

Context

Building a dashboard meant repeatedly grepping skills/cui-dotnet/api/*.md for struct fields (ChartOpts, Series, TableColumn, EmptyOpts, MetricOpts, SegmentedOpts). The generated truth already exists in the repo (bindings/api.json), but it is neither in the skill nor queryable from the CLI.

Icons are worse: Icons is generated with no index in the docs, so RefreshCw was guessed as REFRESH_CW and ChartLine as CHART_LINE — both compile errors.

Two undocumented facts also changed the code I wrote:

  • Size has implicit operator Size(float) (src/CuiSharp/Interop/Types.cs:101). The docs only show Size.Px(...), so I wrote Size.Px(92) everywhere.
  • ChartOpts.Labels is matched to points by index, not spread over the axis. Verified: 5 labels on 100 points renders only the first ("Open") and silently drops the rest, while 100 labels are auto-thinned when painted. Likewise Series.Count == 0 means "draw the whole array", so a partially filled Series[] is a trap.

Proposal

  • Ship api.json (or a slimmed variant) inside the skill/package, and add cui api ChartOpts / cui api LineChart to print the signature and fields.
  • Add cui icons [filter] to list generated icon names.
  • Add a one-page "signatures & traps" index covering implicit conversions, Labels/Count semantics, and the Size.Fill + chart Height rule.
  • Keep the generated pages as the long tail; make the index the entry point.

Acceptance

Any type, member, or icon name is resolvable with a single CLI call; no markdown search required.

Activity

  1. albertwoo commented on Nov 11, 2026

    @albertwoo
    ContributorAuthor

    Fixed and merged in PR #14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions