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.
Work-in-progress snapshot of all current Kryon changes. Records the remaining native language, KSS migration and verification milestones. Includes nested accessibility trees and ongoing selection support, plus regenerated modal and toggle output.
Validation: 17 generated native parity fixtures passed before the newest concurrent selection edits. Latest accessibility build fails on missing generated selection constants; full preflight also fails on the existing website showcase boundary check. This snapshot is not a completed or fully validated implementation.
SetStyleTheme(light|dark|'') re-resolves every registered pack - built-in
embedded packs, source packs, and their declared variants - through the
shared parse environment's theme axis, preserving the active pack id so
frames repaint in place. The parser exports KssSetTheme beside
KssSetVariant, the C shim grows kss_parse_with_environment, built-ins
re-parse through ReapplyBuiltInStyleTheme, and kryon-preview --theme
applies it before --style so captures can combine any pack (including
'<pack>.<variant>') with either theme overlay. The pack-source test
covers overlay winner flips in both directions and active-pack
survival; every test linking the generated parser now links the
formatter module it references. Go and web keep theme selection at
parse time, with the Go registry's source-retaining counterpart
recorded as a follow-up.
The matched fixture now anchors the shared cascade across hosts: the C
suite resolves its rules through ResolveStyle and the Go suite through
the same generated resolver, asserting identical winners - the base
state including the dark-theme overlay winner, an imported token,
explicit zero with its presence bit, the contrast env axis field, the
pressed state, class matching, and an active variant rule plus overlay.
The web suite asserts the same winners through the CSS mapping. To make
variant rules win naturally, the fixture splits its glow declaration
into an overlay block before the rules that reference the token and a
rule block after the same-layer base Button, matching the documented
positional semantics now spelled out in the API notes.
The Go host mirrors the C flow: ParseStyleVariants reports a sheet's
'@variant' declarations with labels, ParseStyleSheetVariant parses with
one active, and RegisterStylePackSource registers each declaration as a
selectable '<pack>.<variant>' pack whose sheet re-resolves base and
variant rules together. The web layer keeps variant selection in the
parse environment since it has no pack registry. Documented in API.md;
end-to-end registration, activation, and resolution are covered by
TestStylePackDeclaredVariant.
'@variant name "Label" { token overlays and rules }' declares a
selectable pack option in the sheet itself, replacing the
color-substitution-only variant path as the home for treatments like
Lightfield's glow. The shared grammar records every declaration (name
and label) for host enumeration even when inactive; the parse
environment names the active variant (KssSetVariant in C and Go, the
environment's variant field on the web). An active variant contributes
rules in document order and applies token overlays at the variant
origin, above theme and environment and below scoped rules. As with
@theme and @env, overlays apply from their position onward.
RegisterStylePackSource registers each declared variant as a selectable
'<pack>.<variant>' pack carrying the declared label; activating it
re-parses the source with the variant active so base and variant rules
resolve together. The matched fixture grows a glow variant asserted in
C, Go, and web (enumeration, inactive skip, overlay precedence over the
dark theme, and rule ordering), and the pack-source test covers
registration, activation, and resolution end to end.
parseWebStyleSheet now runs runtime/kss_parser.kry in declarative mode: the shared grammar lexes rule selectors, declaration spans, and foreign blocks (@keyframes, @media, @supports, @container) and the web layer only maps them to CSS. Theme overlays, typed environment axes, imports with cycle and missing-source diagnostics, layer ordering, and file:line:column provenance now behave identically on the web, and the hand-written regex KSS parser is removed. Durations convert through exact decimal shifting and integer diagnostics printing avoids float division so C, Go, and JavaScript agree. Strict and CSS-superset web suites pass; the remaining k2js syntax failure is the pre-existing ruby text regression from 4d60fab5.