Expose the native widget surface through ordinary typed TSX components and enforce application composition at generic export and entry boundaries. Migrate maintained screens, scaffolds, gallery publication and editor transport through the common checked IR path. Preserve native logic, retained component state, input and platform hosts; remove the pixmap application route.
Local validation: complete make push-check passed with published Ziran dc3ecf0a, including docs, public source/saved surface, private-display desktop input, native host links and Canvas input parity. Fresh CLI/player/desktop library installed and byte-verified. The full migration matrix records remaining owning suites, published consumer pins, platform runs and Alpha benchmarks; this is a source milestone, not completion of the full campaign.
Describe nominal host types with their defining module and generate widget
wire names from the same declaration identity. Match package-qualified
records and slices through the shared hosted-value matcher, retaining
module and package mismatch rejection.
Add a separate package-consumer host regression and negative identity
cases. Pin the canonical type producer from Ziran.
Local tests: widget host, widget codec, component host, and all six hosted
tests pass. Ziran portable records, slices, arrays, capabilities, payloads,
web lifecycle and bootstrap checks pass. Broader checks have unrelated
shared-checkout failures reported separately.
Reported-by: Breeze task codex-breeze-breeze-crash-recovery-ui
The desktop rasterizer loads, decodes and smooth-copies file pictures once
a program first asks a picture's size, which every widget that draws one
does first, so vector icons and managed pixels draw without decoders,
threads or asset paths. LanczosSnap is geometry's RectangleSnap, so a
texture draw no longer reaches the Lanczos cache.
A button reaches file pictures and atlas icons through the new
image_lookup. kryon/image is now image_files, which re-exports the Image
widget (image) and fills the pictures; kryon/icon fills the atlas. Library
code imports image itself, so importing a picture-capable widget registers
nothing. Navigation, copy and confirm buttons and the widget host fill the
lookup where they draw, as they reached pictures before. Props modules that
only name Image.Props import image_props, now also exported; unused image
imports are gone.
The frame and the accessibility host reach text requests and editor focus
through text_editing, which text_request and text_input_platform fill, and
the frame samples scrolls through scroll_sampling, which scroll_device
fills.
Desktop examples (C files, C bytes, executable), before -> after:
button 96, 1 411 582, 448 264 -> 70, 980 794, 342 016
text 95, 1 445 077, 462 504 -> 71, 1 020 207, 356 472
textfield 107, 1 580 157, 514 496 -> 84, 1 166 840, 409 840
make pay-per-import-test checks button and textfield; tests whose programs
no longer reach pictures lose their picture bindings and stubs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Inner Breeze's practice manuals and settings move into the Practices
package, and they change speeds and durations with sliders and show a hold
with a progress bar. Slider, DiscreteSlider and Progress are now hosted:
the host drags the slider with its own pointer and answers the value, and
paints the progress bar.
A portable bundle could draw boxes and icons but no line at an angle, so a
chart's trend lines and dots needed compiled screens. Kryon's shapes are now
hosted like Box: the bundle sends their props and the host fills them with
its renderer's RasterTriangles, which every Kryon renderer provides. The
widget host test stubs that rasterizer, as it draws nothing.
A portable form could not draw a fieldset around its sections or place a
toggle at a row's end, because both needed the host's style and font
metrics. Fieldset is now hosted like Box, and the new toggle_measure module
answers the size a toggle needs, from its host as ToggleSize. The host
encodes the answer with the Vector2 encoder, now part of the widget codec.
A portable bundle could not show a row of choices such as Habits' week and
calendar views, so Inner Breeze drew them in compiled screens. Segmented
controls are now hosted like tab bars: the bundle sends its props and up to
32 options and the host draws them with its own widget and style.
Reuse imported storage and discover supplied operations before generating missing codecs from schema metadata. Preserve complete-provider output and exercise partial providers across source and saved native targets. Regenerate the library against the current widget property records.
A hosted game's board was one host call per cell: Pushy's 240 tiles
were the larger part of its frame on a phone. TileMap now hands the
whole map to the host as one call, which draws it with the native
TileMap. Each picture a cell shows passes the asset policy once, as
each cell's Image did, and the paint is the same: a test compares it
with a direct TileMap. Maps with more than 1024 cells, pictures or
names are still drawn cell by cell. The codec generator now encodes
slices of plain values such as []string and []s32.
A symbol beside a name or a coin beside an amount had no hosted widget:
only buttons carried icons. SvgIcon paints a Shape in the caller's color,
and bundles submit it to their host like the other widgets.
A bundle could draw text, buttons, scrolls and tab bars through its host,
but no dialog, so an app had to fill a whole page instead. ModalFrame is
now a hosted widget: its props and result cross with generated codecs,
its action images pass the host's asset policy, and its open panel is a
scope the bundle Ends, counted with scrolls toward the host's limit.
Every ImageProps codec held room for 256 mesh points with a codec each,
about 74 KB, and buttons, title bars and every dropdown option embed one,
so hosted widget codecs grew by megabytes. The points now have no room in
the codec: a bundle still sends them, the Image effect validates and
decodes them into one host buffer (up to IMAGE_MESH_POINT_LIMIT), and an
image codec is back to about 2.7 KB.
ImageProps.mesh holds a columns x rows grid of screen points; Image
stretches the picture across it, two textured triangles per cell, so a
painted limb can bend at its joint like a paper puppet. Mirrored grids
draw (nothing is culled), the bounds still clip, and fit, origin,
rotation and the style radius do not apply. A grid with too few points
draws nothing, and no placeholder covers its bounds.
The paint queue copies the points into per-session blocks when queued,
moves them with their node, and compares them in the retained snapshot,
so a moved vertex repaints and an unchanged grid reuses the frame.
RasterImageMesh draws the grid in every host: raylib (desktop and
Android) sends front-facing textured triangles in one batch, the web
canvas and Cairo draw each triangle through its affine transform under a
clip, the pixmap host and Plan 9 libdraw rasterize pixel centers with a
shared edge rule (bilinear when smooth), and the terminal shows a marker.
The bundle player, zib tool and frame replay bind it, and hosted bundles
send up to 256 points with a plain Image (a per-field slice bound in the
codec generator keeps every ImageProps codec small).
Tests: pixmap mesh test (C, C++, Go, bundles; copy, snapshot reuse,
mirror, bend, clip, seams), Cairo mesh test, RGBA canvas cases, web
canvas pixels and seam at three densities, hosted widget mesh, and a
raylib pixel test on a private Xvfb (make raylib-mesh-pixels-test).
A TitleBar's trailing_width reserves room at its right for the caller's
own controls, such as an online switch, and the result's trailing_bounds
says where to draw them; the title stays centred clear of them, or takes
what is left on a narrow bar. Portable bundles can now draw a TitleBar
through the widget host, with its leading image and dropdown options
held to the host's asset policy.
TimePicker shows a time as 24-hour HH:MM, or a placeholder while no time
is chosen, and opens an hour and a minute column at the current value. A
tap, a finger drag or fling, or the mouse wheel picks and scrolls; Down
opens it, the arrow keys step a column and wrap within it, Left and Right
switch columns, and Enter or Escape closes it. Optional Now and Done
buttons set the current time and close the popup. The time changes as it
is picked, so closing never loses a choice, and the popup stays on screen,
opening above the field when there is no room below. The picker takes the
dropdown's look from every style, light or dark, and portable apps can draw
it through the widget host.
Dropdowns now follow Kryon's light and dark system palettes; a dark palette
left their field and menu light before.
`make -C examples time-picker` builds a window that shows the picker in
each of its states.
Hosted bundles can now step numbers with the standard Spinbox. The
regenerated codec also carries TextField's numeric flag, which was
missing from the hosted boundary.
A bundle built with KRYON_HOSTED_UI now calls PressHostedHost, and the
widget host draws the press area in the host's frame and returns its press
state, so a hosted app such as Lumi can select messages by holding and
dragging. The generated codec gains PressProps and PressResult.
An application that runs a .zib inside its own window answered each
widget's HostedHost call with its own codec and dispatcher. Kryon now owns
that host side next to the bundle side: widget_host draws a bundle's widgets
in the frame's session, refuses calls from another frame, foreign records,
texture handles and assets its host's callback rejects, and closes scrolls
the bundle leaves open. WidgetHostSupports lists the calls it answers,
including Toggle.
widget_codec is generated from Kryon's widget records by
scripts/generate-widget-codecs.py, whose --uses option lets an application
generate codecs for its own records on top of Kryon's. hosted_values holds
the shared helpers: fields match by name, so a bundle and its host may be
built against different layouts.