Files
kryon/docs/WIDGET_CONFORMANCE.md
T
waozi 4b7c4e84f0 Release v0.2.0: Kry UI runtime authored in .kry
Widget, layout, interaction, style, and UI-tree logic is now authored in
the Kry (.kry) UI language and compiled into the native C and Go runtimes,
replacing the hand-written C widget implementation. The remaining C is
platform and raster backends (X11 window, font rasterization, paint command
execution, surface/image caches, test helpers).

- Clipboard OSC52/paste callbacks are host-provided write functions instead
  of raw function-pointer typedefs, unblocking Go runtime generation.
- AccessibilityNode and Accelerator types are generated from .kry.
- Generated-runtime parity test passes for both C and Go.
2026-09-20 19:36:28 -03:00

2.2 KiB

Widget Conformance

Kryon widgets must be tested at the runtime boundary, not only inside downstream apps. Each widget family should have the same coverage shape:

The canonical public naming and migration review lives in docs/CANONICAL_WIDGET_SURFACE.md. Any registry name added to src/ui/node_registry.kry must appear there before the public API gate passes.

  1. Direct Go runtime tests in go/kryon/*_test.go. These drive public widget APIs with QueueTap, QueueText, QueueKey, focus, selection, and frame rendering. They catch native Go runtime bugs.

  2. Generated runtime parity for active targets. Fixtures in tests/parity/*.kry should continue to cover Go and C behavior. The old JS fixture path is paused and retained only as reference material for a future web-native DOM/CSS/JS target.

  3. Backend or platform translation tests. Backend event adapters must translate native events into the same public input queue contracts. Example: window_linux_test.go verifies X11 keysyms for printable text, Backspace, Enter, and shortcuts.

  4. Performance harnesses for hot widgets. Text input has make perf-text-input, which validates generated lowering and measures retained-core C typing, backspace, selection replacement, tab traversal, idle frames, and random-focus precision.

Required workflow coverage for editable widgets:

  • click/tap focus
  • focus switch between multiple fields
  • printable text insertion
  • Backspace and Delete
  • Enter/commit
  • Tab and Shift-Tab traversal
  • selection replacement
  • clipboard copy/cut/paste where supported
  • secure text rendering does not leak plaintext
  • Unicode cursor movement and deletion
  • stable frame operation counts under long input

Required workflow coverage for collection widgets:

  • single click selection
  • double-click activation
  • keyboard navigation
  • scrolling
  • context/right-click selection where supported
  • selected item/cell rendering without unintended row or panel highlights

New widgets are not complete until their direct runtime test, generated parity fixture or explicit unsupported note, backend event coverage where relevant, and benchmark coverage for hot paths are present.