Compare commits

...
151 Commits
Author SHA1 Message Date
waozi eacdb74144 Release Kryon 0.5.0
Kryon no longer includes raylib: apps use the SDL2/Cairo desktop host, the
Canvas host and the NativeActivity host, with Ziran's core audio natively
and WebAudio in browsers. The desktop host gains what terminal-style apps
used raylib for: descriptor-aware waiting, window options, frame rate, an
exit key, the middle button, fullscreen and glyph preparation. The
changelog section lists what users get. VERSION follows the new section,
as update_version.sh sets it.
2026-11-17 22:30:56 -03:00
waozi 9c8240a73f Give terminal-style desktop apps the services they used raylib for
The SDL2/Cairo desktop host gains what kryonlabs/terminal and Harmony's
terminal need to leave kryon/Raylib:

- kryon/desktop_activity: DesktopWaitForActivity(descriptors, ms) sleeps
  until a program descriptor such as a PTY is readable, window input is
  queued, or the time ends, leaving queued input for PollDesktop. Windows,
  web and Android report DesktopActivityUnsupported.
- OpenDesktopWindow(width, height, title, options) with resizable,
  undecorated, topmost and always-run windows; OpenDesktopTitled stays the
  resizable window.
- DesktopFrameRate(fps) paces the frame clock, 0 drawing without waiting;
  a stable screen never settles faster than the configured rate.
- DesktopExitKey(key), PollMiddlePointer(), DesktopSetFullscreen,
  DesktopToggleFullscreen, DesktopFullscreen and DesktopPrepareGlyphs.

tests/ziran_desktop_host_gaps_test.sh covers each on a private Xvfb, from
source and saved IR.
2026-11-17 22:29:37 -03:00
waozi 3627ea8a90 Remove raylib from Kryon
Kryon carries no raylib code. The ten raylib host modules, the raylib
ZX player, the raylib audio sink and media provider, their tests and
docs, mk/raylib-library.mk, mk/zx-raylib.mk, mk/raylib-shell.html,
cmake/renderer-artifact, the renderer-raylib artifact, the
`backend = "raylib"` profile and [dependencies.raylib] are gone.
Desktop, Android and Canvas hosts keep the shared image, shader and
audio coverage. Browser asset and PCM audio play through
media_audio_web on the Canvas WebAudio engine; native audio uses
Ziran's core audio modules through media_audio_desktop.

macOS CI builds the desktop ZX player and checks the headless bundle
with it. The toolchain moves to Ziran 7fbc8152, which carries the
optimizer fixes the tree-input test needs. All 99 example locks are
regenerated as CI resolves them, without raylib.
2026-11-17 20:59:37 -03:00
waozi ae6f73b435 Decode Android scene textures with linked codecs 2026-11-17 19:59:25 -03:00
waozi 199b51c97c Configure the Vorbis archives under CMake 4
The hosts job's desktop Vorbis test stopped at configure: libvorbis
1.3.7 asks for CMake 2.8, and CMake 4 refuses compatibility below 3.5.
Pass CMAKE_POLICY_VERSION_MINIMUM=3.5 to that configure; earlier CMake
ignores the variable.

Local tests: under CMake 4.1.2 the configure fails without the floor and
passes with it, and make desktop-audio-vorbis-test passes with CMake 4
and with the host's 3.31.
2026-11-17 17:26:30 -03:00
waoziandClaude Opus 5.5 4923381c88 Load the pictures an Android app ships from its APK on first use
Android Frame apps draw through Pixmap, which found only pictures already
registered, so every file picture showed "Missing image". Pixmap now asks
an optional picture source the first time it measures or draws an
unregistered path, once per missing path until invalidation or host
cleanup. pixmap_assets_android registers a source that reads the APK asset
through AAssetManager and decodes it, and the Frame host imports it, as
desktop Cairo loads pictures on first use.

Tests: the Android image services test covers lazy loading, caching, the
single lookup per missing path, retry after invalidation and cleanup. A
new device suite decodes a framework PNG through Android's real
AssetManager inside its VM and compares it with an independent decode;
tests/android_vm_device_test.py now runs it and the typeface suite. Frame
host tests link the codecs that apps link.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 17:23:44 -03:00
waozi 22bc1353c1 Bind linked AVIF and WebP codecs under KRYON_AVIF_LINKED and KRYON_WEBP_LINKED
Desktop hosts decoded AVIF only through a loaded libkryonavif and WebP
only through the system libwebp. Built with KRYON_AVIF_LINKED, AvifInit
binds the avif package's static bridge to the libavif the program
links; built with KRYON_WEBP_LINKED, WebPInit binds webp_linked's table
of the program's libwebp and libwebpdemux. Neither loads a library.

avif_decode_test.sh builds linked_codecs_test with the static libavif,
libaom and libwebp archives and runs it where no libkryonavif exists. It
checks AVIF and WebP pixels from bytes and from files, and that neither
libkryonavif nor libwebp was mapped.

Local tests: the linked build passes; the same test built without the
two defines fails.
2026-11-17 17:11:38 -03:00
waozi da7f5755b1 Write assets given as bytes to temporary files on Windows
Fonts registered from bytes and pictures from a program's asset reader
became Linux in-memory files opened through /proc/self/fd, which MinGW
cannot link. cairo_assets now takes its files from asset_files_linux
(memfd, as before) or asset_files_windows, which writes each asset to a
file of its own in the user's temporary folder by an ASCII path and
removes it when it is closed or when the program exits.

windows_desktop_test.py runs a new Wine program, linked with -lws2_32,
that draws text in a font given as bytes, decodes a picture given as
bytes, calls Winsock's connect beside the image decoders, and leaves no
temporary files behind.

Local tests: the whole Windows desktop suite passes under Wine on a
private display, and the Linux desktop windows test still reads
embedded pictures and fonts from in-memory files.
2026-11-17 17:11:38 -03:00
waozi b97cc23b59 Keep the image decoders' GdkPixbuf slots private to their module
ziran_image_decode's loader slots were public C globals, and one was
named connect. A Windows program that links ws2_32 for its own sockets,
such as one using curl, met that symbol in place of Winsock's connect.
The slots are now file-scoped, so C gives them internal linkage, and the
signal slot is named signal_connect.

Local tests: the generated C declares static Connect signal_connect; the
GdkPixbuf decode test passes on Linux, and the new Wine assets test
(next commit) calls Winsock's connect beside the decoders.
2026-11-17 17:11:38 -03:00
waozi bda9e9d9a2 Add skinned scene surfaces and a portable watercolor material
kryon/scene_skin gives scenes indexed surfaces with four-influence
skinning that always deforms from bind data. kryon/watercolor samples real
paper and pigment bitmaps with soft light and a Fresnel rim, and its
finishing pass adds brush regions, paper grain, pigment pooling and pencil
contours while keeping alpha exact. Both run on the CPU renderer and the
translated GLES path. Desktop LoadImagePixels accepts an optional host path
resolver so bundled assets decode like disk images.
2026-11-17 16:49:39 -03:00
waozi 34f26c2523 Fix scene GPU linking for Android API 21
Use Android's default EGL display and preserve its current context without
importing desktop GLX or newer EGL platform entry points. Link EGL and GLESv3
through the shared Android CMake helper.

Add strict API21 NativeActivity link coverage for both ARM ABIs, rejecting
GLX/newer EGL symbols and requiring the real Android/EGL entry points.
Document the Android generation and link requirements.

Local tests: both-ABI NativeActivity links passed; build-queue -- make push-check
passed, including desktop host, gamepad, text-hook and pixmap GPU coverage.
2026-11-17 15:27:32 -03:00
waozi 455c364e76 Export the image placement rules apart from file pictures
kryon/image brings file pictures since 15c3a22e, so a program that
imports it links a host's ImageWidth and ImageHeight. Jungle's story
layout test uses only ImageFitBounds and ImagePreviewSource and no
longer linked. Export image_behavior for code that needs only the rules.

Local tests: a package consumer using kryon/image_behavior links and runs
without a host; the same program with kryon/image reproduces the
undefined ImageWidth and ImageHeight.
2026-11-17 14:46:23 -03:00
waozi 058e59ac85 Give the website's live-example phase the time CI needs
24b476c3 bounded this phase at 1200s. GitHub runners compile each of
the 101 sources in about 14s, about 24 minutes in all, so the bound
stopped correct runs partway through. Allow 2400s, and 45 minutes for
the Pages step; compile_ready still bounds each compile to 120s.

Local tests: make site-browser-test passed (this phase took 871s).
2026-11-17 14:46:23 -03:00
waozi 6e6f9660fb Mirror SDL3 comparison tiles from the picture's own origin
Since 2d608291 a negative source width mirrors the rectangle that
starts at x. The scene's {16, 0, -16, 16} therefore sampled beside its
16-pixel picture, and the SDL3 GPU renderer's image clip check failed.

Local tests: make sdl3-test passed on a private Xvfb.
2026-11-17 14:46:23 -03:00
waozi 037f464b5e Reuse a program's exported main in web program-entry builds
A program entry that exports main also got the generated
kryon_program_host main, so wasm-ld stopped at "duplicate symbol: main"
for the canvas page. Detect main's own #program_export and compile the
entry directly; an unexported main still gets the generated host. A zx
profile bundles the program's main since 0c6f138e, so the test checks
that bundle instead of a refusal.

Local tests: make program-entry-project-test passed (Window and Hello
canvas pages, desktop window, zx bundle).
2026-11-17 14:46:23 -03:00
waozi 5a8d214087 Pick the zx player's dead-code linker flag per platform
Apple ld rejects --gc-sections, so the macOS player link failed. Use
-dead_strip on Darwin, where the player links no X11, and keep
--gc-sections elsewhere. The display-free headless test runs only the
VM, so it no longer builds the desktop player first.

Local tests: the Darwin link line (make -n) has -dead_strip and no
--gc-sections, Linux keeps --gc-sections, and push-check passed.
2026-11-17 14:46:23 -03:00
waozi 635e1d3d03 Link hand-built test programs with libm
Ziran 2313b49c lowers std Sqrt to C sqrt(), so test scripts that link
generated C with cc directly stopped at "undefined reference to sqrt":
45 behavior tests in the check and sanitizer jobs. Add -lm to those link
lines and to the shared matrix helpers.

Local tests: all 45 failing scripts pass.
2026-11-17 14:46:23 -03:00
waoziandClaude Opus 5.5 e05146b3ba Host Android apps that run their own frame loop
kryon/android_runtime keeps NativeActivity lifecycle and input in the host
while the application's main owns its loop, widgets and pacing:
PollAndroidHost, BeginAndroidFrame and EndAndroidFrame present Pixmap's
device-pixel damage. The host calls the application's C main by symbol, so
generated C never declares main with Ziran's argument types. Pixmap's
RasterSetTransform and RasterPointFromPixels share one camera for painting
and input.

kryon/pixmap_assets_android decodes owned PNG, WebP and AVIF pictures on
first use, and kryon/pixmap_typefaces_android shapes text with Android Paint
and Canvas through the ordinary typeface_source capabilities.

The renderer-desktop artifact also builds Android ARMv7 and AArch64 codec
archives and the shared AVIF bridge, pinned to AVIF 2611e727.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 13:30:41 -03:00
waozi 0a86415bff Apply a followed palette to the active theme too
SystemPaletteApply installs a system palette as style rules and as the
active theme's colours, so code that draws from CurrentPalette() matches
the host as well as styled widgets. SystemPaletteUpdate applies a palette
only when it changed; SystemPaletteFollow in SystemThemeHostLinux and in
the portable SystemThemeHost feeds it each frame, so ZX apps such as
Harmony's Telegram follow a host's theme change with one call.

The parent-theme test checks CurrentPalette() after a followed change.
2026-11-17 11:43:53 -03:00
waozi 13ff9478a3 Expand a host's palette into a full theme palette
SystemTheme.SystemPaletteColors(palette) builds a complete theme Palette
from a system palette such as the one Harmony gives an embedded app: its
background, surface, text, accent and border, and surfaces, text levels,
borders, selection and controls mixed from them, so an app that draws
from a theme palette matches its host completely.

The parent-theme test checks the expanded palette after a host change.
2026-11-17 11:29:23 -03:00
waozi 81e337a6e0 Let embedded apps follow their host's theme with one call
SystemThemeHostLinux.SystemPaletteFollow() installs the current palette,
the host's while an app is embedded, the first time and again whenever
the host changes it, and returns true when it installed. An app that calls
it once per frame follows a theme change in Harmony's Sessions window
without colour code of its own.

The parent-theme test gains a follow scenario: one install, none while
unchanged, and one after each host change. Both theme tests now link libm,
which the style sheet code needs.
2026-11-17 11:17:35 -03:00
waozi a4817c9907 Use core Ziran audio for desktop and Android media playback
Use the platform-selected asynchronous std audio sink and core mixer,
remove the six moved Kryon audio modules and exports, and select their
published compiler and optional Opus package pins. Add actual Moto UI
PCM source/saved validation and retain deterministic device-failure tests.

Local tests: desktop PCM/MP3/Vorbis, Windows Wine host and audio,
Moto source/saved UI PCM, ziran check and push-check passed. The full
shared-tree test stopped at the separately owned Canvas program-entry
title/boot test; this commit has no program-entry or title changes.
2026-11-17 11:06:45 -03:00
waozi 2d608291a9 Mirror signed image sources and isolate invalid image draws 2026-11-17 01:24:17 -03:00
waozi 156cea179d Reconfigure codec archives when resolved package sources change 2026-11-17 01:23:23 -03:00
waozi a98f8bf12a Link the native Canvas event fixture with the math library 2026-11-17 01:22:27 -03:00
waozi a814f67710 Document and test headless image dimension bindings 2026-11-17 00:36:25 -03:00
waozi 78af409035 Present Android frame damage in device pixels 2026-11-17 00:31:30 -03:00
waozi 24b476c365 Bound website browser phases and Chrome request writes
Report each browser test phase and source example, interrupt blocked I/O, and bound the Pages test step. Verify deadlines with blocked read and full request pipe tests.
2026-11-17 00:27:52 -03:00
waozi 3f72441949 Build vendored codecs with CMake 4 2026-11-17 00:17:20 -03:00
waozi 14586a4b62 Update Ziran toolchain for Canvas record copies and portable images 2026-11-17 00:14:14 -03:00
waozi 028d42cb15 Provide native frame snapshots and desktop image services
Add exact/folder/all picture cache invalidation, shared oriented preview
pixels, and owned previous-frame snapshots for desktop and NativeActivity.
Keep alpha and row orientation through Image transitions, including negative
camera origins. Capture desktop frames after presentation and preserve Android
pixels until the route finishes composing. Web returns an invalid snapshot.

Local tests cover source/saved desktop and Android pixels, Windows/Wine
snapshots, native image previews, Canvas browser/Wasm, Android NDK host links,
frame transition behavior, bitmap ownership, and push-check.

Known upstream gap: published Ziran ebd19223 rejects the portable bitmap Image
test in PixmapGpuCorners with assembly.gap.machine-copy. Reproduced unchanged
on origin/master 216c190c: function 300, block 5978, instruction 27407.
The native C control passes. See plans/2026-11-16-remove-raylib.md.
2026-11-16 22:36:04 -03:00
waozi 216c190c43 Document only current Kryon APIs and website pages
Remove raylib paths, obsolete import and preview guidance, migration prose,
and orphaned documents/pages. Align widget imports, native ZX windows and
host contracts with the current implementation, and enforce current site routes.
2026-11-16 21:43:18 -03:00
waozi 0f5c68e162 Let Escape dismiss modals independently of outside clicks
Keep outside releases blocked by default while allowing Escape to close the top modal. Preserve dismiss_disabled as the explicit override for both routes, including through the portable widget host.
2026-11-16 21:40:47 -03:00
waozi 9052a642a0 Apply desktop camera offsets to Cairo painting and pixel snapping 2026-11-16 21:03:44 -03:00
waozi 66a11957b4 Use native desktop and Android hosts for window runtime 2026-11-16 20:50:54 -03:00
waozi 80cbbb3d14 Consolidate portable app tests on the desktop-host ZX player
Run the headless, media/HTTP, hosted-app and native interaction gates
through zx-player instead of the raylib player. Use the shared bundle
media and app lifecycles for packed resources, private documents, input
and scrolling. Play native bundle audio through the SDL mixer and the
package-owned codec archive. Separate normal completion from VM failure
and preserve candidate-media isolation during live reload.

Keep the raylib host modules and their own test target for the separate
deletion. Keep shared BundleApp byte APIs and desktop locale behavior.

Local tests: the four assigned ZX gates, source/saved VM and native
interaction, browser media and hosted apps, completion/trap status,
reload, zx2native window host, retained raylib player/media and
push-check passed through build-queue on private displays.

Owner-request: Waozi, 2026-11-16 (remove raylib dependencies)
2026-11-16 20:32:27 -03:00
waozi e2bac64b60 Use SDL and native image services throughout the shared hosts
Move Opus transport to the shared mixer and SDL sink, query SDL keyboard
focus, and decode/export encoded images without the raylib host. Give
the canvas host its own clip implementation and remove unused C ABI
exports in favor of direct canvas Files imports. Retain the public host
APIs and the raylib host modules for their separate deletion.

Local tests: native-image-services-test, desktop-audio-test,
image_dynamic_integration (source/saved IR, ASan/UBSan/leaks), background
image jobs, complete canvas-test, and push-check passed via build-queue.

Owner-request: Waozi, 2026-11-16 (remove raylib dependencies)
2026-11-16 20:32:27 -03:00
waozi 9a55dbbbc8 Port the SDL Cairo desktop host to Windows x86-64
Add Windows platform adapters, a pinned MinGW desktop renderer artifact,
and private Wine pixel/service/audio tests. Share raster and window code
while selecting native process and library-loading modules per OS.
Pin the public WebP native function-table export for dynamic decoding.

Local tests: windows-desktop-host-test, desktop-windows-test,
desktop-audio-test, native-text-test, native-accessibility-test,
image-pixels-test, pay-per-import-test and push-check passed. Strict
dynamic image source/saved IR passed ASan, UBSan and leak detection.

The stock frame-entry C pruning and Windows ZX external-host gaps remain
upstream in step 6. Full make test separately stops at ZX packed media.
This checkpoint does not include consumer ports or macOS builds.

Signed-off-by: Waozi <[email protected]>
2026-11-16 20:32:27 -03:00
waozi 03016057af Verify the shared Markdown editor across source and saved IR targets
Run the extracted Diary editor and preview through C, Go and ZX, including identical source and saved-IR bundles.

Local tests: markdown-editor-test full matrix and make push-check passed.
2026-11-16 19:53:49 -03:00
waozi 08f70214c3 Provide native codec archives independently of the raylib renderer
Move WebP/AVIF/AOM recipes into mk/codecs.mk and build Opus from the
package-owned audio recipe. Publish all four archives, licenses and the
lazy AVIF library through renderer-desktop. Keep the raylib host recipe
using the same codec targets until its separate deletion.

Local tests: codec-archives, renderer-consumer-test,
desktop-codec-artifact-test (real source/saved-IR AVIF/WebP/Opus), and
renderer-artifact-test including the retained native renderer on Xvfb.

Owner-request: Waozi, 2026-11-16 (remove raylib dependencies)
2026-11-16 19:47:52 -03:00
waozi 9a162223b5 Publish the NativeActivity app directly to shared JNI services
Keep GetAndroidApp inside the raylib host; native JNI uses native_app_glue startup and clears the app on shutdown. Exercise publication and cleanup with the source and saved-IR JNI thread tests.

Owner-request: Waozi, 2026-11-16 (remove raylib dependencies)
2026-11-16 19:47:52 -03:00
waozi 0c6f138e31 Show a program's ZX window in the browser through the canvas player
A program entry (one that declares main) was refused in any profile but
codegen c99, so window.zi's ZX could not run in a page. A codegen = "zx"
profile now bundles the program's own main with portable IR, which
kryon/app gives the zx_window window; no generated program host is made.

In the page the ZX canvas player runs such a bundle through
window_page_player.zi: it binds zx_window's five capabilities to the page's
canvas with page_core, as page_window does for a C program, lowers the
bundle to Wasm in the page and runs main until the page closes. Each wait
for an event sleeps, which yields to the page, so the program's own loop
never blocks it. zx_window_bundle.zi holds the capability check both
players use. The editor's Wasm platform opens window.zi this way, and its
browser test checks that the page's canvas is cleared to the frame colour.
2026-11-16 19:47:52 -03:00
waozi f10e551f6c Ship the desktop window as a host library zx2native links
window.zi's bundle asks its host for five zx_window capabilities. The
desktop zx player binds them in-process for `ziran run`, but a native
executable from zx2native had no host to call, so the editor's Native
Assembly and Binary stopped at assembly.gap.machine-host.

zx_window_host.zi exports the five capabilities with the C ABI the C
target gives zx_window's declarations, over the same desktop_window SDL
window. `make zx-window-host` builds build/lib/libkryon-desktop.so from it
alone, and `make install-user` installs it to ~/.local/lib/kryon and
registers ~/.local/share/ziran/hosts/kryon-desktop.library, so zx2native
links window.zx into a Linux executable that opens its 320x160 "Window"
in the empty frame's colour and exits 0 when it closes.

zx_window_test runs both routes on a private Xvfb, the player through
`ziran run` and the executable directly, and checks that with no library
registered zx2native stops at the gap naming ZxWindowOpenHost.
2026-11-16 19:47:52 -03:00
waozi f123e8ba3e Release Kryon 0.4.0
Kryon builds with Ziran 0.6.0 and runs its widgets natively 121–185× faster, programs carry only the features they use, widgets are imported by package, portable apps run their window from a bundle, and the Linux desktop host gains audio and a raylib-free window path; the changelog section lists what users get. update_version.sh set VERSION from the new section.
2026-11-16 18:44:12 -03:00
waozi bde4614ede Regenerate the media audio codec and deploy newly bundled site assets
The codec generator names hosted records by their defining package since 9ca2e673, but src/backend/media_audio_codec.zi was not regenerated, so media_audio_test's --check stopped the hosts shard. The website's staging step copied only tracked docs/site files, so a freshly built runtime asset (asset-13.bin once the mascot joined the gallery assets) was never deployed and the Website check could not find pfp.webp; it now also stages every asset the build's runtime/assets.json lists.
2026-11-16 18:02:26 -03:00
waozi 1b290f19aa Build with Ziran 0.6.0
Pin the root package and the box, gallery and image examples to the Ziran v0.6.0 release commit d17c7aa1 (by commit, since ziran lock records an annotated tag's object rather than its commit). The gallery lock is regenerated: it pinned image-codec and webp at their master commits while webp declares image-codec 3605531, so ziran pkg path plot --locked failed and the website build stopped.
2026-11-16 17:13:25 -03:00
waozi 9ca2e6731b Preserve canonical hosted record identity across package boundaries
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
2026-11-16 16:42:28 -03:00
waozi 77184e46c5 Export shared Markdown preview and editor
Expose byte-preserving Markdown formatting and TextArea composition as optional
package imports for Breeze Diary. Wire native and portable editor behavior
coverage into make test and test-focus, and document the public surface.

Signed-off-by: Waozi <[email protected]>
2026-11-16 16:38:49 -03:00
waoziandClaude Opus 5.5 7db0aef222 Keep the vendored-raylib path out of the raylib removal plan
source-check rejects the literal path anywhere in the tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 16:34:35 -03:00
waozi c10a6025bc Plan removing raylib from Kryon 2026-11-16 15:38:18 -03:00
waoziandClaude Haiku 5.5 17de1e4bfc Drop unused text input import from the toast test driver
ziran_test_driver_host imports text_input_platform_host but never uses it.
After the pay-per-import split the toast scratch project fails ziran ir
because that module is not in its package root. A toast has no editable
text, so the driver does not need text input; remove the import.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-11-16 14:20:22 -03:00
waozi ce0d49e633 Give the toast action test's project the text input host its driver imports
tests/ziran_test_driver_host.zi imports text_input_platform_host, but the test copied only itself and the driver host into its scratch project, so ziran ir --project failed once the hosts shard reached it.
2026-11-16 14:19:47 -03:00
waozi c23c628597 Run the file-date test's builds directly where build-queue is absent
Like the GTK scroll test, tests/file_date_linux_test.py wrapped its compiler calls in build-queue, which CI runners do not have; it now uses build-queue only when it is installed.
2026-11-16 13:22:57 -03:00
waozi d6750c36f2 Run the GTK scroll test's builds directly where build-queue is absent
tests/gtk_scroll_linux_test.py wrapped its compiler calls in build-queue, which only the developer machines have, so the hosts shard failed with "No such file or directory: 'build-queue'" once it got that far. It now uses build-queue only when it is installed.
2026-11-16 12:37:38 -03:00
waozi baa0e60768 Stub SDL_SetHint in the raylib window probe and wait for site reloads
raylib-window-test links neither raylib nor SDL: tests/raylib_window_host.zi
stands in for raylib's SDL platform and already exports the SDL calls the
Linux host makes. 631f15e7 had OpenRaylib set SDL_SetHint, which the
probe lacked, so the test no longer linked. The probe now counts requests
for a linear framebuffer made before a window opens, and the test checks
OpenRaylib makes one on Linux and none on Windows or macOS. raylib_runtime
is unchanged: on Linux Kryon always builds raylib's PLATFORM_DESKTOP_SDL,
and the hint shares the platform branch of the host's other SDL calls.

site_browser_test reloaded the page and evaluated Module straight away.
Page.reload answers before the new document has run current.js, so on a
slow runner the evaluation reached a document without Module and threw
"ReferenceError: Module is not defined"; the failure screenshot of the
half-loaded page then read as blank paint. With current.js served 300 ms
late, that sequence failed 10 times in 10. Browser.reload marks the old
document and waits for an unmarked one to finish loading, as open does
after a navigation.
2026-11-16 11:54:14 -03:00
waozi 6425728b02 Give embedded apps their host's theme by default
An app that Harmony embeds now draws in Harmony's theme without code of
its own. SystemThemeLinux.SystemPaletteRead returns the palette the host
keeps on the window it embeds the app in, after checking that the named
host is the app's parent and owns that window, and reads it again on each
call so an app that reads it follows a theme change. Started on its own,
an app gets the desktop's GTK palette as before.

The reader moves out of SystemThemeHostLinux into ParentThemeLinux, which
SystemThemeHostLinux now reuses. It loads libX11 at run time and only when
a host is named, so apps that are never embedded, and Windows, Android and
web builds, need no X11.

A Ziran test plays the host on a private X display: the hosted palette is
returned and followed, an unknown version is ignored, and a host that is
not the app's parent gives no theme.
2026-11-16 11:34:44 -03:00
waoziandClaude Haiku 5.5 b45cc52456 Tests: stop the GPUI benchmark project test depending on host libxkbcommon
test_generated_project_uses_disposable_paths_and_xkb_sysroot now points
XKB_LIBRARY at a scratch fixture file, so it no longer needs
/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0. A new case checks that
write_project() rejects a missing library with a clear error.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-11-16 11:02:04 -03:00
waozi 631f15e715 Ask SDL for a linear framebuffer and wait for the ZX window's first frame
The hosted native ZX test read (244,96,110) where its picture is
(230,30,40), and (252,253,254) for the 0xf8fafc background: the whole
window had been sRGB-encoded a second time. That gate ran with a private
SDK whose libSDL2 is sdl2-compat on SDL 3.4.2. SDL 3 gave raylib's
OpenGL ES context an sRGB-capable framebuffer, and Mesa encodes every
write to one. The system SDL 2 picks a linear visual, so the same player
drew exact colours without the SDK. OpenRaylib now sets
SDL_OPENGL_FORCE_SRGB_FRAMEBUFFER=0 before InitWindow; SDL 3 then
requests a linear framebuffer and turns GL_FRAMEBUFFER_SRGB off, and
classic SDL 2 ignores the hint. Under that SDK the test finds the exact
colours again.

zx_window_test captured the window right after it mapped and sometimes
read X's black contents before the player presented its first frame. It
now waits up to 10 s for the presented frame and keeps the exact
single-colour assertion; the corner pixel is checked before the colour
count, so the wait does not build a 2 MB table every 20 ms.
2026-11-16 10:31:04 -03:00
waozi 3982886e04 Stop binding picture sizes in the toast action bundle
Since 15c3a22e a toast no longer reaches pictures, so its bundle has no
image_raster:ImageWidth or ImageHeight capability, and binding them failed
("host capability or exported Ziran provider is missing or already
bound"), failing toast-action-test in the hosts shard. The bundle binds
only what the toast uses.
2026-11-16 10:18:12 -03:00
waozi 3c09a1ecd7 Import only Image's props in the bitmap host policy test
Since 15c3a22e kryon/image is image_files, which brings the file-picture
decoder and its ImageWidth and ImageHeight host capabilities. The bitmap
host policy test only names Image.Props, and its build has no picture
host, so it failed to link ("undefined reference to `ImageWidth'") and
bitmap-image-test failed. It imports kryon/image_props, as props-only code
does.
2026-11-16 10:00:31 -03:00
waozi ec72e936cd Ask the canvas Lanczos test's pictures for their size first
Since 9b551b59 a page makes smooth copies of file pictures only once it
asks a picture's size, as every widget that draws one does first and as
the desktop already did. tests/canvas_lanczos_test.zi drew its pictures
without asking, so no copy started and lanczos-goldens-test failed with
"Canvas Lanczos page: FAIL 20". It now asks each picture's width first.
2026-11-16 09:21:12 -03:00
waozi 7491afa4c0 Build the pay-per-import frame examples against this checkout
pay-per-import-test built examples/box, button, image and textfield in
place, so it used their locks, which pin a published Kryon, or whatever a
developer's ziran.local.toml says. On a plain clone the locks did not match
this checkout's manifest ("declares image_codec ... but lock pins ..."),
and CI passed only because a CI step writes overrides into the examples.
The test now copies each example into build/test/pay-per-import/examples
with its own ziran.local.toml pointing kryon at this checkout and ziran at
the running toolchain, locks the copy and builds it there. The real
examples, their locks and any developer overrides are untouched.
2026-11-16 09:17:07 -03:00
waozi cd7bf21f38 Run the Canvas site's browser test in CI instead of the removed gallery test
9ce47851 replaced make site-gallery-test with site-browser-test, but the site shard still called the removed target after building the site.
2026-11-16 09:14:06 -03:00
waozi 24ff9e710a List the Wasm tier's call import for the document storage page
The browser document storage page runs its hosted guest on Ziran's Wasm
tier, whose zx_wasm_web_call import unwinds through the page's stack. The
page links with ASYNCIFY and ASSERTIONS, and the import was not in
ASYNCIFY_IMPORTS, so the hosts shard aborted with "import zx_wasm_web_call
was not in ASYNCIFY_IMPORTS, but changed the state". It is now listed.
2026-11-16 08:19:07 -03:00
waozi 4e7513041e Wait for the program entry window's name
The desktop check read the name of the first window xdotool found for the
program and stopped. SDL sets the title just after creating the window, so
a search between the two read '' and the web shard failed with "expected
the program's window title, got ''". The check now keeps looking until a
window of the program has a name.
2026-11-16 08:19:07 -03:00
waozi 80fa9a73ac Resolve the gallery module test's imports through package exports
tests/gallery_modules_test.py gave the compiler kryon=src/ui and
kryon=src/backend, so the generated usage modules' imports such as
kryon/button (src/ui/button/button.zi) and kryon/button_group
(buttongroup/buttongroup.zi) were not found and the site shard failed.
Every configured package, Kryon included, now gets each manifest module
root plus the export alias modules gallery.export_aliases writes, which
import the sources through <package>_source.
2026-11-16 08:19:07 -03:00
waozi 5d836703e9 Give the Android test JNIEnvs a DeleteLocalRef
e9017b29 made the activity method lookup release its class reference, and
the fake JNIEnvs in android_device_host.zi (also used by the text editor
test) and android_picker_behavior.zi had no DeleteLocalRef, so the
device, picker and text editor tests called a null function (exit 139;
ASan "SEGV on unknown address 0x0"). Both fakes now have one.
2026-11-16 08:07:45 -03:00
waozi 7742251bb4 Scroll what is under the wheel on the web
The canvas host's wheel event forwarded only its deltas, so the wheel went
to wherever the pointer last moved. A wheel turned without a move first,
as after clicking into the live editor, scrolled the editor instead of the
page under the wheel, and site_browser_test's overflow preview check timed
out with "overflow preview article scroll". The wheel now delivers its
own position as a pointer move before its deltas.
2026-11-16 07:56:28 -03:00
waozi e9017b29d0 Treat an Android activity's missing optional method as absent
On a Java-free NativeActivity, Kryon's optional callbacks
(onNativeFirstFrame, setTextInputState, setSoftKeyboardVisible) do not
exist. AndroidJniMethod returned GetMethodID's null with the
NoSuchMethodError still pending, and the host thread now keeps its JNIEnv
across frames, so later JNI calls in the session ran with that exception.
The lookup now clears the exception it caused and releases the class
reference it took; AndroidJniCallVoid releases its string argument.
Exceptions that Java methods throw still make the call report failure and
are still described and cleared at detach.

tests/android_jni_threads_test.zi's fake JNIEnv now tracks pending
exceptions and local references, and checks all three absent methods, a
present call and a throwing one.
2026-11-16 07:17:03 -03:00
waoziandClaude Sonnet 5.5 7cae309044 Accept package-qualified slice types at the widget host boundary
One shared WidgetHostSliceValid check, built on HostTypeValid, replaces the
six strict per-widget slice checks.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-16 07:12:56 -03:00
waozi d549f3edbe Leave the cursor picture decoder out of the live editor's preview
The preview entry imported kryon/cursor, the public cursor API that
registers the host's picture-cursor decoder, so every compiled preview
asked for CursorPictureHost and the website refused it ("Unavailable
preview capability: CursorPictureHost"). The preview only reports
TreeCursor's kind to the page, which kryon/tree_input already gives it.
2026-11-16 07:12:12 -03:00
waozi 928cf64d7b Read the gallery's hold and confirm state through site.zi
The gallery's web build failed with "unknown record field: progress" and
"armed" in web.zi. web.zi reads site.zi's site_hold and site_confirm
through `using Site`, and their types name site.zi's module aliases
(HoldButton.HoldButtonState, ConfirmButton.ConfirmButtonState), which the
checker resolves in web.zi, where those aliases do not exist. site.zi now
exposes SiteHoldProgress and SiteConfirmArmed, and web.zi calls them.
2026-11-16 07:12:12 -03:00
waozi 8b127a0911 Accept either rounding of the AVIF test's half-transparent preview
The hosts shard's new report shows the 1x1 preview as RGBA 0 0 255 127 on
CI, where this machine gives 128. Half of the 2x1 source is transparent,
so the Lanczos alpha is exactly 127.5 and a last-bit difference in the
filter sums rounds it either way. The check now accepts 127 or 128; the
colour bytes stay exact.
2026-11-16 06:44:38 -03:00
waozi 640b4e3dac Stop running the removed DOM live-editor browser test in CI
74eb8fbb deleted tests/demo_browser.mjs: demo.html now redirects to the Canvas widgets page, whose editor make site-browser-test covers. The web shard's step that ran it is removed.
2026-11-16 06:15:55 -03:00
waozi 860ea80793 Keep the backpressure test's Xvfb from resetting between windows
CI's sanitize shard failed this test on a reopen after CloseDesktop (exits
30, 33, 40, 61, 80 and 101). With the open failure now reported, the CI log
at 9401f34f shows SDL_Init failing with "x11 not available": closing the
window disconnected Xvfb's last client, Xvfb reset, and the reopen's
connection landed in the reset. A desktop's X server never resets that way,
so the test runs its Xvfb with -noreset, as ziran_window_visible_test.sh
and mime_clipboard_linux_test.py already do.
2026-11-16 05:57:07 -03:00
waozi caa900714f Report the AVIF test's 1x1 preview when it fails
CI's hosts shard fails tests/image_avif_zi_test.sh with exit 4 and nothing
else, on the locked avif f26a5522 and Ziran v0.5.0; the same locked graph
passes here with gcc 14 and clang 19. Exit 4 covers an unsuccessful preview,
its size and its pixels. The 2-to-1 Lanczos alpha is exactly 127.5 here, so
one rounding step decides 127 or 128. The check now prints the preview's
error, or its size and RGBA bytes, so the next failing run shows which.
2026-11-16 05:43:56 -03:00
waozi 158fd91d5a Export kryon/tree_frame for programs with their own desktop host
A program that runs DesktopLoop.Run with its own host imports
kryon/tree_frame and calls TreeFrameUse() so the widget tree runs each
frame. The test driver's pointer and wheel now apply once, in the frame
driver, instead of also in the desktop loop.
2026-11-16 05:42:19 -03:00
waozi 74eb8fbb43 Remove the browser test of the removed DOM live editor
tests/demo_browser.mjs drove the DOM live editor at demo.html: its
#status line, iframe embeds and homepage link. The Canvas website redesign
made demo.html a redirect to the canvas widgets.html page, and 9ce47851
removed the matching gallery_browser.mjs, but this test stayed, so it
waited 25 seconds for an element that no page has and failed with
"Default source did not render" (state {}). Rebuilding the committed
playground runtime does not change that. tests/site_browser_test.py
(make site-browser-test) covers the Canvas site's editor compilation.
2026-11-16 05:33:16 -03:00
waoziandClaude Sonnet 5.5 cc731751ac Give hosted bundles kryon/layout and kryon/toolbar's behavior and props
layout.zi and toolbar.zi imported the retained tree, session and paint
queue unconditionally, so a KRYON_HOSTED_UI bundle importing them failed.
Their retained halves now sit in the non-hosted branch, as menu.zi does;
the behavior and props stay available. pay-per-import-test bundles a
hosted program using both and checks it carries only layout_behavior and
toolbar_behavior. The retained examples' generated C differs only in
include and init order.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-16 05:32:09 -03:00
waoziandClaude Sonnet 5.5 32fce42d4f Repin the gallery's DataViews to the package-qualified Kryon imports
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-16 05:29:44 -03:00
waozi 9401f34f66 Say why the desktop window could not open
OpenDesktopTitled returned false from five places without a word, so CI's
ziran_desktop_input_backpressure_test.sh failed a reopen with only its
exit code (30, 33, 40, 61, 80 or 101) and nothing to say which step or
why. Each failure now writes the step (starting SDL video, creating the
SDL window, renderer or texture, or the Cairo surface) and SDL_GetError()
to standard error.
2026-11-16 05:17:44 -03:00
waozi 3744b2a401 Drag a TextField test selection to a caret inside the text
The drag selection test dragged to x=110, past the end of "abcdefghij" with
the test host's 7-pixel glyphs, so its Shift+Right step started at the end of
the text and could not move. It now drags to x=80, leaving the caret inside
the text so Shift+Right extends it by one.
2026-11-16 04:48:24 -03:00
waozi 245605c359 Fix the macOS runtime headers, the drag test's Xlib and the gallery's Plot pin
- mk/zx-raylib.mk generated Darwin private-symbol headers for a vm group
  whose header Ziran 0.5.0 removed with its old VM; Ziran's build uses
  only parse, check and emit.
- The hosts shard runs drag_source_linux_test.py, which needs python3-xlib.
- The gallery's lock pinned Plot 3f888653, which still imported the removed
  kryon/Kryon facade, so the site and Pages web builds failed; `ziran
  update plot` moves it to Plot's current master with its dependencies.
2026-11-16 04:42:03 -03:00
waoziandClaude Opus 5.5 ac209b9ea7 Give hosted bundles kryon/menu's props, types and state alone
menu.zi imported the retained tree, tree input and paint queue
unconditionally, so a KRYON_HOSTED_UI bundle that imports kryon/menu
for its MenuItem, MenuGroup, Props and MenuState failed on TreeNextKey,
TreePrevious and the rest. The retained menu bar now sits in the
non-hosted branch; a hosted bundle carries only menu_props.

pay-per-import-test bundles a hosted program using the menu's types
and checks it carries exactly its own module and menu_props and asks
its host for nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 04:16:51 -03:00
waozi 9c80f79110 Build Android runtimes with the host zi2c
build_android_runtime.py ran Ziran's make with the NDK compiler and no
GEN_ZI2C, so the generated-C step would run a zi2c built for the device.
It now passes the pinned toolchain's build/bin/zi2c, which the Android
CMake already requires. The ZX player APK builds for all three ABIs and
runs app.zx natively on the Moto (armeabi-v7a).
2026-11-16 04:10:17 -03:00
waozi d00b148f21 Build with Ziran 0.5.0 and fix the raylib pixel test and example overrides
The toolchain moves from e813c847 to Ziran v0.5.0 (f9f92b46) in Kryon and
the box, gallery and image examples, locked with `ziran lock`. 0.5.0
builds on macOS again and its browser playground builds, which Kryon's
macOS job, site build and Pages preview need.

tests/android_frame_pixels_test.zi sizes its pbuffer surface through
raylib's CORE.Window record, whose overlay left android_surface.zi on
Nov 10; the test now declares the overlay it uses.

The pay-per-import test builds examples/button and examples/textfield as
applications of this checkout, so CI gives them the same overrides as box,
image and gallery.
2026-11-16 04:08:05 -03:00
waoziandClaude Opus 5.5 eeeeb10c06 Stop listing the Makefile as a renderer artifact input
The renderer and SDL3 providers never read Kryon's top-level Makefile, and
Ziran refuses to publish an artifact whose inputs change while it builds.
Any edit to the Makefile during a downstream build under a local Kryon
override therefore failed that project's native link. A consumer test now
checks each recipe's inputs against the make fragments its provider reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 03:29:40 -03:00
waozi 4e5de9fef1 Stream Ogg Vorbis through the desktop mixer
audio_decode_vorbis adds Ogg Vorbis to audio_mixer by import, streamed at
the stream's own rate through audio/vorbis, which audio ce5837f8 adds over a
pinned stb_vorbis; Kryon now pins that audio commit. make builds the audio
package's libziran_vorbis.a for the programs that link it.
tests/desktop_audio_vorbis_test.zi checks the mixer's frames against
audio/vorbis's own decode of the package's fixtures, a 22.05 kHz stream's
length at 48 kHz, and a Vorbis clip through Kryon's asset audio.
2026-11-16 03:03:19 -03:00
waozi f4cd71a580 Open App.Show's window from a portable bundle
A ZX build of kryon/app shows its window through zx_window: five host
capabilities (open, next event, clear, present, close) and the bundle's
own loop until the window closes. window.zi's bundle is window, app and
zx_window, with no frame, font or text code. The desktop zx player binds
those capabilities to desktop_window, now split into the same SDL steps,
and runs the bundle's main as native code with no engine fallback, so
`ziran run window.zx` opens one 320x160 "Window" in the empty frame's
colour and exits 0 when it closes.

make zx-window-test checks that on a private Xvfb; make
pay-per-import-test checks the bundle's exact modules and host
capabilities and its checked program.
2026-11-16 02:50:22 -03:00
waozi 28424a846d Let portable apps show pictures they make at run time
A zx bundle's kryon/bitmap_image now asks its player to create, update and
release the picture (kryon build defines KRYON_ZX for zx profiles), and the
desktop zx player keeps it in its own bitmap store for the session it runs,
so its raster draws it like any other image. Before, a bundle's runtime
texture was unknown to the player and the frame failed.
2026-11-16 02:40:58 -03:00
waozi 3461b49b86 Let a page's canvas show what is behind it
A #canvas carrying data-transparent gets no background: the empty window
and each Kryon frame clear to alpha 0 with clearRect, so the editor
preview shows its theme wherever a program draws nothing. Widgets draw
over it as usual. Pages without the attribute stay opaque.

The program-entry test checks window.zi's page and examples/hello.zi
both ways.
2026-11-16 02:20:00 -03:00
waozi 069f4c6c26 Stream MP3 through the desktop mixer
audio_decode_mp3 adds MP3 and MPEG Layer I and II audio to audio_mixer by
import, streamed at the stream's own rate through audio/mp3, which audio
5ea3f6f1 adds over a pinned dr_mp3; Kryon now pins that audio commit. make
builds the audio package's libziran_mp3.a for the programs that link it.
A stream's last frame now plays before it finishes.
tests/desktop_audio_mp3_test.zi checks the mixer's frames against
audio/mp3's own decode of the package's fixtures, a 44.1 kHz stream's
length at 48 kHz, and an MP3 asset through Kryon's asset audio.
2026-11-16 02:16:41 -03:00
waozi 0dea8bc28b Mix and play audio on the desktop host without raylib
audio_mixer mixes sounds decoded whole, music decoded while it plays and
PCM streams into 48 kHz float32 stereo, with gain, pitch, loops, pause and
a tap on every mixed block. audio_sink_sdl plays it from SDL2's audio
thread; audio_decode_opus (streamed through audio/opus) and audio_decode_wav
add formats by import; media_audio_desktop runs kryon/media_audio on it.
tests/desktop_audio_test.zi renders into its own buffer and plays through
SDL's disk driver, with no audio device.
2026-11-16 01:30:57 -03:00
waozi 1b8e50bc5b Run an app's own windows, input and raster on the desktop host
The Linux desktop host routes each SDL event to the window it names and
reports the sideways wheel. New optional modules, each linked only by the
programs that import it: desktop_keyboard (held, pressed, repeated and
released keys), desktop_window_state (minimize, maximize, restore, raise,
always on top, monitor bounds and display scale), desktop_secondary_window
(more windows with their own Cairo surface, presenter and events, with the
raylib_secondary_window calls), and cairo_assets (embedded pictures decoded
from memory), cairo_typefaces (typeface_source on Pango and fontconfig) and
cairo_render_scale. tests/desktop_windows_test.zi drives them on a private
Xvfb with XTest input.
2026-11-16 01:30:27 -03:00
waoziandClaude Opus 5.5 a3df0f3acc Keep a TextField's drag selection on release
A drag's release also counts as an activation, and TextFieldCore placed the
anchor on every activation, so a selection made by dragging collapsed to a
caret when the pointer came up. The press places the anchor; a release keeps
it, so a click (released where it pressed) still places a caret, and an
activation without a release still places it too. Numeric fields keep
selecting their whole number on the focusing tap.

tests/ziran_text_field_widget_test.zi checks a held and released drag, a
click in one frame and over two, the same in a secure field, and Shift+Right
after them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 01:24:20 -03:00
waoziandClaude Sonnet 5.5 cbbeb1fd54 Accept local-override dependencies in renderer artifact builds
pkg path validates a local development identity itself; only locked builds
must match the provider edge's exact commit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-16 01:14:29 -03:00
waoziandClaude Opus 5.5 9b551b591d Let web pages carry only what they draw
The Canvas host registered nothing on first use: every frame pumped Lanczos
copies, the window reset meshes and copies, an evicted asset forgot its
copies, and the host polled the test driver directly, so even a box carried
the Lanczos cache, the resampler, page meshes and the test driver. Now the
first smooth copy registers the pump, close and forget (canvas_window), the
first warped picture registers its mesh batches, smooth copies are reachable
only once a page asks a picture's size (as on the desktop), and test input
comes through the frame driver. canvas_raster and page_mesh drop their unused
image imports.

Paint queues warped pictures through their own emitter, so no host links its
mesh rasterizer for a program that warps none.

Web profile (C files, C bytes, page bytes), before -> after:
box 74, 990 402, 1 388 955 -> 70, 828 685, 1 346 817
button 85, 1 238 728, 1 598 206 -> 79, 969 324, 1 487 512
hello checked modules 84 -> 80; an empty window stays at 10.
make pay-per-import-test checks the web window, hello, box, button and
image next to the desktop cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 00:47:27 -03:00
waozi 83c24cdba6 Pin avif to the commit with its encode and preview modules
Image previews import avif/encode and avif/preview, which the pinned avif
f84c1625 did not export, so builds from the pinned packages failed. avif
f26a5522 publishes them.
2026-11-16 00:29:14 -03:00
waoziandClaude Opus 5.5 15c3a22e43 Bring pictures, text input and scroll devices only with the widgets that use them
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]>
2026-11-15 23:10:23 -03:00
waozi 389bf25e17 Retry backpressured test-driver keys 2026-11-15 22:18:55 -03:00
waozi 1ecc01791a Halve the changelog
Every version keeps its heading and date; entries say what changed for a
Kryon user without file counts, test names or rationale.
2026-11-15 21:55:47 -03:00
waozi b223f2c1cc Keep a bare window's checked program to the window
kryon/app imports each platform's window (desktop_window, the new
page_window) and frame loop (frames_desktop, frames_web) as separate
modules. A program that only calls App.Show now checks seven modules on
Linux instead of ten: no session, geometry, desktop runtime or frame host.
desktop_window takes the SDL event from the new sdl_event module rather
than the whole desktop runtime, and the frame loops import app_types by
name so an unrun loop leaves no stub in the checked program.

make pay-per-import-test checks window.zi's exact checked program.
2026-11-15 21:55:30 -03:00
waozi 2b7023eb8e Name the text size field in the chart and table examples 2026-11-15 20:44:30 -03:00
waoziandClaude Opus 5.5 9c49ec1d12 Export the window module as kryon/window
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 20:36:56 -03:00
waoziandClaude Opus 5.5 3d82bf36f2 Feed test-driver pointer, wheel and input through the desktop and raylib loops
The desktop frame loop applies the frame driver's test pointer, wheel and
input hooks, and raylib checks synthetic pointer frames against the app's
live session.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 20:36:56 -03:00
waoziandClaude Opus 5.5 4108c80a6b Find Kryon's locked edges under a local override, and keep test-driver builds from rebuilding artifacts
The renderer artifact build looks up Kryon's locked dependencies through the
root's edge when a local override changes its package ID. Selecting the test
driver no longer changes dependency artifact identities.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 20:36:56 -03:00
waoziandClaude Opus 5.5 eda083bd73 Keep shadows of objects hidden from the camera
A node hidden with SetVisible still casts its shadow when SetShadows enables
it; shadow maps no longer skip nodes the camera doesn't show.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 20:36:56 -03:00
waoziandClaude Opus 5.5 c5c1122ae2 Measure every example's generated C against its imports
Record per-example C files, C and header bytes and executable sizes for
all 101 examples, the before/after table, and the modules frame examples
carry without importing them (pictures, text input, gamepad navigation).
The plan keeps only the open steps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 20:01:35 -03:00
waoziandClaude Opus 5.5 277b31162f Build with the Ziran that lowers long-named host records, and test in-tree examples from this checkout
Ziran 93a54f08 kept only the first eight characters of a host import's
record type when lowering to ZX, so --project bundles of hosted widgets
(TileMapResult, ActionModalResult, BundleInput, ...) failed with "this
type has no portable lowered representation yet". Ziran 94355db4 keeps
whole names; the toolchain pin moves to e813c847, current master.

CI built examples/box, examples/image and examples/gallery from the
Kryon their locks pinned, not from the checkout under test: box and
image pinned an image-codec that their locked Kryon no longer declared,
and the gallery's Kryon lacked kryon/box. CI now gives these examples
the same overrides ziran.local.toml gives them locally, as the Pages
workflow already does, and their locks name current Kryon and the same
Ziran.

The notification host test reads std/file.zi from the Ziran its package
graph resolves rather than ZIRAN_ROOT, which CI checks out separately.
The secondary raylib window test links XTest, so the desktop hosts job
installs libxtst-dev. The renderer artifact test builds its consumer
apps with Kryon's Ziran pin: Ziran v0.4.2 cannot read Kryon's current
ziran.toml.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 19:01:52 -03:00
waozi 0fbdc93884 Show a bare window through its own small loop
App.Show(window) on the desktop no longer runs the frame loop: a new
desktop_window module opens the SDL window, waits for its events, clears
and presents it, and closes it. examples/window.zi now reaches only the
program, kryon/app, the desktop app host, that loop, the SDL presenter and
C strings; its executable is 17 KB instead of 118 KB (265 KB before this
work), with none of the desktop runtime, raster, sessions, input or
accessibility. The window still opens centered, titled, resizable, in the
empty frame's colour, redraws when exposed or resized and exits 0 when
closed or terminated.

make pay-per-import-test now checks that the window carries none of the
frame loop, desktop runtime, raster, accessibility, session or input
modules either.
2026-11-15 16:46:11 -03:00
waoziandClaude Opus 5.5 cad98ae6a4 Carry only the code a program imports and uses
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 16:42:38 -03:00
waozi ba0d3950d3 Let an empty window carry only the window, its events and presenting
Nothing is imported by default. App.Show(window) shows a window without
frames; examples/window.zi uses it and now compiles to 23 C files and
133 KB instead of 62 and 546 KB, with a 118 KB executable instead of 265 KB.

Hosts that run frames (App.Run(window, Draw) and the frame host
desktop_run) call TreeFrameUse() to register the widget tree's frame driver
(tree_frame, through frame_driver): input routing, begin and end of the
frame, cursor shapes, scrolling, gamepad navigation and the test driver's
hooks. The call, not an import, brings it: a module initializer in the tree
would have turned existing import cycles into fatal startup cycles and made
hostless test builds keep every program export.

Accessibility is split. The window keeps the AT-SPI connection and the
application object; widget roles, states and nodes live in
accessibility_tree_linux, which the same hosts register with
AccessibilityTreeUse().

The test driver is in a build only when KRYON_TEST_DRIVER is defined;
desktop_runtime then connects it through test_driver_frame (exported for
other native hosts), and a window started for a test without it stops and
says how to build it. App.Run passes the window's title straight to the
window. input_delivery, frame_input_provider and gamepad_navigation move to
src/ui, InputDeliveryTake to input_take. desktop_loop and test_driver_frame
are exported. The ZX player imports cursor_picture again, so its guests'
picture cursors decode.

make pay-per-import-test builds the window, hello, box and image examples
and checks which modules their generated C carries.
2026-11-15 16:17:07 -03:00
waozi 44bd2bd667 Light painted rooms with north-facing daylight and cast shadows 2026-11-15 16:01:00 -03:00
waozi 681bfb85f9 Build with the Ziran that lets Go register procedures calling a host
Kryon's picture cursors register a decoder that calls the host from a
module initializer (cursor_picture). Ziran 93a54f08 includes 38f133cd,
whose Go check accepts storing such a procedure; the toolchain pin moves
there from 37a64372 so the Go backend check builds Kryon again.
2026-11-15 15:12:01 -03:00
waozi 3cd79f2c67 Prepare a scene grade's colours on GPU-only hosts too
PrepareGrade converted its colours through the CPU renderer's linear
table, which only a CPU render filled. A host drawing only on the GPU
got a black tint and black rooms. The grade now fills the table itself,
and the daylight test prepares a grade before anything is rendered.
2026-11-15 14:57:18 -03:00
waozi 8a4e6f05cc Leave pictures, smooth copies, video and threads out of an empty window
The desktop loop called the image decoders (through cursor pictures), the
Lanczos cache and its worker threads, video and the Kryon font every frame,
so every desktop program carried them. Now each part registers itself the
first time it is used: the rasterizer's picture cache and smooth copies when
a frame draws a picture, the font and shaped layouts with the first text,
and video as a named picture source (raster_picture) when it opens. Picture
cursors decode through kryon/cursor again (cursor_picture and the
CursorPictureHost capability, with no-op exports in the hosts without
picture cursors). A widget host no longer imports the decoder; the
application that embeds it imports kryon/cursor.

examples/window.zi now generates 39 C files and 344 KB instead of 62 and
546 KB, and its executable is 179 KB instead of 265 KB. Native desktop
project builds also link X11 explicitly (from the ATR integration lane).
2026-11-15 14:44:27 -03:00
waozi 67e436293f Skip a scene grade that would change nothing
A neutral grade (white tint, full colour, no lamp and no beam), as a
room has for most of the day, now costs no work per pixel on the CPU or
the GPU.
2026-11-15 14:35:08 -03:00
waozi 0dcd71cc54 Keep night rooms gentler and the low sun's beam softer
A night room took a dark tint that hid the picture; it now keeps more of
its colour under a lighter moonlit blue. The low morning and evening sun
through a large window lit most of the floor too brightly; its beam is
softer, and moonlight a little stronger.
2026-11-15 14:30:53 -03:00
waozi c96178aae8 Light painted scenes by the hour with a scene grade and a daylight sky
Scenes made of painted pictures ignore scene lights, so a time of day had
no way to reach them. Scene.grade tints and desaturates every material not
marked ungraded, and lights it with up to four lamps and a beam through an
elliptical opening such as a round window. The CPU and GPU renderers share
its preparation (PrepareGrade) and agree within the GPU test's tolerance.

kryon/daylight gives the sun's path for any local hour, the grade for that
hour (exactly neutral while the sun is high), warm sun or cool moonlight
through a window, lamps from dusk to dawn, and a storybook sky drawn by one
material shader: a horizon-to-zenith gradient, the sun's glow and disc, two
drifting cloud layers and twinkling stars from tileable noise made in code.
2026-11-15 14:21:27 -03:00
waozi 07d74f6dae Render text as RGBA pixels for lettering on 3D surfaces
TextPixels shapes a string exactly as the window draws it and returns a
straight-RGBA picture: Pango on Cairo for desktop builds, the page canvas
on the web. Hosts use it to paint text into textures, such as a sign that
turns with its door.
2026-11-14 23:51:30 -03:00
waoziandGLM 4daa24b78c Drop the CUI name from Kryon's style
Co-Authored-By: GLM <[email protected]>
2026-11-14 22:40:47 -03:00
waozi 0e66e40ac3 Capture frames through the test driver and build canvas apps without raylib or EGL
The test driver gains a capture command: `capture path=` asks the host for
its next finished frame as a PNG, and DriverCapture sends it from a test.
The desktop host writes the raster it shows (RasterWritePNG); a host that
cannot capture answers "this host does not capture frames" instead of
leaving the test waiting. Hosts capture through TestDriverCapturePath and
TestDriverCaptured. The driver client test covers both answers.

On the web (OS == .WEB) image_pixels decodes with the browser's codecs
through PageImageDecode, so a canvas build no longer links raylib's image
transforms, and scene_gpu links no EGL or GL: its probe reports the GPU
unavailable and SceneGpuRenderOrCPU draws with RenderScene. Jungle's
website builds and draws its 3D rooms this way.
2026-11-14 22:39:16 -03:00
waoziandClaude Opus 5.5 311bcb362f Show a star mask in secure text fields without a display value
A secure TextField with a nonempty value and an empty display_value painted
nothing and showed its placeholder, so an API key field looked empty until
the app's show toggle. TextFieldSecureDisplay now returns the caller's
explicit mask, or one '*' per scalar of the value, which keeps the existing
codepoint cursor and selection mapping. The secret still never reaches
paint, semantics or the clipboard; a focused regression covers the default
mask, an explicit mask and an empty value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 22:18:33 -03:00
waoziandClaude Opus 5.5 0411e4bb8e Track Ziran's renamed tool folders in the build dependencies
Ziran's drivers moved to cmd/zi2* and cmd/zx2*, so the Ziran source lists
that decide when the player runtimes and compiler rebuild now include
those folders too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 22:08:13 -03:00
waozi c8a068e343 Keep modal backdrops open by default 2026-11-14 21:25:38 -03:00
waozi 5f9d675daa Mark the removed portable VM and TinyCC runtimes in the docs 2026-11-14 17:54:14 -03:00
waozi 7baf863221 Commit pending scene, input, export and asset work
- GPU scene renderer: moved, turned or scaled nodes re-send only their own
  triangles instead of rebuilding the scene; per-node matrices are reused;
  FreezeGeometry skips geometry comparisons; lights carry projected
  textures (LightCookie) in the CPU and GLES renderers.
- One ordered per-session key and text delivery path across Desktop,
  Canvas and Raylib.
- Context-menu rows show accelerator labels and checked state.
- Bundle apps keep extracted assets that already match instead of
  rewriting and syncing all of them on every open.
- Image and PDF export modules, hosted box tests, brand assets, plans,
  and the ZX changelog entry.
2026-11-14 16:27:22 -03:00
waozi 0678895719 Run ZX apps on Ziran's one executable format
Ziran dropped the semantic bundle VM: every bundle is revision-28 executable
ZX on the instruction engine (or its Wasm tier). Players and hosted apps
call InstantiateBundle on every target, including the browser; the --vm
option of the zx player goes, and its tests run without it. The web,
Raylib and Android runtimes build libziran in normal mode so they carry the
engine (BOOTSTRAP=1 builds have none), and their rebuild rules watch the
engine's Ziran sources.
2026-11-14 16:27:22 -03:00
waozi 0cf2c54b50 Expose the PRIMARY selection and keep in-poll modifier taps for Raylib keys
SystemPrimaryText, SystemPrimaryAvailable and SystemPrimarySet read and set
the X11/Wayland PRIMARY selection through the host. The SDL desktop and
Linux Raylib hosts implement it with SDL's primary selection; the Android,
Canvas, pixmap, terminal and bundle hosts report it unavailable instead of
aliasing the ordinary clipboard. Terminal uses it for selections,
middle-click, Shift+Insert and Paste Selection.

RaylibInputPoll took modifiers only from keys still down or just released,
so a Control press released again within the same poll was lost and a
scripted Control+C reached the app as a plain C. Modifier presses from the
pressed-key queue now apply to the keys after them. raylib_window_test
covers the tap.
2026-11-14 10:53:34 -03:00
waozi 9e5c5c2d6e Notice a new default display in cached GTK style queries
The style query cache returned before the settings watcher ran, so after
the default display changed it answered from the old settings and the
style generation did not advance. Check the default settings first.
2026-11-14 10:21:55 -03:00
waozi 92a86b9f25 Add an XDND drag source and GTK check, radio and arrow indicators
Native Linux apps can drag data out to other applications with the optional
kryon/DragSourceLinux module, an XDND version 5 drag source on its own X
connection. It starts while the toolkit keeps its implicit button grab, so
the toolkit still sees the release; it follows the pointer, finds the
top-level XDND window under it (honouring XdndProxy and skipping its own
shaped drag icon), sends Enter, Position, Leave and Drop, answers
XdndStatus, serves the XdndSelection data including TARGETS, and reports
when the pointer is over one of the process's own windows so the app can
handle internal drops. The suggested action follows GTK's modifiers.
tests/drag_source_linux_test.py drops onto an independent python-xlib XDND
target on a private Xvfb from source and saved IR (make
drag-source-linux-test, already part of make test).

GtkStyleIndicatorRaster and GtkPainter kinds 9 to 11 draw the theme's own
check box, radio option and submenu arrow with gtk_render_check,
gtk_render_option and gtk_render_arrow, so native menus show check, radio
and submenu rows as GTK draws them.
2026-11-14 10:21:22 -03:00
waozi 1be70904a3 Remove the semantic DOM backend
No project used the dom profile, and it added a second browser host to
maintain beside Canvas. This removes dom_host, dom_tree, dom_paint, dom_run
and dom_app_run, the dom profile in the project tool, docs/dom.md, and the
DOM tests and their three make targets.

The shared browser code loses its DOM branches: page_events no longer tells
a DOM host about presses, blur and document layout, page_core and
page_texture drop the native DOM flag and the img decode kept for it, and
CanvasAppMainLoop takes no argument. The web template builds a Canvas2D
page. The cursor and rotated text tests cover the Canvas profile only.
2026-11-14 06:04:15 -03:00
waozi 797d7317c3 Decode cursor pictures in the host again, run browser bundles on the VM, drop duplicate test targets
Reaching the cursor picture decoder through a CursorPictureHost capability
broke the Go backend check, which refuses a host call reachable from global
startup, and four tests whose hosts link the hosted-widget host without
providing it. The desktop host decodes cursor pictures directly again, and
cursor_picture, cursor_api and the host stubs are gone. The image decoders
therefore stay in every desktop program; an empty window is 62 C files and
545 KB. The test driver and text reductions are unchanged.

Ziran's WebAssembly tier runs only s64 -> s64 host capabilities and no longer
hands other bundles to the VM, so the ZX Canvas player and hosted apps failed
to start in a page. bundle_player and hosted_app select the portable VM on the
web with InstantiateBundlePortable. zx-services-test, zx-hosted-test and
zx-canvas-test pass again.

Sixteen targets in make test, and video-test outside it, only reran one
tests/ziran_*_test.sh that the behavior test runner already runs. They are
removed, leaving 70 targets; make test-focus TEST=NAME runs one script, and
push-check runs the pixmap GPU script that way. The runner clears XAUTHORITY,
the session bus, the session manager and GDK_DISPLAY as those targets did.
2026-11-14 02:39:12 -03:00
waozi c80e022fe8 Leave the test driver and the image decoders out of programs that do not use them
The test driver is test code, yet every program carried it because the hosts
call it each frame. kryon/test_driver now passes the platform's input through
unchanged, and the driver itself, test_driver_engine, is compiled in only when
a build defines KRYON_TEST_DRIVER: --define KRYON_TEST_DRIVER on a direct
build, or the variable set in the environment of kryon build, which keeps a
stamp per setting so toggling it rebuilds. A program built without the driver
and started with the variable set stops at once and says how to build it.

The desktop host decoded cursor pictures directly, which kept PNG, WebP and
AVIF decoding in every desktop program. The decoder is now reached through a
procedure that cursor_picture registers from its initializer, using the new
CursorPictureHost host capability. kryon/cursor, which applications import,
and the hosted-widget host import cursor_picture; the cursor module the hosts
import does not, so hostless and custom-host builds need nothing new. Kryon's
hosts export the capability.

An empty window generates 43 C files and 370 KB instead of 62 and 627 KB, and
its executable is 196 KB instead of 296 KB. The program entry test asserts
that the decoders and the driver stay out, and that a build made for a test
gets the driver.
2026-11-14 01:58:44 -03:00
waozi 9e4af21b6d Name the web target in the page tests and repair two stale test builds
The Canvas host is selected by OS == .WEB, so a page build that only defines
PLATFORM_WEB fails on unresolved Canvas names. The Canvas backend, audio and
text tests, the shared browser behavior helper, and the Lanczos, asset cache,
bitmap image and document storage tests now pass --target-os web
--target-cpu wasm32 (with --target=c when saving IR).

The host keys test builds as part of the project: the key modules import
widgets by name, which bare module paths no longer resolve. The toast test
drops its binding of the platform keyboard capability, which a toast program
never calls, so binding it was refused.

canvas-test, document-storage-test, lanczos-goldens-test,
canvas-asset-cache-test, bitmap-image-test, host-keys-test and
toast-action-test pass again.
2026-11-14 01:20:35 -03:00
waozi fdedbdc392 Keep the Unicode tables out of programs that cannot edit text
text_request checked the cut points of a platform's text request with
std/grapheme, and accessibility can send such a request, so every desktop
program carried 134 KB of grapheme tables. The check now goes through a
procedure that text_boundary registers from its initializer. The text field
and text area import text_boundary, so only programs that can edit text
include the tables. Without an editing widget nothing could take a request,
and TextRequestSend refuses it.

An empty window generates 121 KB less C and its executable shrinks from
346 KB to 296 KB. The program entry test asserts the tables stay out. The
Android text editor test, which sends requests without a widget, imports
text_boundary.

The Canvas frame snapshot test binds the app's Frame to the ProjectFrame
capability its host calls, which the link was missing.
2026-11-14 01:05:35 -03:00
waozi 4757cb3e0b Build the time picker and image examples and the pixmap parity test again
The desktop hosts of the time picker and image examples import a shared demo
module beside them. Project builds only take modules from the package's roots
or a named module path, and examples/ cannot be one because window.zi shares
a name with a project module. The two demos move to examples/demo/, which
those rules name. The time picker demo also uses the current Text.Props size
field and imports time_picker_behavior for TimePickerText.

The pixmap parity test builds the image example as part of the project, since
it imports kryon/image, and passes every saved module when building from
saved IR. Naming only the entry left out the app module bound to the host's
ProjectFrame capability, so all four template cases failed.
2026-11-13 22:23:51 -03:00
waozi 718572978d Build kryon/app programs with the project tool and name the web target
A project whose entry module declares main, such as examples/window.zi, is a
program. The project tool now generates a host that only calls that main, so
kryon build gives a desktop executable or a Canvas page from the same file. A
portable zx profile needs a Frame entry and is refused with that reason.

Browser builds pass --target=c --target-os web --target-cpu wasm32 when they
save IR. The Canvas host is selected by OS == .WEB, and untargeted IR is
portable, so with only PLATFORM_WEB defined every canvas, DOM and raylib-web
project and the ZX canvas player failed on unresolved Canvas functions. The
frame-input and password Canvas tests name the target the same way.

Kryon's manifest names the desktop host's system libraries in [package]
links, so ziran build --project --target=c --exe links a program in this
checkout without caller LDLIBS. The examples Makefile drops its pkg-config
link flags and its own compile of the desktop examples.
2026-11-13 21:10:18 -03:00
waozi 3ac259c4c2 Generate Android sources for the Android target 2026-11-13 18:07:38 -03:00
waozi b08079641f Keep Android loader entries in generated native graphs
`ziran ir --entry main:main` keeps only what main reaches, so the glue's
JNI_OnLoad, android_fopen's __wrap_fopen/__wrap_fopen64 and a ZX player's
android_main were pruned: libmain.map.txt then failed with "symbol not
defined" for JNI_OnLoad and --wrap=fopen left __wrap_fopen undefined.

The generator now selects the graph through a generated root that forwards
to the stable main(argc, argv) and names the loader entries only on a
negative-argc branch, binding Kryon's entries as host capabilities. The
root never enters the C inputs. The source generation test now uses a
real JNI_OnLoad glue, checks the generated C defines every loader entry,
and links native and ZX graphs through kryon_android_app and
kryon_android_host with the canonical export map.
2026-11-13 17:20:59 -03:00
waoziandClaude Opus 5.5 302939233e Build raylib in the Android renderer artifact project again
The kryon:renderer-raylib Android artifact configures
cmake/renderer-artifact, which still called kryon_android_raylib after the
renderer-free native host helpers in cmake/KryonAndroid.cmake stopped
defining it. Every arm64 and armv7 artifact build, such as Shovey's
android-fdroid, failed with an unknown CMake command.

The artifact project now owns that function in RaylibAndroid.cmake: raylib's
GLES2 Android backend, Kryon's WebP and AVIF codecs, and the audio package's
libopus. Raylib's own APK reader keeps the KryonRaylibFopen name, so it never
collides with the __wrap_fopen in src/backend/android_fopen.zi.
KryonAndroid.cmake stays renderer-free.

make android-renderer-artifact-test configures the project for arm64,
checks the codec targets, builds raylib, and checks its fopen symbols.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 16:13:22 -03:00
waozi bd693c1ea9 Accept qualified ActionModal action slices in the widget host
Portable ActionModal guests send their actions as []Modal.ActionModalAction,
the type the modal's host declaration and the generated codec use. The widget
host still required the old unqualified []ActionModalAction, so a package
consumer's real ActionModal call was refused. Check the qualified name only,
and cover it with a package consumer bundle run through the real
WidgetHostCall.
2026-11-13 12:42:12 -03:00
waozi 6a509e300c Pin package templates to compatible Ziran 2026-11-13 11:50:12 -03:00
waozi ff07bddbec Simplify hello world and package widget APIs 2026-11-13 04:29:23 -03:00
waozi 681fd26ddf Checkpoint desktop painter and context menu work
Committed at the owner's request while the work continues.

- Detect unchanged GTK painter surfaces by exact byte comparison, clear
  and copy them in bulk, and reuse resolved GTK style metrics and CSS
  layers within a style generation.
- Present desktop frames before publishing accessibility changes.
- Context menu widget, keyboard and canvas input updates with tests.
2026-11-12 20:12:14 -03:00
waozi b154a5faec Reuse GTK cell measurements and refresh site pages
Reuse identical GTK cell measurements, keep native raster caches across
unrelated GLib events, fix tab widget updates and regenerate the docs site.
2026-11-12 19:16:01 -03:00
waozi 271113fda8 Open website pages at their extensionless URLs
Cloudflare Pages redirects widgets.html to /widgets, and the site only
recognised routes ending in .html, so every page on kryonlabs.com fell
back to the Overview. Match a route with or without the suffix, and make
the browser test server answer clean paths the same way the live host does.
2026-11-12 19:15:10 -03:00
waozi 2d80834675 Fix nested scroll drags and refresh the live website
- Keep scroll pointer, drag and momentum state per Session, so a preview's
  frame sampling cannot release the page's scrollbar thumb or content drag.
- Left-align component navigation, drop the Kryon prefix from core component
  labels, and syntax-highlight the usage, source and guide code areas.
- Replace the Apps text list with card images, public applications and GitHub
  links, and rename Shelf to Explorer.
2026-11-12 18:59:07 -03:00
waozi 73ff84637a Reduce native desktop input and GTK rendering latency 2026-11-12 02:09:28 -03:00
waozi 090a52fd82 Preserve retained frame snapshots during transitions 2026-11-12 02:03:01 -03:00
waozi 602b4a8467 Fix browser startup for website deployments 2026-11-12 01:52:21 -03:00
1372 changed files with 38172 additions and 48961 deletions

No files matched your search

+22 -22
View File
@@ -104,15 +104,15 @@ jobs:
fetch: true
- name: Install the AVIF decoder's dav1d build tools
run: brew install meson ninja $([ "$RUNNER_ARCH" = X64 ] && echo nasm)
run: brew install meson ninja pkgconf sdl2 cairo pango fontconfig freetype gdk-pixbuf webp $([ "$RUNNER_ARCH" = X64 ] && echo nasm)
# No GUI launch or screenshot can reach a runner's inherited display.
- name: Build native player and execute the portable VM with CPU pixels
run: |
export PATH="$ZIRAN_ROOT/build/bin:$PATH"
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
make zx-headless-test
build/zx-raylib/zx --check build/scratch/zx-headless/app.zx
make zx-headless-test zx-player
build/bin/zx --check build/scratch/zx-headless/app.zx
test-linux:
name: Ziran library and host tests (${{ matrix.shard }})
@@ -151,7 +151,7 @@ jobs:
libfreetype-dev libfontconfig1-dev libcurl4-openssl-dev libdrm-dev libgbm-dev
libegl-dev libgles-dev libegl-mesa0 libgl1-mesa-dri imagemagick xclip xdotool
libxkbcommon-x11-0
x11-xserver-utils python3-gi python3-gi-cairo python3-cairo python3-pil ffmpeg gir1.2-gtk-3.0 gir1.2-atspi-2.0
x11-xserver-utils python3-gi python3-gi-cairo python3-cairo python3-pil python3-xlib ffmpeg gir1.2-gtk-3.0 gir1.2-atspi-2.0
libglib2.0-dev libpango1.0-dev at-spi2-core dbus-x11 gstreamer1.0-plugins-base
gstreamer1.0-plugins-good gstreamer1.0-libav cmake nasm meson ninja-build libwebpdemux2 libopus-dev
@@ -175,6 +175,21 @@ jobs:
with:
node-version: '22'
# The pay-per-import test and the gallery build these examples as
# applications of this checkout, as ziran.local.toml does locally.
- name: Build the in-tree examples from this checkout
if: matrix.shard == 'hosts' || matrix.shard == 'site'
run: |
python3 - <<'PY'
import os, subprocess
from pathlib import Path
ziran = Path(os.environ['ZIRAN_ROOT'])
settings = f'[overrides]\nkryon = "{Path.cwd()}"\nziran = "{ziran}"\n'
for project in ('examples/box', 'examples/button', 'examples/image', 'examples/textfield', 'examples/gallery'):
(Path(project) / 'ziran.local.toml').write_text(settings)
subprocess.run([str(ziran / 'build/bin/ziran'), 'lock'], cwd=project, check=True)
PY
- name: Keep Google libraries in the gplay edition
run: python3 scripts/check-google-free.py --source .
@@ -232,12 +247,6 @@ jobs:
if: matrix.shard == 'hosts'
run: env -u DISPLAY -u WAYLAND_DISPLAY make -C examples test
- name: Test live preview and rendered themes
if: matrix.shard == 'web'
env:
CHROMIUM: google-chrome
run: env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY node tests/demo_browser.mjs
# The whole site is rebuilt from this checkout, so the live editor's
# embedded examples match the gallery under test. Nothing is deployed.
- name: Build and test the widget gallery
@@ -248,7 +257,7 @@ jobs:
export PATH="$ZIRAN_ROOT/build/bin:$PATH"
make site
python3 tests/gallery_modules_test.py
make site-gallery-test
make site-browser-test
- name: Show how much the compile cache saved
if: always()
@@ -303,7 +312,7 @@ jobs:
run: env -u DISPLAY -u WAYLAND_DISPLAY make sanitize-test TEST_JOBS=4
test-desktop-hosts:
name: Desktop and raylib hosts on private Xvfb
name: Desktop hosts on private Xvfb
needs: push-check
if: needs.push-check.outputs.code == 'true'
runs-on: ubuntu-latest
@@ -333,7 +342,7 @@ jobs:
packages: >-
build-essential python3 pkg-config libsdl2-dev libcairo2-dev libglib2.0-dev
libpango1.0-dev libdrm-dev libgbm-dev libegl-dev libgles-dev libegl-mesa0
libgl1-mesa-dri libx11-dev libxt-dev libxext-dev libfontconfig1-dev libfreetype-dev
libgl1-mesa-dri libx11-dev libxt-dev libxext-dev libxtst-dev libfontconfig1-dev libfreetype-dev
libxkbcommon-x11-0
fonts-dejavu-core fonts-wqy-zenhei xvfb xdotool x11-apps x11-utils imagemagick xfwm4
dbus-x11 cmake nasm meson ninja-build libwebpdemux2 libopus-dev
@@ -353,12 +362,3 @@ jobs:
- name: Desktop frame input snapshots
run: make desktop-frame-input-test
- name: Raylib host
run: env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY make raylib-project-test
- name: Raylib font coverage, collections and frame pipeline
run: |
RAYLIB_A="$PWD/build/raylib-ziran/libraylib.a" \
RAYLIB_LIBS="$(pkg-config --libs sdl2 libdrm gbm egl glesv2) -ldl -lpthread -lm" \
make raylib-typeface-test raylib-trace-test raylib-secondary-window-test raylib-frame-pixels-test raylib-frame-input-test
+17 -4
View File
@@ -78,12 +78,15 @@ jobs:
run: |
python3 - <<'PY'
from pathlib import Path
import shutil, subprocess
import json, shutil, subprocess
site = Path('docs/site')
output = Path('build/scratch/website-deploy')
paths = {Path(p) for p in subprocess.check_output(['git', 'ls-files', '-z', '--', str(site)]).decode().split('\0') if p}
paths.add(site / 'gallery-data.js')
paths.update((site / 'gallery-sources').rglob('*.zi'))
# The build numbers runtime assets; stage every one it lists, since
# a newly bundled asset is not tracked yet.
paths.update(site / name for _, name in json.loads((site / 'runtime/assets.json').read_text()))
for source in paths:
destination = output / source.relative_to(site)
destination.parent.mkdir(parents=True, exist_ok=True)
@@ -135,8 +138,6 @@ jobs:
- name: Check static site assets
run: |
test -f docs/site/index.html
test -f docs/site/demo.html
test -f docs/site/assets/widgets.html
test -f docs/site/runtime/playground-runtime.js
test -f docs/site/runtime/playground-runtime.wasm
test -f docs/site/demo-theme.js
@@ -150,13 +151,25 @@ jobs:
test -f docs/site/gallery-sources/kryon/0.zi
- name: Test the Canvas website
timeout-minutes: 45
env:
CHROMIUM: google-chrome
# Chrome creates Unix sockets below TMPDIR; keep them clear of the
# runner's deeply nested checkout path.
KRYON_TEST_RUNTIME: ${{ runner.temp }}
run: |
export PATH="$GITHUB_WORKSPACE/ziranlang/ziran/build/bin:$PATH"
export ZIRAN_ROOT="$GITHUB_WORKSPACE/ziranlang/ziran"
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
YUE_DESKTOP_RECOVERY=0 python3 tests/site_browser_test.py
YUE_DESKTOP_RECOVERY=0 python3 -u tests/site_browser_test.py
- name: Save browser startup diagnostics
if: failure()
uses: actions/upload-artifact@v6
with:
name: website-browser-log
path: kryonlabs/kryon/build/scratch/site-browser/profile/chromium.log
if-no-files-found: ignore
deploy-production:
name: Deploy Kryon Labs
+13 -2
View File
@@ -59,8 +59,19 @@ and portable loader must never recognize Kryon widget names specially. An
application that does not import Kryon needs no Kryon code or graphical host.
Keep app-specific screens, assets, copy, workflows, and state in the app repo.
One widget concept has one public implementation. `Text(TextProps)` and
`Image(ImageProps)` are the intended text and image widget surfaces. Do not
Nothing is imported by default. A program carries only the code for what it
imports and uses. A bare window carries the window, its events and
presenting; import a frame and you get a frame, import a rectangle and you get
a rectangle. Optional features arrive through their import or first use, never
through runtime flags. Shared code reaches an optional part through a small
slot module (such as `frame_driver`, `image_lookup`, `text_editing` and
`scroll_sampling`) that the part's own module fills from its initializer or
first use; shared code never imports the part itself. Make generated code
smaller by cutting what isn't
needed, never by merging files (owner, 2026-11-15).
One widget concept has one public implementation. `Text.Draw(Text.Props)` and
`Image.Draw(Image.Props)` are the intended text and image widget surfaces. Do not
add parallel wrappers or expose raw texture draw calls as app widget APIs.
## Testing and desktop safety
+672 -1899
View File
File diff suppressed because it is too large. Load diff
+284 -240
View File
@@ -39,14 +39,15 @@ ZIRAN_INCLUDE ?= $(abspath $(ZIRAN_DIR)/include)
KRYON_UI_PATHS := $(foreach directory,$(sort $(shell find src/ui -type d)),--module-path $(directory) --module-path kryon=$(directory))
ZIRAN_STD_PATH := --module-path $(ZIRAN_DIR)/std $(KRYON_UI_PATHS)
KRYON_DIR := $(CURDIR)
include mk/codecs.mk
include mk/zx-player.mk
ZIRAN_SOURCES := $(wildcard $(ZIRAN_DIR)/cmd/zir*/*.c \
$(ZIRAN_DIR)/cmd/zir*/*.h $(ZIRAN_DIR)/include/*.h \
ZIRAN_SOURCES := $(wildcard $(ZIRAN_DIR)/cmd/zir*/*.c $(ZIRAN_DIR)/cmd/zi2*/*.c $(ZIRAN_DIR)/cmd/zx2*/*.c \
$(ZIRAN_DIR)/cmd/zir*/*.h $(ZIRAN_DIR)/cmd/zi2*/*.h $(ZIRAN_DIR)/cmd/zx2*/*.h $(ZIRAN_DIR)/include/*.h \
$(ZIRAN_DIR)/scripts/* $(ZIRAN_DIR)/std/*.zi $(ZIRAN_DIR)/Makefile)
SOURCE := $(addprefix src/ui/,$(shell cat src/ui/modules.txt))
.PHONY: all backends-check check laws test test-focus ziran-test header-check source-check docs-check public-surface-check clean project-toolchain project-test templates-test pixmap-parity-test pixmap-font pixmap-emoji install-user dom-project-test host-keys-test
.PHONY: all backends-check check laws test test-focus ziran-test header-check source-check docs-check public-surface-check clean project-toolchain project-test templates-test pixmap-parity-test pixmap-font pixmap-emoji install-user host-keys-test
all: source-check $(BUILD_DIR)/libkryon.a backends-check
# Project command. Its implementation and platform integration are Ziran.
@@ -112,6 +113,39 @@ ziran-test: project-toolchain
# fetch the same package at the same time, and offline ones find none. A
# pinned toolchain this builds uses the plain compilers, not instrumented ones.
.PHONY: behavior-tests
test: markdown-editor-test
.PHONY: markdown-editor-test
MARKDOWN_TEST_BINDINGS = \
--bind kryon/font_metrics:MeasureGlyphWidth=ziran_widget_noop_host:MeasureGlyphWidth \
--bind kryon/font_metrics:MeasureGlyphLineHeight=ziran_widget_noop_host:MeasureGlyphLineHeight \
--bind kryon/raster_text:RasterText=ziran_widget_noop_host:RasterText \
--bind kryon/raster_text:RasterTextClipped=ziran_widget_noop_host:RasterTextClipped \
--bind kryon/raster_text:RasterTextRotated=ziran_mesh_noop_host:RasterTextRotated \
--bind kryon/raster_shape:RasterRoundedRectangle=ziran_widget_noop_host:RasterRoundedRectangle \
--bind kryon/raster_shape:RasterRoundedRectangleOutline=ziran_widget_noop_host:RasterRoundedRectangleOutline \
--bind kryon/raster:RasterLine=ziran_widget_noop_host:RasterLine \
--bind kryon/paint_queue:RasterImage=ziran_widget_noop_host:RasterImage \
--bind kryon/image_raster:ImageWidth=ziran_widget_noop_host:ImageWidth \
--bind kryon/image_raster:ImageHeight=ziran_widget_noop_host:ImageHeight \
--bind kryon/system_clipboard:SystemClipboardOpenHost=system_clipboard_host:SystemClipboardOpenHost \
--bind kryon/system_clipboard:SystemClipboardByteHost=system_clipboard_host:SystemClipboardByteHost \
--bind kryon/system_clipboard:SystemClipboardWriteHost=system_clipboard_host:SystemClipboardWriteHost
markdown-editor-test:
$(ZIRAN_BIN) ir --project --module-path $(CURDIR)/tests --root $(CURDIR)/tests -o $(CURDIR)/build/markdown-editor/ir $(CURDIR)/tests/markdown_editor_behavior.zi
@set -eu; unset DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS SESSION_MANAGER; export HARMONY_DESKTOP_RECOVERY=0; \
for form in source saved; do \
input=$(CURDIR)/tests/markdown_editor_behavior.zi; root=$(CURDIR)/tests; \
if test "$$form" = saved; then input=$(CURDIR)/build/markdown-editor/ir/markdown_editor_behavior.zir; root=$(CURDIR)/build/markdown-editor/ir; fi; \
$(ZIRAN_BIN) build --project --module-path "$$root" $(MARKDOWN_TEST_BINDINGS) --target=c --root "$$root" --entry markdown_editor_behavior:Main --exe -o build/markdown-editor/$$form-c "$$input"; \
build/markdown-editor/$$form-c/markdown_editor_behavior; \
$(ZIRAN_BIN) build --project --module-path "$$root" $(MARKDOWN_TEST_BINDINGS) --target=go --pkg main --root "$$root" --entry markdown_editor_behavior:Main --exe -o build/markdown-editor/$$form-go "$$input"; \
GO111MODULE=off go run build/markdown-editor/$$form-go/*.go; \
$(ZIRAN_BIN) bundle --project --module-path "$$root" $(MARKDOWN_TEST_BINDINGS) --root "$$root" --entry markdown_editor_behavior:Main -o build/markdown-editor/$$form.zx "$$input"; \
test "$$($(ZIRAN_BIN) run build/markdown-editor/$$form.zx)" = 0; \
done
cmp build/markdown-editor/source.zx build/markdown-editor/saved.zx
behavior-tests:
@env -u CC -u CXX "$(abspath $(ZIRAN_BUILD_DIR))/bin/ziran" fetch
@ZIRAN_BIN="$(abspath $(ZIRAN_BUILD_DIR))/bin/ziran" \
@@ -122,7 +156,11 @@ behavior-tests:
# Run one behavior area without regenerating every UI module and target.
test-focus:
@test -n "$(TEST)" || { echo 'usage: make test-focus TEST=link_widget' >&2; exit 2; }
ifeq ($(TEST),markdown_editor_behavior)
@$(MAKE) --no-print-directory markdown-editor-test
else
@$(MAKE) --no-print-directory ziran-test TEST="$(TEST)" TEST_JOBS="$(TEST_JOBS)"
endif
header-check:
sh tools/check-zi-header-free.sh
@@ -164,17 +202,22 @@ renderer-consumer-test:
test: renderer-consumer-test
.PHONY: desktop-codec-artifact-test
desktop-codec-artifact-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY python3 tests/desktop_codec_artifact_test.py
test: desktop-codec-artifact-test
renderer-artifact-test: build/bin/kryon
env -u DISPLAY -u WAYLAND_DISPLAY python3 tests/renderer_artifact_test.py
.PHONY: zx-test zx-reload-test
include mk/zx-canvas.mk
include mk/raylib-library.mk
include mk/zx-raylib.mk
include mk/codecs.mk
# Injected graphics hosts still link the production WebP and AVIF native ABIs.
ziran-test behavior-tests: $(WEBP_A) $(AVIF_A) $(AOM_A)
$(ZX_CANVAS_GENERATED)/.complete $(ZX_RAYLIB_GENERATED)/.complete: | project-toolchain
$(ZX_CANVAS_GENERATED)/.complete: | project-toolchain
zx-reload-test: zx-player
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
ZIRAN_ROOT=$(abspath $(ZIRAN_DIR)) python3 tests/zx_reload_test.py
@@ -185,37 +228,52 @@ zx-test: build/bin/kryon zx-player
test: zx-test zx-reload-test
# window.zi's bundle runs as native code on a private Xvfb through a private
# host registry: in the desktop player's window through `ziran run`, and as
# zx2native's executable linking the desktop host library.
.PHONY: zx-window-test
zx-window-test: zx-player zx-window-host
@rm -rf build/test/zx-window
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS YUE_DESKTOP_RECOVERY=0 \
ZIRAN_BIN="$(abspath $(ZIRAN_BIN))" "$(ZIRAN_BIN)" run --target=c tests/zx_window_test.zi -- \
"$(abspath build/test/zx-window)" "$(abspath $(PLAYER))" "$(abspath $(WINDOW_HOST))" \
"$(abspath $(dir $(ZIRAN_BIN))zx2native)"
test: zx-window-test
.PHONY: zx-services-test zx-hosted-test zx-headless-test
zx-headless-test: zx-raylib
zx-headless-test:
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
ZIRAN_ROOT=$(abspath $(ZIRAN_DIR)) ZIRAN_BIN=$(abspath $(ZIRAN_DIR))/build/bin/ziran \
python3 tests/zx_headless_test.py
zx-services-test: zx-raylib zx-canvas
zx-services-test: zx-player zx-canvas
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
ZIRAN_ROOT=$(abspath $(ZIRAN_DIR)) ZIRAN_BIN=$(abspath $(ZIRAN_DIR))/build/bin/ziran \
python3 tests/zx_services_test.py
zx-hosted-test: zx-raylib zx-canvas
zx-hosted-test: zx-player zx-canvas
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
ZIRAN_ROOT=$(abspath $(ZIRAN_DIR)) ZIRAN_BIN=$(abspath $(ZIRAN_DIR))/build/bin/ziran \
python3 tests/zx_hosted_test.py
test: zx-services-test zx-hosted-test zx-headless-test
.PHONY: zx-canvas-test zx-raylib-test zx-android-test gallery-zx gallery-zx-test
.PHONY: zx-canvas-test zx-android-test gallery-zx gallery-zx-test
gallery-zx: project-toolchain
python3 scripts/export-gallery-zx.py --ziran $(ZIRAN_BIN)
gallery-zx-test: gallery-zx zx-player
python3 tests/gallery_zx_test.py
zx-canvas-test: build/bin/kryon
zx-canvas-test: build/bin/kryon zx-player
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
ZIRAN_ROOT=$(abspath $(ZIRAN_DIR)) python3 tests/zx_canvas_test.py
zx-raylib-test: zx-test zx-raylib
@python3 tests/zx_native_test.py --player $(ZX_RAYLIB_PROGRAM) \
--bundle build/zx-test/download\ with\ spaces/app.zx
.PHONY: zx-native-test
zx-native-test: zx-test zx-player
@python3 tests/zx_native_test.py --bundle build/zx-test/download\ with\ spaces/app.zx
test: zx-native-test
# This gate builds only; a device test requires an explicit disposable emulator.
zx-android-test: build/bin/kryon
@@ -258,16 +316,22 @@ pixmap-mono-font: $(OUTLINE_FONT_PROGRAM)
# Installs the kryon command. Outside `ziran tool kryon` it forwards project
# commands to ziran, which runs the Kryon each project's lock pins.
PREFIX ?= $(HOME)/.local
install-user: build/bin/kryon zx-player
install-user: build/bin/kryon zx-player zx-window-host
mkdir -p "$(PREFIX)/bin"
cp build/bin/kryon "$(PREFIX)/bin/kryon.new"
mv -f "$(PREFIX)/bin/kryon.new" "$(PREFIX)/bin/kryon"
cp build/bin/zx "$(PREFIX)/bin/zx.new"
mv -f "$(PREFIX)/bin/zx.new" "$(PREFIX)/bin/zx"
mkdir -p "$(PREFIX)/lib/kryon"
cp $(WINDOW_HOST) "$(PREFIX)/lib/kryon/libkryon-desktop.so.new"
mv -f "$(PREFIX)/lib/kryon/libkryon-desktop.so.new" "$(PREFIX)/lib/kryon/libkryon-desktop.so"
mkdir -p "$(PREFIX)/share/ziran/hosts"
@provider=$$(CDPATH= cd -- "$(PREFIX)/bin" && pwd -P) && \
printf '%s/zx\n' "$$provider" > "$(PREFIX)/share/ziran/hosts/kryon-desktop.host.new"
mv -f "$(PREFIX)/share/ziran/hosts/kryon-desktop.host.new" "$(PREFIX)/share/ziran/hosts/kryon-desktop.host"
@library=$$(CDPATH= cd -- "$(PREFIX)/lib/kryon" && pwd -P) && \
printf '%s/libkryon-desktop.so\n' "$$library" > "$(PREFIX)/share/ziran/hosts/kryon-desktop.library.new"
mv -f "$(PREFIX)/share/ziran/hosts/kryon-desktop.library.new" "$(PREFIX)/share/ziran/hosts/kryon-desktop.library"
$(RM) "$(PREFIX)/bin/zib"
# Laws state policy independently of its implementation; `ziran check`
@@ -289,7 +353,6 @@ docs-check:
python3 scripts/feature-matrix-html.py --check
public-surface-check: canvas-hosted-import-test $(BUILD_DIR)/ziran-toolchain.stamp
$(ZIRAN_BIN) ir --project --root src/ui -o $(BUILD_DIR)/public/core src/ui/Kryon/module.zi
python3 tests/public_surface_test.py
.PHONY: canvas-hosted-import-test
@@ -301,11 +364,11 @@ check: all ziran-test header-check docs-check project-test public-surface-check
# CI runs make test as parallel jobs on separate machines. The hosts shard takes
# every test target not named here, so a new one cannot miss CI.
CI_SHARD_ZX := renderer-consumer-test zx-test zx-reload-test zx-services-test zx-hosted-test \
zx-headless-test native-text-test native-accessibility-test bundle-preload-test
CI_SHARD_ZX := renderer-consumer-test zx-test zx-reload-test zx-window-test zx-services-test zx-hosted-test \
zx-headless-test native-text-test native-accessibility-test
CI_SHARD_CHECK := check
CI_SHARD_WEB := canvas-test canvas-project-test zx-canvas-test zx-raylib-test page-route-project-test dom-project-test \
raylib-web-project-test
CI_SHARD_WEB := canvas-test canvas-project-test program-entry-project-test zx-canvas-test \
page-route-project-test
.PHONY: test-shard-zx test-shard-check test-shard-web test-shard-hosts
test-shard-zx: $(CI_SHARD_ZX)
test-shard-check: $(CI_SHARD_CHECK)
@@ -320,7 +383,9 @@ test-shard-hosts:
.PHONY: push-check
push-check:
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS YUE_DESKTOP_RECOVERY=0 \
$(MAKE) --no-print-directory source-check public-surface-check docs-check zx-player desktop-project-test pixmap-gpu-test gamepad-test text-hook-hosts-ir-test
$(MAKE) --no-print-directory source-check public-surface-check docs-check zx-player desktop-project-test gamepad-test text-hook-hosts-ir-test
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS YUE_DESKTOP_RECOVERY=0 \
$(MAKE) --no-print-directory test-focus TEST=ziran_pixmap_gpu_test
.PHONY: text-hook-hosts-ir-test
text-hook-hosts-ir-test:
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/text_hook_hosts_ir_test.sh
@@ -330,6 +395,80 @@ gamepad-test:
python3 tests/canvas_gamepad_test.py
test: gamepad-test
# An example's generated C holds only what it imports: an empty window is
# the window, its event loop, clearing and presenting; images bring decoders.
.PHONY: pay-per-import-test
pay-per-import-test:
@rm -rf build/test/pay-per-import
@env -u DISPLAY -u WAYLAND_DISPLAY ZIRAN_BIN="$(ZIRAN_BIN)" \
"$(ZIRAN_BIN)" run --target=c --root tests tests/pay_per_import_test.zi
test: pay-per-import-test
# The desktop host's windows on a private Xvfb with real X input: each
# window's own events and surface, the sideways wheel, key repeat, window
# state, the monitor, embedded pictures and fonts, and the render scale.
.PHONY: desktop-windows-test
desktop-windows-test:
@rm -rf build/test/desktop-windows
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS YUE_DESKTOP_RECOVERY=0 \
LDLIBS="-lXtst" "$(ZIRAN_BIN)" run --target=c tests/desktop_windows_test.zi -- build/test/desktop-windows
test: desktop-windows-test
# The desktop audio mixer, SDL sink and asset audio, with no audio device:
# SDL's disk driver stands in for one.
.PHONY: desktop-audio-test
desktop-audio-test:
@rm -rf build/test/desktop-audio
@env -u DISPLAY -u WAYLAND_DISPLAY LDLIBS="-lopus" \
"$(ZIRAN_BIN)" run --target=c tests/desktop_audio_test.zi -- build/test/desktop-audio
test: desktop-audio-test
# The core MP3 archive, built through std/native/AudioCodecs.cmake.
AUDIO_PACKAGE = $$("$(ZIRAN_BIN)" pkg path audio --offline)
MP3_DIR := $(BUILD_DIR)/mp3
MP3_A := $(MP3_DIR)/libziran_mp3.a
$(MP3_A): ziran.lock
@mkdir -p $(MP3_DIR)
@cmake -S "$(AUDIO_PACKAGE)/native" -B $(MP3_DIR) -DCMAKE_BUILD_TYPE=Release \
-DZIRAN_STDLIB="$(ZIRAN_ROOT)/std" -DAUDIO_CORE_VORBIS=OFF > $(MP3_DIR)/configure.log
@cmake --build $(MP3_DIR) --target ziran_mp3 > $(MP3_DIR)/build.log
# MPEG audio streamed through the mixer equals std/audio_mp3's own decode of the
# audio package's fixtures, and plays as asset audio, with no audio device.
.PHONY: desktop-audio-mp3-test
desktop-audio-mp3-test: $(MP3_A)
@rm -rf build/test/desktop-audio-mp3
@env -u DISPLAY -u WAYLAND_DISPLAY LDLIBS="-L$(MP3_DIR) -lziran_mp3 -lopus -lm" \
"$(ZIRAN_BIN)" run --target=c tests/desktop_audio_mp3_test.zi -- \
"$(AUDIO_PACKAGE)/tests/fixtures/mp3" build/test/desktop-audio-mp3
test: desktop-audio-mp3-test
# The core Xiph Vorbis archives, built through std/native/AudioCodecs.cmake.
# libvorbis 1.3.7 asks for CMake 2.8, which CMake 4 configures only with a
# policy floor; earlier CMake ignores the variable.
VORBIS_DIR := $(BUILD_DIR)/vorbis
VORBIS_A := $(VORBIS_DIR)/libvorbisfile.a
$(VORBIS_A): ziran.lock
@mkdir -p $(VORBIS_DIR)
@cmake -S "$(AUDIO_PACKAGE)/native" -B $(VORBIS_DIR) -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DZIRAN_STDLIB="$(ZIRAN_ROOT)/std" -DAUDIO_CORE_VORBIS=ON > $(VORBIS_DIR)/configure.log
@cmake --build $(VORBIS_DIR) --target vorbisfile > $(VORBIS_DIR)/build.log
# Ogg Vorbis streamed through the mixer equals std/vorbis_linux's own decode of
# the audio package's fixtures, and plays as asset audio, with no audio device.
.PHONY: desktop-audio-vorbis-test
desktop-audio-vorbis-test: $(VORBIS_A)
@rm -rf build/test/desktop-audio-vorbis
@env -u DISPLAY -u WAYLAND_DISPLAY LDLIBS="-L$(VORBIS_DIR) -lvorbisfile -lvorbis -logg -lopus -lm" \
"$(ZIRAN_BIN)" run --target=c tests/desktop_audio_vorbis_test.zi -- \
"$(AUDIO_PACKAGE)/tests/fixtures/vorbis" build/test/desktop-audio-vorbis
test: desktop-audio-vorbis-test
.PHONY: android-audio-test
android-audio-test:
@ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/android_audio_test.sh
.PHONY: cursor-api-test
cursor-api-test:
python3 tests/cursor_api_test.py
@@ -339,13 +478,6 @@ test: cursor-api-test
canvas-audio-engine-test:
@env -u DISPLAY -u WAYLAND_DISPLAY sh tests/canvas_audio_engine_zi_test.sh
.PHONY: dom-spec-test
dom-spec-test:
@env -u DISPLAY -u WAYLAND_DISPLAY sh tests/dom_spec_zi_test.sh
@mkdir -p build/scratch/dom-pixels
@'$(ZIRAN_BIN)' bundle --root tests $(KRYON_UI_PATHS) --module-path src/backend --module-path '$(ZIRAN_DIR)/std' --entry dom_pixels_test:main -o build/scratch/dom-pixels/pixels.zx tests/dom_pixels_test.zi
@test "$$('$(ZIRAN_BIN)' run build/scratch/dom-pixels/pixels.zx)" = 0
.PHONY: desktop-frame-input-test canvas-frame-input-test
desktop-frame-input-test:
@python3 tests/host_frame_snapshot_test.py desktop
@@ -372,7 +504,7 @@ page-geometry-test: project-toolchain
test: page-geometry-test
.PHONY: canvas-test
canvas-test: canvas-frame-input-test web-js-boundary-test canvas-events-test mini-mode-test dom-spec-test canvas-audio-engine-test page-geometry-test
canvas-test: canvas-frame-input-test web-js-boundary-test canvas-events-test mini-mode-test canvas-audio-engine-test page-geometry-test
@env -u DISPLAY -u WAYLAND_DISPLAY sh tests/canvas_backend_test.sh
@env -u DISPLAY -u WAYLAND_DISPLAY python3 tests/file_picker_browser_test.py
@env -u DISPLAY -u WAYLAND_DISPLAY python3 tests/http_transfer_browser_test.py
@@ -390,94 +522,35 @@ canvas-project-test:
@env -u DISPLAY -u WAYLAND_DISPLAY python3 tests/canvas_project_test.py
@env -u DISPLAY -u WAYLAND_DISPLAY python3 tests/web_simd_page_test.py
# A program entry (main plus App.Run) built by the project tool for the page
# and for the desktop.
.PHONY: program-entry-project-test
program-entry-project-test:
@env -u DISPLAY -u WAYLAND_DISPLAY python3 tests/program_entry_project_test.py
test: program-entry-project-test
.PHONY: page-route-project-test
page-route-project-test:
@env -u DISPLAY -u WAYLAND_DISPLAY python3 tests/page_route_project_test.py
.PHONY: dom-project-test
dom-project-test:
@env -u DISPLAY -u WAYLAND_DISPLAY python3 tests/dom_project_test.py
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
YUE_DESKTOP_RECOVERY=0 KRYON_DOM_INTERACTION=1 python3 tests/dom_project_test.py
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
YUE_DESKTOP_RECOVERY=0 KRYON_DOM_PRESS=1 python3 tests/dom_project_test.py
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
YUE_DESKTOP_RECOVERY=0 KRYON_DOM_PRESS_MOVE=1 python3 tests/dom_project_test.py
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
YUE_DESKTOP_RECOVERY=0 KRYON_DOM_IMAGE_DECODE=1 python3 tests/dom_project_test.py
.PHONY: native-text-test native-accessibility-test bundle-preload-test
.PHONY: native-text-test native-accessibility-test
native-text-test:
@sh tests/native_text_test.sh
native-accessibility-test:
@sh tests/native_accessibility_test.sh
bundle-preload-test:
@ZIRAN_ROOT=$(abspath $(ZIRAN_DIR)) ZIRAN_BIN=$(abspath $(ZIRAN_DIR))/build/bin/ziran sh tests/ziran_bundle_preload_test.sh
test: native-text-test native-accessibility-test bundle-preload-test
test: native-text-test native-accessibility-test
.PHONY: typeface-source-test
typeface-source-test: $(ZI2C_BIN)
@env -u DISPLAY -u WAYLAND_DISPLAY sh tests/typeface_source_link_test.sh
.PHONY: raylib-project-test
raylib-project-test: build/bin/kryon
@python3 tests/raylib_project_test.py
# platform = "web": a custom raylib host's 3D cube under Kryon UI on WebGL, in
# private headless Chromium.
.PHONY: raylib-web-project-test
raylib-web-project-test: build/bin/kryon
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
YUE_DESKTOP_RECOVERY=0 python3 tests/raylib_web_project_test.py
test: raylib-web-project-test
.PHONY: program-title-test
program-title-test: $(ZI2C_BIN)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/program_title_test.sh
.PHONY: raylib-window-test
raylib-window-test: $(ZI2C_BIN) $(WEBP_A) $(AVIF_A) $(AOM_A)
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY ZIRAN_ROOT="$(ZIRAN_DIR)" \
ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/raylib_window_test.sh
.PHONY: raylib-typeface-test
raylib-typeface-test: $(ZI2C_BIN) $(RAYLIB_ARCHIVES)
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" RAYLIB_A="$(RAYLIB_A)" \
sh tests/raylib_typeface_test.sh
.PHONY: raylib-text-pixels-test
raylib-text-pixels-test: $(ZI2C_BIN) $(RAYLIB_ARCHIVES)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" RAYLIB_A="$(RAYLIB_A)" WEBP_A="$(WEBP_A)" \
AVIF_A="$(AVIF_A)" AOM_A="$(AOM_A)" RAYLIB_AUDIO_LIBS="$(RAYLIB_AUDIO_LIBS)" \
sh tests/raylib_text_pixels_test.sh
.PHONY: raylib-mesh-pixels-test
raylib-mesh-pixels-test: $(ZI2C_BIN)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" WEBP_A="$(WEBP_A)" \
sh tests/raylib_mesh_pixels_test.sh
.PHONY: raylib-frame-input-test
raylib-frame-input-test: project-toolchain $(RAYLIB_ARCHIVES)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" RAYLIB_A="$(RAYLIB_A)" WEBP_A="$(WEBP_A)" \
sh tests/raylib_frame_snapshot_test.sh
# The canonical Android host's frame publication, on desktop raylib and Xvfb.
.PHONY: android-raylib-host-link-test
android-raylib-host-link-test: project-toolchain
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/android_raylib_host_link_test.sh
test: android-raylib-host-link-test
.PHONY: android-raylib-jni-test
android-raylib-jni-test: project-toolchain
sh tests/android_raylib_jni_test.sh
test: android-raylib-jni-test
.PHONY: android-frame-input-test
android-frame-input-test: project-toolchain $(RAYLIB_ARCHIVES)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" RAYLIB_A="$(RAYLIB_A)" WEBP_A="$(WEBP_A)" \
android-frame-input-test: project-toolchain $(WEBP_A) $(AVIF_A) $(AOM_A)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" WEBP_A="$(WEBP_A)" \
AVIF_A="$(AVIF_A)" AOM_A="$(AOM_A)" sh tests/android_frame_input_test.sh
# Android's fopen, for a process with no running activity.
@@ -485,48 +558,37 @@ android-frame-input-test: project-toolchain $(RAYLIB_ARCHIVES)
android-fopen-test: project-toolchain
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/android_fopen_test.sh
.PHONY: raylib-frame-pixels-test
raylib-frame-pixels-test: project-toolchain $(RAYLIB_ARCHIVES)
@ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/android_frame_pixels_test.py --host \
--raylib "$(RAYLIB_A)" --webp "$(WEBP_A)" --archive "$(AVIF_A)" --archive "$(AOM_A)" \
--runtime "$(ZIRAN_BUILD_DIR)/libziran.a"
.PHONY: raylib-secondary-window-test
raylib-secondary-window-test: $(ZI2C_BIN) $(RAYLIB_A)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" RAYLIB_A="$(RAYLIB_A)" sh tests/raylib_secondary_window_test.sh
.PHONY: raylib-trace-test
raylib-trace-test: $(ZI2C_BIN)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/raylib_trace_test.sh
.PHONY: raylib-clip-test
raylib-clip-test: $(ZI2C_BIN)
@ZIRAN_DIR="$(abspath $(ZIRAN_DIR))" ZI2C_BIN="$(ZI2C_BIN)" WEBP_A="$(WEBP_A)" \
ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/raylib_clip_test.sh
.PHONY: raylib-smooth-shape-test
raylib-smooth-shape-test: $(ZI2C_BIN)
@ZIRAN_DIR="$(abspath $(ZIRAN_DIR))" ZI2C_BIN="$(ZI2C_BIN)" \
ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/raylib_smooth_shape_test.sh
.PHONY: desktop-project-test
desktop-project-test: build/bin/kryon
@python3 tests/desktop_project_test.py
.PHONY: desktop-size-test
desktop-size-test: build/bin/kryon
@env -u DISPLAY -u WAYLAND_DISPLAY python3 tests/desktop_size_test.py
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
HARMONY_DESKTOP_RECOVERY=0 python3 tests/desktop_size_test.py
.PHONY: system-clipboard-linux-test
system-clipboard-linux-test: build/bin/kryon
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
python3 tests/system_clipboard_linux_test.py
# The portable clipboard and PRIMARY API against a bound fixture host.
.PHONY: system-clipboard-test
system-clipboard-test:
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY ZIRAN_ROOT="$(ZIRAN_DIR)" \
ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/system_clipboard_test.sh
@echo 'System clipboard and PRIMARY: fixture host, unavailable PRIMARY and buffer limits passed'
test: system-clipboard-test
.PHONY: mime-clipboard-linux-test
mime-clipboard-linux-test:
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/mime_clipboard_linux_test.py
test: mime-clipboard-linux-test
.PHONY: drag-source-linux-test
drag-source-linux-test:
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/drag_source_linux_test.py
test: drag-source-linux-test
.PHONY: window-test
window-test: build/bin/kryon
@@ -557,11 +619,11 @@ sanitize-test: project-toolchain
# removes every other entry that nothing has written to for a day, so a build
# another session is running keeps its files. Go's module cache is read-only,
# so write permission comes back first.
BUILD_OUTPUTS := ziran project bin tools test examples sanitize raylib-ziran webp-ziran avif-ziran zx-reload-test zx-raylib zx-native-test zx-android-test \
BUILD_OUTPUTS := ziran project bin tools test examples sanitize webp-ziran avif-ziran opus zx-reload-test zx-native-test zx-android-test \
emscripten-cache android-surface-check text-input-platform-test zx-player zx-test zx-canvas zx-canvas-test gallery-zx \
accessibility text-shaping performance frame-replay frame-inspect frame-input-replay dom-project
accessibility text-shaping performance frame-replay frame-inspect frame-input-replay
# Keep prior generated output while an installed or running app may use it.
BUILD_OUTPUTS += zib-reload-test zib-raylib zib-native-test zib-android-test \
BUILD_OUTPUTS += zib-reload-test zib-native-test zib-android-test \
zib-player zib-test zib-canvas zib-canvas-test gallery-zib
.PHONY: clean-scratch
clean-scratch:
@@ -593,7 +655,7 @@ pixmap-emoji: project-toolchain
pixmap-surface-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY sh tests/pixmap_surface_test.sh
test: check canvas-test canvas-project-test zx-canvas-test zx-raylib-test page-route-project-test dom-project-test typeface-source-test pixmap-surface-test program-title-test raylib-window-test system-clipboard-linux-test
test: check canvas-test canvas-project-test zx-canvas-test page-route-project-test typeface-source-test pixmap-surface-test program-title-test system-clipboard-linux-test
clean:
rm -rf $(BUILD_DIR)
@@ -625,76 +687,16 @@ pixmap-mesh-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/pixmap_mesh_test.sh
test: pixmap-mesh-test
.PHONY: pixmap-parallel-test
pixmap-parallel-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/ziran_pixmap_parallel_test.sh
test: pixmap-parallel-test
.PHONY: pixmap-gpu-test
pixmap-gpu-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/ziran_pixmap_gpu_test.sh
test: pixmap-gpu-test
# Opt-in SDL3 SDK and real GPU-renderer parity on a private display.
.PHONY: sdl3-test
sdl3-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
YUE_DESKTOP_RECOVERY=0 ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/sdl3_test.py
.PHONY: style-cache-test
style-cache-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/ziran_style_cache_test.sh
test: style-cache-test
.PHONY: tree-style-metadata-test
tree-style-metadata-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER sh tests/ziran_tree_style_metadata_test.sh
test: tree-style-metadata-test
.PHONY: css-dom-test
css-dom-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER YUE_DESKTOP_RECOVERY=0 python3 tests/css_dom_browser.py
test: css-dom-test
.PHONY: component-host-test
component-host-test: project-toolchain
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/ziran_component_host_test.sh
test: component-host-test
.PHONY: theme-test theme-token-export-test button-theme-raster-test cui-inputs-test cui-overlays-test
theme-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/ziran_theme_test.sh
test: theme-test
theme-token-export-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/ziran_theme_tokens_test.sh
test: theme-token-export-test
button-theme-raster-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/ziran_button_theme_raster_test.sh
test: button-theme-raster-test
cui-inputs-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER sh tests/ziran_cui_inputs_test.sh
test: cui-inputs-test
cui-overlays-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER YUE_DESKTOP_RECOVERY=0 sh tests/ziran_cui_overlays_test.sh
test: cui-overlays-test
.PHONY: style-cache-benchmark
style-cache-benchmark: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/style_cache_cost.sh
.PHONY: video-test
video-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER sh tests/ziran_video_linux_test.sh
.PHONY: image-decode-test
image-decode-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER sh tests/ziran_image_decode_linux_test.sh
test: image-decode-test
# Android NDK link of the WebP decoder for every ABI; needs ANDROID_NDK.
.PHONY: android-webp-link-test
android-webp-link-test: project-toolchain
@@ -702,17 +704,11 @@ android-webp-link-test: project-toolchain
ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/android_webp_link_test.py \
--ndk "$(or $(ANDROID_NDK),$(HOME)/Android/Sdk/ndk/28.2.13676358)"
.PHONY: raylib-webp-decode-test
raylib-webp-decode-test: project-toolchain $(RAYLIB_ARCHIVES)
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER \
ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" RAYLIB_A="$(RAYLIB_A)" WEBP_A="$(WEBP_A)" \
RAYLIB_LIBS="$(RAYLIB_PLATFORM_LIBS) -lm" sh tests/raylib_webp_decode_test.sh
test: raylib-webp-decode-test
.PHONY: scene-image-material-test
.PHONY: scene-test
scene-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/ziran_scene_test.sh
test: scene-test
scene-image-material-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS HARMONY_DESKTOP_RECOVERY=0 sh tests/scene_image_material_test.sh
test: scene-image-material-test
.PHONY: scene-render-benchmark
scene-render-benchmark: project-toolchain
@@ -724,6 +720,7 @@ shader-glsl-test: project-toolchain
@ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/shader_glsl_test.sh
scene-gpu-test: project-toolchain
@ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/scene_gpu_test.py
@ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/scene_gpu_test.py --glx
@ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/scene_gpu_test.py --async-test
@ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/scene_gpu_test.py --async-test --saved
@ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/scene_camera_shift_test.py
@@ -732,16 +729,19 @@ scene-gpu-test: project-toolchain
scene-camera-shift-test: project-toolchain
@ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/scene_camera_shift_test.py
.PHONY: daylight-test
daylight-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS HARMONY_DESKTOP_RECOVERY=0 sh tests/daylight_test.sh
test: daylight-test
.PHONY: shader-scene-test
shader-scene-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS HARMONY_DESKTOP_RECOVERY=0 sh tests/shader_scene_test.sh
test: shader-scene-test
.PHONY: shader-host-test shader-web-test shader-android-test image-pixels-test
shader-host-test: project-toolchain $(RAYLIB_ARCHIVES) $(AVIF_SO)
.PHONY: shader-host-test shader-android-test image-pixels-test
shader-host-test: project-toolchain $(WEBP_A) $(AVIF_A) $(AOM_A) $(AVIF_SO)
@ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/shader_host_test.sh
shader-web-test: project-toolchain
@ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/shader_web_test.py
# Explicit hardware test: USB Moto required; not part of the headless gate.
shader-android-test: project-toolchain
@ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/shader_android_test.sh
@@ -749,6 +749,12 @@ image-pixels-test: project-toolchain
@ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/image_pixels_test.sh
test: image-pixels-test
.PHONY: native-image-services-test
native-image-services-test: project-toolchain $(AVIF_SO)
@sh tests/native_image_services_test.sh
test: native-image-services-test
.PHONY: image-preview-test
image-preview-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/image_preview_zi_test.sh
@@ -758,7 +764,6 @@ image-preview-web-test: project-toolchain
sh tests/image_preview_web_test.sh
test: image-preview-web-test
.PHONY: android-surface-test android-rotation-pixels-test
android-surface-test: project-toolchain
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS python3 tests/android_surface_test.py
@@ -776,8 +781,8 @@ test: window-focus-test
# Asset audio uses actual decoders on a private null device and a muted private
# browser. It never connects to the owner's audio session or desktop.
.PHONY: asset-audio-test
asset-audio-test: $(RAYLIB_A)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" RAYLIB_A="$(RAYLIB_A)" \
asset-audio-test: project-toolchain
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" \
ZIRAN_BUILD_DIR="$(ZIRAN_BUILD_DIR)" python3 tests/media_audio_test.py --browser
test: asset-audio-test
@@ -786,16 +791,12 @@ test: asset-audio-test
document-storage-test:
@ZIRAN_ROOT="$(abspath $(ZIRAN_DIR))" ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/document_storage_test.py --browser
.PHONY: app-files-test
app-files-test:
@ZIRAN_ROOT="$(abspath $(ZIRAN_DIR))" ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/ziran_app_files_test.sh
.PHONY: pcm-audio-test
pcm-audio-test: $(RAYLIB_A)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" RAYLIB_A="$(RAYLIB_A)" \
pcm-audio-test: project-toolchain
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" \
ZIRAN_BUILD_DIR="$(ZIRAN_BUILD_DIR)" python3 tests/media_audio_test.py --browser --pcm
test: pcm-audio-test document-storage-test app-files-test
test: pcm-audio-test document-storage-test
.PHONY: android-notification-jvm-test
android-notification-jvm-test:
@@ -821,7 +822,6 @@ test: android-launch-uri-test
play-billing-test:
@python3 tests/play_billing_test.py
# Optional extensions on the compiled canvas runner retain the bare defaults.
.PHONY: canvas-app-hooks-test
canvas-app-hooks-test:
@@ -829,26 +829,16 @@ canvas-app-hooks-test:
canvas-test: canvas-app-hooks-test
.PHONY: rotated-text-test
rotated-text-test: project-toolchain $(RAYLIB_ARCHIVES)
rotated-text-test: project-toolchain $(WEBP_A) $(AVIF_A) $(AOM_A)
@sh tests/rotated_text_test.sh
@sh tests/rotated_text_raylib_test.sh
@sh tests/rotated_text_cairo_test.sh
@python3 tests/rotated_text_web_test.py
test: rotated-text-test
.PHONY: cairo-scaled-image-test
cairo-scaled-image-test: project-toolchain
@sh tests/ziran_cairo_scaled_image_test.sh
test: cairo-scaled-image-test
# Smooth images draw their shared Lanczos copies the same as Pillow on the
# pixmap host, Raylib in a private Xvfb window and Canvas in private headless
# Firefox; cairo-scaled-image-test checks Cairo's, and
# tests/lanczos_backend_goldens.sh runs all four.
# Canvas, pixmap and Cairo compare shared Lanczos output against Pillow.
# tests/lanczos_backend_goldens.sh runs all three renderers.
.PHONY: lanczos-goldens-test
lanczos-goldens-test: project-toolchain $(RAYLIB_ARCHIVES)
@sh tests/ziran_pixmap_lanczos_test.sh
@RAYLIB_A="$(RAYLIB_A)" WEBP_A="$(WEBP_A)" AVIF_A="$(AVIF_A)" AOM_A="$(AOM_A)" sh tests/raylib_lanczos_test.sh
lanczos-goldens-test: project-toolchain $(WEBP_A) $(AVIF_A) $(AOM_A)
@python3 tests/canvas_lanczos_test.py
test: lanczos-goldens-test
@@ -866,7 +856,7 @@ lanczos-benchmark: project-toolchain
@sh tests/lanczos_benchmark.sh
.PHONY: avif-decode-test
avif-decode-test: project-toolchain $(RAYLIB_ARCHIVES) $(AVIF_SO)
avif-decode-test: project-toolchain $(WEBP_A) $(AVIF_A) $(AOM_A) $(AVIF_SO)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/avif_decode_test.sh
test: avif-decode-test
@@ -894,10 +884,9 @@ avif-benchmark: project-toolchain
$(if $(AVIF_BENCHMARK_BROWSER),--browser)
.PHONY: avif-render-test
avif-render-test: project-toolchain $(RAYLIB_ARCHIVES) $(AVIF_SO) $(ZX_RAYLIB_RUNTIME)
avif-render-test: project-toolchain $(WEBP_A) $(AVIF_A) $(AOM_A) $(AVIF_SO)
@sh tests/avif_render_test.sh
.PHONY: bitmap-image-test
bitmap-image-test: project-toolchain
@ZIRAN_ROOT=$(abspath $(ZIRAN_DIR)) ZIRAN_BIN=$(abspath $(ZIRAN_DIR))/build/bin/ziran sh tests/bitmap_store_test.sh
@@ -906,11 +895,6 @@ bitmap-image-test: project-toolchain
@ZIRAN_ROOT=$(abspath $(ZIRAN_DIR)) ZIRAN_BIN=$(abspath $(ZIRAN_DIR))/build/bin/ziran python3 tests/bitmap_image_browser_test.py
test: bitmap-image-test
.PHONY: bitmap-raylib-test
bitmap-raylib-test: project-toolchain $(RAYLIB_ARCHIVES) $(AVIF_SO)
@ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/bitmap_raylib_test.sh
test: bitmap-raylib-test
.PHONY: native-assets-install-test
native-assets-install-test: project-toolchain
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER -u ICEAUTHORITY YUE_DESKTOP_RECOVERY=0 python3 tests/native_assets_install_test.py
@@ -941,11 +925,6 @@ android-surface-platform-test: project-toolchain
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS python3 tests/android_surface_platform_test.py
test: android-surface-platform-test
.PHONY: cui-motion-test
cui-motion-test: project-toolchain
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER YUE_DESKTOP_RECOVERY=0 sh tests/ziran_cui_motion_test.sh
test: cui-motion-test
.PHONY: android-source-generation-test
android-source-generation-test: project-toolchain
@python3 tests/android_source_generation_test.py
@@ -978,3 +957,68 @@ application-entry-test: $(ZI2C_BIN)
ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/application_entry_test.sh
test: application-entry-test
# Cross-build and execute the Windows SDL/Cairo host on a private Wine display.
.PHONY: windows-desktop-host-test
BUILD_OUTPUTS += windows-desktop
windows-desktop-host-test:
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
HARMONY_DESKTOP_RECOVERY=0 python3 tests/windows_desktop_test.py
# Owned frame snapshots and desktop file-picture cache services.
.PHONY: cairo-picture-cache-test desktop-frame-texture-test android-frame-texture-test
cairo-picture-cache-test: project-toolchain
@sh tests/ziran_cairo_picture_cache_test.sh
desktop-frame-texture-test: project-toolchain
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER HARMONY_DESKTOP_RECOVERY=0 YUE_DESKTOP_RECOVERY=0 sh tests/ziran_desktop_frame_texture_test.sh
android-frame-texture-test: project-toolchain
@sh tests/ziran_android_frame_texture_test.sh
test: cairo-picture-cache-test desktop-frame-texture-test android-frame-texture-test
.PHONY: android-present-damage-test
android-present-damage-test: project-toolchain codec-archives
@sh tests/android_present_damage_test.sh
test: android-present-damage-test
.PHONY: image-dimensions-host-test
image-dimensions-host-test: project-toolchain
@sh tests/image_dimensions_host_test.sh
test: image-dimensions-host-test
.PHONY: android-runtime-test pixmap-camera-test android-image-services-test pixmap-typeface-test android-codec-artifact-test android-typefaces-link-test android-typefaces-device-test android-pictures-link-test android-pictures-device-test
android-runtime-test: project-toolchain
@sh tests/ziran_android_runtime_test.sh
pixmap-camera-test: project-toolchain
@sh tests/pixmap_camera_test.sh
android-image-services-test: project-toolchain codec-archives
@sh tests/android_image_services_test.sh
pixmap-typeface-test: project-toolchain
@sh tests/pixmap_typeface_test.sh
android-codec-artifact-test: project-toolchain
@python3 tests/android_codec_artifact_test.py
android-typefaces-link-test: project-toolchain
@python3 tests/android_vm_device_test.py typefaces
android-typefaces-device-test: project-toolchain
@python3 tests/android_vm_device_test.py typefaces --serial ZE2223BQZT
android-pictures-link-test: project-toolchain
@python3 tests/android_vm_device_test.py pictures
android-pictures-device-test: project-toolchain
@python3 tests/android_vm_device_test.py pictures --serial ZE2223BQZT
test: android-runtime-test pixmap-camera-test android-image-services-test pixmap-typeface-test
.PHONY: mirrored-image-test
mirrored-image-test: project-toolchain
@sh tests/ziran_cairo_mirrored_image_test.sh
@sh tests/pixmap_mirrored_image_test.sh
test: mirrored-image-test
.PHONY: scene-skin-test watercolor-test practice-material-gpu-test image-pixels-resolver-test
scene-skin-test: project-toolchain
@ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/scene_skin_test.sh
watercolor-test: project-toolchain
@ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/watercolor_test.sh
practice-material-gpu-test: project-toolchain
@ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/practice_material_gpu_test.py
image-pixels-resolver-test: project-toolchain
@ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/image_pixels_resolver_test.sh
test: scene-skin-test watercolor-test practice-material-gpu-test image-pixels-resolver-test
+32 -28
View File
@@ -1,18 +1,19 @@
# Kryon
Documentation for Kryon 0.4.0 and Unreleased changes on master.
Linux desktop and portable hosts can decode local videos with synchronized audio
using the optional GStreamer service exported as `kryon/Video` and
`kryon/VideoLinux`. Display the returned frame with `Image(ImageProps)`.
`kryon/VideoLinux`. Display the returned frame with `Image.Draw(Image.Props)`.
Applications own playback controls and access checks; an optional expiring lease
revokes both audio and decoded frames when authorization is no longer renewed.
`make video-test` checks synthetic moving frames, paused seeking, speed, volume,
`make test-focus TEST=ziran_video_linux_test` checks synthetic moving frames, paused seeking, speed, volume,
replay and lease revocation with a silent audio sink and no display access.
Kryon is a UI library written in Ziran. Its source lives under `src/ui/` and
imports Ziran modules normally. The Ziran compiler, `.zir` representation, and
`.zx` bundle format belong to the separate
[Ziran](https://github.com/ziranlang/ziran) repository. Kryon has no
`.kry` runtime or language compiler.
[Ziran](https://github.com/ziranlang/ziran) repository.
## Build
@@ -47,15 +48,14 @@ depend on Kryon: [Plot](https://github.com/kryonlabs/plot),
in `ziran.toml`); see [writing a widget package](docs/API.md#widget-packages).
Style sheets are the separate [CSS](https://github.com/kryonlabs/css)
package: it parses and formats a subset of CSS, installs the rules, and ships
the classic, lightfield, and material style packs. Kryon keeps the rule table and
package: it parses and formats a subset of CSS, installs the rules. Kryon keeps the rule table and
style resolution, so an app that builds its rules in code needs no parser.
The optional [Game2D](https://github.com/kryonlabs/game2d) Ziran package owns
the raylib game API. Kryon keeps its geometry, drawing values, UI primitives,
and raylib UI host. Kryon exports `geometry` and `drawing_props` so Game2D can
share their types without pulling in widget modules. The raylib game adapter
uses a C ABI and does not support native Go.
Kryon exports `geometry` and `drawing_props` for programs that need drawing
values without importing widgets. Imports and use determine what a program
carries. `App.Show(window)` carries only the window, events and presentation;
`App.Run(window, Draw)` also brings the frame loop. Portable ZX windows run
through the native desktop provider by default. See the [API](docs/API.md).
`make test` builds the test host and runs the Ziran source, saved-IR, and
portable bundle tests with four concurrent jobs. Set `TEST_JOBS=1` to run them
@@ -70,17 +70,15 @@ See [composition input](docs/COMPOSITION_INPUT.md) for the checked IME event
contract and host queue lifetime.
See [cursor input](docs/CURSOR.md) for the checked cursor decision and platform
effect contract.
See [style picker](docs/STYLE_PICKER.md) for caller-owned pack selection.
See [theming](docs/THEMING.md) for palette and style customization.
See [zoom](docs/ZOOM.md) for Ctrl and mouse-wheel zoom of a whole application.
See [clipboard state](docs/CLIPBOARD.md) for the portable clipboard value and
host effect contract.
See [frame replay](docs/FRAME_REPLAY.md) for committed UI and paint capture
with scripted input on a headless host.
The [Ziran example](examples/README.md) builds a `.zx` that imports Kryon and
runs a retained `Button` press and release through a separate Ziran SVG host
without a display.
The same directory also has a plain `Text(TextProps)` hello world desktop
example; `make -C examples desktop-text-test` renders it on a private display.
The [hello world example](examples/README.md) is one small Ziran program with
an explicit `main`: it imports Kryon's app and text packages, opens a window,
and draws the label `Hello, world!`.
For Ziran app manifests, the terminal backend, and `kryon run`, see
[Ziran projects](docs/PROJECTS.md).
Portable desktop profiles build a `.zx` with embedded assets; a downloaded
@@ -88,8 +86,8 @@ file launches with `ziran run app.zx` after installing the desktop provider. See
## Website and widget gallery
`make site` rebuilds the initial Canvas demo, the browser compiler and preview
host, and the widget gallery into `docs/site/`. Emscripten is required; activate
`make site` packages the Canvas website, browser compiler, preview host and
widget gallery into `docs/site/`. Emscripten is required; activate
emsdk or set `EMCC`. `make site-gallery` builds only the gallery, and
`make site-gallery-test` prepares editable examples and exercises the gallery in
a private Chromium/Xvfb session.
@@ -99,9 +97,8 @@ Its core scenes are shared by the desktop, web and review hosts. Examples are
grouped by installed module and category, including core UI and 2D drawing.
Optional package integrations are registered only while their dependencies
are declared. Each selected example includes editable Ziran source and a live
preview, using the same compiler and editor as `demo.html`. Plot and DataViews
supply the additional charts, tree and Kanban; TableView's entry identifies its
current API-only status. `make site` generates the scene metadata and editable
preview, using the browser compiler and the gallery editor. Plot and DataViews
supply charts, tree, Kanban and an interactive TableView. `make site` generates the scene metadata and editable
snippets directly from these examples. The Pages workflow builds and tests the
full website from fixed source revisions before publishing.
@@ -109,13 +106,10 @@ full website from fixed source revisions before publishing.
The [feature matrix](docs/FEATURE_MATRIX.md) records package and host coverage.
The Canvas2D browser host is covered by private headless Chromium, WebAudio,
and Wasm tests. Its semantic DOM profile is covered by a separate private
headless Chromium document test. The [open-work plan](plan/README.md) lists
the remaining platform-accessibility work.
and Wasm tests. See [accessibility](docs/ACCESSIBILITY.md) for platform coverage.
Kryon commits land upstream first. Applications then update their
`ziran.lock` with Ziran's package commands; an app that still vendors Kryon
moves only its clean `vendor/kryon` submodule pointer. This repository's tests
`ziran.lock` with Ziran's package commands. This repository's tests
verify Kryon itself, not every downstream application build.
See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the library boundary and
@@ -123,6 +117,16 @@ See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the library boundary and
status](https://github.com/ziranlang/ziran/blob/master/docs/IMPLEMENTATION_STATUS.md)
for language and portable runtime gaps.
`Widgets` includes `Breadcrumb` for keyed label navigation, with measured
`kryon/breadcrumb` serves `Breadcrumb.Draw` for keyed label navigation, with measured
ancestors and an accessible, virtualized overflow menu. Applications own
selection, focus and navigation; see [the API](docs/API.md#breadcrumbs).
## Documentation
- [API reference and widget packages](docs/API.md)
- [Architecture](docs/ARCHITECTURE.md) and [repository boundaries](docs/BOUNDARIES.md)
- [Projects](docs/PROJECTS.md), [hosts](docs/BACKENDS.md) and [Canvas](docs/canvas.md)
- [Feature matrix](docs/FEATURE_MATRIX.md) and [widget verification](docs/WIDGET_CONFORMANCE.md)
- [Input components](docs/INPUT_COMPONENTS.md), [overlays](docs/OVERLAYS.md) and [compact navigation](docs/navigation.md)
- [Component loading](docs/COMPONENTS.md), [window focus](docs/window-focus.md) and [accessibility](docs/ACCESSIBILITY.md)
- [Raster workers](docs/THREADING.md) and [performance measurements](docs/PERFORMANCE.md)
-1
View File
@@ -2,7 +2,6 @@
The Kryon static package includes third-party code pinned by its package lock.
- raylib: zlib/libpng license, see `LICENSE` in the locked raylib source package.
- Noto fonts: SIL Open Font License 1.1, see `fonts/noto/LICENSE.txt` in the source tree.
- Liberation Sans: SIL Open Font License 1.1, see `assets/fonts/LICENSE-Liberation`.
`src/backend/pixmap_font.zi` holds outlines of its Latin glyphs for the
+1 -1
View File
@@ -1 +1 @@
0.3.0
0.5.0
Binary file not shown.

After

Width:  |  Height:  |  Size: 847 KiB

+91
View File
@@ -0,0 +1,91 @@
{
"project": "Kryon",
"request": "One original friendly full-body dragon mascot for the Kryon UI toolkit, in the Ziran capybara's flat warm illustration feel, followed by a pastel-only color revision that preserves the accepted character.",
"pastel_follow_up_request": "okay but the colors should be more pastel — for the mascot",
"generation_mode": "built-in image_gen",
"generation_calls_planned": 1,
"conditional_retry_allowed": 1,
"generation_calls_completed": 3,
"attempt_count": 3,
"pastel_edit_calls_planned": 1,
"pastel_edit_calls_completed": 1,
"retry_reason": "The first attempt had extra body shading and tighter margins, a clear style/composition mismatch; the one permitted retry fixed the flat-ink direction.",
"proposals": [
{
"id": "01-dragon-v1",
"version": "v1",
"attempt_count": 2,
"animal": "Dragon",
"direction": "Rounded approachable full-body dragon in three-quarter view, facing right, with a calm warm personality and strong small-icon silhouette.",
"prompt": "Use case: logo-brand\nAsset type: final original mascot bitmap for Kryon, a UI toolkit and Ziran sister project; exactly one finished character.\nPrimary request: Create one entirely original friendly cartoon dragon mascot for Kryon. KDE inspiration is limited only to the broad idea of a rounded, approachable open-source cartoon dragon body and shape. This must not copy or trace Konqi and must not reuse Konqi's exact face, anatomy, pose, or proportions.\nScene/backdrop: None. A genuinely transparent square canvas with no background pixels, ground, shadow, border, or decoration.\nSubject: One full-body dragon in three-quarter view, facing right, standing in a relaxed welcoming pose. Big friendly head, short rounded snout, small rounded horns, small wings, a soft row of rounded back spines, four simple grounded feet without claws, and one clear tapering tail. Calm warm expression, small gentle eyes rendered only with earth-brown marks, closed mouth, no teeth. Nothing in its hands.\nStyle/medium: Confident hand-drawn flat illustration in the same visual family as Ziran's capybara mascot: bold deep earth-brown outline of consistent apparent weight, large quiet solid color areas, minimal interior marks, slight purposeful hand-drawn irregularity, calm warm character, strong sticker-like silhouette readable as a tiny website icon. Absolutely flat ink fills: no lighting, highlights, shadows, secondary shades, gray, cream, white fill, texture, or tonal modeling.\nComposition/framing: Center the single complete dragon on a 1:1 square canvas. The entire silhouette should occupy about 72–76% of the canvas width and height, leaving a clean 12–15% transparent border on every side. Every horn, wing, spine, foot, and tail is wholly visible and comfortably clear of the edge. Three-quarter view faces right.\nColor palette: Exactly four visual ink colors and no others except edge antialiasing between them and transparency: jade green #63B190 for the entire body and wings; exactly one continuous lake-blue underside/belly plane #77B7EA; deep earth-brown #502511 for every outline, eye, nostril, and minimal interior mark; one restrained muted light-orange #A48B62 used only on the small horn tips. Do not create light and dark variants of any color. Do not use orange on wings or elsewhere.\nText: NONE.\nConstraints: One original approachable rounded dragon; one character only; genuine alpha transparency; strong readable silhouette; generous clear margins; four flat source-family inks only; exactly one lake-blue belly plane; orange limited to horn tips; eyes use brown with no white eye fill.\nAvoid: Konqi likeness, KDE logo, gear, fire, smoke, teeth, aggressive claws, K monogram, letter-shaped body, props, clothing, scenery, borders, frames, solid or patterned background, gradients, glow, glossy 3D, textures, shading, highlights, drop shadows, extra characters, extra limbs, cropped anatomy. Absolutely no text, letters, numbers, labels, signatures, logos, or watermark anywhere.",
"file": null,
"transparent_background": true,
"status": "removed-at-owner-request",
"retained": false,
"actual": {
"dimensions": [1254, 1254],
"mode": "RGBA",
"alpha_extrema": [0, 255],
"content_bbox_alpha_gt_1": [107, 63, 1125, 1197],
"bytes": 877306,
"sha256": "aa041bbfe0fa60b97736fff724be5922f6b178607cfab5514b6cc4a17295da89"
},
"visual_review": {
"no_text_verified": true,
"transparent_background_verified": true,
"not_konqi_copy": true,
"style_matches_ziran": true,
"original_character": true
}
},
{
"id": "02-dragon-v2-pastel",
"version": "v2",
"attempt_count": 1,
"animal": "Dragon",
"direction": "Pastel-only color revision of the accepted v1 dragon, preserving the same friendly character, pose, proportions, framing, linework, expression, wings, spines, and transparent background.",
"prompt": "Use case: precise-object-edit\nAsset type: pastel color revision of the accepted Kryon dragon mascot bitmap.\nInput images: Image 1 is the sole edit target, the accepted v1 Kryon dragon mascot.\nPrimary request: Change ONLY the four flat ink colors of Image 1 to a softer pastel palette. Do not redraw, reinterpret, restyle, simplify, or add anything.\nColor palette: body pastel mint/jade approximately #A9DCC5; the single existing belly/underside plane pastel sky blue approximately #BCDDF6; the existing horn-tip accents pastel peach approximately #F5C7A1; all existing outline, eye, nostril, and interior marks deep earth-brown/warm cocoa approximately #6B4434. Use at most these four flat visual inks plus edge antialiasing and transparency.\nTransparency: Preserve the genuinely transparent background and all current alpha edges. No background pixels, ground, or shadow.\nInvariants: Preserve the exact same original character, pose, anatomy, proportions, framing, silhouette, linework geometry and apparent weight, expression, gaze, wings, rounded back spines, horns, feet, tail, belly-plane shape, detail placement, canvas dimensions, and transparent margins. Change only colors. Keep every existing element in the exact same position and size. No added or removed details.\nAvoid: gradients, extra shades, texture, highlights, shadows, glow, glossy rendering, new marks, altered outlines, altered anatomy, text, letters, numbers, logos, signatures, or watermark. Do not introduce a Konqi likeness, KDE logo, gear, props, clothing, scenery, border, fire, teeth, or claws.",
"file": "mascot-dragon.png",
"transparent_background": true,
"status": "complete",
"actual": {
"dimensions": [1254, 1254],
"mode": "RGBA",
"alpha_extrema": [0, 255],
"content_bbox_alpha_gt_1": [107, 64, 1127, 1197],
"bytes": 867648,
"sha256": "9537921d73713caccd9c991b4998224207f5ad21a079dcebc2f57cfc111daae4"
},
"target_palette": {
"body_pastel_mint_jade": "#A9DCC5",
"belly_pastel_sky_blue": "#BCDDF6",
"horn_tips_pastel_peach": "#F5C7A1",
"outline_warm_cocoa": "#6B4434"
},
"visual_review": {
"exact_character_preserved": true,
"pixel_identical_to_v1": false,
"transparent_background_verified": true,
"no_text_verified": true,
"not_konqi_copy": true,
"style_matches_ziran": true,
"pastel_palette_verified": true,
"at_most_four_visual_inks": true,
"original_character": true,
"notes": "The same accepted character, pose, anatomy, expression, linework design, and framing are preserved. Built-in image editing re-antialiased some edge pixels: the alpha>128 silhouette IoU is 99.53710%, ink-region agreement is 99.69063%, and the content bounding box moved by at most two pixels; v2 is therefore not claimed to be pixel-identical to v1."
}
}
],
"validation": {
"local_tests": "passed",
"tests": [
"The retained pastel mascot is a decodable 1254x1254 8-bit RGBA PNG with alpha extrema [0, 255].",
"The retained pastel mascot SHA-256 is 9537921d73713caccd9c991b4998224207f5ad21a079dcebc2f57cfc111daae4 and matches its proposal record.",
"Visible content above alpha 1 has bounding box [107, 64, 1127, 1197], wholly inside the canvas with transparent clearance on every side.",
"OCR returned no text; visual review found no text, letters, numbers, labels, signatures, or watermark.",
"Visual and palette review confirmed the same accepted original dragon, no Konqi copy, the Ziran flat warm style, and the requested pastel mint, sky-blue, peach, and warm-cocoa direction."
],
"scope": "Local validation of the sole retained asset assets/brand/mascot-dragon.png and assets/brand/prompts.json.",
"notes": "The earlier darker bitmap was removed at the owner's request; its prompt and digest remain as provenance only. The retained pastel mascot used one built-in image_gen edit call and its generated binary was copied without retouching."
}
}
+1 -1
View File
@@ -16,7 +16,7 @@ function(kryon_avif_decoder avif_dir aom_dir)
kryon_ziran_package_path(dav1d_dir dav1d)
endif()
set(shared)
if(NOT ANDROID AND NOT WIN32 AND NOT APPLE)
if(ARGV2 STREQUAL "BUILD_SHARED_BRIDGE" OR (NOT ANDROID AND NOT WIN32 AND NOT APPLE))
# Cairo lazily opens the same self-contained library as before.
set(shared BUILD_SHARED_BRIDGE SHARED_TARGET_NAME kryonavif)
endif()
+3 -1
View File
@@ -103,7 +103,9 @@ function(kryon_android_app target)
-Wl,--wrap=fopen64)
# Gradle strips the packaged library. Keep this original, with line
# information, so native startup failures can be symbolicated.
target_link_libraries(${target} PUBLIC android log atomic dl m)
# Imported scene shaders use EGL and GLES directly, including when the
# Android host itself presents through a software surface.
target_link_libraries(${target} PUBLIC android log atomic dl m EGL GLESv3)
endfunction()
# Adopt Kryon's canonical Android host for a shared-library target whose
+9
View File
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.22)
project(KryonDesktopCodecs C CXX)
# Codecs only: platform-native Android presentation links no renderer.
include("${CMAKE_CURRENT_LIST_DIR}/../WebP.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/../AVIF.cmake")
kryon_webp_decoder("${WEBP_DIR}")
kryon_avif_decoder("${AVIF_DIR}" "${AOM_DIR}" BUILD_SHARED_BRIDGE)
include("${AUDIO_DIR}/native/AudioCodecs.cmake")
ziran_audio_codecs("${OPUS_DIR}" "${SAMPLERATE_DIR}")
-5
View File
@@ -1,5 +0,0 @@
cmake_minimum_required(VERSION 3.22)
project(KryonRendererArtifact C CXX)
include(${CMAKE_CURRENT_LIST_DIR}/../KryonAndroid.cmake)
kryon_android_raylib("${RAYLIB_DIR}" "${WEBP_DIR}" "${AVIF_DIR}" "${AOM_DIR}"
"${KRYON_ANDROID_AUDIO_DIR}" "${KRYON_ANDROID_OPUS_DIR}" "${KRYON_ANDROID_SAMPLERATE_DIR}")
+2 -4
View File
@@ -7,7 +7,7 @@ Shift+Tab traverse eligible controls; Enter and Space activate focused
controls while editors keep their normal key handling. Modal scopes reject
outside focus, activation and edit requests.
The Linux desktop host now exposes an optional AT-SPI bridge through GIO.
The Linux desktop host exposes an optional AT-SPI bridge through GIO.
It registers the application with the accessibility bus, uses retained
generations for object paths, reconciles reordered and removed objects, and
provides Accessible, Application, Component, Action, Text and EditableText
@@ -34,10 +34,8 @@ and drives them through real libatspi on private Xvfb and DBus sessions. It
checks discovery, identity after reorder, focus, Unicode text/selection,
readonly and disabled controls, modal blocking and password redaction.
The DOM host mounts native browser elements. Its private browser test checks
an editor in Chromium's accessibility tree as well as editing and focus.
These checks establish the implemented protocol paths, not complete Orca or
other screen-reader usability. Text boundary/extents methods, list Selection,
table interfaces, and Windows/macOS/mobile accessibility remain unverified
or unsupported. Raylib, Canvas2D and terminal hosts do not currently
or unsupported. Canvas2D and terminal hosts do not currently
provide the Linux bridge automatically.
+733 -213
View File
File diff suppressed because it is too large. Load diff
+10 -10
View File
@@ -14,11 +14,11 @@ library. The compiler and bundle loader have no Kryon-specific branches.
| `src/project/*.zi` | Kryon project tool that builds an app through Ziran |
| `tests/*_host.zi` | Ziran behavior-test hosts; not part of the library or application hosts |
| Application repositories | Screens, assets, translations, product data, and workflows |
| Game2D repository | Optional game API; Kryon determines its shared raylib revision when both packages are used |
All maintained implementation files under `src/` are `.zi`. The core module
inventory is [`src/ui/modules.txt`](../src/ui/modules.txt). The two public
import modules, `Kryon` and `Widgets`, compose that surface. Optional packages
inventory is [`src/ui/modules.txt`](../src/ui/modules.txt). Applications import
each widget package by name, such as `Text :: #import "kryon/text";`, and the
shared core modules they use. Optional packages
have separate imports and build targets; the core UI does not import them.
## Widget and host boundary
@@ -29,10 +29,11 @@ The host supplies system effects such as windows, terminal output, font and
image loading, rasterization, and storage. A host should not implement a
second set of widget decisions.
An application exports `Frame(session: Session, viewport: Rectangle) -> s32`.
The selected host calls it between `BeginFrame` and `EndFrame`. Package
profiles choose the terminal, desktop, raylib, Canvas2D, or semantic
DOM host; see [BACKENDS.md](BACKENDS.md). A non-graphical Ziran program can
An application owns `main` and calls `App.Show` or `App.Run`, or exports
`Frame(session: Session, viewport: Rectangle) -> s32` for a profile host.
A frame host calls it between `BeginFrame` and `EndFrame`. Package
profiles choose the terminal, desktop, Android or Canvas2D host;
see [BACKENDS.md](BACKENDS.md). A non-graphical Ziran program can
import a Kryon policy module without selecting any of these hosts.
## Build and verification
@@ -40,9 +41,8 @@ import a Kryon policy module without selecting any of these hosts.
`make` checks the Ziran modules, writes `.zir`, generates C and Go,
compiles native objects, and creates a C archive from generated source.
`make test` exercises the checked library through source, saved `.zir`, and
portable `.zx` behavior, Canvas2D Wasm effects, and packaged Canvas2D and
semantic DOM browser applications in private headless Chromium. Desktop and
raylib package tests run separately on private Xvfb displays;
portable `.zx` behavior, Canvas2D Wasm effects, and packaged Canvas2D
browser applications in private headless Chromium. Desktop package tests run on private Xvfb displays;
CI runs them too. `make sanitize-test` repeats the behavior tests with AddressSanitizer and UndefinedBehaviorSanitizer.
[FEATURE_MATRIX.md](FEATURE_MATRIX.md) states exactly what those checks cover.
+48 -238
View File
@@ -1,8 +1,8 @@
# Kryon hosts
Kryon's reusable widget, layout, input, and composition code is written in
Ziran under `src/ui/`. An application imports the `Kryon` or `Widgets`
package module and exports `Frame(session: Session, viewport: Rectangle) ->
Ziran under `src/ui/`. An application imports the widget packages it uses,
such as `Text :: #import "kryon/text";`, and exports `Frame(session: Session, viewport: Rectangle) ->
s32`. A selected host under `src/backend/` owns the process entry point,
window or terminal, platform input, rasterization, and presentation. Ziran has
no special knowledge of Kryon widgets.
@@ -20,22 +20,9 @@ backend = "desktop"
Run `ziran tool kryon build` or `ziran tool kryon run` from the application.
See [Ziran projects](PROJECTS.md) for the complete package manifest.
MediaAudio's Raylib and Canvas providers support individual voice Pause/Resume.
Raylib uses Pause/ResumeMusicStream and Pause/ResumeAudioStream, and reports
GetMusicTimePlayed for asset music. Canvas retains music offsets against the
AudioContext clock and re-creates only that voice's source on explicit Resume;
paused PCM retains at most two immutable buffers and their remaining offsets.
No owner pauses the shared context. See [MediaAudio](API.md) for capability
bits and position availability. Native tests use Raylib/miniaudio's paced null
backend; browser tests use a disposable muted headless context and trusted gesture.
Ogg Opus assets decode through the `audio` package on native Linux and Windows;
those targets link `-lopus -lm` (the `renderer-raylib` artifact ships a static
`lib/libopus.a`). Android portable guests use the platform `MediaPlayer`
service through JNI instead of carrying an audio codec.
## Renderer artifacts in build scripts
The package exports `renderer-raylib`, `renderer-desktop` and `renderer-web`
The package exports `renderer-desktop`, `renderer-desktop-windows` and `renderer-web`
artifacts for the supported native and browser targets. Request them through
`ziran pkg artifact kryon:NAME --platform OS-ARCH-ABI`, using the application's
package wrapper and locked graph. Ziran's `scripts/ziran_artifacts.py` verifies
@@ -64,39 +51,26 @@ in the application.
| --- | --- | --- |
| `terminal` | `src/backend/terminal_run.zi` | 80 × 24 terminal cells via `terminal.zi` |
| `desktop` | `src/backend/desktop_run.zi` | SDL2 window with Cairo raster |
| `raylib` | `src/backend/raylib_run.zi` | raylib SDL2/OpenGL ES 2 window |
| `raylib` with `platform = "web"` | `src/backend/raylib_run.zi` | raylib WebGL 1 page with Emscripten and Asyncify; see [raylib in the browser](#raylib-in-the-browser) |
| `canvas` | `src/backend/canvas_run.zi` | Canvas2D page with Emscripten and Asyncify |
| `dom` | `src/backend/dom_run.zi` | Semantic DOM layer over the Canvas2D raster host |
| `android` | app `src/main.zi` → `android_run.zi` | Android NativeActivity package with direct `ANativeWindow` pixel presentation |
The desktop host uses `cairo_raster.zi`. Its frame loop is `desktop_loop.zi`:
a project host that needs its own window size imports `kryon/desktop_loop`
and returns `RunDesktop(width, height)`, and `DesktopStartBeside(marker)`
starts a program opened from its build folder where its files are.
`DesktopPressedKey()` supplies the frame's last key to ordinary widget loops.
Games with several players can drain `DesktopNextKey()` for every key in arrival
order after `PollDesktop()`, up to 32 presses per poll. This snapshot is consumed
independently from the widget event and resets on the next poll. Numeric-keypad
digits use the shared codes 320–329; `DesktopModifiers()` follows the key most
recently drained.
The DOM host reuses
the Canvas raster provider and adds [semantic DOM reconciliation](dom.md).
Standalone `AppContext` applications can use the same two presentations with
the compiled hosts `canvas_app_run.zi` and `dom_app_run.zi`; the DOM entry
reuses the application frame lifecycle while emitting positioned native HTML
text, images and buttons with CSS boxes, gradients and clipping. Custom drawing,
meshes and texture effects use bounded Canvas tiles in paint order; the full-page
Canvas bitmap is not presented in this mode. The ordinary document-layout DOM
host remains available for browser flow layout.
Polygon-clipped images use native Cairo/Canvas path clips; DOM keeps these
custom image shapes in bounded Canvas tiles. Raylib caches bounded polygon triangulations and draws them directly on the
GPU, including all Jungle puzzle pieces. Complex polygons and pixel hosts use
The small application surface selects the host from the compile-time target.
Import `kryon/app` and call `App.Run(window, draw)`: C/Linux uses
`kryon/host/desktop`, while C/Web uses `kryon/host/web`. Advanced hosts can
import those named host packages directly. The desktop implementation uses
`cairo_raster.zi` and `desktop_loop.zi`.
After `PollDesktop()`, custom loops call `DesktopInputTake(session)` to transfer
the next ordered editing action or printable-key/text run into that session.
The returned key uses shared codes, including 320–329 for numeric-keypad
digits, and carries the modifiers held when that key arrived.
Standalone `AppContext` applications use the compiled host
`canvas_app_run.zi`.
Polygon-clipped images use native Cairo/Canvas path clips. Complex polygons and pixel hosts use
clipped spans while preserving the original source mapping.
SDL pixel hosts prefer accelerated texture presentation without blocking on
vertical refresh. `SDL_RENDER_DRIVER` retains explicit driver selection,
including `software`; hosts without an accelerated driver use software
presentation automatically. Pixel rasterization remains on CPU workers.
SDL pixel hosts use software presentation by default. `SDL_RENDER_DRIVER`
retains explicit driver selection; `KRYON_PIXMAP_GPU=1` requests accelerated
presentation. Pixel rasterization remains on CPU workers unless the host
explicitly enables a GPU painter.
Desktop windows become visible only after their first complete frame has
been uploaded and presented. A failed initial upload or copy leaves the
window hidden until presentation succeeds.
@@ -105,83 +79,12 @@ The `image_preview` module also supplies `ImageCompress` for smaller upright
JPEG copies. It keeps transparent and animated originals intact and returns
no replacement when encoding would increase file size.
## raylib in the browser
A `raylib` profile with `platform = "web"` builds the same raylib host, or a
project's own raylib host, as a WebGL page. raylib's `PLATFORM_WEB` library
(GLFW through Emscripten, OpenGL ES 2 on WebGL 1, with `rmodels` and `raudio`)
builds once into `build/raylib-web/`, and the generated program is compiled
with `PLATFORM_WEB` defined, so no POSIX threads are used.
```toml
[tool.kryon.profiles.web]
backend = "raylib"
platform = "web"
host = "src/host.zi" # optional custom raylib host
assets = "assets" # mounted at /assets
preload = "client/bin/textures@textures mods"
```
| Key | Meaning |
| --- | --- |
| `platform` | `web` builds a browser page. It needs `backend = "raylib"` with c99 codegen; `library`, `static_archive` and `native_artifacts` are rejected. |
| `host` | A project host as for native raylib. The default is `raylib_run.zi`. |
| `assets` | One project directory, mounted at its own relative path. |
| `preload` | Space-separated project directories, `DIR` or `DIR@MOUNT`, mounted at `/DIR` or `/MOUNT`. It needs `platform = "web"`. |
`ziran tool kryon build --profile web` writes `index.html`, `index.js`,
`index.wasm` and, when files are preloaded, `index.data` to
`build/NAME-PROFILE/`. A new build replaces the directory only after the link
succeeds. Serve that directory over HTTP, not `file://`, so the page can fetch
its module and data. Copy it as a whole, for example to a site's `play/`
directory. The page's working directory is `/`, so relative asset paths
resolve as they do from the project directory on the desktop. Kryon's UI font
is preloaded at `/kryon-font.ttf`. The page's `<title>` and raylib's window
title come from `[tool.kryon.install] name` or else the package name. The page
records how the program ended in `document.body.dataset.kryon` (`exit CODE` or
`abort REASON`).
The program keeps its ordinary blocking loop. Emscripten's ASYNCIFY suspends
the program inside `PollRaylib()`: raylib's web `WindowShouldClose()` sleeps
12 ms, which returns to the browser so it can present the frame and deliver
input. The frame rate therefore depends on that sleep. Kryon sets raylib's
target FPS to 0 in the page, because a frame limit would spin the browser's
only thread. A custom host follows these rules:
- Call `OpenRaylib(width, height, title, flags)` once. Pass
`FLAG_WINDOW_RESIZABLE` (4, the default) so the canvas follows the browser
window, and keep the result of `RaylibViewport()` per frame rather than the
opening size.
- Loop on `while PollRaylib() { ... }` from `main` or a procedure called
directly by it. Each frame calls `PollRaylib()` once. Do not wait, sleep or
spin anywhere else in the loop.
- Inside a frame call `RaylibFrameInputBegin(session)`, then
`BeginRaylibFrame()`. Draw the world after it: clear the background, then
call `BeginMode3D`, the 3D drawing and `EndMode3D`. Then call
`BeginFrame(session, ...)`, the app's `Frame`, `EndFrame`,
`FrameInputEnd(session)` and `EndRaylibFrame()`. Kryon paints above
whatever the host drew earlier in the frame.
- Use only GLES2/WebGL 1 features: no geometry shaders, `#version 100`
shaders, and power-of-two textures when mipmaps or repeat wrapping are
needed.
- Read files through the preloaded mounts. Writes stay in the page's memory
file system and are lost on reload.
- Leave out native-only libraries: threads, `#system_library` libraries other
than raylib, libc and libm, and `RunRaylibAppFrame` worker pipelines. WebP assets
decode with the `webp` package's authored still-image engine; AVIF assets
do not decode in this host.
- Return from `main` to end the page. `CloseRaylib()` releases the WebGL
context.
`make raylib-web-project-test` builds such a host, with a 3D cube under a
Kryon `Box` and `Image`, and checks the page in private headless Chromium.
## Experimental SDL3 GPU renderer
Custom Linux x86_64 GNU hosts can import `kryon/pixmap_sdl3` and
`kryon/pixmap_sdl3_gpu`. This is an opt-in rendering prototype, rather than a
new project profile: the host supplies an SDL3 window, input loop and
presentation. Existing desktop, SDL2 and Raylib profiles keep their behavior.
presentation. Desktop profiles keep their behavior.
The handwritten renderer is Ziran; SDL3 supplies the GPU API and shaders.
Kryon's `native-sdl3` artifact builds static SDL 3.4.18 from its pinned official
@@ -240,17 +143,10 @@ texel ties in the 1.25× zoom scene can choose the adjacent texel, as in the SDL
reference; the test accepts only analytically identified checker boundaries
within the image and clip. The shared sampler is therefore not byte-exact at
those ties. SDL3 also converts byte colors to float colors in 1536-vertex chunks,
which can add draw calls; this does not establish a speedup over SDL2 or Raylib.
which can add draw calls; this does not establish a speedup over SDL2.
See the executable lifecycle example in
[`tests/sdl3_renderer_host_test.zi`](../tests/sdl3_renderer_host_test.zi).
After `make sdl3-test`, the separate comparison harness is available with
`build-queue -- python3 tests/backend_render_benchmark.py --smoke`. It records
device identity, parity and raw samples under ignored
`work/backend-render-benchmark`. The test-only Raylib adapter currently fails
the zoom scene's pixel oracle, so the comparison returns status 2 and excludes
that scene's Raylib timings. This does not make the SDL3 integration test fail.
For SDL2 versus SDL3 on a physical AMD GPU under Linux, use the explicit
hardware mode (choose the render node from `/sys/class/drm/renderD*/device`):
@@ -271,8 +167,7 @@ The report records that device's render node, PCI address, vendor/device IDs,
kernel driver, renderer/API and Mesa versions. A mismatched device, software
renderer, missing execution evidence or failed pixel oracle blocks hardware
timing. This qualification currently requires AMD's Linux DRM counters; it
does not infer acceleration from the Vulkan API name. Raylib is excluded
from this hardware comparison. The default software mode still forces
does not infer acceleration from the Vulkan API name. The default software mode still forces
llvmpipe on private Xvfb; `--backends sdl2 sdl3` restricts its smoke test.
Every selected backend must pass all 120 frames of all five 480×320 scenes
@@ -286,28 +181,6 @@ measurement. Offscreen results do not measure visible-window/compositor
performance, and other running workloads and GPU clock changes remain
uncontrolled. No backend default or SDL2 software fallback is changed.
The 2026-11-02 hardware run used AMD Radeon Graphics
(RAPHAEL_MENDOCINO), `/dev/dri/renderD129`, PCI `0000:7a:00.0`,
vendor/device `1002:13c0`, kernel `amdgpu`, Mesa 25.0.7. SDL2 used
radeonsi OpenGL 4.6; SDL3 used RADV Vulkan. Both passed 600 parity frames,
with zero failures after the specified checker-boundary allowance. Five
randomized trials per scene used 1,200 timed frames and 240 warmup frames.
Median drained frames/s, SDL2 then SDL3, were:
- Text: 7,709 / 7,115 (SDL3 −7.7%).
- Images: 2,819 / 2,894 (+2.7%).
- Shapes: 4,047 / 4,794 (+18.5%).
- Scroll: 8,270 / 6,633 (−19.8%).
- Zoom: 9,829 / 7,406 (−24.7%).
These are scene-specific observations from this machine, with trial spread
and concurrent workloads; the small image difference does not establish a
general advantage. The old forced-software comparison is not hardware
evidence. Raw frame samples and DRM counters are in ignored
`work/backend-render-benchmark/hardware.json`; the compact
`hardware-summary.json` includes every trial's throughput and CPU latency
p50/p95. Load averages were approximately 6.3/6.1/5.9 at both ends of the run.
## AVIF images
Native AVIF and WebP decoding is supplied by the standalone Ziran `avif`,
@@ -331,10 +204,8 @@ Failed decode, cancellation and changed output dimensions release the buffer
before publishing any pixels. Browser codecs and pixel-renderer inputs retain
their existing paths.
`Image(ImageProps)` accepts AVIF assets through the same path as PNG/JPEG/WebP,
including extensionless names and packaged bundle/APK assets. Raylib hosts opt
in with `AVIF_RAYLIB` and the pinned archives; builds without it decode no AVIF
and link no codec library. Native hosts
`Image.Draw(Image.Props)` accepts AVIF assets through the same path as PNG/JPEG/WebP,
including extensionless names and packaged bundle/APK assets. Native hosts
decode with the locked libavif 1.3 and dav1d, its assembly selected at run time
for the CPU (x86 SSE2 to AVX-512, ARMv7 and AArch64 NEON); Android 9 requires
no OS AVIF support. libaom is linked as the explicit comparison oracle, never
@@ -344,9 +215,17 @@ AOM/NDK combination emits unaligned NEON loads which fault on real Android
hardware; dav1d's own NEON runs there. The ARMv7 device suite covers both Debug
and Release, including the original large YUV420 crash input and background
image loading.
Desktop hosts load the AVIF bridge (`libkryonavif.so`, `kryonavif.dll`) on
first use, from `KRYON_AVIF_LIBRARY`, the library search path or beside the
executable, and WebP from the system libwebp. A program that links the codecs
itself builds with `--define KRYON_AVIF_LINKED` (libavif and its AV1 codec)
and `--define KRYON_WEBP_LINKED` (libwebp and libwebpdemux), and loads
neither; `make avif-decode-test` runs such a build, linked with the static
archives, where no `libkryonavif` exists.
8/10/12-bit color and monochrome decode to straight 8-bit RGBA; alpha and
container clean aperture, rotation and mirroring are preserved. The renderer
then premultiplies for Cairo or composites normally in Raylib. HDR tone mapping
then premultiplies for Cairo. HDR tone mapping
and ICC display color management are outside the existing 8-bit image surface.
Encoded files are limited to 256 MiB, dimensions to 32768 per axis and pixel
@@ -367,20 +246,7 @@ bytes. Only the first decoded frame is retained.
| Linux AArch64 | dav1d NEON, dotprod, i8mm | qemu-user: strict parity |
| Windows, macOS | dav1d via the same recipe | unverified here |
`mk/raylib-library.mk` builds `AVIF_A`, `AOM_A` and Linux `AVIF_SO` beside the
existing renderer archives; `AVIF_A` contains dav1d. Building it needs Meson,
Ninja and, on x86, NASM; `ZIRAN_AVIF_TOOLS` can name a directory holding the
avif package's pinned Meson/Ninja. `kryon_android_codecs(webp, avif, aom)`
links the static codec for each ABI; older scaffolds receive the source paths
through `KRYON_ANDROID_AVIF_DIR`, `KRYON_ANDROID_AOM_DIR` and `KRYON_DAV1D_DIR`
(otherwise dav1d comes from the locked package graph). The Raylib artifact
includes the static codec archives. The desktop artifact includes the
self-contained `libkryonavif.so`; `renderer_link` retains it as a runtime
dependency so application packaging tools carry it into their lib directory.
Cairo also searches beside the executable and its `lib`/`../lib` directories;
`KRYON_AVIF_LIBRARY` can select an explicit codec file for custom hosts.
Canvas/DOM use the browser AVIF decoder through `PageImageDecode`; supported
Canvas uses the browser AVIF decoder through `PageImageDecode`; supported
browsers (Firefox 93+, Chromium 85+, Safari 16.4+) supply their native AVIF
implementation. In a browser without AVIF, every AVIF decode fails cleanly:
no pixels and zero size, so the image is treated like any undecodable file,
@@ -394,7 +260,7 @@ strict libavif digests in `tests/avif_strict_digests.zi`, tolerance 0. The
independent goldens keep small documented tolerances: ±1 for 10/12-bit and
grayscale (8-bit rounding of the source pattern), ±4 premultiplied (unpremultiply
rounding) and ±3 for Jungle title samples (YUV420 conversion versus Pillow).
`make avif-render-test` checks real Cairo and private-display Raylib rendering,
`make avif-render-test` checks native rendering,
including a portable bundle using the public Image widget. `make android-avif-test
ANDROID_NDK=... ANDROID_SERIAL=ZE2223BQZT` builds all four ABIs and runs the
ARMv7 strict-parity/golden-pixel tests on the Android 9 USB Moto, asserting each
@@ -402,7 +268,7 @@ ABI's dav1d assembly. `make avif-cross-test [AVIF_CROSS_ROOT=...] [ANDROID_NDK=.
runs the strict parity test for Linux AArch64 and static Android arm64-v8a
under qemu-user (Cortex-A53 and every emulated feature) and Android x86/x86_64
on the host; `AVIF_CROSS_ROOT` is a prefix holding the AArch64 GCC and
qemu-aarch64. `make avif-browser-test` exercises the Canvas/DOM image
qemu-aarch64. `make avif-browser-test` exercises the Canvas image
boundary in private headless Firefox, reporting the AVIF capability, and repeats
it as a browser without AVIF. `make avif-benchmark [ANDROID_SERIAL=ZE2223BQZT]
[AVIF_BENCHMARK_BROWSER=1]` records ms/image, MP/s and peak RSS for libaom,
@@ -421,20 +287,11 @@ its name. Lossy, lossless and alpha pictures decode to straight RGBA. An
animated WebP decodes to its first complete frame, since Kryon images are
still; `ImageCompress` keeps animated originals unchanged.
- The raylib and Android hosts decode through `webp_image.zi` with libwebp's
decoder and animation demuxer, built from the locked `libwebp` source
package into the static `kryonwebp` archive (`cmake/WebP.cmake`, no
encoder or threads). Images above 67108864 pixels are refused. The static
adapter retains its 2147483647-byte input cap; Cairo retains its 256 MiB
encoded-file budget.
`mk/raylib-library.mk` builds it as `WEBP_A` beside `RAYLIB_A`;
`kryon_android_codecs` builds it for each ABI; the `renderer-raylib`
artifact lists `lib/libkryonwebp.a` in its archives.
- The desktop (Cairo) host loads the system libwebp demuxer
(`libwebpdemux.so.2`) on first use, like its other optional codecs.
- The canvas and DOM hosts use the browser's own WebP decoder.
- The canvas host uses the browser's own WebP decoder.
`make raylib-webp-decode-test` and `make image-decode-test` decode the
`make test-focus TEST=ziran_image_decode_linux_test` decode the
`tests/fixtures/webp` pictures natively, `tests/webp_browser_test.py` does the
same in headless Chromium, and `make android-webp-link-test` links the
decoder for every Android ABI.
@@ -446,32 +303,6 @@ are ignored. `tests/ziran_png_test.sh` compares independent reference pixels
for 33 fixtures through source and saved IR in bundles, C and Go, including
malformed streams and bounded decoder output.
The raylib host uses `raylib_runtime.zi` and the raylib revision pinned as a
Ziran source dependency. The canvas host uses its dedicated `canvas_raster.zi` provider over
a Canvas2D browser ABI; see [Canvas2D browser host](canvas.md). Backend build
dependencies and link flags live in `mk/ziran-project.mk`. Platform calls are
declared with Ziran foreign imports; handwritten host implementation is
Ziran.
On Linux, the Raylib host resolves system typefaces and missing characters
through [Fontconfig](https://fontconfig.pages.freedesktop.org/fontconfig/fontconfig-devel/).
Measurement and drawing use the same fallback face and advances. TrueType and
OpenType collections are extracted into owned standalone font bytes following
the [OpenType table and checksum rules](https://learn.microsoft.com/en-us/typography/opentype/spec/otff).
Glyph atlases remain available for later frames, and queued text is flushed
before replacing an atlas.
Missing characters are checked against the source before rebuilding an atlas.
Text measurement refreshes the base atlas; cached drawing sizes refresh only
when used, so a new character cannot rebuild every cached zoom at once.
`make raylib-typeface-test` decodes real fonts and checks mixed Latin/CJK text,
supplementary characters, collection bounds and checksums, retained sources,
and disposal in C from source and saved IR. It replaces only graphics
submission and texture allocation, so it needs no display and does not verify
rendered pixels. Supply `RAYLIB_A` for an existing Raylib archive (and
`RAYLIB_LIBS` for its link flags); Fontconfig and an installed CJK outline font
are required. Whole-application captures still require a private display.
Browser projects save the selected `_run` host and `canvas_raster.zi` as
generation roots without entry pruning. This keeps both the host `main` and
the raster adapters available to the paint queue. Native projects continue
@@ -507,10 +338,8 @@ LRU budgets, so a large cover and its small marker do not evict each other.
| Backend | Lanczos copy |
| --- | --- |
| Desktop/Cairo | Cached surface, drawn 1:1 |
| Raylib | Uploaded texture; the CPU copy is freed after upload |
| pixmap and SDL3 GPU | A copy slot drawn 1:1 (threaded builds only, `PIXMAP_LANCZOS`), so the CPU rows and GPU hosts show the same bytes |
| Canvas | Ziran resampler in slices, from the texture's pixels read back, then uploaded |
| DOM `<img>` | Scaled by the browser |
Firefox has no `imageSmoothingQuality`. Canvas therefore does not rely on
it, and still sets it to `high` for upright smooth draws that it does not
@@ -536,7 +365,7 @@ already does this by pushing a wake event. `PixmapLanczosWait` and
smooth picture is final.
`make lanczos-goldens-test` (part of `make test`) compares Cairo, pixmap,
Raylib on a private Xvfb display and Canvas in headless Firefox against
Canvas in a private headless browser against
Pillow goldens. `make lanczos-benchmark` times Kryon against Pillow,
Pillow-SIMD, libvips and stb_image_resize2. It reports ms per output
megapixel, extra peak memory and PSNR against a float64 reference, on
@@ -570,23 +399,6 @@ a JDK, the Android SDK with NDK `28.2.13676358` and CMake `3.22.1`
`libavif` and `libaom` source packages. Scaffolds pass their source roots to
`kryon_android_codecs`; the packaged host links no renderer or audio library.
A custom raylib Android host defines `KRYON_RAYLIB_HOST` during Ziran generation.
This selects raylib's pointer and clipboard exports while retaining Android
platform services. Direct touch consumers call `AndroidPointerFrame()` and
`AndroidSecondarySample()` from `android_touch`; those samples do not replace
the selected renderer's generic input exports.
JNI also selects raylib's `GetAndroidApp()` for this host, so private files,
Java calls and process preparation use the raylib-owned NativeActivity.
Before initializing graphics, custom hosts can read the announced native window
with `GetAndroidPendingSurfaceSize(width, height)` from `android_surface`. It
returns positive dimensions without consuming or acknowledging lifecycle commands.
Once EGL is current, surface synchronization reads its drawing-buffer extent.
If raylib's fixed buffer request no longer matches the native window after
picture-in-picture, synchronization releases that request. Subsequent EGL
buffers follow the native window size; software hosts use the native window.
The same synchronization maps window-local touch samples into the decorated
surface, including replayed quick taps and logical zoom.
At runtime a `NativeActivity` subclass owns the Java side: it reports window
insets, display cutouts, IME state, density, dark mode and orientation
through JNI natives registered by the generated `src/android_glue.zi`, and
@@ -647,13 +459,12 @@ input such as `KeyboardTake`, `TypedCodepointTake`,
`PointerWheelTake`, and pointer state. `KeyboardModifiers` reports
Shift, Control, and Alt keys as `KeyModifierShift`, `KeyModifierControl`, and
`KeyModifierAlt` bits, so a shortcut such as Ctrl+S is a key press read with
the modifiers that were down. The desktop and raylib hosts submit them with
`KeyboardModifiersSend` before each frame. Canvas and DOM app hosts submit
the modifiers retained with the consumed key press or repeat, so shortcuts
remain intact when all physical keys are released before a frame. Custom
Canvas loops pair `CanvasPressedKey()` with `CanvasPressedKeyModifiers()`;
`CanvasModifiers()` and the immutable frame snapshot keep their held-state
semantics. Other hosts report none.
the modifiers that were down. Desktop and Canvas custom loops call
`DesktopInputTake(session)` or `CanvasInputTake(session)` before each frame. Each take transfers ordered text
to that session and returns the next key with the modifiers retained when the
press or repeat arrived, so shortcuts remain intact even when every physical
key is released before a frame. `CanvasModifiers()` and the immutable frame
snapshot keep their held-state semantics. Other hosts report none.
The host calls `BeginFrame` and
`EndFrame` around application composition, then presents the resulting
paint operations. Widget behavior stays in `src/ui/`.
@@ -664,7 +475,7 @@ window hosts and ignores terminal escape sequences. The project test drives
this through a private PTY. The other hosts can capture a frame with
`KRYON_CAPTURE_PATH`; the graphical integration tests run on private Xvfb
displays. Run `make test` for the library, browser, and typeface gates, plus
`make desktop-project-test` and `make raylib-project-test` for graphical
`make desktop-project-test` for graphical
capture and input.
Never run graphical tests against the developer's live display.
@@ -677,7 +488,7 @@ buffer that is too small leaves the next path queued. Text drops are ignored.
## Portable programmable scene rendering
`scene_render` executes `shader` material programs in Ziran on CPU before
presentation. Cairo, Raylib (including WebAssembly), and Android's
presentation. Cairo and Android's
ANativeWindow/Pixmap host consume the resulting managed bitmap through the
standard Image surface. These hosts do not need a shader-language bridge.
This interface does not claim GPU execution, GLSL compilation, vertex-shader
@@ -694,8 +505,7 @@ materials and the Pixmap-to-ANativeWindow presentation path on the USB Moto. It
uses a private offscreen AImageReader window, verifies posted RGBA pixels,
clipping, alpha and binding changes, and destroys/recreates that window while
keeping the CPU program and bitmap alive. It does not launch or alter an owner
app. `make shader-web-test` exercises the corresponding Raylib WebGL presentation
inside a private headless browser. These targets also load a real PNG through
app. These targets also load a real PNG through
`kryon/image_pixels`; activity-bound Android asset/JNI decoding is a separate
application integration responsibility.
+1 -3
View File
@@ -4,7 +4,6 @@
| --- | --- |
| Ziran | Language, compiler, standard library, `.zir`, `.zx`, and generic host capabilities |
| Kryon | Reusable Ziran UI modules, widget decisions, and UI hosts |
| Game2D | Optional game API and game behavior using Kryon's selected raylib backend |
| Applications | Screens, copy, translations, assets, data storage, migrations, and product workflows |
Kryon is imported by applications. It is not linked into programs that never
@@ -18,7 +17,6 @@ decisions. The host may call native libraries through declared Ziran foreign
bindings, but must not duplicate widget policy.
Make upstream Kryon changes on `master` and commit them there. A downstream
app picks them up by updating its `ziran.lock`, or, if it still vendors
Kryon, by moving its clean `vendor/kryon` submodule pointer. Never edit
app picks them up by updating its `ziran.lock`. Never edit
Kryon's source inside an application. See [ARCHITECTURE.md](ARCHITECTURE.md)
for source modules and [PROJECTS.md](PROJECTS.md) for package use.
+2 -4
View File
@@ -16,7 +16,6 @@ numbers as the platform input phases: start 1, update 2, commit 3, cancel 4.
to 16 pending events. `BeginCompositionFrame`, `SubmitComposition`, and
`TakeComposition` manage ordering, owned byte copies, and UTF-8 truncation.
The queue is tested from source and saved `.zir` on C and Go targets.
Its pointer parameters are not yet supported by the portable VM.
Portable applications bind `composition_input:PollComposition` to an ordinary
Ziran provider with `ziran bundle --bind`; the checked test uses this route for
@@ -38,11 +37,10 @@ and Indic joins intact, including joins across preedit segments. Existing
The native Cairo host uses Pango for shaping, bidirectional placement and
font fallback. Caret measurement uses the full shaped line rather than a
separately shaped prefix. `tests/native_text_test.sh` checks combining marks,
Arabic joining, Hebrew caret/hit positions and text longer than the former
1,024-byte draw limit through source/saved IR and C.
Arabic joining, Hebrew caret/hit positions and long text through source/saved IR and C.
Logical Left/Right movement is still by grapheme order. Mixed bidirectional
selection uses a single highlight rectangle, and separately styled preedit
runs are not shaped as one joined run. Pixmap, raylib and other hosts retain
runs are not shaped as one joined run. Pixmap and other hosts retain
their own font/rendering capabilities; Cairo shaping does not imply all-host
bidirectional support.
-128
View File
@@ -1,128 +0,0 @@
family status current_kryon_surface exact_parity_gap target_file_and_public_contract meaningful_acceptance_test
text extend Text, RichText, Page Heading/Paragraph No CUI last-line balancing contract; missing tabular digits, explicit 1.45 line height, nowrap+tooltip handoff, and direction analysis. src/ui/text_props.zi + text_widget.zi; extend TextProps, no wrapper. Balanced/nowrap/LTR/RTL fixtures produce exact row counts and stable geometry across two frames; ellipsis tooltip exposes full text.
icons extend SvgIconProps, Icon module No embedded Lucide name catalog/font roles or exact size/color token mapping. src/ui/svg_icon_props.zi + src/ui/icon.zi; CUI icon pack adapter. Render sampled Lucide names at 12/16/24 px in both modes; unknown names are inert and reported.
badge-avatar-and-keycap new No canonical Badge, Avatar, AvatarGroup, or Keycap. Badge tone/dot/solid/icon/size; avatar status/square/deterministic initials color; groups and overlap. src/ui/badge.zi, avatar.zi, keycap.zi. Verify all tones, image/initials/status, deterministic color, group clipping, and semantic labels.
card-and-metric partial Card/CardProps Metric delta/label/lower-is-better, spark values, icon, exact padding/min/max and hover/muted/selected variants are absent. src/ui/card_props.zi + src/ui/metric.zi. Card variants and positive/negative/inverted metric fixtures pass style and semantic assertions.
image extend Image/ImageProps Kryon already exceeds CUI input formats; CUI parity needs exact radius/tint defaults and raster bounds. src/ui/image_props.zi. PNG/JPEG golden at fit/contain/cover, rounded, tinted, missing asset and alt semantics.
button extend Button/ButtonProps Tooltip, shortcut hint, exact CUI variants/sizes/colors, and accessible description/tooltip behavior are absent. src/ui/button_props.zi; extend ButtonProps/ButtonResult. Pointer, Enter, Space, disabled, loading, full-width, icon-leading/trailing and tooltip assertions.
icon-button extend Button with icon_only/circle/square Tooltip/shortcut and CUI exact square/circle sizing/variants are absent. src/ui/button_props.zi. All sizes/variants render within exact bounds; accessible name comes from label/tooltip.
button-group-copy-and-hold-to-confirm new Button primitives only No group result contract, transient copy success, or hold progress/release/cancel. src/ui/button_group.zi, copy_button.zi, hold_button.zi. Space-held activation fires only at duration; early release restores; copy action emits once and shows success.
split-button partial Button split/menu fields + Menu/Dropdown No unified down-arrow menu ownership, menu item icons, or action/menu result split. src/ui/split_button.zi composing Button+Menu. Main and chevron have separate hit areas; Down opens menu, Escape restores focus, choice reports item ID.
toggle-group partial SegmentedControl single selection No exclusive=false multi-toggle, icon-only mode, or group value/result. src/ui/toggle_group.zi. Toggle independent values, exclusive clamps to one, disabled items retain values, arrows/Space activate.
confirm-button new Button only No armed state, timeout, outside-click disarm, Escape, or confirm result. src/ui/confirm_button.zi. First activation arms, second commits, timeout/Escape/outside click disarms without commit.
status-button partial Button loading state No busy/success/error labels, result lifecycle, or terminal-state styling. src/ui/button_props.zi + status_button.zi. Busy suppresses activation; success/error transitions expose one result and accessible state.
reactions new No canonical component Reaction groups, counts, user selection, overflow and result events are absent. src/ui/reactions.zi. Add/remove/toggle emits stable reaction IDs, count formatting and aria-pressed are exact.
speed-dial new Overlay/Button primitives only No placement, expanded state, outside-click/Escape close, or action result. src/ui/speed_dial.zi. Open/close animation, placement, Escape/outside close and action IDs pass pointer and keyboard tests.
theme-switcher-and-toggle partial SystemTheme, ThemePolicy, SetThemeMode No animated light/dark/accent switcher result or mode/accent persistence boundary. src/ui/theme.zi + system_theme.zi. Switch mode/accent; 0.32s OKLab interpolation respects reduced motion and restores custom metrics.
user-menu partial Menu, Button No avatar/detail/status user identity contract or compact menu placement. src/ui/user_menu.zi. Identity, status, compact mode, placement, activation and focus restoration pass.
swipe-actions strong SwipeRow with short/long actions Most gesture/result behavior exists; exact CUI visual states, defaults and motion need style parity. src/ui/swipe_row_props.zi. Left/right short/long thresholds, vertical-scroll rejection, release/removal and keyboard activation assertions.
text-field partial TextField/TextFieldState CUI label/hint/error/clearable/autofocus/search, prefix/suffix and exact undo/redo behavior are not one public surface. src/ui/text_input_props.zi + text_field_widget.zi. Type/edit/select/clipboard/undo/redo, validation and focused-field scroll reveal pass keyboard and touch replays.
text-area partial TextArea TextArea has rich editing state; CUI label/hint/error, Ctrl+Enter submit and exact visual rows are absent. src/ui/text_input_props.zi + text_area_widget.zi. Wrap, visual-line arrows, wheel, Enter newline, Ctrl+Enter submit, selection and scroll pass.
number-field partial Spinbox integer API only No float/decimal precision, formatted display, suffix, step buttons with Shift x10, or commit/cancel events. src/ui/number_field.zi replacing parallel spinbox use for this concept. Type/buttons/arrows update value within precision; invalid text restores or reports exactly by contract.
tag-input new TextField + chips absent No tag array ownership, max count, Enter/comma add, chip remove, Backspace-on-empty result. src/ui/tag_input.zi. Add/remove/duplicate/max-limit behavior and stable caller tag IDs pass.
one-time-code new No canonical OTP input No segmented code boxes, auto-advance/backspace, paste/complete result. src/ui/one_time_code.zi. Typing, pasting, backspace, change and completion emit exactly once with accessible code-group semantics.
password-strength new TextField secure only No strength algorithm/score/label/colour contract. src/ui/password_strength.zi. Known passwords map to exact score/label/color; secure field behavior remains canonical.
inline-edit new Text/TextField primitives only No display-to-edit transition, selected text, save/cancel result. src/ui/inline_edit.zi. Click/Enter edits with selection, Enter/blur saves, Escape restores old value and focus.
scrub-field new No canonical component Drag value editing, Shift fine step, formatting and keyboard equivalence absent. src/ui/scrub_field.zi. Pointer drag and arrows change exact values; Shift changes granularity and text remains selectable/read-only correctly.
money-field new TextField only No currency symbol/code, decimal/locale formatting, validation or commit semantics. src/ui/money_field.zi. Locale/currency fixtures format, clamp, parse and expose changed/committed without losing caret unexpectedly.
prefix-and-suffix partial TextField props No first-class prefix/suffix layout and semantic association. src/ui/text_input_props.zi. Prefix/suffix glyphs never overlap value; hit testing and accessible description are exact.
shortcut-recorder new KeyInput only No key-name/localized combo label or recorder capture/clear/cancel behavior. src/ui/shortcut_recorder.zi. Record modifiers+key, Backspace clear, Escape/Tab cancel; labels match platform fixtures.
dropzone new No widget contract No file drag/hover/drop, click-browse handoff, accept filter, compact variant or file-list result. src/ui/dropzone.zi + backend file events. Drag hover/leave, drop paths, click request, accept filter and disabled state pass with host stub.
avatar-upload new Avatar/Image primitives only No crop/zoom, file pick/drop, preview and commit/cancel boundary. src/ui/avatar_upload.zi. Choose/drop, preview, crop/zoom, commit and cancel preserve or reject the prior image exactly.
signature-pad new Canvas/pointer primitives only No stroke capture, pressure/width policy, clear/undo, point export or raster result. src/ui/signature_pad.zi. Recorded points/raster match pointer replay; undo/clear and minimum-stroke validation pass.
segmented-control partial SegmentedControl Icons, full-width, CUI sizes/motion and exact arrow wrap behavior are absent. src/ui/segmented_control_props.zi. Selection, wrap, disabled options, icons and style tokens pass pointer/keyboard/semantic checks.
checkbox-switch-and-radio partial Checkbox, Toggle, Radio Description/indeterminate and exact CUI states/motion are absent. src/ui/checkbox_props.zi, toggle_props.zi, radio_props.zi. Space toggles each control; tri-state reports indeterminate and label/description semantics.
slider partial Slider/DiscreteSlider Range slider, Shift x10, Home/End, value formatting/display and exact thumb/track styles are absent. src/ui/slider_props.zi. Pointer/keyboard single/range edits, clamping, step and formatting pass; vertical variant if CUI documents it.
chips-and-rating new No canonical Chip or Rating Icon/disabled chip remove/action and fractional/hover/keyboard rating are absent. src/ui/chip.zi + rating.zi. Chip activation/removal and rating values/arrows/reset produce exact events and aria values.
radio-cards new Radio primitives only Grid layout, card content, arrows and selected semantics are absent. src/ui/radio_cards.zi. Arrow navigation across columns, wrap, disabled cards and one selected stable key pass.
select-and-combobox partial Dropdown/ListBox Searchable combobox filtering, placeholder/icons, highlight/choose/cancel and async-owner data boundary are absent. src/ui/dropdown_props.zi + combobox.zi. Down opens and moves, typing filters, Enter chooses, Escape closes/restores focus, disabled items skipped.
date-picker-and-calendar new No canonical date UI No calendar grid, today, month navigation, selection/activation or locale contract. src/ui/date_picker.zi + month_calendar.zi. Locale month/day fixtures, today, navigation, selection and activation pass keyboard tests.
color-picker partial ColorPicker RGBA channels CUI popup presentation, exact channel/alpha controls, token output and accessible value are absent. src/ui/color_picker_props.zi. RGBA sliders produce exact values, clamping, focus order and result changed semantics.
multi-select new Dropdown/ListBoxMulti primitives No chips, search, max chips, list Space/Enter selection or caller-owned selection result. src/ui/multi_select.zi. Search, toggle, chips, max chip display, SelectAll-like keyboard behavior and stable IDs pass.
date-range-picker new No canonical component Presets, dual-month range, hover preview, minimum/narrow dates and result boundary absent. src/ui/date_range_picker.zi. Forward/back range, same-day policy, presets and keyboard navigation produce exact start/end events.
time-picker partial TimePicker Twelve-hour, minute step, wheel/popover behavior, clear/now and exact result timing are incomplete. src/ui/time_picker_props.zi. 12/24-hour parse/format, minute step, now/done/clear and keyboard path pass.
wheel-picker-and-time-dial new No canonical widget Momentum drum snapping, rows/loop, joined wheels, arrows/scroll and time dial absent. src/ui/wheel_picker.zi + time_dial.zi. Scroll momentum settles on item; arrows Home/End, loop boundary and joined hour/minute AM/PM pass.
ruler-and-histogram-sliders new Slider only No ruler ticks/major marks/unit formatting or histogram range handles/distribution rendering. src/ui/ruler_slider.zi + histogram_slider.zi. Tick layout, snapping, range drag and histogram bounds produce exact values.
knob-fader-and-level-meter new Slider only CUI drag geometry, 200-point knob traversal, Shift fine, reset, log/bipolar, ticks, meters, hold/decay absent. src/ui/knob.zi, fader.zi, level_meter.zi. Pointer/keyboard values, reset, log range and 1-8 channel peak/hold/decay fixtures pass.
emoji-picker new No canonical widget Unicode order/groups/search/recent/tone/preview and grid keyboard navigation absent. src/ui/emoji_picker.zi with generated data. Search, group traversal, arrows/Home/End, tone and recent selection return exact scalar/name.
tabs partial TabBar Variant/icon/full-width look, exact arrow behavior and animated selection are not CUI parity. src/ui/tab_bar_props.zi. Left/Right, wrap, activation, icons, overflow and focus pass; selected geometry stable across resize.
sidebar-navigation partial NavigationBar, Collapsible Desktop sidebar sections/groups/badges/collapse and active-item result are not a canonical CUI surface. src/ui/sidebar_navigation.zi. Section/group navigation, badges, selected key, keyboard traversal and collapse preserve scroll.
breadcrumb-pagination-and-stepper partial Breadcrumb; no Pagination/Stepper Breadcrumb exists; pagination pages/ellipsis, and stepper current/done/error states/results are absent. src/ui/breadcrumb_props.zi + pagination.zi + stepper.zi. Breadcrumb overflow, page change, disabled pages, step activation and status transitions pass.
table-of-contents new Heading/Scroll primitives only No anchor tracking, active heading, scroll sync or link result. src/ui/table_of_contents.zi. Scroll input updates active anchor; activation scrolls target and keyboard traversal is exact.
menu-bar new Menu primitives only No bar ownership, mnemonics, Alt/F10 mode, menu traversal or focus restore. src/ui/menu_bar.zi. Alt/F10, mnemonics, Left/Right/Down/Enter/Escape and global Alt-shortcut paths pass.
toolbar partial Toolbar Toolbar button label/tooltip/shortcut/toggle, separator/spacer and overflow menu behavior are incomplete. src/ui/toolbar_props.zi. Tabs through buttons, toggles state, overflow opens and shortcuts do not activate disabled actions.
document-tabs partial TabBar close/reorder Global Ctrl+Tab/PageDown/PageUp/Ctrl+W, close suppression, reorder and exact focus behavior are incomplete. src/ui/tab_bar_props.zi + document_tabs.zi. Select/reorder/close keyboard paths and global shortcuts report one event and preserve focus.
status-bar new No canonical component Status item click/tooltip/tone, progress/spacer/text variants and keyboard order absent. src/ui/status_bar.zi. Items focus/click once, progress updates, spacers layout and tooltips/semantics pass.
docking new PanedView only Persistent dock layout, panel open/dirty state, tab strips, drag/drop, save/load and shortcuts absent. src/ui/docking.zi. Serialize/load layout; drag/cancel, close, reorder, cycle and focus shortcuts mutate only reported state.
dropdown-and-context-menu partial Dropdown, ContextMenu, Menu Placement, scale/fade motion, trigger/menu keyboard continuity, labels/separators/danger/checked exactness are incomplete. src/ui/dropdown_props.zi + menu_props.zi + context_menu_widget.zi. Down opens, arrows skip disabled/labels, Enter chooses, Escape/outside closes and focus returns to trigger.
popover partial Popup/Overlay Placement, width/pad/gap, toggle/close ownership and focus trap/return are not a canonical CUI popover. src/ui/popover_props.zi. Toggle/open/close, placement, Escape/outside, focus restoration and layer clipping pass.
tooltip new No canonical tooltip Pointer/focus delay, placement, boundary fitting, truncated-text trigger and reduced motion absent. src/ui/tooltip.zi. Hover/focus shows after exact delay; near viewport edge moves; disabled triggers do not show.
dialog partial Modal/ActionModal Description, width, persistent/no-close variants, scrim close and focus lifecycle need exact CUI behavior. src/ui/modal_props.zi. Escape/scrim/close behavior, persistent suppression, accept/cancel focus and result pass.
sheet new Overlay/Modal only Side, size, description, drag/scrim close and safe-area behavior absent. src/ui/sheet.zi. Each side opens/clips correctly; Escape/scrim/drag close and focus containment pass.
command-palette new No canonical component Fuzzy ranking, groups, keyboard selection, global open ownership and action result absent. src/ui/command_palette.zi. Ranking fixtures, grouping, Up/Down/Enter/Escape and exact action dispatch pass.
hover-card new No canonical component Placement, delay, interactive content and boundary fitting absent. src/ui/hover_card.zi. Show/hide delay, pointer movement tolerance, focus path and clipping pass.
confirm-popover new Button/Popover primitives only Danger confirmation, focus on confirm, Escape/cancel and outside dismiss absent. src/ui/confirm_popover.zi. Enter confirms, Escape cancels, outside closes without confirm, focus returns to trigger.
expandable-text-and-card new No canonical component Line clamping/fade, More/Less result, badge/icon/description card expansion absent. src/ui/expandable_text.zi + expandable_card.zi. Exact clamp threshold, toggle text, focus order and height animation pass.
guided-tour new No canonical component Step targeting, blocking, padding, labels/count and keyboard traversal absent. src/ui/guided_tour.zi. Next/back/done/Esc sequences report steps; target geometry, scrim and focus are exact.
toast partial Toast Description/tone/duration/action/timer/result ownership and stacking are incomplete. src/ui/toast_props.zi. Action fires once, timer expiry closes, tone/style and multiple toast ordering pass.
alert new No canonical component Tone/icon/action/dismiss semantics absent. src/ui/alert.zi. Tone/style, action dispatch, dismiss and focus/semantic role pass.
progress-meter-spinner-and-skeleton partial Progress, LoadingIndicator Progress label/value/indeterminate, gauge/meter variants, spinner styles and skeleton shimmer are absent. src/ui/progress_props.zi + meter.zi + skeleton.zi. Indeterminate/terminal animation, aria values and reduced-motion snapshots pass.
empty-state new No canonical component Icon/description/action composition and semantics absent. src/ui/empty_state.zi. Layout and action activation pass; description remains accessible.
banner-and-countdown new No canonical component Tone/action/dismiss banner and live countdown formatting absent. src/ui/banner.zi + countdown.zi. Dismiss/action events and deterministic time fixtures with compact/hide-days pass.
onboarding-checklist new No canonical component Checklist title/description, stable task IDs, progress and completion state absent. src/ui/onboarding_checklist.zi. Toggle tasks, progress, completion and persistence boundary pass.
undo-toast partial Toast only No undo action timeout/result contract. src/ui/undo_toast.zi or ToastProps extension. Undo fires once before timeout; expiry emits dismissed without undo.
table package-promote DataViews TableView Plain CUI table needs richer cell composition, sort request, striped/compact/selectable style and stable row IDs. src/ui/table_view.zi promoted from data-views, one implementation. Virtualization, sort requests, selection, row/cell events and style parity pass.
list-and-tree package-promote DataViews TreeView + ListBox List item subtitle/trailing/avatar and tree expansion/activation/keyboard need exact CUI identity/results. src/ui/tree_view.zi + list_item.zi promoted from data-views. Visible preorder identity, expansion, arrows, activation and clipping pass.
accordion partial Collapsible Group open policy, animated height, exact header/body bounds and keyboard focus order are incomplete. src/ui/collapsible_props.zi + accordion.zi. Independent/single-open policy, animation and Space/arrow behavior pass.
timeline-and-progress-ring new Shape/Ring primitives only Timeline time/icon/tone/last and ring value/thickness/status are absent. src/ui/timeline.zi + progress_ring.zi. Ordered timeline semantics and ring sweep/reduced motion pass.
reorderable-list strong Reorder Drag threshold/auto-scroll/commit exists; CUI row visuals and exact keyboard/motion gaps remain. src/ui/reorder_props.zi. Drag, reorder, cancel and auto-scroll produce exact from/to IDs without duplicated commits.
data-grid-and-filter-bar partial-package DataViews TableView Editable cells, spreadsheet selection/cursor/anchor, column filters, checkbox column and commit/cancel are absent. src/ui/data_grid.zi promoted/extended from TableView. Range/Ctrl selection, cursor navigation, double-click/Enter edit, commit/cancel and scroll reveal pass.
tree-table-and-path-bar new Only TreeView/TableView concepts Tree grid navigation/selection, sorting/guides, path editing, segment menus and submitted path result absent. src/ui/tree_table.zi + path_bar.zi. Right/Left parent-child behavior, range selection, activation, path parse/submit/cancel pass.
file-browser-and-picker new Backend dialogs exist, not CUI widget Places, history/reload, filter, folders/hidden, save/name editing and keyboard browsing absent. src/ui/file_browser.zi + file_picker.zi with host list callback. Stub filesystem navigation, filters, selection, Enter/Backspace/history/F5 and picked path pass.
code-block new No canonical widget Language highlighting, title, line numbers/range highlight, scroll and header behavior absent. src/ui/code_block.zi. Token spans, wrapping/scroll, highlight lines and copy semantics if contracted pass.
json-viewer new No canonical widget Expand depth, key/value types, paths, selection/copy and virtual scrolling absent. src/ui/json_viewer.zi. Deep fixture expands/collapses, exposes paths and handles invalid input deterministically.
markdown-view new Page/RichText primitives only Streaming Markdown, links/tasks/images/headings/code and task result application absent. src/ui/markdown_view.zi. CommonMark fixture and streaming append produce same tree; link/task events stable.
code-editor new TextArea only Language editor, undo grouping, tabs/indent, find/go-to, auto-indent, gutter and scroll selection absent. src/ui/code_editor.zi. C-language and Python edit scripts exercise indentation, undo/redo, find, goto and clipboard.
diff-viewer new No canonical widget Unified/split modes, folding, context, ignore EOL and change navigation absent. src/ui/diff_viewer.zi. Known diffs produce exact hunks, folds and next/previous/expand commands.
property-inspector new No canonical widget Groups, bool/color/enum/float/text/vector rows, scrub fields and keyboard order absent. src/ui/property_inspector.zi. Each property type edits/clamps and reports path-keyed changes; group fold works.
log-console new TerminalList partial list behavior only Timestamps, levels, selection range, follow, copy, toolbar and append API absent. src/ui/log_console.zi. Append/virtualize/follow, selection, copy and keyboard navigation pass.
terminal new No canonical widget Colored output selection/copy, input history, interrupt, clear and caret-at-prompt absent. src/ui/terminal.zi. Write/printf fixtures, Ctrl+C with/without selection, history and prompt behavior pass.
hex-viewer new No canonical widget Row layout, ranges, selection/cursor, edit mode, ASCII column and copy caps absent. src/ui/hex_viewer.zi. Navigation, selection, editing and hex/ASCII copy enforce byte limits and exact cursor.
flame-graph new No canonical widget Stack sorting, zoom/pan, span keyboard navigation, fit and selection absent. src/ui/flame_graph.zi. Zoom around pointer, pan and exact keyboard span/parent/child/fit paths pass.
curve-editor new No canonical widget Keys, add/remove constraints, drag/nudge, snap, playhead and evaluation absent. src/ui/curve_editor.zi. Add/remove/nudge/snap fixtures and curve evaluation values pass.
gradient-editor new No canonical widget Stops, focus/nudge/delete, color picker handoff and evaluation absent. src/ui/gradient_editor.zi. Minimum two-stop rule, exact stop position/color changes and evaluation pass.
timeline-editor new No canonical widget Tracks, clips/keys, box selection, zoom/pan, frame snapping, playhead and mutation result absent. src/ui/timeline_editor.zi. Scripted add/select/move/trim/delete/play operations report exact frame mutations.
charts partial-package Plot package lines/bars/markers/axes Donut, sparkline, area/stacked/smooth, common label/legend/format/min/max and exact styling are absent. src/ui/chart/{line,bar,donut,sparkline}.zi promoted core chart surface. Golden plots plus axis/format/legend/empty-data behavior pass.
heatmap new No canonical widget Matrix labels, min/max/color/format and cell sizing absent. src/ui/heatmap.zi. Matrix values render exact token colors and accessible labels/summaries.
calendar-heatmap new No canonical widget Year layout, empty days, color/format/unit and tooltip absent. src/ui/calendar_heatmap.zi. Date range fixtures render exact active/empty cells and value formatting.
treemap-and-radar new No canonical widget Treemap squarify/layout and radar axes/series/legend are absent. src/ui/treemap.zi + radar_chart.zi. Known hierarchies/values produce deterministic geometry and labels.
funnel-split-bar-and-waffle new No canonical widget Funnel, proportional split bar and waffle cell layouts/formatting are absent. src/ui/funnel.zi, split_bar.zi, waffle.zi. Proportions, rounding remainder, legends and accessible values pass.
sankey new No canonical widget Node/link flow layout, labels, formatting and hit targets absent. src/ui/sankey.zi. Small balanced-flow fixture has stable geometry, conservation checks and labels.
bar-list-and-activity-rings new No canonical widget Ordered bar list max rows and multi-ring activity/caption/legend absent. src/ui/bar_list.zi + activity_rings.zi. Order/keep-order/max rows, ring sweeps, center/caption and values pass.
scatter-and-bubble new Plot package markers only Dedicated scatter/bubble axes, sizing, legends and hit testing absent. src/ui/scatter_chart.zi. Point/bubble positions and sizes match formulas; axis/legend and empty cases pass.
radial-gauge new No canonical widget Sweep bands/ticks/target/needle/value semantics absent. src/ui/radial_gauge.zi. Clamped sweep geometry, band/target values and accessible value pass.
candlestick-chart partial-package Plot CandleChart OHLC/volume/SMA/EMA Crosshair, pointer zoom/pan, keyboard zoom/fit, overlays and exact up/down tokens are absent. src/ui/candlestick.zi promoted/extended from Plot. OHLC/volume/overlays render and navigation/zoom report exact visible range.
kanban-board partial-package DataViews Kanban Column dot/limit/width, keyboard lift/drop/cancel and exact slot result are incomplete. src/ui/kanban.zi promoted from data-views. Drag and keyboard moves return stable card/lane/slot IDs; limits and cancellation pass.
week-calendar new No canonical widget Hour range, event drag/resize 15-minute snapping and read-only behavior absent. src/ui/week_calendar.zi. Drag/resize/day-move fixtures produce exact times and mutation events.
month-calendar new No canonical component Selected day carry-over, first weekday, locale names, today and Space/Enter/Page navigation absent. src/ui/month_calendar.zi. Month boundaries, today, carry-over and keyboard activation pass.
gantt-chart new No canonical widget Task/timeline layout, weekend shading, today marker, drag/resize and keyboard changes absent. src/ui/gantt.zi. Day-width layout and arrow/Shift resize/move produce exact dates.
node-editor new No canonical widget Nodes, pins, links, detach, marquee, zoom/pan, minimap and graph mutations absent. src/ui/node_editor.zi. Construct/detach/delete/link graph and zoom/pan/selection keyboard paths pass.
chat new No canonical component Message grouping/author/time/status/avatar/markdown and divider/typing behavior absent. src/ui/chat.zi. Group boundaries, status and markdown/link events pass accessibility and layout checks.
comments new No canonical component Thread depth/line, likes/edited/badge and reply ownership absent. src/ui/comments.zi. Depth layout and like/reply events use stable IDs; nested semantics pass.
presence-counter-and-ticker new No canonical component Presence overlap/spread/idle, counter formatting and ticker motion absent. src/ui/presence.zi, counter.zi, ticker.zi. Presence layout/spread and number/ticker animation reduce to exact static frames.
carousel partial Carousel specialized implementation General slide count/drag/flick/wheel/arrows/dots/autoplay/loop/gap API absent. src/ui/carousel_props.zi replacing specialized surface. Index transitions and gestures report one terminal index; autoplay/loop/reduced motion pass.
image-compare-and-card-stack new Image primitives only Divider drag/focus and finite card stack visibility/drag behavior absent. src/ui/image_compare.zi + card_stack.zi. Compare position and arrows exact; stack forward/back changes visible order deterministically.
image-viewer-and-cropper new Image primitives only Zoom-at-pointer, pan, fit/actual, toolbar/checkerboard and crop aspect/min-size absent. src/ui/image_viewer.zi + cropper.zi. Zoom/pan formulas, double-click, keyboard fit/actual and crop bounds pass.
text-effects new Text typing only Shimmer, reveal, typewriter and word rotation timing/caret behavior absent. src/ui/text_effects.zi. Time-driven fixtures produce exact intermediate/final text and honor reduced motion.
rolling-numbers new Text only Character roll direction/order/timing and number formatting absent. src/ui/rolling_numbers.zi. Increase/decrease fixtures animate only changed digits and end exact.
gradient-text-and-spotlight-cards new Text/Box gradients partial Gradient text span and pointer spotlight/beam card effects absent. src/ui/gradient_text.zi + spotlight.zi. Gradient stops and pointer-position/clipped spotlight produce deterministic pixels.
loaders partial LoadingIndicator CUI named loader styles, size/color and reduced-motion fallback absent. src/ui/loading_indicator.zi. Every style has first/final frame and reduced-motion static equivalent.
dock new No canonical component Magnification falloff, badges/running indicators, separators and keyboard activation absent. src/ui/dock.zi. Pointer sweep produces exact cosine magnification; Tab/Enter activates and badges layout.
control-tiles new Toggle/Grid primitives only Large tile toggle, detail, color, wide/grid sizing and Space/Enter absent. src/ui/control_tile.zi. Activation toggles once, tile fill/layout and aria-pressed pass.
now-playing-waveform-and-tab-bar new No canonical component Artwork, morphing play/pause, scrubber, waveform and sliding tab pill absent. src/ui/now_playing.zi, waveform.zi + tab_bar.zi extension. Playback state, scrub value, waveform bars and tab pill geometry pass.
reasoning-and-tool-calls new No canonical component Thinking timer/collapse shimmer, tool status/input/output and elapsed semantics absent. src/ui/reasoning.zi + tool_call.zi. State transitions expose exact elapsed/status and collapse event; content remains accessible.
agent-plan-and-status new No canonical component Plan rail, running shimmer, progress count and status timeline absent. src/ui/agent_plan.zi + agent_status.zi. Step/status changes update rail/progress exactly and report activation.
sources-and-citations new No canonical component Citation chips, domain, hover/source card and open result absent. src/ui/sources.zi + citation.zi. Stable source IDs, hover/focus card and activation pass.
composer-and-model-picker new TextArea/Dropdown only Auto-grow max lines, attachments, remove events, model picker, Enter send/Shift+Enter newline absent. src/ui/chat_composer.zi + model_picker.zi. Growth/scroll threshold, attachment removal, model choice and send events pass.
suggestions-response-actions-and-context-meter new No canonical component Prompt suggestions, copy/regenerate/vote/share actions and segmented context meter absent. src/ui/prompt_suggestions.zi, response_actions.zi + context_meter.zi. Each action fires once and context segments/values/labels pass.
voice-orb new No canonical component Amplitude-driven orb shape/color and idle/listening/speaking states absent. src/ui/voice_orb.zi. Amplitude samples produce deterministic animated frames and reduced-motion static state.
1 family status current_kryon_surface exact_parity_gap target_file_and_public_contract meaningful_acceptance_test
2 text extend Text, RichText, Page Heading/Paragraph No CUI last-line balancing contract; missing tabular digits, explicit 1.45 line height, nowrap+tooltip handoff, and direction analysis. src/ui/text_props.zi + text_widget.zi; extend TextProps, no wrapper. Balanced/nowrap/LTR/RTL fixtures produce exact row counts and stable geometry across two frames; ellipsis tooltip exposes full text.
3 icons extend SvgIconProps, Icon module No embedded Lucide name catalog/font roles or exact size/color token mapping. src/ui/svg_icon_props.zi + src/ui/icon.zi; CUI icon pack adapter. Render sampled Lucide names at 12/16/24 px in both modes; unknown names are inert and reported.
4 badge-avatar-and-keycap new No canonical Badge, Avatar, AvatarGroup, or Keycap. Badge tone/dot/solid/icon/size; avatar status/square/deterministic initials color; groups and overlap. src/ui/badge.zi, avatar.zi, keycap.zi. Verify all tones, image/initials/status, deterministic color, group clipping, and semantic labels.
5 card-and-metric partial Card/CardProps Metric delta/label/lower-is-better, spark values, icon, exact padding/min/max and hover/muted/selected variants are absent. src/ui/card_props.zi + src/ui/metric.zi. Card variants and positive/negative/inverted metric fixtures pass style and semantic assertions.
6 image extend Image/ImageProps Kryon already exceeds CUI input formats; CUI parity needs exact radius/tint defaults and raster bounds. src/ui/image_props.zi. PNG/JPEG golden at fit/contain/cover, rounded, tinted, missing asset and alt semantics.
7 button extend Button/ButtonProps Tooltip, shortcut hint, exact CUI variants/sizes/colors, and accessible description/tooltip behavior are absent. src/ui/button_props.zi; extend ButtonProps/ButtonResult. Pointer, Enter, Space, disabled, loading, full-width, icon-leading/trailing and tooltip assertions.
8 icon-button extend Button with icon_only/circle/square Tooltip/shortcut and CUI exact square/circle sizing/variants are absent. src/ui/button_props.zi. All sizes/variants render within exact bounds; accessible name comes from label/tooltip.
9 button-group-copy-and-hold-to-confirm new Button primitives only No group result contract, transient copy success, or hold progress/release/cancel. src/ui/button_group.zi, copy_button.zi, hold_button.zi. Space-held activation fires only at duration; early release restores; copy action emits once and shows success.
10 split-button partial Button split/menu fields + Menu/Dropdown No unified down-arrow menu ownership, menu item icons, or action/menu result split. src/ui/split_button.zi composing Button+Menu. Main and chevron have separate hit areas; Down opens menu, Escape restores focus, choice reports item ID.
11 toggle-group partial SegmentedControl single selection No exclusive=false multi-toggle, icon-only mode, or group value/result. src/ui/toggle_group.zi. Toggle independent values, exclusive clamps to one, disabled items retain values, arrows/Space activate.
12 confirm-button new Button only No armed state, timeout, outside-click disarm, Escape, or confirm result. src/ui/confirm_button.zi. First activation arms, second commits, timeout/Escape/outside click disarms without commit.
13 status-button partial Button loading state No busy/success/error labels, result lifecycle, or terminal-state styling. src/ui/button_props.zi + status_button.zi. Busy suppresses activation; success/error transitions expose one result and accessible state.
14 reactions new No canonical component Reaction groups, counts, user selection, overflow and result events are absent. src/ui/reactions.zi. Add/remove/toggle emits stable reaction IDs, count formatting and aria-pressed are exact.
15 speed-dial new Overlay/Button primitives only No placement, expanded state, outside-click/Escape close, or action result. src/ui/speed_dial.zi. Open/close animation, placement, Escape/outside close and action IDs pass pointer and keyboard tests.
16 theme-switcher-and-toggle partial SystemTheme, ThemePolicy, SetThemeMode No animated light/dark/accent switcher result or mode/accent persistence boundary. src/ui/theme.zi + system_theme.zi. Switch mode/accent; 0.32s OKLab interpolation respects reduced motion and restores custom metrics.
17 user-menu partial Menu, Button No avatar/detail/status user identity contract or compact menu placement. src/ui/user_menu.zi. Identity, status, compact mode, placement, activation and focus restoration pass.
18 swipe-actions strong SwipeRow with short/long actions Most gesture/result behavior exists; exact CUI visual states, defaults and motion need style parity. src/ui/swipe_row_props.zi. Left/right short/long thresholds, vertical-scroll rejection, release/removal and keyboard activation assertions.
19 text-field partial TextField/TextFieldState CUI label/hint/error/clearable/autofocus/search, prefix/suffix and exact undo/redo behavior are not one public surface. src/ui/text_input_props.zi + text_field_widget.zi. Type/edit/select/clipboard/undo/redo, validation and focused-field scroll reveal pass keyboard and touch replays.
20 text-area partial TextArea TextArea has rich editing state; CUI label/hint/error, Ctrl+Enter submit and exact visual rows are absent. src/ui/text_input_props.zi + text_area_widget.zi. Wrap, visual-line arrows, wheel, Enter newline, Ctrl+Enter submit, selection and scroll pass.
21 number-field partial Spinbox integer API only No float/decimal precision, formatted display, suffix, step buttons with Shift x10, or commit/cancel events. src/ui/number_field.zi replacing parallel spinbox use for this concept. Type/buttons/arrows update value within precision; invalid text restores or reports exactly by contract.
22 tag-input new TextField + chips absent No tag array ownership, max count, Enter/comma add, chip remove, Backspace-on-empty result. src/ui/tag_input.zi. Add/remove/duplicate/max-limit behavior and stable caller tag IDs pass.
23 one-time-code new No canonical OTP input No segmented code boxes, auto-advance/backspace, paste/complete result. src/ui/one_time_code.zi. Typing, pasting, backspace, change and completion emit exactly once with accessible code-group semantics.
24 password-strength new TextField secure only No strength algorithm/score/label/colour contract. src/ui/password_strength.zi. Known passwords map to exact score/label/color; secure field behavior remains canonical.
25 inline-edit new Text/TextField primitives only No display-to-edit transition, selected text, save/cancel result. src/ui/inline_edit.zi. Click/Enter edits with selection, Enter/blur saves, Escape restores old value and focus.
26 scrub-field new No canonical component Drag value editing, Shift fine step, formatting and keyboard equivalence absent. src/ui/scrub_field.zi. Pointer drag and arrows change exact values; Shift changes granularity and text remains selectable/read-only correctly.
27 money-field new TextField only No currency symbol/code, decimal/locale formatting, validation or commit semantics. src/ui/money_field.zi. Locale/currency fixtures format, clamp, parse and expose changed/committed without losing caret unexpectedly.
28 prefix-and-suffix partial TextField props No first-class prefix/suffix layout and semantic association. src/ui/text_input_props.zi. Prefix/suffix glyphs never overlap value; hit testing and accessible description are exact.
29 shortcut-recorder new KeyInput only No key-name/localized combo label or recorder capture/clear/cancel behavior. src/ui/shortcut_recorder.zi. Record modifiers+key, Backspace clear, Escape/Tab cancel; labels match platform fixtures.
30 dropzone new No widget contract No file drag/hover/drop, click-browse handoff, accept filter, compact variant or file-list result. src/ui/dropzone.zi + backend file events. Drag hover/leave, drop paths, click request, accept filter and disabled state pass with host stub.
31 avatar-upload new Avatar/Image primitives only No crop/zoom, file pick/drop, preview and commit/cancel boundary. src/ui/avatar_upload.zi. Choose/drop, preview, crop/zoom, commit and cancel preserve or reject the prior image exactly.
32 signature-pad new Canvas/pointer primitives only No stroke capture, pressure/width policy, clear/undo, point export or raster result. src/ui/signature_pad.zi. Recorded points/raster match pointer replay; undo/clear and minimum-stroke validation pass.
33 segmented-control partial SegmentedControl Icons, full-width, CUI sizes/motion and exact arrow wrap behavior are absent. src/ui/segmented_control_props.zi. Selection, wrap, disabled options, icons and style tokens pass pointer/keyboard/semantic checks.
34 checkbox-switch-and-radio partial Checkbox, Toggle, Radio Description/indeterminate and exact CUI states/motion are absent. src/ui/checkbox_props.zi, toggle_props.zi, radio_props.zi. Space toggles each control; tri-state reports indeterminate and label/description semantics.
35 slider partial Slider/DiscreteSlider Range slider, Shift x10, Home/End, value formatting/display and exact thumb/track styles are absent. src/ui/slider_props.zi. Pointer/keyboard single/range edits, clamping, step and formatting pass; vertical variant if CUI documents it.
36 chips-and-rating new No canonical Chip or Rating Icon/disabled chip remove/action and fractional/hover/keyboard rating are absent. src/ui/chip.zi + rating.zi. Chip activation/removal and rating values/arrows/reset produce exact events and aria values.
37 radio-cards new Radio primitives only Grid layout, card content, arrows and selected semantics are absent. src/ui/radio_cards.zi. Arrow navigation across columns, wrap, disabled cards and one selected stable key pass.
38 select-and-combobox partial Dropdown/ListBox Searchable combobox filtering, placeholder/icons, highlight/choose/cancel and async-owner data boundary are absent. src/ui/dropdown_props.zi + combobox.zi. Down opens and moves, typing filters, Enter chooses, Escape closes/restores focus, disabled items skipped.
39 date-picker-and-calendar new No canonical date UI No calendar grid, today, month navigation, selection/activation or locale contract. src/ui/date_picker.zi + month_calendar.zi. Locale month/day fixtures, today, navigation, selection and activation pass keyboard tests.
40 color-picker partial ColorPicker RGBA channels CUI popup presentation, exact channel/alpha controls, token output and accessible value are absent. src/ui/color_picker_props.zi. RGBA sliders produce exact values, clamping, focus order and result changed semantics.
41 multi-select new Dropdown/ListBoxMulti primitives No chips, search, max chips, list Space/Enter selection or caller-owned selection result. src/ui/multi_select.zi. Search, toggle, chips, max chip display, SelectAll-like keyboard behavior and stable IDs pass.
42 date-range-picker new No canonical component Presets, dual-month range, hover preview, minimum/narrow dates and result boundary absent. src/ui/date_range_picker.zi. Forward/back range, same-day policy, presets and keyboard navigation produce exact start/end events.
43 time-picker partial TimePicker Twelve-hour, minute step, wheel/popover behavior, clear/now and exact result timing are incomplete. src/ui/time_picker_props.zi. 12/24-hour parse/format, minute step, now/done/clear and keyboard path pass.
44 wheel-picker-and-time-dial new No canonical widget Momentum drum snapping, rows/loop, joined wheels, arrows/scroll and time dial absent. src/ui/wheel_picker.zi + time_dial.zi. Scroll momentum settles on item; arrows Home/End, loop boundary and joined hour/minute AM/PM pass.
45 ruler-and-histogram-sliders new Slider only No ruler ticks/major marks/unit formatting or histogram range handles/distribution rendering. src/ui/ruler_slider.zi + histogram_slider.zi. Tick layout, snapping, range drag and histogram bounds produce exact values.
46 knob-fader-and-level-meter new Slider only CUI drag geometry, 200-point knob traversal, Shift fine, reset, log/bipolar, ticks, meters, hold/decay absent. src/ui/knob.zi, fader.zi, level_meter.zi. Pointer/keyboard values, reset, log range and 1-8 channel peak/hold/decay fixtures pass.
47 emoji-picker new No canonical widget Unicode order/groups/search/recent/tone/preview and grid keyboard navigation absent. src/ui/emoji_picker.zi with generated data. Search, group traversal, arrows/Home/End, tone and recent selection return exact scalar/name.
48 tabs partial TabBar Variant/icon/full-width look, exact arrow behavior and animated selection are not CUI parity. src/ui/tab_bar_props.zi. Left/Right, wrap, activation, icons, overflow and focus pass; selected geometry stable across resize.
49 sidebar-navigation partial NavigationBar, Collapsible Desktop sidebar sections/groups/badges/collapse and active-item result are not a canonical CUI surface. src/ui/sidebar_navigation.zi. Section/group navigation, badges, selected key, keyboard traversal and collapse preserve scroll.
50 breadcrumb-pagination-and-stepper partial Breadcrumb; no Pagination/Stepper Breadcrumb exists; pagination pages/ellipsis, and stepper current/done/error states/results are absent. src/ui/breadcrumb_props.zi + pagination.zi + stepper.zi. Breadcrumb overflow, page change, disabled pages, step activation and status transitions pass.
51 table-of-contents new Heading/Scroll primitives only No anchor tracking, active heading, scroll sync or link result. src/ui/table_of_contents.zi. Scroll input updates active anchor; activation scrolls target and keyboard traversal is exact.
52 menu-bar new Menu primitives only No bar ownership, mnemonics, Alt/F10 mode, menu traversal or focus restore. src/ui/menu_bar.zi. Alt/F10, mnemonics, Left/Right/Down/Enter/Escape and global Alt-shortcut paths pass.
53 toolbar partial Toolbar Toolbar button label/tooltip/shortcut/toggle, separator/spacer and overflow menu behavior are incomplete. src/ui/toolbar_props.zi. Tabs through buttons, toggles state, overflow opens and shortcuts do not activate disabled actions.
54 document-tabs partial TabBar close/reorder Global Ctrl+Tab/PageDown/PageUp/Ctrl+W, close suppression, reorder and exact focus behavior are incomplete. src/ui/tab_bar_props.zi + document_tabs.zi. Select/reorder/close keyboard paths and global shortcuts report one event and preserve focus.
55 status-bar new No canonical component Status item click/tooltip/tone, progress/spacer/text variants and keyboard order absent. src/ui/status_bar.zi. Items focus/click once, progress updates, spacers layout and tooltips/semantics pass.
56 docking new PanedView only Persistent dock layout, panel open/dirty state, tab strips, drag/drop, save/load and shortcuts absent. src/ui/docking.zi. Serialize/load layout; drag/cancel, close, reorder, cycle and focus shortcuts mutate only reported state.
57 dropdown-and-context-menu partial Dropdown, ContextMenu, Menu Placement, scale/fade motion, trigger/menu keyboard continuity, labels/separators/danger/checked exactness are incomplete. src/ui/dropdown_props.zi + menu_props.zi + context_menu_widget.zi. Down opens, arrows skip disabled/labels, Enter chooses, Escape/outside closes and focus returns to trigger.
58 popover partial Popup/Overlay Placement, width/pad/gap, toggle/close ownership and focus trap/return are not a canonical CUI popover. src/ui/popover_props.zi. Toggle/open/close, placement, Escape/outside, focus restoration and layer clipping pass.
59 tooltip new No canonical tooltip Pointer/focus delay, placement, boundary fitting, truncated-text trigger and reduced motion absent. src/ui/tooltip.zi. Hover/focus shows after exact delay; near viewport edge moves; disabled triggers do not show.
60 dialog partial Modal/ActionModal Description, width, persistent/no-close variants, scrim close and focus lifecycle need exact CUI behavior. src/ui/modal_props.zi. Escape/scrim/close behavior, persistent suppression, accept/cancel focus and result pass.
61 sheet new Overlay/Modal only Side, size, description, drag/scrim close and safe-area behavior absent. src/ui/sheet.zi. Each side opens/clips correctly; Escape/scrim/drag close and focus containment pass.
62 command-palette new No canonical component Fuzzy ranking, groups, keyboard selection, global open ownership and action result absent. src/ui/command_palette.zi. Ranking fixtures, grouping, Up/Down/Enter/Escape and exact action dispatch pass.
63 hover-card new No canonical component Placement, delay, interactive content and boundary fitting absent. src/ui/hover_card.zi. Show/hide delay, pointer movement tolerance, focus path and clipping pass.
64 confirm-popover new Button/Popover primitives only Danger confirmation, focus on confirm, Escape/cancel and outside dismiss absent. src/ui/confirm_popover.zi. Enter confirms, Escape cancels, outside closes without confirm, focus returns to trigger.
65 expandable-text-and-card new No canonical component Line clamping/fade, More/Less result, badge/icon/description card expansion absent. src/ui/expandable_text.zi + expandable_card.zi. Exact clamp threshold, toggle text, focus order and height animation pass.
66 guided-tour new No canonical component Step targeting, blocking, padding, labels/count and keyboard traversal absent. src/ui/guided_tour.zi. Next/back/done/Esc sequences report steps; target geometry, scrim and focus are exact.
67 toast partial Toast Description/tone/duration/action/timer/result ownership and stacking are incomplete. src/ui/toast_props.zi. Action fires once, timer expiry closes, tone/style and multiple toast ordering pass.
68 alert new No canonical component Tone/icon/action/dismiss semantics absent. src/ui/alert.zi. Tone/style, action dispatch, dismiss and focus/semantic role pass.
69 progress-meter-spinner-and-skeleton partial Progress, LoadingIndicator Progress label/value/indeterminate, gauge/meter variants, spinner styles and skeleton shimmer are absent. src/ui/progress_props.zi + meter.zi + skeleton.zi. Indeterminate/terminal animation, aria values and reduced-motion snapshots pass.
70 empty-state new No canonical component Icon/description/action composition and semantics absent. src/ui/empty_state.zi. Layout and action activation pass; description remains accessible.
71 banner-and-countdown new No canonical component Tone/action/dismiss banner and live countdown formatting absent. src/ui/banner.zi + countdown.zi. Dismiss/action events and deterministic time fixtures with compact/hide-days pass.
72 onboarding-checklist new No canonical component Checklist title/description, stable task IDs, progress and completion state absent. src/ui/onboarding_checklist.zi. Toggle tasks, progress, completion and persistence boundary pass.
73 undo-toast partial Toast only No undo action timeout/result contract. src/ui/undo_toast.zi or ToastProps extension. Undo fires once before timeout; expiry emits dismissed without undo.
74 table package-promote DataViews TableView Plain CUI table needs richer cell composition, sort request, striped/compact/selectable style and stable row IDs. src/ui/table_view.zi promoted from data-views, one implementation. Virtualization, sort requests, selection, row/cell events and style parity pass.
75 list-and-tree package-promote DataViews TreeView + ListBox List item subtitle/trailing/avatar and tree expansion/activation/keyboard need exact CUI identity/results. src/ui/tree_view.zi + list_item.zi promoted from data-views. Visible preorder identity, expansion, arrows, activation and clipping pass.
76 accordion partial Collapsible Group open policy, animated height, exact header/body bounds and keyboard focus order are incomplete. src/ui/collapsible_props.zi + accordion.zi. Independent/single-open policy, animation and Space/arrow behavior pass.
77 timeline-and-progress-ring new Shape/Ring primitives only Timeline time/icon/tone/last and ring value/thickness/status are absent. src/ui/timeline.zi + progress_ring.zi. Ordered timeline semantics and ring sweep/reduced motion pass.
78 reorderable-list strong Reorder Drag threshold/auto-scroll/commit exists; CUI row visuals and exact keyboard/motion gaps remain. src/ui/reorder_props.zi. Drag, reorder, cancel and auto-scroll produce exact from/to IDs without duplicated commits.
79 data-grid-and-filter-bar partial-package DataViews TableView Editable cells, spreadsheet selection/cursor/anchor, column filters, checkbox column and commit/cancel are absent. src/ui/data_grid.zi promoted/extended from TableView. Range/Ctrl selection, cursor navigation, double-click/Enter edit, commit/cancel and scroll reveal pass.
80 tree-table-and-path-bar new Only TreeView/TableView concepts Tree grid navigation/selection, sorting/guides, path editing, segment menus and submitted path result absent. src/ui/tree_table.zi + path_bar.zi. Right/Left parent-child behavior, range selection, activation, path parse/submit/cancel pass.
81 file-browser-and-picker new Backend dialogs exist, not CUI widget Places, history/reload, filter, folders/hidden, save/name editing and keyboard browsing absent. src/ui/file_browser.zi + file_picker.zi with host list callback. Stub filesystem navigation, filters, selection, Enter/Backspace/history/F5 and picked path pass.
82 code-block new No canonical widget Language highlighting, title, line numbers/range highlight, scroll and header behavior absent. src/ui/code_block.zi. Token spans, wrapping/scroll, highlight lines and copy semantics if contracted pass.
83 json-viewer new No canonical widget Expand depth, key/value types, paths, selection/copy and virtual scrolling absent. src/ui/json_viewer.zi. Deep fixture expands/collapses, exposes paths and handles invalid input deterministically.
84 markdown-view new Page/RichText primitives only Streaming Markdown, links/tasks/images/headings/code and task result application absent. src/ui/markdown_view.zi. CommonMark fixture and streaming append produce same tree; link/task events stable.
85 code-editor new TextArea only Language editor, undo grouping, tabs/indent, find/go-to, auto-indent, gutter and scroll selection absent. src/ui/code_editor.zi. C-language and Python edit scripts exercise indentation, undo/redo, find, goto and clipboard.
86 diff-viewer new No canonical widget Unified/split modes, folding, context, ignore EOL and change navigation absent. src/ui/diff_viewer.zi. Known diffs produce exact hunks, folds and next/previous/expand commands.
87 property-inspector new No canonical widget Groups, bool/color/enum/float/text/vector rows, scrub fields and keyboard order absent. src/ui/property_inspector.zi. Each property type edits/clamps and reports path-keyed changes; group fold works.
88 log-console new TerminalList partial list behavior only Timestamps, levels, selection range, follow, copy, toolbar and append API absent. src/ui/log_console.zi. Append/virtualize/follow, selection, copy and keyboard navigation pass.
89 terminal new No canonical widget Colored output selection/copy, input history, interrupt, clear and caret-at-prompt absent. src/ui/terminal.zi. Write/printf fixtures, Ctrl+C with/without selection, history and prompt behavior pass.
90 hex-viewer new No canonical widget Row layout, ranges, selection/cursor, edit mode, ASCII column and copy caps absent. src/ui/hex_viewer.zi. Navigation, selection, editing and hex/ASCII copy enforce byte limits and exact cursor.
91 flame-graph new No canonical widget Stack sorting, zoom/pan, span keyboard navigation, fit and selection absent. src/ui/flame_graph.zi. Zoom around pointer, pan and exact keyboard span/parent/child/fit paths pass.
92 curve-editor new No canonical widget Keys, add/remove constraints, drag/nudge, snap, playhead and evaluation absent. src/ui/curve_editor.zi. Add/remove/nudge/snap fixtures and curve evaluation values pass.
93 gradient-editor new No canonical widget Stops, focus/nudge/delete, color picker handoff and evaluation absent. src/ui/gradient_editor.zi. Minimum two-stop rule, exact stop position/color changes and evaluation pass.
94 timeline-editor new No canonical widget Tracks, clips/keys, box selection, zoom/pan, frame snapping, playhead and mutation result absent. src/ui/timeline_editor.zi. Scripted add/select/move/trim/delete/play operations report exact frame mutations.
95 charts partial-package Plot package lines/bars/markers/axes Donut, sparkline, area/stacked/smooth, common label/legend/format/min/max and exact styling are absent. src/ui/chart/{line,bar,donut,sparkline}.zi promoted core chart surface. Golden plots plus axis/format/legend/empty-data behavior pass.
96 heatmap new No canonical widget Matrix labels, min/max/color/format and cell sizing absent. src/ui/heatmap.zi. Matrix values render exact token colors and accessible labels/summaries.
97 calendar-heatmap new No canonical widget Year layout, empty days, color/format/unit and tooltip absent. src/ui/calendar_heatmap.zi. Date range fixtures render exact active/empty cells and value formatting.
98 treemap-and-radar new No canonical widget Treemap squarify/layout and radar axes/series/legend are absent. src/ui/treemap.zi + radar_chart.zi. Known hierarchies/values produce deterministic geometry and labels.
99 funnel-split-bar-and-waffle new No canonical widget Funnel, proportional split bar and waffle cell layouts/formatting are absent. src/ui/funnel.zi, split_bar.zi, waffle.zi. Proportions, rounding remainder, legends and accessible values pass.
100 sankey new No canonical widget Node/link flow layout, labels, formatting and hit targets absent. src/ui/sankey.zi. Small balanced-flow fixture has stable geometry, conservation checks and labels.
101 bar-list-and-activity-rings new No canonical widget Ordered bar list max rows and multi-ring activity/caption/legend absent. src/ui/bar_list.zi + activity_rings.zi. Order/keep-order/max rows, ring sweeps, center/caption and values pass.
102 scatter-and-bubble new Plot package markers only Dedicated scatter/bubble axes, sizing, legends and hit testing absent. src/ui/scatter_chart.zi. Point/bubble positions and sizes match formulas; axis/legend and empty cases pass.
103 radial-gauge new No canonical widget Sweep bands/ticks/target/needle/value semantics absent. src/ui/radial_gauge.zi. Clamped sweep geometry, band/target values and accessible value pass.
104 candlestick-chart partial-package Plot CandleChart OHLC/volume/SMA/EMA Crosshair, pointer zoom/pan, keyboard zoom/fit, overlays and exact up/down tokens are absent. src/ui/candlestick.zi promoted/extended from Plot. OHLC/volume/overlays render and navigation/zoom report exact visible range.
105 kanban-board partial-package DataViews Kanban Column dot/limit/width, keyboard lift/drop/cancel and exact slot result are incomplete. src/ui/kanban.zi promoted from data-views. Drag and keyboard moves return stable card/lane/slot IDs; limits and cancellation pass.
106 week-calendar new No canonical widget Hour range, event drag/resize 15-minute snapping and read-only behavior absent. src/ui/week_calendar.zi. Drag/resize/day-move fixtures produce exact times and mutation events.
107 month-calendar new No canonical component Selected day carry-over, first weekday, locale names, today and Space/Enter/Page navigation absent. src/ui/month_calendar.zi. Month boundaries, today, carry-over and keyboard activation pass.
108 gantt-chart new No canonical widget Task/timeline layout, weekend shading, today marker, drag/resize and keyboard changes absent. src/ui/gantt.zi. Day-width layout and arrow/Shift resize/move produce exact dates.
109 node-editor new No canonical widget Nodes, pins, links, detach, marquee, zoom/pan, minimap and graph mutations absent. src/ui/node_editor.zi. Construct/detach/delete/link graph and zoom/pan/selection keyboard paths pass.
110 chat new No canonical component Message grouping/author/time/status/avatar/markdown and divider/typing behavior absent. src/ui/chat.zi. Group boundaries, status and markdown/link events pass accessibility and layout checks.
111 comments new No canonical component Thread depth/line, likes/edited/badge and reply ownership absent. src/ui/comments.zi. Depth layout and like/reply events use stable IDs; nested semantics pass.
112 presence-counter-and-ticker new No canonical component Presence overlap/spread/idle, counter formatting and ticker motion absent. src/ui/presence.zi, counter.zi, ticker.zi. Presence layout/spread and number/ticker animation reduce to exact static frames.
113 carousel partial Carousel specialized implementation General slide count/drag/flick/wheel/arrows/dots/autoplay/loop/gap API absent. src/ui/carousel_props.zi replacing specialized surface. Index transitions and gestures report one terminal index; autoplay/loop/reduced motion pass.
114 image-compare-and-card-stack new Image primitives only Divider drag/focus and finite card stack visibility/drag behavior absent. src/ui/image_compare.zi + card_stack.zi. Compare position and arrows exact; stack forward/back changes visible order deterministically.
115 image-viewer-and-cropper new Image primitives only Zoom-at-pointer, pan, fit/actual, toolbar/checkerboard and crop aspect/min-size absent. src/ui/image_viewer.zi + cropper.zi. Zoom/pan formulas, double-click, keyboard fit/actual and crop bounds pass.
116 text-effects new Text typing only Shimmer, reveal, typewriter and word rotation timing/caret behavior absent. src/ui/text_effects.zi. Time-driven fixtures produce exact intermediate/final text and honor reduced motion.
117 rolling-numbers new Text only Character roll direction/order/timing and number formatting absent. src/ui/rolling_numbers.zi. Increase/decrease fixtures animate only changed digits and end exact.
118 gradient-text-and-spotlight-cards new Text/Box gradients partial Gradient text span and pointer spotlight/beam card effects absent. src/ui/gradient_text.zi + spotlight.zi. Gradient stops and pointer-position/clipped spotlight produce deterministic pixels.
119 loaders partial LoadingIndicator CUI named loader styles, size/color and reduced-motion fallback absent. src/ui/loading_indicator.zi. Every style has first/final frame and reduced-motion static equivalent.
120 dock new No canonical component Magnification falloff, badges/running indicators, separators and keyboard activation absent. src/ui/dock.zi. Pointer sweep produces exact cosine magnification; Tab/Enter activates and badges layout.
121 control-tiles new Toggle/Grid primitives only Large tile toggle, detail, color, wide/grid sizing and Space/Enter absent. src/ui/control_tile.zi. Activation toggles once, tile fill/layout and aria-pressed pass.
122 now-playing-waveform-and-tab-bar new No canonical component Artwork, morphing play/pause, scrubber, waveform and sliding tab pill absent. src/ui/now_playing.zi, waveform.zi + tab_bar.zi extension. Playback state, scrub value, waveform bars and tab pill geometry pass.
123 reasoning-and-tool-calls new No canonical component Thinking timer/collapse shimmer, tool status/input/output and elapsed semantics absent. src/ui/reasoning.zi + tool_call.zi. State transitions expose exact elapsed/status and collapse event; content remains accessible.
124 agent-plan-and-status new No canonical component Plan rail, running shimmer, progress count and status timeline absent. src/ui/agent_plan.zi + agent_status.zi. Step/status changes update rail/progress exactly and report activation.
125 sources-and-citations new No canonical component Citation chips, domain, hover/source card and open result absent. src/ui/sources.zi + citation.zi. Stable source IDs, hover/focus card and activation pass.
126 composer-and-model-picker new TextArea/Dropdown only Auto-grow max lines, attachments, remove events, model picker, Enter send/Shift+Enter newline absent. src/ui/chat_composer.zi + model_picker.zi. Growth/scroll threshold, attachment removal, model choice and send events pass.
127 suggestions-response-actions-and-context-meter new No canonical component Prompt suggestions, copy/regenerate/vote/share actions and segmented context meter absent. src/ui/prompt_suggestions.zi, response_actions.zi + context_meter.zi. Each action fires once and context segments/values/labels pass.
128 voice-orb new No canonical component Amplitude-driven orb shape/color and idle/listening/speaking states absent. src/ui/voice_orb.zi. Amplitude samples produce deterministic animated frames and reduced-motion static state.
-132
View File
@@ -1,132 +0,0 @@
# CUI-to-Kryon Component Parity Research
This is research only. It does not change widget implementations or declare CUI as Kryon's default look. The complete family-level deliverable is the 127-row matrix in [`docs/CUI_COMPONENT_PARITY.tsv`](CUI_COMPONENT_PARITY.tsv); this file records evidence, architectural contracts, priorities and cross-cutting acceptance criteria.
## What is CUI, what is claimed, and what was measured?
### Takeaway
CUI is a compact C99 immediate-mode desktop UI library with an unusually broad documented component catalog, an MIT license, and embedded third-party assets. Its public claim of “about 170 components” does not equal the catalog's 127 documented component families or 289 distinct referenced APIs; both numbers are useful but measure different things.
### Cited Findings
- **Claimed scope and size:** CUI describes “About 170 components with spring motion and full keyboard support,” Windows/macOS/Linux from one C99 codebase, and a no-dependency core around 240 KB. — [CUI README, stable commit 3d60199](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/README.md#L12-L16)
- **Claimed binaries and performance:** the README reports `hello` around 240 KB, the full library around 930 KB, and full-screen build/layout/paint at 0.09–0.75 ms, most under 0.25 ms. — [CUI performance table](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/README.md#L315-L321)
- **Claimed platforms:** Win32, Cocoa, X11, and SDL2/GLFW for Wayland or others, with OpenGL or software rendering. Android is not listed. — [CUI platform table](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/README.md#L331-L337)
- **Claimed limitations:** no accessibility tree; optional, limited Arabic-script shaping/bidi; inline IME shows committed text but not inline composition. — [CUI stated limitations](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/README.md#L341-L345)
- **Catalog measurement:** the generated catalog at this commit contains **14 categories, 127 component families, 343 API references, 289 unique API names, 148 option groups, 811 option fields, 121 keyboard notes, 138 family scene references, 156 top-level scene entries, 240 shots and 6 unlisted entries**. This was measured from [`build/scratch/cui/catalog.json`](../build/scratch/cui/catalog.json) and the extracted [`build/scratch/cui/item-api-map.tsv`](../build/scratch/cui/item-api-map.tsv); it is not a CUI-provided component count.
- **Catalog discrepancy:** the GitHub repository description still says about 150 components, while the README and live site say about 170. No generated counter defining “component” was found; 127 is a **documented family measurement**, not a refutation of every API-level counting method. — [CUI repository metadata](https://github.com/yappologistic/CUI/tree/3d60199b253c882da982a56e7cbeae4ce7e2682a) and [component claim](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/README.md#L12-L13)
- **Canonical Kryon inventory measurement:** at Kryon commit `a139f22c5eb3c5b97994a727cfca94ab63104d79`, `Widgets/module.zi` has 100 public `using` imports, `WidgetKind` has 56 concrete kinds before the count sentinel, `src/ui` contains 275 `.zi` files, and `src/ui/modules.txt` compiles 225 modules. Many of those files are internals rather than parallel widget APIs. — [Kryon Widgets module](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/src/ui/Widgets/module.zi#L1-L140), [WidgetKind](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/src/ui/widget_kind.zi#L2-L59)
- **Working-tree caveat:** Kryon already had many unrelated modified and untracked source/test files before this research. This report adds only research documents and does not interpret those active changes as completed or canonical behavior.
### Inferences
- Kryon should use “127 documented families / 289 APIs” for exhaustive parity work, while retaining CUI's “~170 components” as a claim. A family can contain several APIs and visual variants.
- API-count parity alone would be misleading. CUI parity requires props, result events, retained state, pointer/keyboard behavior, styling, motion, accessibility and host capability contracts.
- CUI performance numbers are credible upstream benchmark claims but were **not rerun here**. They must not be presented as Kryon measurements.
### Gaps
- No authoritative CUI definition of “component” was found, so an exact reconciliation from 127 families to the claimed ~170 is impossible without choosing a counting rule.
- No CUI Android implementation exists to compare; Android work is a Kryon portability requirement, not CUI parity.
## What exact parity gaps and disjoint implementation contracts emerge?
### Takeaway
Kryon already has strong foundations for text, images, buttons, fields, basic controls, menus, modals, scroll/layout, tabs, trees/tables, reorder and swipe behavior. The dominant gaps are specialized inputs, picker surfaces, overlays, editable data grids/editors, chart breadth, planning surfaces, social/media surfaces, motion effects and AI components. The complete status, exact gap, target file/API and acceptance test for every family are in [`docs/CUI_COMPONENT_PARITY.tsv`](CUI_COMPONENT_PARITY.tsv).
### Cited Findings
- **Strong or near-existing families include:** text, image, button/icon button, split button, swipe actions, text field/area, segmented control, checkbox/toggle/radio, slider, select, color/time picker, tabs, toolbar, document tabs, dropdown/context menu, popover, dialog, toast, progress/loading, table/list/tree, accordion, reorder, Kanban, candlestick charts and carousel. Their current surfaces and missing behavior are enumerated row-by-row in the matrix. — [`docs/CUI_COMPONENT_PARITY.tsv`](CUI_COMPONENT_PARITY.tsv)
- **CUI documents each family with usage, options and keyboard behavior across the two component guides.** — [CUI components](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/docs/components.md#L1-L70) and [more components](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/docs/components-more.md#L1-L80)
- **Kryon's ownership rule requires one public widget concept and no wrappers or parallel legacy APIs**, so implementation must extend existing canonical APIs or replace them rather than add CUI facades. — [Kryon repository rules](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/AGENTS.md#L10-L49)
- **Linked package coverage:** `css` parses selectors/custom properties/layers/media/keyframes and compiles style packs; `plot` supplies retained lines/bars/markers/axes plus OHLC, volume, SMA/EMA and band charts; `data-views` supplies TableView, TreeView and Kanban with virtualization/keyboard selection and stable IDs. — [CSS README](https://github.com/kryonlabs/css/blob/6aad71c34fffec40ec903cc8f9d5c95f02572d35/README.md#L1-L14), [Plot README](https://github.com/kryonlabs/plot/blob/3f888653b6b97010163d824c4cc72476be3214f3/README.md#L1-L10), [DataViews README](https://github.com/kryonlabs/data-views/blob/942fea7809063407e2b4fa9611a2247ab6b3b894/README.md#L1-L29)
- **Package limitations:** Plot does not cover CUI's full chart set; DataViews does not implement CUI's editable data grid or tree table; neither is currently required by Kryon's manifest for every app. The matrix marks these as `package-promote` or `partial-package` rather than pretending dependency presence is parity. — [`docs/CUI_COMPONENT_PARITY.tsv`](CUI_COMPONENT_PARITY.tsv)
### Contract Rules
1. **One canonical implementation.** A row marked `extend` modifies the existing props/result/state module. A row marked `new` creates one family module under `src/ui/`. Do not add a CUI wrapper beside a Kryon widget.
2. **Standard call shape.** New family APIs use `Family(session, props) -> FamilyResult` or `Family(session, props, state) -> FamilyResult` when state must survive frame boundaries. Borrowed data stays caller-owned; results identify changed data by stable IDs/paths and never take ownership.
3. **Explicit event/state split.** Props describe input and presentation; results describe pointer/keyboard mutations; state contains only retained public state. Business actions stay in the application.
4. **No hidden host behavior.** Widget behavior/layout/styling/accessibility stays in `src/ui/**/*.zi`. Hosts only provide input, files, fonts, images, clipboard, persistence or raster surface capabilities.
5. **Independent module boundaries.** Each matrix family can be compiled and exercised independently, making a family small enough to package as a `.zx` component without dragging unrelated widget code.
6. **Replace rather than preserve legacy.** Breaking changes are allowed. Where a promoted DataViews/Plot implementation becomes canonical, retire the parallel package-facing API rather than maintaining two implementations.
### Prioritized Disjoint Task Groups
1. **Foundations and safety:** CUI token/theme pack, style continuity, component identity/state migration contract, accessibility semantic contract, and portable input/result codec.
2. **Basics/actions/inputs:** text and icon parity; badge/avatar/keycap; metric; button lifecycle variants; specialized text, numeric, tag, OTP, shortcut, file and signature inputs.
3. **Selection/pickers/navigation/overlays:** toggle groups, chips/rating/radio cards; date/range/wheel/ruler/knob/emoji pickers; sidebar, menu bar, status bar, docking; popover/tooltip/sheet/palette/hover/tour.
4. **Feedback/data:** alert/banner/checklist/undo; promote table/tree/Kanban; implement data grid, tree table/path bar, file browser and all editor/viewer surfaces.
5. **Charts/planning/social/motion/AI:** chart core plus missing chart families; calendars/Gantt/node editor; chat/media/motion; AI composition surfaces.
6. **Cross-host integration only after family behavior is nonvisual-complete:** Android, Canvas2D/DOM and desktop input/file/raster capability adapters and golden suites.
### Gaps
- Exact visual golden tolerances and glyph metrics cannot be finalized until Kryon embeds or selects the matching Inter/Geist/Geist Mono/Lucide assets. The source-derived token and font requirements below are sufficient for contract design.
- The renderer/VM strategy is intentionally outside this component report and belongs to the separate rendering/dependency audit.
## What style, platform, licensing, state and validation contract is required?
### Takeaway
A 1:1 default look needs a distinct versioned CUI-compatible semantic token pack, exact Inter/Geist typography, Lucide icons, OKLab theme interpolation, CUI radii/heights/shadows/motion, and website-chrome tokens kept separate from widget defaults. Kryon already has all three requested host families, including Canvas2D without WebGL, but live module replacement needs a new explicit public state/identity boundary.
### Cited Findings
- **License:** CUI code is MIT. — [LICENSE](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/LICENSE#L1-L3)
- **Embedded licenses:** Inter and Geist are SIL OFL 1.1, Lucide is ISC, generated Unicode 17 data is Unicode License v3, and stb helpers are public domain or MIT. — [THIRD_PARTY.md](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/THIRD_PARTY.md#L5-L13)
- **Widget theme colors:** CUI uses neutral light/dark backgrounds, surfaces, foreground/secondary/muted text, border/subtle/strong, success/warning/danger/info, accent variants, control on/glyph/track/thumb, hover/active/scrim/focus and six rotated series colors. The exact light/dark values and eight accents are in `src/cui_theme.c`. — [semantic colors](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/src/cui_theme.c#L128-L234) and [accent table](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/src/cui_theme.c#L106-L124)
- **Dimensions and type:** controls use radii 10/14/18, heights 30/36/44, text sizes 11/12/13/15 and headings 36/28/22/17. — [CUI theme scale](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/src/cui_theme.c#L236-L248)
- **Shadows and motion:** light resting/raised/floating shadows and darker variants are explicit; reduced motion zeroes the multiplier; theme changes interpolate all colors over 0.32 seconds with ease-out in OKLab. — [shadows/scales](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/src/cui_theme.c#L250-L266) and [theme transition](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/src/cui_theme.c#L268-L329)
- **Typography:** Inter Regular/Medium for body/control, Geist Medium for headings 28+, Geist Mono for code, Lucide for icons. — [CUI theming docs](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/docs/theming.md#L75-L96)
- **Website agreement:** the live site says its colors are read from the library and confirms control/item/panel/surface radii 10/8/14/18. Its light/dark CSS values match the semantic neutral palette. The site's own 14px body, 56px topbar and 264px sidebar are documentation-chrome values, not widget theme defaults. — [site token agreement](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/web/style.css#L1-L58) and [site body/chrome](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/web/style.css#L91-L123)
- **Kryon current metrics differ materially:** radii 4/12/28/999, heights 32/40/48 and font sizes 14/16/22. — [Kryon Metrics](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/src/ui/theme.zi#L257-L300)
- **Kryon style engine already has selector facts and style fields** for kind/name/class/role/tone/emphasis/size/state/validation/orientation/placement and colors, radius, borders, opacity, spacing, font, icons, gradients, material and letter spacing. It lacks the complete CUI semantic token pack, multi-layer elevation tokens, motion duration/multiplier tokens, series rotation, OKLab transition and font-role tokens as first-class installed theme state. — [selector facts](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/src/ui/style_sheet.zi#L340-L378) and [style merge fields](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/src/ui/style.zi#L47-L190)
- **Host targets:** Kryon's desktop backend is SDL2+Cairo, `raylib` web is WebGL1, and `canvas` is Canvas2D; DOM is a semantic layer over Canvas2D. Android builds use NativeActivity, Android viewport/input policy and shared raylib host. These satisfy desktop, web-without-WebGL and Android targets without making WebGL a component dependency. — [backend table](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/docs/BACKENDS.md#L62-L92) and [Android host](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/docs/BACKENDS.md#L545-L578)
- **Current retained identity:** a Kryon node survives only when parent key, widget key and widget kind match. Built-in node state is only `open`, `index`, `offset` and `focus_generation`. — [identity](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/src/ui/tree.zi#L24-L31) and [WidgetState](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/src/ui/tree.zi#L240-L247)
- **Current `.zx` player retention:** the portable player owns the window; widgets/layout/state execute in the bundle instance; bundle globals/session persist while the same instance runs. No live module-instance replacement or state migration API was found. — [zx player](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/src/backend/zx_run.zi#L1-L48) and [reusable player](https://github.com/kryonlabs/kryon/blob/a139f22c5eb3c5b97994a727cfca94ab63104d79/src/backend/bundle_player.zi#L1-L8)
### Required Style Contract
- Add a versioned **CUI-compatible style pack**, not silently replace Kryon Classic unless the owner later chooses CUI as the global default.
- Token groups: backgrounds/surfaces; foreground/text; borders; status; accents; control on/glyph/track/thumb; hover/active/scrim/focus; six series; neutral label tones; radius control/item/panel/surface/small; control heights; text and heading scales; font roles; three two-layer shadow groups; motion durations and multiplier.
- Preserve user-customized non-color metrics when switching mode/accent, matching CUI behavior.
- Implement exact OKLab interpolation or a precomputed equivalent for the 0.32-second theme transition; reduced motion snaps color state.
- Keep website chrome tokens (`14px` site body, topbar/sidebar dimensions, bezel/code palette) outside widget defaults while deriving shared semantic values from the same source.
- Package full CSS parsing as optional `kryonlabs/css`; core needs only compiled CUI token/style tables and runtime resolution so components can render without a Git CSS dependency.
- Add license manifests for any embedded Inter/Geist/Lucide/Unicode data. Prefer existing Kryon assets for Classic; use CUI-compatible assets only in the CUI pack.
### Required Portable Component / Hot-Swap Contract
1. **Stable external identity:** host/component identity is `(owner key, stable component key, public component kind)` and remains constant across implementation replacement. Internal child keys may change without losing public state.
2. **Versioned public state:** every component exposes a serializable state schema/version. Public state includes editing cursor/selection/IME, scroll, focus generation, open popup, active item, drag operation, undo stack and animation-neutral semantic state as applicable.
3. **Migration and rollback:** replacement declares accepted source versions. Successful migration commits before the first replacement frame; failure leaves the previous instance/frame state available and reports a typed error. A failed next frame cannot destroy already committed state.
4. **Private state is disposable:** implementation caches, glyph caches and transient animation phase may reset. Focus, editing value, scroll, open state, public selection and user-visible theme must not.
5. **Caller-owned data:** arrays, files, model data and business actions are borrowed by the component and remain outside the hot-swapped module.
6. **Stable result ABI:** events use stable component/function IDs and typed codecs; result enums and IDs are part of the public contract.
7. **Theme continuity:** installed semantic token generation and user customizations survive replacement.
8. **No renderer special case:** component modules emit Kryon tree/style/semantic commands; Canvas, DOM, Cairo and Android hosts render the same command stream.
### Meaningful Cross-Cutting Acceptance Tests
- **Style exactness:** compare Cairo pixmap, Canvas2D and Android-safe raster frames for every tone/accent/mode, including theme transition first/middle/last frames and reduced motion.
- **Keyboard/focus:** replay the documented CUI key sequence for each family and assert focus, consumed keys, result event and accessibility semantics.
- **State retention:** replace a component implementation between frames and assert focused field caret/selection, scroll, open menu, selected tab/item, drag state, undo state and theme survive or migrate exactly.
- **Failure rollback:** corrupt/missing replacement modules and failing migration must keep the previous committed frame and report the exact failure.
- **Portable bundles:** each family's `.zx` sample runs headless through the pixel player with no renderer-specific imports; required host capabilities are declared explicitly.
- **Host matrix:** nonvisual tree/input tests everywhere; exact raster parity on Cairo, Canvas2D and Android stub; desktop window tests only under private Xvfb/Xephyr.
- **License:** build fails if any embedded asset lacks its matching license file and generated source provenance.
### Inferences
- The safest dependency direction is: core carries a compiled CUI style pack and all canonical component behavior; full CSS remains optional; Plot/DataViews implementations should be promoted only when their family becomes canonical, then removed from the dependency path rather than duplicated.
- CUI's lack of an accessibility tree is not parity to preserve. Kryon should keep and extend its semantic/accessibility model while matching CUI's visual and keyboard behavior.
- MIT permits reference and porting, but Kryon's own 100%-Ziran rule means the implementation should be authored in Ziran rather than copying C source. Embedded assets must follow their separate licenses.
### Gaps
- Exact file-drop, Android file picker, font fallback and clipboard capability adapters need per-family host tests; CUI docs alone do not establish their behavior on Kryon Android/Canvas.
- Unicode emoji data size and whether it belongs in core or an optional generated module is a dependency decision not settled by component behavior.
- No CUI Android baseline exists, so Android acceptance must compare Kryon hosts to Kryon's own expected command/raster output, not to CUI.
-46
View File
@@ -1,46 +0,0 @@
The six overlay families are retained Ziran widgets with caller-owned state and deterministic results. `Apply` functions are pure state transitions suitable to component hosting; widget functions take a `Session`, explicit props and a caller-owned state pointer, then submit popup/modal tree nodes and paint effects. No family owns process-global UI state.
## Composition
- `Tooltip(session, props, state)` and `TooltipApply(state, props)` implement hover/focus delay, warm replay, touch/press suppression, truncation-only mode, placement fitting, flipping, clamping and ellipsis text.
- `Sheet(session, props, state)` and `SheetApply(state, props)` implement all four sides, clamped min/max size, safe-area insets, scrim/Escape/drag close, deterministic motion and focus wrap/return.
- `CommandPalette(session, props, state)` and `CommandPaletteApply(state, props)` implement fuzzy prefix/run/word scoring, stable command order, contiguous group starts, text editing, Up/Down/Enter/Escape, pointer activation and explicit owner takeover.
- `HoverCard(session, props, state)` and `HoverCardApply(state, props)` implement open delay, movement tolerance, content grace, interactive action dispatch, focus paths and placement fitting.
- `ConfirmPopover(session, props, state)` and `ConfirmPopoverApply(state, props)` implement danger styling, initial confirm focus, Enter/Space confirm, Escape/cancel, outside close and trigger focus return.
- `GuidedTour(session, props, state)` and `GuidedTourApply(state, props)` implement target geometry, padded highlight hole, four-band scrim, card fitting, count formatting, Back/Next/Done/Skip and three-focus wrap.
Each `*StateFor` constructor returns an isolated, serializable state value. Results identify nodes, geometry, interaction outcome and state change; callers supply `now_ms` and retain ownership. Empty `id`, `class_name`, key and action values follow the explicit prop values, while nonpositive geometry/delay fallbacks use the documented defaults in the matching `*_props.zi` module.
## Styles and semantics
Every family has typed `StyleData` props with installed selector facts for kind, ID, class, role, state and popup/modal/guide style kind. Caller styles merge over theme/selector values with `MergeValues`; state overrides resolve through `StyleStates`. Light and dark defaults come from `CurrentTheme`, and motion honors duration, multiplier and reduced-motion fields.
Tree nodes carry style ID/class facts plus interactive, popup, semantic kind, heading and label metadata. Paint uses the real queued raster API; no mock painter or parallel styling protocol exists.
## Verification
`tests/ziran_cui_overlays_test.sh` checks source and saved-IR bundle byte identity, runs both ZX programs, builds and executes generated C and Go from both representations, and exercises behavior, committed tree metadata, custom geometry/font/motion/style IDs and real 480×360 light/dark pixmap raster hashes without a desktop display.
The six overlay families are retained Ziran widgets with caller-owned state and deterministic results. `Apply` functions are pure state transitions suitable to component hosting; widget functions take a `Session`, explicit props and a caller-owned state pointer, then submit popup/modal tree nodes and paint effects. No family owns process-global UI state.
## Composition
- `Tooltip(session, props, state)` and `TooltipApply(state, props)` implement hover/focus delay, warm replay, touch/press suppression, truncation-only mode, placement fitting, flipping, clamping and ellipsis text.
- `Sheet(session, props, state)` and `SheetApply(state, props)` implement all four sides, clamped min/max size, safe-area insets, scrim/Escape/drag close, deterministic motion and focus wrap/return.
- `CommandPalette(session, props, state)` and `CommandPaletteApply(state, props)` implement fuzzy prefix/run/word scoring, stable command order, contiguous group starts, text editing, Up/Down/Enter/Escape, pointer activation and explicit owner takeover.
- `HoverCard(session, props, state)` and `HoverCardApply(state, props)` implement open delay, movement tolerance, content grace, interactive action dispatch, focus paths and placement fitting.
- `ConfirmPopover(session, props, state)` and `ConfirmPopoverApply(state, props)` implement danger styling, initial confirm focus, Enter/Space confirm, Escape/cancel, outside close and trigger focus return.
- `GuidedTour(session, props, state)` and `GuidedTourApply(state, props)` implement target geometry, padded highlight hole, four-band scrim, card fitting, count formatting, Back/Next/Done/Skip and three-focus wrap.
Each `*StateFor` constructor returns an isolated, serializable state value. Results identify nodes, geometry, interaction outcome and state change; callers supply `now_ms` and retain ownership. Empty `id`, `class_name`, key and action values follow the explicit prop values, while nonpositive geometry/delay fallbacks use the documented defaults in the matching `*_props.zi` module.
## Styles and semantics
Every family has typed `StyleData` props with installed selector facts for kind, ID, class, role, state and popup/modal/guide style kind. Caller styles merge over theme/selector values with `MergeValues`; state overrides resolve through `StyleStates`. Light and dark defaults come from `CurrentTheme`, and motion honors duration, multiplier and reduced-motion fields.
Tree nodes carry style ID/class facts plus interactive, popup, semantic kind, heading and label metadata. Paint uses the real queued raster API; no mock painter or parallel styling protocol exists.
## Verification
`tests/ziran_cui_overlays_test.sh` checks source and saved-IR bundle byte identity, runs both ZX programs, builds and executes generated C and Go from both representations, and exercises behavior, committed tree metadata, custom geometry/font/motion/style IDs and real 480×360 light/dark pixmap raster hashes without a desktop display.
-272
View File
@@ -1,272 +0,0 @@
# Redesign Kryon around portable Ziran components
Kryon should match CUI's default quality, then exceed it with one canonical
Ziran-authored system: a single semantic token contract, independently
replaceable `.zx` families, shared runtime/render/style services, typed state
migration, atomic rollback, Android/desktop/Canvas2D hosts, and a static website
generated from those components. The verified corpus is **127 documented CUI
families**, not an ambiguous “about 170”; the dirty-checkout assessment is
**2 strong, 5 extend, 30 partial, 84 new, 2 package-promote, and 4 partial-package**—source findings, not release or parity-test claims
([component research](CUI_COMPONENT_RESEARCH.md),
[matrix](CUI_COMPONENT_PARITY.tsv)).
Kryon already has safe whole-bundle replacement and rollback, but not retained
or migrated public state for one independently changed component. CUI's sizes
and frame timings are upstream claims only; its separate full repaint metric can
reach 19 ms. Kryon must publish only its own distributions
([runtime research](CUI_RUNTIME_RESEARCH.md),
[CUI README](https://github.com/yappologistic/CUI/blob/3d60199b253c882da982a56e7cbeae4ce7e2682a/README.md#L315-L321)).
## One canonical default removes ambiguity and legacy
There is one improved default, not a CUI theme beside retained Classic.
`src/ui/theme.zi` owns semantic color, radius, type, spacing, motion, focus, and
shadow values; customization changes those values and metrics rather than
selecting another implementation. Customization spans semantic tokens, typed
style properties, selectors/classes/IDs/states, layout and geometry, fonts,
borders, motion, and per-component rules. Website chrome consumes a generated
bridge; the CSS parser is optional as a dependency, not removed from the product
([component research](CUI_COMPONENT_RESEARCH.md),
[website research](CUI_WEBSITE_RESEARCH.md)).
Plot/DataViews families are promoted once into `src/ui/`, imported selectively,
and their package-facing duplicates leave the dependency path. There are no
parallel widget APIs, theme runtimes, wrappers, or editor stacks: `/demo`
redirects after catalog migration and its old implementation/assets are deleted.
| Decision | Rule | Primary owner |
|---|---|---|
| Default theme | One CUI-compatible semantic contract | `src/ui/theme.zi` |
| Customization | Typed style properties plus optional CSS selectors/rules | `src/ui/theme.zi`, `src/ui/style_sheet.zi`, CSS package |
| Component API | One public family concept | `src/ui/**` |
| Package promotion | Promote once, remove duplicate surface | `src/ui/**`, `ziran.toml` |
| Website examples | Generated static Ziran shots | `docs/site/**`, site scripts |
| Superseded editor | Redirect route, delete unused code/assets | `docs/site/**` |
## Fix the general runtime before scaling components
The first gate is upstream Ziran, not widget count. Ziran already supports
verified bundles, explicit foreign calls, opaque host handles, and module
composition. Standalone portable VM instances already have independent state;
the composed library/add-on path currently has one independent global-state
instance, which cannot host multiple independently replaced UI components.
Browser linked code also has one-instance and scalar-subset
constraints. Ziran needs general module identity/version metadata, typed ABI and
capability negotiation, independent instances, ownership/lifetime checks, state
export/import/migration, stale-reference rejection, transactional replacement,
partial declaration replacement, loader timing, a production wasm story, and a
dev/runtime split ([runtime research](CUI_RUNTIME_RESEARCH.md)).
### Stage A: baseline and capability audit
Kryon owns `render_dispatch.zi`, current desktop/pixmap/Canvas/Android hosts,
the snapshot/benchmark tests, and new trace fixtures. With no public API change,
it adds identical scene/pixel oracles and counters for composition,
reconciliation, layout, paint, raster, present, damage, input latency,
allocations, and memory. `build-queue -- python3 tests/backend_render_benchmark_test.py`,
then the identified snapshot/pixmap/Canvas/Android build gates, must report
p50/p95/p99 and counts while pixels match the oracle.
### Stage B: general component lifecycle
Ziran goes first in `zir_bundle.c/h`, `zir_zx_host.c/h`, `zir_zx_native.c/h`,
`zir_zx_wasm.c/h`, `std/bundle_host.zi`, and bundle/ZX/spec tests. It exposes
general identity/version, typed capability compatibility, independent instances,
state migration, stale-reference failure, and transactional replacement. No
Ziran API learns a Kryon widget name.
Only then does Kryon consume it through `tools/zx.zi`, `bundle_watch.zi`,
`widget_host.zi`, and `widget_codec.zi`. Public state versions editing/IME,
scroll, focus, open state, active item, drag, undo, and semantic animation
state; caches are disposable and data remains caller-owned. Successful migration
commits before the replacement frame; failure preserves the prior frame.
The Ziran suite must prove two concurrent independent replacements, successful
migration, rollback, ABI mismatch rejection, and stale-reference rejection. The
Kryon focused test is `python3 tests/zx_reload_test.py`, extended to two
components while an unrelated component remains live. It reports verify,
instantiate, migrate, resume, and first-frame separately.
### Stages C–E: presenters and dependency pruning
Desktop keeps the deterministic pixmap renderer and small SDL
window/event/present host. Stage C owns the pixmap/SDL/text/Cairo/desktop files
and tests; Cairo/Pango leave only after Unicode, bidi, ligatures, fallback,
clipping, caret, density, IME, damage, and presentation match privately. Run
`build-queue -- make pixmap-parity-test desktop-native-test`, then Stage A on
the same machine.
Android replaces raylib ownership with a thin NativeActivity/`ANativeWindow`
host, not a draw-call substitution. Stage D owns the Android runtime/surface/
touch/text/clipboard/file/notification modules, Android glue, and Cmake. It
preserves lifecycle, input/IME, clipboard, assets, fonts, timing, and software
presentation. Build-only tests precede a private-emulator or designated USB Moto
gate; raylib files/artifacts are removed only afterward.
Web makes Canvas2D required. Stage E owns page/canvas modules, `ziran.toml`,
renderer artifacts, and their three tests. The minimal artifact has no WebGL
symbol/reference, Node tooling, or development compiler; player, bundle, assets,
and wrapper sizes are separate. Run `build-queue -- make zx-canvas-test
renderer-artifact-test`, then browser-tier and Stage A web tests.
## Implement 127 families in serialized waves
`docs/CUI_COMPONENT_PARITY.tsv` is the issue tracker. Each row already supplies
family, status, current surface, exact gap, target file/public contract, and
acceptance test. Family workers own only those files. Shared `theme.zi`,
`style_sheet.zi`, `ziran.toml`, `src/ui/modules.txt`, codec generators, and
fixtures are serialized by the foundation owner to protect the already dirty
active tree. Selective imports are mandatory: an app that does not request a
family does not carry it.
### Component waves
| Wave | Exact initial owners | Focused command and completion definition |
|---|---|---|
| 0 | `theme.zi`, `style_sheet.zi`, then Stage B Kryon hosts/codecs | `make public-surface-check && python3 tests/cui_theme_contract_test.py`; every mode/accent/custom metric and reduced-motion tree/raster passes; replacement gate above passes |
| 1 | Extend `text_props.zi`, `text_widget.zi`, `button_props.zi`, `icon.zi`, `svg_icon_props.zi`, `image_props.zi`; add TSV basics/actions/inputs | `python3 tests/cui_basics_wave_test.py`; geometry, pointer, keyboard, loading/disabled, tooltip, formatting, and accessibility pass row by row |
| 2 | Existing selection/navigation/overlay owners plus canonical `date_picker.zi`, `month_calendar.zi`, `tooltip.zi`, and all TSV targets | `python3 tests/cui_controls_overlays_wave_test.py`; keyboard, focus, placement, boundary, delay, drag, locale, and reduced-motion contracts pass |
| 3 | Promote `table_view.zi`, `tree_view.zi`, `list_item.zi`, `kanban.zi`, `data_grid.zi` | `make public-surface-check && python3 tests/cui_data_wave_test.py`; stable IDs, virtualization, editing, selection, sorting, filtering, and accessibility pass without a package-only API |
| 4 | Create `src/ui/chart/{line,bar,donut,sparkline}.zi`, promote/extend `candlestick.zi`, then remaining chart rows | `python3 tests/cui_chart_wave_test.py`; axes, formatting, legends, empty data, hit testing, goldens, and reduced motion pass |
| 5 | Add planning/editors/media/motion/AI rows such as `chat.zi`, `markdown_view.zi`, `code_editor.zi`, `node_editor.zi`, `gantt.zi`, `timeline_editor.zi`, `text_effects.zi` | `python3 tests/cui_advanced_wave_test.py`; layout, content boundaries, keyboard, link/task/media results, virtualization, motion, and capability declarations pass |
| 6 | Only affected host adapters from Stages C–E | `make test`, then `make push-check`; host-specific behavior passes after nonvisual tree/input/state/style tests |
Every command above runs as `build-queue -- <command>`. The `cui_*` Python gates
and final performance command are proposed tests; the named `make` targets and
existing runtime tests already exist. Ziran Stage B, canonical theme/style
foundations, Stage A instrumentation, and disjoint static website metadata/shell
work can proceed in parallel. Only `.zx` hot-swap consumer integration waits on
the upstream lifecycle API; shared theme, manifest, codec, and module files stay
serialized, while family waves follow style/state contract availability.
New family APIs use `Family(session, props) -> FamilyResult`, or
`Family(session, props, state) -> FamilyResult` when public state survives frame
boundaries. Props describe input/presentation, results describe typed mutations
and actions, state is versioned and serializable, and business behavior remains
outside the component. A row marked `extend` changes its current canonical API;
a row marked `new` creates one canonical family module. No CUI facade is added.
## Measure components and complete apps separately
A component benchmark covers one independently imported family. It reports cold
load, verify/instantiate/migrate/resume, first semantic tree, first raster,
steady-state frame, memory, and replacement latency. An application benchmark
separately accounts for shared runtime, selected modules, production player,
fonts, icons, Unicode/emoji data, renderer, wrapper, assets, and application
payload. Exact CUI-compatible fonts can increase bytes; the report says so.
Comparisons must pre-register complete binaries, common scenes, fonts, viewport,
DPI, input script, hardware, OS, browser/device, toolchain, optimization flags,
run count, warmup, and every deviation. Match or exceed CUI's documented 30
warmup and 200 measured frames, preserve failures, and report p50/p95/p99,
min/max, standard deviation, allocations, peak RSS, and raw traces. Measure
input dispatch, composition, layout, paint, raster, present, end-to-end frame,
and replacement independently. Android and no-WebGL web results are Kryon
capability results because CUI documents no equivalent target.
The proposed report entry point is `build-queue -- python3
tests/cui_performance_benchmark.py --report build/scratch/cui/performance.json`.
Passing means the report exists, every accounting field is present, sample
counts or confidence are stated, and correctness oracles pass. It never means
every app is under 250 KB or that Ziran output beats C99.
## Build the website from the winning system
Primary navigation becomes Overview, Guide, Components, Showcase, Apps, and
Docs. `/widgets` remains the stable Components URL; `/components` may redirect
to it. The catalog has search, category/module counts, grid/list views, and
static light/dark images. It does not import `live-editor.js` or embed a
compiler, editable source pane, or preview iframe. `/demo` redirects after
migration and its old implementation/assets are deleted.
`scripts/gallery.py`, `examples/gallery/modules.toml`, and gallery sources
enrich every existing and new scene with category, module, honest summary,
source path, APIs, options, keyboard note, related entries, and alt text.
`scripts/build-gallery.py`, `scripts/build-site.py`, new
`examples/gallery/src/catalog-shot.zi`, and `examples/gallery/ziran.toml` render
each scene alone using `KRYON_CATALOG_SCENE`/`KRYON_CAPTURE_PATH` under private
headless/Xvfb conditions. Stable WebP/PNG outputs go under
`docs/site/assets/components/`.
`widgets.html`, `gallery.css`, `gallery.js`, and generated `gallery-data.js`
render cards and compact rows. Site JavaScript handles search, filtering, view
switching, theme selection, drawer behavior, and focus management only; it never
reimplements widget appearance, state, or behavior. `current.css` and
`current.js` consume generated tokens for a 56px topbar, 264px desktop sidebar,
880px docs measure, 76ch prose, 860px drawer breakpoint, and 640px compact
layout.
The focused commands are `build-queue -- make site` and
`build-queue -- make site-browser-test`. Done means manifest and scene counts
match, every image path and alt text resolves, search and filters work, keyboard
focus survives view changes, reduced motion is honored, the drawer closes on
navigation/scrim/Escape/resize, and no maintained page overflows at 320, 390,
768, 1024, or 1366px. The Python test also asserts that no live editor or demo
compiler path remains reachable. Cloudflare Pages deployment is owned by
`.github/workflows/pages.yml`, not GitHub Pages.
## Protect active work and report only completed gates
The Kryon and Ziran worktrees are dirty with unrelated active changes. Workers
must preserve them, avoid cleanup/revert, and report shared-file conflicts rather
than overwriting. Each coherent feature set completes focused tests, relevant
host suites, and integrated local gates before one coherent repository commit.
No source-generation-only milestone is committed. Final Kryon gates are
`build-queue -- make test` and `build-queue -- make push-check`; upstream Ziran
runs its own suite before the Kryon consumer changes.
The final report distinguishes source inspection, generation, nonvisual tests,
private visual tests, native/platform tests, local website tests, Cloudflare
deployment, and GitHub CI. It does not call matrix statuses parity-test passes,
CUI metrics Kryon measurements, or component counts total app size. These
research documents remain uncommitted because implementation has not started.
## Conclusion
The dependency order is fixed: audit current hosts, generalize Ziran component
identity/state/replacement, prove selective imports, adopt one canonical theme,
then consume the 127-row matrix in serialized waves while the website is
generated from the same components. Portable `.zx` remains primary and future
Ziran self-hosting remains a clean-language goal; C/Go output is never the
optimization deliverable. Parallel themes, package duplicates, raylib ownership,
Cairo dependence where general text can replace it, WebGL assumptions, and the
old website editor are removable obstacles. Kryon's credible advantage is a more
customizable, accessible, measurable, portable Ziran system—not another C copy.
## Execution status
Research and synthesis are verified. Active implementation sessions are
`glm-kryon-canonical-style-foundation` for canonical tokens, typed style, and
shared manifest integration; `glm-kryon-zx-component-host-integration` for
hot-ZX host integration; `glm-css-css-kryon-typed-style-parity` for typed CSS
parity; `glm-kryon-responsive-canvas-no-webgl` for the browser/Canvas runtime;
`glm-kryon-android-raylib-free-host` for the Android host; and the
`glm-kryon-cui-action-components` plus
`glm-kryon-cui-input-components` family waves, and
`glm-kryon-kryon-static-catalog-site` for the static catalog. Canonical theme, token-export
source/saved-ZX parity, retained Button raster behavior, style-cache parity,
and Android source/bundle checks have passed. A short-`TMPDIR` full `make
test` currently stops in native `tests/cursor_api_test.py` because its missing
asset request never changes the cursor; the backend input owner is diagnosing
delivery before any whole-suite rerun.
The static-site stream has generated the compact seven-page shell, retained
redirects including the former API route, and source-driven metadata for all 76
gallery scenes—64 original scenes plus the completed input and overlay waves—with
152 private-headless light/dark Ziran captures. Capture reuse is invalidated by
scene-source hashes, gallery-source hashes, capture-selection logic, and the
built gallery binary hash plus canonical exporter source/output hashes. The
current private-Chromium gate verifies files, links, redirects, canonical token
equality, metadata/source/API/options/status/alt, unique capture contents,
search/filter/details, grid/list, themes, keyboard focus, Escape, reduced
motion, and no overflow at all required widths. The only equal captures are the
inherited `Group` and `Screen` equivalence; the former local-index duplication
is gone. Subjective CUI visual comparison and full-bleed-versus-crop acceptance
remain unverified.
All 127-family parity remains incomplete. No original-Kryon redesign milestone
is complete. No commit, push, deployment,
integrated platform validation, or performance result is complete yet. Remaining
backend/component work includes portable replacement/state migration, all
component-family waves, package promotion, presenter/raylib/dependency pruning,
and meaningful platform/performance validation before coherent per-repo commits.
-513
View File
@@ -1,513 +0,0 @@
# Kryon runtime research against CUI
Date: 2026-11-08
Scope: platform/rendering architecture, dependency and size inventory, performance
boundaries, and the general Ziran work needed for small, hot-swappable `.zx`
components. Component parity and website design are separate research tasks.
This is a research report, not a benchmark result and not an implementation. No
Kryon build, browser run, desktop run, Android run, or performance test was run
for this report. Existing artifacts were only inspected for identity, size, and
freshness.
## Evidence snapshot
- Kryon worktree: `a139f22c5eb3c5b97994a727cfca94ab63104d79`, dirty with
unrelated active work. Counts and file state below are a research snapshot,
not a clean release claim.
- Ziran worktree: `acb15f2ae465a2b3b62881cf48313fab8774d854`, dirty.
- CSS package worktree: `6aad71c34fffec40ec903cc8f9d5c95f02572d35`, clean.
- Kryon snapshot inventory: 275 `src/ui/*.zi` modules, 177
`src/backend/*.zi` modules, and about 105,000 source lines in the researched
set. `src/ui/widget_kind.zi:2` defines 56 semantic widget kinds (values 0
through 55); `WidgetKindCount` is a sentinel, not a 57th widget. This is not
a component-count comparison because CUI and Kryon do not define “component”
identically.
## CUI claims, in CUI's own terms
The relevant primary sources are the
[README](https://github.com/yappologistic/CUI/blob/master/README.md#L311-L325),
[performance methodology](https://github.com/yappologistic/CUI/blob/master/docs/performance.md),
[benchmark source](https://github.com/yappologistic/CUI/blob/master/tests/bench.c),
[integration guide](https://github.com/yappologistic/CUI/blob/master/docs/integration.md),
and [rendering guide](https://github.com/yappologistic/CUI/blob/master/docs/rendering.md).
- **Components:** CUI's README advertises about 170 built-in components. The
owner's “about 160” recollection is close, but 170 is the figure to quote.
- **Codebase/dependencies:** CUI describes one C99 codebase with no required
dependencies. This report did not audit every optional platform library or
prove that the claim holds at every commit.
- **Size:** “Complete app” in the integration guide means the stripped
MinSizeRel `hello` executable, reported at about 240 KB. The complete library
build is reported at about 930 KB. These are CUI's definitions and build
configuration, not interchangeable with Kryon's current project bundles.
- **Frame timing:** CUI reports `cui_frame` build/layout/paint at 0.09–0.75 ms,
with most results below 0.25 ms. Its full software repaint is a separate
metric: 3.4–19 ms at 2480×1640 with four threads. Quoting only the sub-0.25 ms
figure as “rendering” would be dishonest.
- **Benchmark method:** CUI's documented suite uses warmup and measured frames,
randomized input, soak behavior, software rasterization loops, a shared
cloud x86-64 machine, and allocation/memory checks. Its benchmark source uses
30 warmup and 200 measured frames; any Kryon comparison must disclose all
differences rather than borrow those numbers.
- **Platform:** CUI's platform table covers Windows, macOS, and Linux desktop.
Its live web documentation uses WebGL2. No Android target and no no-WebGL web
path was found in the primary documentation. This is a platform opportunity,
not evidence that Kryon is faster or smaller.
- **Rendering model:** CUI produces a triangle draw list for one shader and has
a software reference renderer. It is a compact, explicit rendering boundary;
its numbers still cannot be transferred to Kryon's retained tree, damage, and
presenter work without running the same scenes on the same hardware.
No performance or size superiority over C99/CUI is claimed here. In particular,
there is no current evidence that Ziran-generated code is faster or smaller than
CUI. The immediate objective is a coherent, testable architecture; only the
pre-registered procedure below can support comparative claims.
## Current Kryon architecture
### Portable UI core
Kryon already keeps widget behavior, composition, layout, input routing, and
paint production in Ziran:
- `src/ui/tree.zi:113` keeps committed and submitted tree state separate.
- `src/ui/tree.zi:308` uses fixed label storage rather than per-label heap
allocation.
- `src/ui/tree_draw.zi:28` records frame input and damage.
- `src/ui/paint_queue.zi:113` owns paint pools and snapshots.
- `src/ui/paint_queue.zi:1571` retains draw data and damage information.
These are the right assets to preserve. They provide frame-boundary ownership
and bounded storage, but they are not yet a measured CUI competitor.
### Web without WebGL
A maintained Canvas2D path already exists:
- `src/backend/page_core.zi:516` selects Canvas2D contexts.
- `src/backend/canvas_frame.zi:114` retains frame damage and presentation work.
- `src/backend/canvas_raster.zi:323` can raster triangles through Canvas2D.
- `src/backend/page_texture.zi:338` has a non-WebGL texture fallback.
- `src/backend/page_mesh.zi:138` contains the only observed WebGL-oriented image
mesh path and can be made optional or removed for a Canvas2D-only gate.
This is stronger than CUI's documented live-web position because it does not
require WebGL. It is not yet evidence of better speed: Canvas2D performance and
its CPU/GPU backing depend on the browser and device.
### Desktop
The current desktop path combines:
- SDL window/events through `src/backend/Desktop/module.zi:1`,
`src/backend/desktop_runtime.zi:1`, and `src/backend/desktop_loop.zi`.
- Cairo rasterization and host text through `src/backend/cairo_raster.zi:43`.
- SDL pixel presentation through `src/backend/pixmap_sdl.zi:1`.
- The deterministic portable rasterizer in `src/backend/pixmap.zi`, including
damage clipping, row parallelism, and caller-owned buffers.
- Bundled-font raster text in `src/backend/pixmap_text.zi:6`, with fixed glyph
and edge scratch arrays at `src/backend/pixmap_text.zi:29`.
Cairo currently provides convenient host FreeType/Pango shaping. Removing Cairo
is possible only after a general text capability can preserve metrics, Unicode,
bidi, ligatures, fallback faces, clipping, and IME caret behavior. The existing
host contracts are `src/ui/font_metrics.zi:3` and `src/ui/raster_text.zi:6`.
### Android and raylib
Raylib is not merely one optional renderer on Android. It is structural:
- `ziran.toml:9` pins raylib as a source dependency.
- `ziran.toml:280` defines the raylib renderer artifact and many codec/font
outputs.
- `src/backend/android_run.zi:6` documents raylib NativeActivity owning the
window.
- `src/backend/android_surface.zi:98` reads raylib `CORE` state.
- `cmake/KryonAndroid.cmake:167` links `raylib`, Android, log, OpenSLES, EGL,
and GLESv2 and wraps lifecycle, EGL, and asset file access.
- The researched source has 156 direct raylib bindings across eight backend
files, including `src/backend/android_run.zi`,
`src/backend/android_surface.zi`, `src/backend/raylib_run.zi`,
`src/backend/raylib_runtime.zi`, `src/backend/raylib_frame_render.zi`,
`src/backend/bundle_raylib.zi`, `src/backend/audio_sink_raylib.zi`, and
`src/backend/media_audio_raylib.zi`.
Complete removal requires replacing NativeActivity/window ownership,
`ANativeWindow` presentation, lifecycle, EGL or software presentation, touch,
key, IME, clipboard, asset access, fonts, image decode, audio, notifications,
secondary windows where applicable, timing, error reporting, and tests. A
draw-call substitution is insufficient.
### Styling
CSS remains separable:
- The CSS package parses a documented closed subset and installs values into
Kryon's typed style table. It is whole-or-not-at-all at parse time.
- Compiled style packs can populate the same typed table without the parser.
- Package-owned files are under `kryonlabs/packages/css/src`; its parser,
vocabulary, migration, and sheet code should stay optional.
The smallest dependency strategy is therefore compiled style packs in the core
surface and the CSS parser as an optional package, not a runtime requirement.
### Existing `.zx` behavior
Kryon already has safe whole-app replacement:
- `tools/zx.zi:398` opens and prepares a replacement before switching.
- `src/backend/bundle_watch.zi:1` keeps immutable bundles and rejects incomplete
pointers.
- `tests/zx_reload_test.py:38` verifies immutable hashes/sequences and rejects
rollback.
- Replacement is frame-boundary atomic, but the new module instance starts with
fresh global state.
The hosted protocol is different from independently swappable components:
`src/backend/widget_host.zi:1` exposes a fixed generated widget-call surface and
`src/backend/widget_codec.zi:1` implements its bounded value codec. It does not
provide independent component identity, version negotiation, state migration, or
replacement.
## Ziran capabilities and missing general contracts
Verified current Ziran behavior in `/mnt/storage/Projects/ziranlang/ziran/docs/ZX.md`:
- Saved IR and bundle capabilities are verified. Foreign-call signatures are
explicit, and native hosts can inspect and bind required capabilities
(`docs/ZX.md:71`–`99`).
- Handles are opaque and host-owned; mutable slices are copied back only after
successful synchronous calls (`docs/ZX.md:106`–`118`).
- Bundle instances retain their own globals (`docs/ZX.md:124`).
- Partial modules can compose disjoint declarations, but composed library and
add-on code execute with one independent global-state instance
(`docs/ZX.md:173`).
- Linux/Android native execution currently uses checked generated C plus a
TinyCC cache (`docs/ZX.md:217`).
- Browser linked code and the wasm tier have important one-instance and scalar
subset restrictions (`docs/ZX.md:255`).
General upstream work required, with no Kryon widget names or UI special cases:
1. Stable module/component identity and semantic version metadata.
2. Typed capability and ABI compatibility across replacement, including record
and procedure revisions.
3. Independent instance state for multiple components, not one global state per
composed library/add-on.
4. Explicit host/component ownership rules and opaque handle lifetime checks.
5. State export, import, migration, rollback, and stale-reference prevention.
6. Pause/resume or transactional replacement at a safe program boundary.
7. Partial-module composition with declaration replacement that preserves
unrelated declarations.
8. Loader overhead instrumentation: verify, instantiate, initialize, migrate,
resume, and first-frame timings.
9. A production wasm/linking story that removes the current one-instance and
scalar-subset barriers for multi-component UIs.
10. Explicit dev-runtime/runtime split so TinyCC and compiler machinery are not
shipped with a minimal production player.
Likely Ziran owners are `zir_bundle.c/h`, `zir_zx_host.c/h`,
`zir_zx_native.c/h`, `zir_zx_wasm.c/h`, `std/bundle_host.zi`, and the existing
bundle/ZX tests under `tests/`. Exact implementation files must be selected from
a clean Ziran tree when work starts; this dirty research snapshot does not
authorize edits there.
## Existing size evidence
The following files were inspected, not rebuilt or executed. They are existing,
uncommitted outputs and are not performance evidence:
| Artifact | Raw bytes | gzip bytes | Interpretation |
|---|---:|---:|---|
| `build/bin/kryon` | 51,264 | 21,966 | Project tool only; not a complete app. |
| `build/bin/zx` | 6,103,208 | 1,797,521 | Development/player runtime; compiler machinery makes size inference invalid. |
| `build/zx-raylib/zx` | 13,477,224 | 4,539,453 | Raylib development player; not a minimal production target. |
| Canvas player wasm | 2,790,458 | 1,076,379 | Current no-WebGL-capable web baseline, not minimized. |
| Canvas player HTML | 956 | 589 | Wrapper only. |
| Project options bundle | 106,986 | 24,891 | Options payload, not whole app. |
| Hello bundle | 604,104 | 168,584 | Bundle bytes, not host/runtime size. |
At inspection, no relevant source file was newer than the latest artifacts
checked. Freshness is not correctness or optimization. A future minimal target
must report executable/wasm plus required assets and host wrapper as separate
numbers under the pre-registered size definition.
## Bottleneck inventory
These are evidence-backed structural risks, not measured hotspots:
- **Reload state:** whole-app replacement reinitializes module globals, losing
UI/application state and making component-level hot replacement impossible
without the Ziran lifecycle work.
- **Layout and tree work:** fixed storage prevents per-widget allocator churn,
but overflow and reconciliation costs at large trees remain unmeasured.
- **Paint snapshot/copy:** retained pools and damage are promising, but the
number of copied commands, snapshots, and damage rectangles needs counters and
traces before optimization.
- **Raster:** `src/backend/pixmap.zi` has deterministic integer raster,
parallel rows, and clipping. Full repaint and text-heavy damage costs need
device measurements.
- **Text:** fixed glyph caches are predictable but can thrash with many type
faces, scripts, or subpixel positions. Cairo removal must not regress shaping
correctness.
- **Web present:** Canvas2D removes the WebGL requirement, but browser command
conversion, `ImageData` uploads, compositing, and damage merging must be
measured independently.
- **Android present:** `src/backend/render_dispatch.zi:221` already overlaps
render work, but raylib owns the surrounding event/present lifecycle. That
overlap is not enough to assess input latency.
- **Dependencies:** codecs, audio, optional GPU, and the CSS parser can all be
decoupled. Font/image support and platform capability definitions are the
actual functional tradeoffs.
- **Development payload:** TinyCC/compiler-inclusive players dwarf the claimed
production app target. Production and development outputs need separate size
gates.
## Smallest coherent Ziran-first architecture
### 1. Shared portable core
Keep behavior, tree reconciliation, layout, input, accessibility, styling
contracts, and paint production in `.zi`. The output to every presenter is a
bounded retained display list plus damage and presentation metadata. Widget
behavior never moves into a browser, Android, SDL, or Cairo host.
### 2. General host capability ABI
Define one typed, non-UI-specific platform surface:
- window lifecycle and visibility;
- pointer, key, wheel, touch, text, IME, and composition events;
- font metrics, shaping, caret measurement, and glyph rasterization;
- image decode and cache lifetime;
- clipboard, files, and notifications;
- presentation timing, vsync where available, and frame pacing;
- optional audio and secondary-window capabilities.
Presenters implement only drawing/presentation. Kryon consumes capabilities as
ordinary Ziran imports; Ziran does not learn widget names.
### 3. Platform presenters
- **Web:** Canvas2D is the required path. Keep command translation and retained
damage; make WebGL mesh generation optional and exclude it from the minimal
gate. Use the deterministic pixmap renderer as a pixel oracle, and only add a
shared `ImageData` presenter if Canvas2D measurements justify it.
- **Desktop:** use the shared pixmap renderer and a small SDL window/event/present
host initially. Remove Cairo only after the general text capability reaches
parity. Direct Wayland/X11 can be a later measured decision, not a prerequisite.
- **Android:** replace raylib with a thin NativeActivity/`ANativeWindow` host.
Start with software presentation through the shared renderer; add EGL/GPU only
behind the same presenter interface if measurements require it.
SDL is therefore optional but initially useful on desktop. Raylib and Cairo are
removable. The CSS parser is optional. Codec dependencies become format-specific
capabilities rather than global requirements.
### 4. `.zx` components
After the Ziran lifecycle work, a Kryon component is a small verified module with
typed props/events, semantic identity/version, independent state, and a
frame-boundary transaction. State belongs to the component or its declared host
capability, never to a globally shared module slot. Whole-app reload remains the
fallback during migration.
### 5. Self-hosting boundary
Self-hosting Ziran/Kryon is a long-term goal, not a prerequisite for this
architecture and not a performance claim. The immediate system still uses the
Ziran compiler for development and emits verified bundles or native code for
production. A self-hosted compiler should be justified by workflow and dependency
goals after minimal runtime and reload measurements exist.
## Removable versus essential
### Essential
- `src/ui/*`: retained tree, layout, input, widget behavior, accessibility, and
style contracts.
- `src/backend/pixmap*`: deterministic software raster, density, blend, image,
and bundled text foundations.
- `src/backend/canvas_frame.zi`, `canvas_raster.zi`, and the non-WebGL portions
of `page_core.zi`/`page_texture.zi`.
- General host capability definitions and platform event/lifecycle adapters.
- Font metrics/shaping contracts and compiled style packs.
- `tools/zx.zi` and `bundle_watch.zi` for verified reload, once generalized.
### Removable or optional
- All `src/backend/*raylib*` modules, `mk/raylib-library.mk`,
`mk/zx-raylib.mk`, `cmake/KryonAndroid.cmake` raylib/EGL wrapping, and the
`renderer-raylib` artifact after Android replacement lands.
- `src/backend/cairo_raster.zi` after host text parity and desktop pixmap
presentation are proven.
- `src/backend/page_mesh.zi` and WebGL texture paths in the Canvas2D-only target.
- CSS parser package; compiled style packs remain.
- AVIF/WebP/AOM/Opus/audio/image dependencies when the corresponding optional
capability is absent.
- TinyCC/compiler-inclusive player components in production artifacts.
- Legacy compatibility wrappers, if any are found during implementation; the
owner accepts breaking changes.
## Staged implementation contracts
Each later stage depends on the earlier gate. Every build command must use the
shared build queue. Visual or window tests must use a private display and must
not touch the owner's live desktop.
### Stage A — baseline and capability audit
**Owner:** Kryon.
**Files:** `src/backend/render_dispatch.zi`, desktop/pixmap/canvas/Android host
files, `tests/host_frame_snapshot_test.*`, `tests/backend_render_benchmark_test.py`,
`tests/gpui_render_benchmark_test.py`, and new benchmark manifest/trace fixtures
under `tests/`.
**API:** no public API change. Add counters and identical scene/oracle fixtures.
**Done:** one command reports p50/p95/p99 and counts for composition, layout,
paint, raster, present, damage, input queue latency, allocation, and peak memory
on desktop headless; pixel output matches the oracle. Existing Canvas2D, pixmap,
and Android build gates still pass.
**Tests:** targeted snapshot, pixmap parity, canvas build, and Android build-only
tests through `build-queue`; no device run in this stage.
### Stage B — general Ziran component lifecycle
**Owner:** Ziran first, then Kryon.
**Ziran files:** `zir_bundle.c/h`, `zir_zx_host.c/h`, `zir_zx_native.c/h`,
`zir_zx_wasm.c/h`, `std/bundle_host.zi`, and focused additions under
`tests/bundle_*`, `tests/zx_*`, and `tests/spec/`.
**Kryon files:** only after the Ziran API lands: `tools/zx.zi`,
`src/backend/bundle_watch.zi`, `src/backend/widget_host.zi`,
`src/backend/widget_codec.zi`, and reload tests.
**API:** general module identity/version, typed capability compatibility,
independent instances, state export/import/migration, safe stale-reference
failure, and pause/resume or transactional replace. No Kryon widget special case.
**Done:** Ziran tests prove two independent replacements concurrently, state
migration success and rollback, ABI mismatch rejection, stale-reference rejection,
and browser/native constraints. Kryon whole-app reload remains unchanged until
this gate is green.
**Tests:** Ziran bundle/ZX integration suite plus a Kryon two-component reload
test that preserves unrelated component state and measures verify/instantiate/
migrate/resume/first-frame separately.
### Stage C — desktop pixmap presenter and Cairo removal
**Owner:** Kryon.
**Files:** `src/backend/pixmap.zi`, `pixmap_sdl.zi`, `pixmap_text.zi`,
`cairo_raster.zi`, `desktop_runtime.zi`, `desktop_loop.zi`, font/text contracts,
and `tests/pixmap_*`, `tests/ziran_desktop_*`, text/IME tests.
**API:** desktop consumes the shared host capability ABI; public widget APIs do
not change.
**Done:** SDL window/event/present host uses only the shared pixmap renderer;
Cairo and Pango are absent from the target link; text, clipping, IME, density,
damage, and presentation tests pass on a private display.
**Tests:** existing pixmap parity and desktop native tests, Unicode/bidi/
ligature/fallback/caret tests, frame snapshot equality where deterministic, and
Stage A benchmark on the same desktop hardware.
### Stage D — Android NativeActivity replacement and raylib removal
**Owner:** Kryon, with any generic platform capability fixed upstream in Ziran.
**Files:** `src/backend/android_run.zi`, `android_surface.zi`,
`android_touch.zi`, `android_text_editor.zi`, `android_clipboard.zi`,
`android_fopen.zi`, `android_bundle_run.zi`, relevant notification/JNI modules,
`templates/droid/src/android_glue.zi`, `cmake/KryonAndroid.cmake`, and Android
tests under `tests/`.
**API:** same host capability ABI; optional GPU presenter is not exposed as a
widget API.
**Done:** NativeActivity and `ANativeWindow` lifecycle, input/touch/IME,
clipboard, assets, fonts/images, software presentation, and timing work without
raylib. APK/link metadata no longer contains raylib or its license payload.
**Tests:** first an integrated Android build-only gate; then an explicit private
emulator or designated USB Moto device gate covering cold start, pause/resume,
rotation, touch, IME, clipboard, damage, frame pacing, and Stage A metrics.
Only after those pass remove all raylib files/artifacts and run the full gate.
### Stage E — Canvas2D-only web and dependency pruning
**Owner:** Kryon, plus upstream Ziran wasm work where needed.
**Files:** `src/backend/page_core.zi`, `page_mesh.zi`, `page_texture.zi`,
`canvas_frame.zi`, `canvas_raster.zi`, `ziran.toml`, CMake renderer artifact
files, and `tests/zx_canvas_test.py`, `tests/renderer_artifact_test.py`,
`tests/renderer_web_probe.zi`.
**API:** Canvas2D is the supported baseline; WebGL remains optional at most.
**Done:** minimal web artifact contains no WebGL API/symbol/reference, no Node
tooling, and no dev compiler; Canvas2D damage and deterministic oracle tests
pass. Production player, project bundle, assets, and wrapper are reported as
separate sizes.
**Tests:** artifact inspection, Canvas2D behavior in the existing non-live-desktop
harness, wasm/browser tier tests from Ziran, and Stage A web benchmark on the
chosen browser/device. Finally prune unused codecs/audio/legacy exports and rerun
desktop, Android, and web gates.
## Apples-to-apples benchmark procedure
No comparative number may be published until this procedure is pre-registered
and run.
1. **Define binaries exactly.** Compare complete runnable applications, not a
library archive with a bundle or a development player. For each target report
executable/wasm, required wrapper/JS, required assets/fonts, compressed
transfer, installed APK size, and strip/LTO/optimization flags.
2. **Match features and scenes.** Use only a common primitive scene set that both
systems can express identically: fixed viewport/DPI, identical fonts and
Unicode text, colors, images, widget geometry, scroll/input scripts, and frame
count. Any unsupported feature removes that scene from both sides, not just
the slower side. Separately report a full Kryon stress scene as Kryon-only.
3. **Use identical hardware and environment.** Name computer model, OS/kernel,
CPU/governor, memory, power state, browser version, Android device/API level,
thermal state, battery/power connection, viewport scale, and background load.
Never mix CUI's cloud x86-64 result with a local phone result.
4. **Use a pre-registered order.** Match or exceed CUI's 30 warmup and 200
measured frames, randomize input order deterministically, repeat enough runs
for variance, discard no failures silently, and save raw traces.
5. **Measure boundaries separately:** app input timestamp to event dispatch;
composition/reconciliation; layout; paint/display-list production; raster;
present/composite; end-to-end frame; reload verify/instantiate/migrate/
resume/first-frame. Never compare CUI's frame-only metric with Kryon raster
or present time.
6. **Report distributions:** p50, p95, p99, min/max, standard deviation, failures,
allocations, peak RSS, cache misses where available, CPU energy only if the
device counter is trustworthy. Averages alone are insufficient.
7. **Check correctness under load.** Use deterministic pixel oracles, input-state
oracles, soak tests, randomized input, rotation/configuration changes on
Android, and reload rollback. Performance of wrong pixels is invalid.
8. **Run each platform on that platform.** Desktop C/CUI versus Kryon on desktop;
browser Canvas2D Kryon on the selected browser/device; Android Kryon on a named
device. CUI has no documented Android/no-WebGL target, so those are Kryon
capability results rather than cross-system wins.
9. **Publish limitations.** State compiler/toolchain versions, feature subset,
unsupported scenes, and every deviation from CUI's published methodology.
## Current uncertainty
- No fresh performance benchmark was run; all existing timings are CUI's, not
Kryon's.
- No fresh build was run; artifact freshness does not prove current-source
correctness.
- The dirty Kryon/Ziran worktrees may change host tests and desktop behavior
before implementation.
- CUI's dependency and performance claims were verified against its primary
docs/source, not rebuilt in this environment.
- Android IME, clipboard, notification, audio, image, and multi-window scope
needs a product decision before exact raylib replacement size can be predicted.
- Canvas2D browser backing and phone thermal behavior are unknown until tested
on named devices.
- General component state migration semantics need an upstream Ziran design;
no current API should be assumed stable.
- The long-term self-hosting path is intentionally separate from the minimal
runtime plan and has no size/performance evidence yet.
## Recommendation
Do not port CUI's renderer into Kryon and do not add UI-specific loader rules to
Ziran. Preserve Kryon's retained tree, bounded paint pools, damage model, and
deterministic pixmap renderer; make Canvas2D the required web presenter; keep SDL
only as the initial desktop shell; replace raylib's Android ownership with a thin
NativeActivity host; make Cairo and the CSS parser removable; and first fix the
general Ziran module-instance/version/state lifecycle. Establish the benchmark
and pixel oracle before changing hot paths. Only that sequence can credibly aim
to exceed CUI on Android, no-WebGL web, desktop responsiveness, and hot-swappable
Ziran components without making unsupported C-versus-Ziran claims.
-673
View File
@@ -1,673 +0,0 @@
# Kryon website CUI parity research
Status: research and redesign specification only. No implementation, local build,
commit, push, release, or deployment was performed.
## Scope and conclusions
The owner's goal is a Kryonlabs website at least as good as
[CUI](https://yappologistic.github.io/CUI/), with CUI-like default component
appearance, then stronger customization and coverage. The owner explicitly does
not require the website's component catalog to include a live-preview editor.
The true website owner is this repository, `kryonlabs/kryon`, not
`kryonlabs/github`. The maintained website source is `docs/site/`; its build
inputs include the gallery sources and site scripts. The Cloudflare Pages
deployment defined by `.github/workflows/pages.yml` publishes the prepared
`docs/site` tree for project `kryon` from `master` under `kryonlabs.com`; this
is not a GitHub Pages deployment.
CUI looks stronger for six concrete reasons:
1. Its overview immediately proves the component system with visual examples.
2. Its documentation is dense but readable: a small UI type scale, a separate
long-form reading scale, narrow prose measure, and compact section spacing.
3. Its surfaces are disciplined: neutral light and dark palettes, hairline
borders, restrained radius and control scales, and shadows only on floating
layers.
4. Its catalog is an information system, not a demo list: category counts,
search, honest summaries, APIs, options, scenes, guides, and showcases.
5. Its navigation stays persistent and predictable while fitting both desktop
documentation and mobile drawer patterns.
6. Its component presentation is generated by the actual system, so the page is
product proof rather than CSS mockups.
Kryon's present site is an accessible warm editorial brochure, but not a compact
product documentation system. It uses oversized display type, a taller header,
wider gutters, decorative card shadows, generic gallery notes, and a one-at-a-
time live editor. Those choices make the product feel less systematic and less
component-rich than CUI.
## Primary evidence
### CUI
- Live site: <https://yappologistic.github.io/CUI/>
- Primary repository: <https://github.com/yappologistic/CUI>
- Source branch: `master`
- Relevant primary files:
- `web/site/index.html`
- `web/site/style.css`
- `web/site/responsive.css`
- `web/site/js/app.js`
- `web/site/js/responsive.js`
- `docs/design.md`
- `docs/theming.md`
- `docs/components.md`
The catalog data parsed from CUI's `catalog.js` contains:
- 14 categories.
- 127 documented component entries.
- 127 entries with documentation, API, and scene fields.
- 111 entries with options.
- 12 showcases.
- 9 guides.
Guide coverage and section counts:
| Guide | Sections |
|---|---:|
| Getting started | 9 |
| Layout | 12 |
| Theming | 6 |
| Icons | 3 |
| Custom components | 6 |
| Integration | 7 |
| Rendering | 3 |
| Performance and memory | 3 |
| Design principles | 9 |
Category counts:
| Category | Entries |
|---|---:|
| Basics | 5 |
| Actions | 12 |
| Inputs | 14 |
| Selection | 5 |
| Pickers | 10 |
| Navigation | 9 |
| Overlays | 10 |
| Feedback | 7 |
| Data display | 21 |
| Charts | 10 |
| Planning | 5 |
| Conversation/media | 6 |
| Motion | 7 |
| AI interfaces | 6 |
CUI's overview is persuasive because it leads with component proof and concrete
claims: approximately 160 components, approximately 250 KB, under 0.25 ms per
frame, Windows/macOS/Linux support, and zero dependencies. It then presents a
short learning path, theming proof, design principles, and states that previews
are drawn by CUI itself. Kryon must only publish equivalent metrics after a
reproducible local benchmark exists.
### Kryon
Canonical repository and branch:
```text
/mnt/storage/Projects/kryonlabs/kryon
git@github.com:kryonlabs/kryon.git
master
```
Relevant website surfaces:
- `docs/site/index.html`
- `docs/site/apps.html`
- `docs/site/modules.html`
- `docs/site/widgets.html`
- `docs/site/docs.html`
- `docs/site/getting-started.html`
- `docs/site/renderers.html`
- `docs/site/demo.html`
- `docs/site/current.css`
- `docs/site/current.js`
- `docs/site/gallery.css`
- `docs/site/gallery.js`
- `docs/site/gallery-data.js`
- `scripts/site-metadata.py`
- `scripts/build-site.py`
- `scripts/gallery.py`
- `scripts/build-gallery.py`
- `examples/gallery/modules.toml`
- `examples/gallery/src/desktop.zi`
- `tests/site_browser_test.py`
- `.github/workflows/pages.yml`
Ownership evidence:
- `.github/workflows/pages.yml` is triggered by `docs/site/**`, gallery
sources, Kryon source, manifests, site scripts, and site tests.
- `scripts/build-site.py` invokes site metadata generation, the site demo build,
the demo preview build, and gallery generation.
- The Pages workflow deploys the prepared `docs/site` tree.
- Canonical site URLs throughout the source use `https://kryonlabs.com/...`.
Maintained routes:
- `/`
- `/apps`
- `/modules`
- `/widgets`
- `/docs`
- `/getting-started`
- `/renderers`
- `/demo`
Superseded routes include `/showcase`, `/live-examples`, `/api`, `/matrices`,
`/language`, and eventually `/demo`. They may redirect, but the owner does not
require parallel legacy implementations.
Current gallery generation has 64 scenes: 55 Kryon entries, 6 Plot entries, and
3 DataViews entries. Most current notes are generic. The current page lacks
CUI-level summaries, API names, options, keyboard behavior, related entries,
and searchable card metadata. `docs/site/gallery.js` imports the live editor;
the homepage embeds the mini demo. This directly conflicts with the owner's
preference for a component catalog without live preview.
Existing static/private-capture foundations:
- `scripts/gallery.py` already generates `gallery-data.js`, staged `.zi`
sources, and the catalog registry.
- `examples/README.md` documents `KRYON_CATALOG_SCENE` and
`KRYON_CAPTURE_PATH`.
- `examples/gallery/src/desktop.zi` can render a selected scene and capture it.
- `docs/site/assets/previews/README.md` documents real private Xvfb/headless
Chromium captures and states that they are real implementations.
- `tests/site_browser_test.py` is a Python private headless site test covering
maintained pages, links, images, metadata, themes, focus, and 320–1366px
layouts.
## CUI design language
### Typography
| Context | Font | Size and line height |
|---|---|---|
| Site UI/body | Inter 400 | 14px / 1.55 |
| Long-form docs | Documentation body | 16px / 1.75 |
| Prose measure | Long-form text | 76ch maximum |
| General heading 1 | Geist 500 | 32px |
| General heading 2 | Geist 500 | 22px |
| General heading 3 | Geist 500 | 15px |
| Home heading 1 | Geist 500 | 56px |
Kryon should use the CUI scale for the product site even if long-form guides use
the larger reading scale. Manrope/Newsreader may remain as brand accents, but
not at the current brochure scale.
### Layout and density
| Element | CUI value |
|---|---:|
| Topbar | 56px |
| Persistent sidebar | 264px |
| Standard docs maximum width | 880px |
| Docs horizontal padding | 32–48px |
| Bottom page padding | 112px |
| Component grid | `repeat(auto-fill, minmax(230px, 1fr))` |
| Component grid gap | 14px |
| Card body padding | 12/14/14px |
| Card title | 14px |
| Card summary | 12.5px, two-line clamp |
| Compact row padding | 9/8px |
| Compact row text | 13–13.5px |
Card thumbnails are 16:9. Resting cards use hairline borders, radius 18, and no
shadow. Compact list rows omit thumbnails and expose title, summary, and API
columns.
Spacing follows a four-point grid:
- 4px micro steps.
- 16px inside a group.
- 24px between related regions.
- 32–48px between major sections.
### Radius and controls
Radius scale:
| Surface | Radius |
|---|---:|
| Marks | 6px |
| Rows/items | 8px |
| Controls | 10px |
| Panels | 14px |
| Surfaces/dialogs | 18px |
Control heights:
- Small: 30px.
- Medium: 36px.
- Large: 44px.
These website densities must not be independent CSS: they need a shared semantic
token contract with the actual Kryon widget theme. `src/ui/theme.zi` currently
uses materially different values, including 4/12/28px radii and 32/40/48px
controls.
### Color
Light:
| Token | Value |
|---|---|
| `base/bg/surface` | `#ffffff` |
| `surface-muted` | `#f8f8f8` |
| `surface-sunk/bezel` | `#f3f3f3` |
| `foreground` | `#0b0b0b` |
| `secondary` | `#585858` |
| `muted` | `#767676` |
| `border` | `#e3e3e3` |
| `subtle-border` | `#f0f0f0` |
| `strong-border` | `#949494` |
| `focus` | `#1f7dcfe6` |
| `success` | `#00774d` |
| `warning` | `#9f6202` |
| `danger` | `#c9302d` |
Dark:
| Token | Value |
|---|---|
| `base/bg` | `#121212` |
| `surface` | `#181818` |
| `surface-muted` | `#1f1f1f` |
| `surface-sunk` | `#0e0e0e` |
| `foreground` | `#f2f2f2` |
| `secondary` | `#b4b4b4` |
| `muted` | `#8c8c8c` |
| `border` | `#2b2b2b` |
| `subtle-border` | `#222222` |
| `strong-border` | `#676767` |
| `focus` | `#55adffe6` |
CUI accent pairs:
| Accent | Light | Dark |
|---|---|---|
| Neutral | `#353535` | `#bebebe` |
| Violet | `#7747ff` | `#a78bff` |
| Blue | `#0562ef` | `#6ba3ff` |
| Green | `#00864b` | `#53dca6` |
| Amber | `#f3ad20` | `#ffcb62` |
| Orange | `#c25300` | `#ffad5e` |
| Coral | `#d1403a` | `#ff9386` |
| Rose | `#d23286` | `#ff8bc5` |
Primary CUI site actions are neutral rather than colorful. Kryon should retain
one intentional green accent, preferably the CUI-compatible green pair above,
while making neutral text, borders, and surfaces carry the interface.
Resting cards must use borders, not shadows. Only menus, popovers, dialogs,
toasts, and other floating layers cast shadows.
### Motion
| Purpose | Duration |
|---|---:|
| Highlight | 100ms |
| Hover | 140ms |
| State | 180ms |
| Enter | 260ms |
| Exit | 160ms |
Easing: `cubic-bezier(0.22, 1, 0.36, 1)`.
`prefers-reduced-motion: reduce` must disable drawer/scrim and decorative
movement.
### Responsive behavior
At widths below 860px:
- Sidebar becomes a drawer.
- Drawer width is `min(300px, 86vw)`.
- It closes on navigation, scrim press, Escape, or resizing back above 860px.
- Scrim and drawer animation are removed under reduced motion.
At widths below 640px:
- Page margins are 16–20px.
- Stage padding is reduced.
- Filter chips scroll horizontally without creating page overflow.
- Option-table rows stack.
- Component cards remain full-width with 16:9 thumbnails.
No maintained route may have horizontal overflow from 320 through 1366px.
## Kryon redesign specification
### Information architecture
Primary navigation:
1. Overview: `/`
2. Guide: `/getting-started`
3. Components: `/widgets`
4. Showcase: `/showcase`
5. Apps: `/apps`
6. Docs: `/docs`
This is the smallest stable-URL route. Add `components.html` only as an alias
or redirect to `widgets.html`; do not fork duplicate content. Redirect `/demo`
to the component catalog after migration and remove the superseded live-editor
implementation and assets once no maintained route references them.
Guide sections:
1. Getting started.
2. Layout and composition.
3. Theming and customization.
4. Component/API patterns.
5. Platform integration and renderers.
6. Design principles.
7. Performance and status.
Existing `/modules` and `/renderers` should remain reachable from Docs rather
than competing as primary navigation. Superseded URLs may redirect, but no
parallel legacy page or editor should remain merely to preserve an old route.
### Homepage anatomy
1. Compact product header, not an oversized editorial hero.
2. Above the fold: a neutral panel containing several real static component
thumbnails, proving breadth immediately.
3. Fact strip with only reproducible Kryon facts: component count, supported
platforms, renderer families, dependency policy, and package/runtime size if
measured. Do not copy CUI performance claims.
4. Six-step learning path matching the primary guide sections.
5. Theme/customization proof using real generated light/dark component images.
6. Compact module coverage summary for Kryon UI, Plot, and DataViews.
7. Design principles and integration preview.
No homepage live editor or compiler iframe.
### Components page anatomy
Top:
- Title and one-sentence purpose.
- Text search.
- Category/module chips with counts.
- Grid/list toggle.
- Light/dark preview toggle where both assets exist.
Grid card:
- 16:9 generated component image.
- Component title.
- Module badge.
- Category badge.
- Two-line honest summary.
- API names when available.
- Source link.
- Keyboard note when meaningful.
Compact row:
- No thumbnail.
- Title and summary.
- Module/category.
- APIs/options.
- Source and detail actions.
Detail presentation:
- Larger light/dark generated images, initially on the same page rather than
creating per-component routes.
- Source and source module.
- Purpose and composition notes.
- Public API names.
- Options and defaults.
- Keyboard and accessibility behavior.
- Related components.
- No parallel interactive editor route.
The catalog must not import `live-editor.js` or embed a compiler/preview iframe.
### Better-than-CUI customization page
Use real generated Ziran scenes, not CSS mockups, to demonstrate:
- Light/dark base themes.
- One intentional accent and semantic status colors.
- Radius scale changes.
- Compact/normal/dense layouts.
- Font family and scale changes.
- Border and focus-ring overrides.
- Component-specific token overrides.
- State preservation examples once hot-swappable `.zx` component contracts are
implemented.
Theme documentation should expose one semantic token table and show the same
token names in website and widget source. Avoid presenting arbitrary CSS as if
the native widget system supports it.
### Static demo strategy
Preferred architecture:
1. Gallery sources remain the canonical component presentation definitions.
2. A Ziran catalog-shot host renders a selected scene without catalog chrome.
3. Private Xvfb/headless captures emit deterministic WebP or PNG images for
each entry and requested theme.
4. Images are written under `docs/site/assets/components/`.
5. `gallery-data.js` records image paths, summaries, APIs, options, keyboard
behavior, module, category, source path, and alt text.
6. `docs/site/gallery.js` renders static cards from that manifest.
Captures must use a private display, scrub inherited display/auth/session
variables, and touch only their own processes. The owner did not request visible
desktop capture or mouse control.
## Smallest implementation architecture
The work should remain source-driven in this repository and avoid a new client
framework or Node dependency.
### Contract 1: enrich component metadata
Owning files:
- `scripts/gallery.py`
- `examples/gallery/modules.toml`
- `examples/gallery/src/**`
- `docs/site/gallery-data.js` (generated)
Requirements:
- Preserve every current gallery scene.
- Add category, module, summary, API, options, keyboard note, source path,
related entries, and alt text to the manifest.
- Keep generated output reproducible and stable.
- Make every metadata field optional at first, but require summary and image.
Acceptance:
- Generated manifest count matches scene count.
- Every entry has category, module, nonempty summary, source path, alt text,
and at least one image.
- No generated source path or image is missing from the output tree.
### Contract 2: generate static component shots
Owning files:
- `scripts/gallery.py`
- `scripts/build-gallery.py`
- `scripts/build-site.py`
- `examples/gallery/src/catalog-shot.zi` (new)
- `examples/gallery/src/desktop.zi`
- `examples/gallery/ziran.toml`
- `docs/site/assets/components/**` (generated)
Requirements:
- Create a Ziran scene host dedicated to catalog shots.
- Select scene and theme through the existing private capture mechanism.
- Emit at least light images for every entry; add dark images when a scene is
theme-aware.
- Prefer stable filenames based on module and scene identity rather than hashes.
- Keep generated assets ignored if the Pages workflow regenerates them, or
committed only if the current site deployment requires checked-in assets.
Acceptance:
- Every manifest image exists.
- Every output image is referenced exactly once by the manifest.
- Generated manifest paths resolve on the local static site.
- Capture runs only under private Xvfb/headless conditions.
- Existing public live demo assets are not required by the catalog page.
### Contract 3: redesign global shell and tokens
Owning files:
- `docs/site/current.css`
- `docs/site/current.js`
- all maintained HTML pages
Requirements:
- Consume a generated CSS custom-property bridge from one canonical Ziran token
contract; do not hand-maintain a second website-only token definition.
- Implement CUI typography, spacing, radius, control heights, border, focus,
motion, and shadow rules.
- Reduce topbar to 56px and persistent desktop sidebar to 264px.
- Cap docs prose at 76ch and normal content at 880px.
- Use 860px as mobile navigation breakpoint and 640px as compact-content
breakpoint.
- Preserve the current accessibility contrast or improve it.
Acceptance:
- Every maintained page consumes the generated bridge from the canonical Ziran
contract.
- No page-specific duplicate color/type system remains.
- Keyboard focus remains visible in both themes.
- Reduced-motion test disables drawer/scrim and decorative animation.
### Contract 4: build the static component catalog
Owning files:
- `docs/site/widgets.html`
- `docs/site/gallery.css`
- `docs/site/gallery.js`
- `docs/site/gallery-data.js` (generated)
Requirements:
- Replace one-at-a-time live preview with searchable card/list catalog.
- Render category/module counts.
- Implement text search, grid/list toggle, and theme asset toggle.
- Keep filters as horizontal scroll chips under 640px.
- Provide no compiler, editable source pane, or preview iframe.
- Link every entry to its staged source.
- Implement page search, filtering, and view switching in site-shell code only;
component appearance and product behavior remain generated from Ziran scenes.
Acceptance:
- `widgets.html` does not import `live-editor.js`.
- Every component image has descriptive alt text.
- Search and filters match title, summary, category, module, API, and options.
- Grid/list switch preserves current filters and focus.
- Cards and rows are fully keyboard reachable.
### Contract 5: rewrite maintained pages
Owning files:
- `docs/site/index.html`
- `docs/site/apps.html`
- `docs/site/modules.html`
- `docs/site/docs.html`
- `docs/site/getting-started.html`
- `docs/site/renderers.html`
- `docs/site/showcase.html`
- `docs/site/current.js`
Requirements:
- Apply the primary navigation and guide structure.
- Replace brochure hero with compact product proof.
- Remove homepage live-demo promotion.
- Redirect superseded editor routes and remove `demo.html`, `live-editor.js`,
demo compiler assets, and related build outputs after references are migrated.
- Keep Apps, Modules, Showcase, Docs, and Renderers content rather than
deleting useful material.
- Ensure superseded URLs redirect without retaining parallel implementations.
Acceptance:
- Primary navigation is identical on every maintained page.
- No maintained page promotes live preview as the main path.
- All maintained links and redirects pass the Python site test.
- Page metadata remains unique and valid.
### Contract 6: private headless validation
Owning files:
- `tests/site_browser_test.py`
- `scripts/build-site.py`
- `.github/workflows/pages.yml`
Requirements:
- Extend the existing Python private headless browser test instead of adding
Node/npm/npx.
- Validate catalog metadata and assets.
- Validate links, metadata, focus, theme switching, filters, grid/list, mobile
drawer, Escape/scrim behavior, reduced motion, and no horizontal overflow.
- Assert no live-editor import, demo compiler asset, or superseded editor route
remains reachable from maintained pages.
- Keep capture helpers outside the browser test unless an explicit integration
test is added.
Acceptance:
- Gallery generation succeeds.
- Site build succeeds.
- Every gallery entry has complete manifest data and assets.
- Components page contains no live-editor import or compiler iframe.
- Maintained pages pass link/metadata/theme/focus checks.
- Layouts pass 320, 390, 768, 1024, and 1366px checks without overflow.
- Drawer closes on navigation, scrim, Escape, and crossing back above 860px.
- Reduced motion removes decorative animation.
## Shared theme requirements for component/runtime work
The website redesign cannot be completed as isolated CSS. The parent's
component and renderer work should treat these as shared requirements:
- Actual widget defaults and website demos must consume one canonical Ziran
semantic token contract; generated CSS custom properties are a bridge, not a
second source of truth.
- Adopt CUI-compatible neutral light/dark surfaces.
- Use one intentional Kryon accent.
- Ensure control edges meet non-text contrast requirements.
- Move toward radius 6/8/10/14/18 and control heights 30/36/44.
- Use a four-point spacing grid.
- Preserve accessible focus and reduced-motion behavior.
- Keep component presentations small, portable `.zx` definitions so a future
hot-swap path and static catalog can use the same source.
- Do not hardcode a separate website-only component appearance or move widget
behavior into handwritten website JavaScript.
These requirements do not themselves define renderer internals, component APIs,
or hot-swap implementation; those remain with the sibling research tasks.
## Verification status
This document records research only. No files were built, no tests were run, no
deployment was checked, and no repository state was cleaned or reverted.
Implementation acceptance checks above are the local requirements for the later
implementation task.
+3 -5
View File
@@ -21,7 +21,7 @@ li{margin:.25rem 0}
<h2>Library packages</h2>
<table>
<tr><th>Package</th><th>Ziran source</th><th>Native code generation</th><th>Package verification</th></tr>
<tr><td class="">Core UI (<code>src/ui</code>)</td><td class="ok">✅ <code>.zi</code> modules listed in <code>modules.txt</code> and two public import modules</td><td class="ok">✅ C and Go generation in <code>make</code></td><td class="ok">✅ <code>make test</code> builds the library and runs source, saved <code>.zir</code>, and <code>.zx</code> behavior tests</td></tr>
<tr><td class="">Core UI (<code>src/ui</code>)</td><td class="ok">✅ <code>.zi</code> modules listed in <code>modules.txt</code> and named package exports</td><td class="ok">✅ C and Go generation in <code>make</code></td><td class="ok">✅ <code>make test</code> builds the library and runs source, saved <code>.zir</code>, and <code>.zx</code> behavior tests</td></tr>
</table>
<p>The generated C archive is a build output of Ziran source. Behavior tests use Ziran hosts in <code>tests/*_host.zi</code>. Code generation verifies that a module lowers for a target; it does not prove that every native host runs on that target.</p>
<h2>Application hosts</h2>
@@ -29,10 +29,8 @@ li{margin:.25rem 0}
<tr><th>Backend</th><th>Implementation</th><th>Input and presentation verification</th><th>Current status</th></tr>
<tr><td class="">Terminal</td><td class=""><code>src/backend/terminal_run.zi</code></td><td class="">Private PTY project test covers ASCII, UTF-8, invalid input, and escape sequences</td><td class="ok">✅ supported</td></tr>
<tr><td class="">Desktop</td><td class=""><code>src/backend/desktop_run.zi</code></td><td class="">Private Xvfb project test covers image capture, keyboard, UTF-8 text, and wheel input</td><td class="ok">✅ supported on the tested Linux host</td></tr>
<tr><td class="">Raylib</td><td class=""><code>src/backend/raylib_run.zi</code></td><td class="">Private Xvfb project test covers image capture and input</td><td class="ok">✅ supported on the tested Linux host</td></tr>
<tr><td class="">Web Canvas</td><td class=""><code>src/backend/canvas_run.zi</code></td><td class="">Headless Chromium checks Canvas2D pixels, clips, input, textures, fonts, lifecycle, WebAudio, and file behavior</td><td class="ok">✅ supported through Emscripten on the tested browser</td></tr>
<tr><td class="">Web DOM</td><td class=""><code>src/backend/dom_run.zi</code></td><td class="">Headless Chromium checks incremental updates, native Unicode editing, reorder focus, CSS styles, responsive sizing and browser accessibility</td><td class="part">🧪 hybrid host with opt-in native CSS layout for document widgets</td></tr>
<tr><td class="">Android</td><td class="">app <code>src/main.zi</code> + <code>src/backend/android_run.zi</code></td><td class=""><code>tests/ziran_android_device_test.sh</code> checks the device text, lifecycle, and inset protocol with the Java side stubbed; a manual emulator run verifies install, rendering, touch, and back</td><td class="ok">✅ supported through NativeActivity with raylib OpenGL ES 2</td></tr>
<tr><td class="">Android</td><td class="">app <code>src/main.zi</code> + <code>src/backend/android_run.zi</code></td><td class=""><code>tests/ziran_android_device_test.sh</code> checks the device text, lifecycle, and inset protocol with the Java side stubbed; a manual emulator run verifies install, rendering, touch, and back</td><td class="ok">✅ supported through NativeActivity with direct ANativeWindow pixel presentation</td></tr>
</table>
<p>The desktop and raylib project tests run separately with <code>make desktop-project-test</code> and <code>make raylib-project-test</code>; they must use a private Xvfb display. CI runs both on every push in their own job. The Canvas2D and semantic DOM project tests run in <code>make test</code> and launch only private headless Chromium.</p>
<p>The desktop project test (<code>make desktop-project-test</code>) uses a private Xvfb display. The Canvas2D project test runs in <code>make test</code> and launches only private headless Chromium. <code>make zx-window-test</code> covers bare-window bundles through the native desktop player and host library. Code generation alone does not establish platform execution.</p>
</body></html>
+7 -8
View File
@@ -10,7 +10,7 @@ module and host boundaries.
| Package | Ziran source | Native code generation | Package verification |
| --- | --- | --- | --- |
| Core UI (`src/ui`) | ✅ `.zi` modules listed in `modules.txt` and two public import modules | ✅ C and Go generation in `make` | ✅ `make test` builds the library and runs source, saved `.zir`, and `.zx` behavior tests |
| Core UI (`src/ui`) | ✅ `.zi` modules listed in `modules.txt` and named package exports | ✅ C and Go generation in `make` | ✅ `make test` builds the library and runs source, saved `.zir`, and `.zx` behavior tests |
The generated C archive is a build output of Ziran source. Behavior tests use
Ziran hosts in `tests/*_host.zi`. Code generation verifies that a module lowers
@@ -22,12 +22,11 @@ for a target; it does not prove that every native host runs on that target.
| --- | --- | --- | --- |
| Terminal | `src/backend/terminal_run.zi` | Private PTY project test covers ASCII, UTF-8, invalid input, and escape sequences | ✅ supported |
| Desktop | `src/backend/desktop_run.zi` | Private Xvfb project test covers image capture, keyboard, UTF-8 text, and wheel input | ✅ supported on the tested Linux host |
| Raylib | `src/backend/raylib_run.zi` | Private Xvfb project test covers image capture and input | ✅ supported on the tested Linux host |
| Web Canvas | `src/backend/canvas_run.zi` | Headless Chromium checks Canvas2D pixels, clips, input, textures, fonts, lifecycle, WebAudio, and file behavior | ✅ supported through Emscripten on the tested browser |
| Web DOM | `src/backend/dom_run.zi` | Headless Chromium checks incremental updates, native Unicode editing, reorder focus, CSS styles, responsive sizing and browser accessibility | 🧪 hybrid host with opt-in native CSS layout for document widgets |
| Android | app `src/main.zi` + `src/backend/android_run.zi` | `tests/ziran_android_device_test.sh` checks the device text, lifecycle, and inset protocol with the Java side stubbed; a manual emulator run verifies install, rendering, touch, and back | ✅ supported through NativeActivity with raylib OpenGL ES 2 |
| Android | app `src/main.zi` + `src/backend/android_run.zi` | `tests/ziran_android_device_test.sh` checks the device text, lifecycle, and inset protocol with the Java side stubbed; a manual emulator run verifies install, rendering, touch, and back | ✅ supported through NativeActivity with direct ANativeWindow pixel presentation |
The desktop and raylib project tests run separately with
`make desktop-project-test` and `make raylib-project-test`; they must use a
private Xvfb display. CI runs both on every push in their own job. The Canvas2D and semantic DOM
project tests run in `make test` and launch only private headless Chromium.
The desktop project test (`make desktop-project-test`) uses a private Xvfb
display. The Canvas2D project test runs in `make test` and launches only private
headless Chromium. `make zx-window-test` covers bare-window bundles through
the native desktop player and host library. Code generation alone does not
establish platform execution.
+4 -12
View File
@@ -23,15 +23,8 @@ rejected frames, and 2 for invalid arguments or files. Files are limited to
64 MiB each.
The entry takes no arguments, returns an integer, and samples exactly one
input record per frame. Existing entries may keep a module-local
`PollPointer() -> PointerFrame`. Five-column traces remain supported:
```
x y down pressed released
```
For keyboard, text, composition, wheel, resize, clipboard and time, declare a
module-local `PollFrameInput() -> FrameInput` and use the twenty-column format:
input record per frame. Declare a module-local `PollFrameInput() -> FrameInput` and use the
twenty-column format:
```
x y down pressed released secondary_down secondary_pressed secondary_released key modifiers wheel width height elapsed_ms text_hex ime_phase ime_cursor ime_selection ime_hex clipboard_hex
@@ -47,11 +40,10 @@ positive and elapsed milliseconds nonnegative. Blank lines and `#` comments
are accepted. A trace holds at most 1,024 samples within 1 MiB.
`FrameInputApply` supplies session pointer, key, modifier and wheel inputs;
`FrameInputField` converts text and composition into a `TextFieldInput`.
`FrameInputField` converts text and composition into a `TextField.Input`.
Applications explicitly use the recorded viewport and elapsed time rather
than reading wall time. Clipboard reads use the recorded input and clipboard
writes appear in the JSON. Rich traces produce format version 2; legacy
pointer traces keep version 1.
writes appear in the JSON. Captures use format version 2.
Capture includes focus, read-only state, selection and committed editor text.
Secure editor values, lengths and selections are redacted. A document larger
@@ -1,7 +1,7 @@
# CUI input components
# Input components
These six Ziran components cover the selected CUI input families without a CUI
compatibility layer. Each render entry is `(Session, Props, *State) -> Result`;
These six Ziran components cover the selected modern input families without an
external compatibility layer. Each render entry is `(Session, Props, *State) -> Result`;
each `Apply` function has the same behavior without requiring a building frame.
Caller-owned state is plain fixed-size data, including text bytes, so it can be
copied or serialized. No component owns global text, focus, clipboard, or
@@ -15,18 +15,20 @@ disabled component neither accepts text nor keeps focus.
## Tag input
```ziran
TagInput :: (session: Session, props: TagInputProps,
state: *TagInputState) -> TagInputResult
TagInputApply :: (state: *TagInputState,
props: TagInputProps) -> TagInputResult
```zi
TagInput :: #import "kryon/tag_input";
TagInput.Draw :: (session: Session, props: TagInput.Props,
state: *TagInput.TagInputState) -> TagInput.TagInputResult
TagInput.TagInputApply :: (state: *TagInput.TagInputState,
props: TagInput.Props) -> TagInput.TagInputResult
```
`TagInputState` owns up to 64 tags and their stable caller IDs, the editable
text, selection, scroll, and focus. Initial IDs can be supplied through
`TagInputStateInit`; newly entered tags receive stable generated IDs.
Commit text on Enter or `TextFieldInput.commit`. A nonempty separator also
Commit text on Enter or `TextField.Input.commit`. A nonempty separator also
splits committed and pasted text. Spaces can be trimmed, duplicates rejected,
and a positive `max_tags` enforced. Backspace on an empty field requests removal
of the final tag through `field.backspace_on_empty`; explicit removal is by
@@ -36,11 +38,13 @@ buttons, and nested field all honor disabled state and stylesheet cascade.
## One-time code
```ziran
OneTimeCode :: (session: Session, props: OneTimeCodeProps,
state: *OneTimeCodeState) -> OneTimeCodeResult
OneTimeCodeApply :: (state: *OneTimeCodeState,
props: OneTimeCodeProps) -> OneTimeCodeResult
```zi
OneTimeCode :: #import "kryon/one_time_code";
OneTimeCode.Draw :: (session: Session, props: OneTimeCode.Props,
state: *OneTimeCode.OneTimeCodeState) -> OneTimeCode.OneTimeCodeResult
OneTimeCode.OneTimeCodeApply :: (state: *OneTimeCode.OneTimeCodeState,
props: OneTimeCode.Props) -> OneTimeCode.OneTimeCodeResult
```
The state owns 1–12 alphanumeric slots, the cursor, focus, and prior completion.
@@ -58,11 +62,13 @@ real retained nodes.
## Inline edit
```ziran
InlineEdit :: (session: Session, props: InlineEditProps,
state: *InlineEditState) -> InlineEditResult
InlineEditApply :: (state: *InlineEditState,
props: InlineEditProps) -> InlineEditResult
```zi
InlineEdit :: #import "kryon/inline_edit";
InlineEdit.Draw :: (session: Session, props: InlineEdit.Props,
state: *InlineEdit.InlineEditState) -> InlineEdit.InlineEditResult
InlineEdit.InlineEditApply :: (state: *InlineEdit.InlineEditState,
props: InlineEdit.Props) -> InlineEdit.InlineEditResult
```
Activation selects the current value for replacement. Normal text and paste
@@ -74,11 +80,13 @@ and whether the committed value changed.
## Scrub field
```ziran
ScrubField :: (session: Session, props: ScrubFieldProps,
state: *ScrubFieldState) -> ScrubFieldResult
ScrubFieldApply :: (state: *ScrubFieldState,
props: ScrubFieldProps) -> ScrubFieldResult
```zi
ScrubField :: #import "kryon/scrub_field";
ScrubField.Draw :: (session: Session, props: ScrubField.Props,
state: *ScrubField.ScrubFieldState) -> ScrubField.ScrubFieldResult
ScrubField.ScrubFieldApply :: (state: *ScrubField.ScrubFieldState,
props: ScrubField.Props) -> ScrubField.ScrubFieldResult
```
Arrow-left/right, arrow-up/down, and horizontal drag use the same step. Shift
@@ -95,11 +103,13 @@ metrics and can be overridden by ID/class stylesheet rules.
## Money field
```ziran
MoneyField :: (session: Session, props: MoneyFieldProps,
state: *MoneyFieldState) -> MoneyFieldResult
MoneyFieldApply :: (state: *MoneyFieldState,
props: MoneyFieldProps) -> MoneyFieldResult
```zi
MoneyField :: #import "kryon/money_field";
MoneyField.Draw :: (session: Session, props: MoneyField.Props,
state: *MoneyField.MoneyFieldState) -> MoneyField.MoneyFieldResult
MoneyField.MoneyFieldApply :: (state: *MoneyField.MoneyFieldState,
props: MoneyField.Props) -> MoneyField.MoneyFieldResult
```
The state owns a `float64` value and the focused edit bytes. Blurred display
@@ -115,11 +125,13 @@ hidden in widget state.
## Shortcut recorder
```ziran
ShortcutRecorder :: (session: Session, props: ShortcutRecorderProps,
state: *ShortcutRecorderState) -> ShortcutRecorderResult
ShortcutRecorderApply :: (state: *ShortcutRecorderState,
props: ShortcutRecorderProps) -> ShortcutRecorderResult
```zi
ShortcutRecorder :: #import "kryon/shortcut_recorder";
ShortcutRecorder.Draw :: (session: Session, props: ShortcutRecorder.Props,
state: *ShortcutRecorder.ShortcutRecorderState) -> ShortcutRecorder.ShortcutRecorderResult
ShortcutRecorder.ShortcutRecorderApply :: (state: *ShortcutRecorder.ShortcutRecorderState,
props: ShortcutRecorder.Props) -> ShortcutRecorder.ShortcutRecorderResult
```
Activation records only while this widget is focused. A supported key plus
@@ -133,16 +145,3 @@ The state owns the key, modifier mask, focus/recording flags, and its fixed
label buffer. Width, height, and font size have explicit metrics; animation
uses the current theme motion duration and installed style cascade.
## Verification
`tests/ziran_cui_inputs_test.sh` builds identical source and saved-IR bundles,
runs both, generates native C and Go, and checks behavior across all six
families. Rendering assertions inspect the retained tree and actual raster
providers, including custom one-time-code slot metrics, shortcut font metrics,
and inline-edit IME preedit. The command is:
```sh
build-queue -- env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY \
-u DBUS_SESSION_BUS_ADDRESS YUE_DESKTOP_RECOVERY=0 \
sh tests/ziran_cui_inputs_test.sh
```
+25
View File
@@ -0,0 +1,25 @@
# Overlays
The six overlay families are retained Ziran widgets with caller-owned state and deterministic results. `Apply` functions are pure state transitions suitable to component hosting; widget functions take a `Session`, explicit props and a caller-owned state pointer, then submit popup/modal tree nodes and paint effects. No family owns process-global UI state.
Import `kryon/tooltip`, `kryon/sheet`, `kryon/command_palette`,
`kryon/hover_card`, `kryon/confirm_popover` or `kryon/guided_tour` under the
corresponding widget name. Each module exposes `Props` and `Draw`.
## Composition
- `Tooltip.Draw(session, props, state)` and `Tooltip.TooltipApply(state, props)` implement hover/focus delay, warm replay, touch/press suppression, truncation-only mode, placement fitting, flipping, clamping and ellipsis text.
- `Sheet.Draw(session, props, state)` and `Sheet.SheetApply(state, props)` implement all four sides, clamped min/max size, safe-area insets, scrim/Escape/drag close, deterministic motion and focus wrap/return.
- `CommandPalette.Draw(session, props, state)` and `CommandPalette.CommandPaletteApply(state, props)` implement fuzzy prefix/run/word scoring, stable command order, contiguous group starts, text editing, Up/Down/Enter/Escape, pointer activation and explicit owner takeover.
- `HoverCard.Draw(session, props, state)` and `HoverCard.HoverCardApply(state, props)` implement open delay, movement tolerance, content grace, interactive action dispatch, focus paths and placement fitting.
- `ConfirmPopover.Draw(session, props, state)` and `ConfirmPopover.ConfirmPopoverApply(state, props)` implement danger styling, initial confirm focus, Enter/Space confirm, Escape/cancel, outside close and trigger focus return.
- `GuidedTour.Draw(session, props, state)` and `GuidedTour.GuidedTourApply(state, props)` implement target geometry, padded highlight hole, four-band scrim, card fitting, count formatting, Back/Next/Done/Skip and three-focus wrap.
Each `*StateFor` constructor returns an isolated, serializable state value. Results identify nodes, geometry, interaction outcome and state change; callers supply `now_ms` and retain ownership. Empty `id`, `class_name`, key and action values follow the explicit prop values, while nonpositive geometry/delay fallbacks use the documented defaults in the matching `*_props.zi` module.
## Styles and semantics
Every family has typed `StyleData` props with installed selector facts for kind, ID, class, role, state and popup/modal/guide style kind. Caller styles merge over theme/selector values with `MergeValues`; state overrides resolve through `StyleStates`. Light and dark defaults come from `CurrentTheme`, and motion honors duration, multiplier and reduced-motion fields.
Tree nodes carry style ID/class facts plus interactive, popup, semantic kind, heading and label metadata. Paint uses the real queued raster API; no mock painter or parallel styling protocol exists.
+2 -2
View File
@@ -26,14 +26,14 @@ The build directory is stable and locked for the whole run. Desktop variables
are scrubbed. RSS comes from the native runner's `/proc/self/status` VmHWM
after the measured frames. Unlike a launcher's `wait4` high-water mark, it
excludes the Python process's memory before exec. Schema 2 baselines use this
measurement; capture a new baseline when migrating from schema 1. The timings
measurement. The timings
exclude warmup; the runner CPU-seconds counter includes initialization and all
warmup/measured frames, and excludes compilation and the Python launcher. Timings
cover the pixmap pipeline, not native window presentation, asset decoding,
screen-reader overhead, process idle wakeups or GPU/browser rendering.
The widget review harness measures actual public controls, rather than mock
faces. It includes all 54 core gallery scenes plus light and dark system-palette
faces. It includes the core gallery scenes plus light and dark system-palette
compositions. Each interactive scene captures resting, disabled, hover, keyboard
focus and held-press states, using the same 480 × 320 viewport.
+28 -79
View File
@@ -20,7 +20,7 @@ kryon run # the default profile; kryon run tui picks another
| `app` (default) | counter with buttons, a step slider, and progress | `desktop`, `tui`, `web` (canvas) |
| `tui` | keyboard-driven task list | `tui`, `desktop` |
| `pages` | Home, Library, and Settings behind a tab row, sharing state | `desktop`, `tui`, `web` (canvas) |
| `web` | semantic page: headings, paragraphs, links, a button | `web` (DOM), `canvas`, `desktop` |
| `web` | page: headings, paragraphs, links, a button | `web` (Canvas2D), `desktop` |
Each template's `src/layout.zi` stacks rows in pixels in a window or browser
and in character cells on the terminal host, so one `Frame` serves every
@@ -70,18 +70,19 @@ frame capability to the selected source's exported `Frame` function. The source
can have any module filename, such as `button.zi`; no `app.zi` alias or reverse
module bridge is needed. `[tool.kryon] entry` selects the source with `Frame`
when it differs from the package entry, as in a command-line package that also
has a window. The app imports `Kryon` for the small core
surface or `Widgets` for all core widgets:
has a window. The app imports the small `kryon/app` runner and only the named
widget packages it uses:
```zi
using UI :: #import "Widgets";
App :: #import "kryon/app";
Text :: #import "kryon/text";
#program_export
Frame :: (session: Session, viewport: Rectangle) -> s32 {
text: TextProps
text.text = "Hello, Kryon"
Text(session, text)
return 0
main :: () -> s32 {
return App.Run(App.Window.{.title="Hello", .width=320, .height=160}, Draw)
}
Draw :: (frame: App.Frame) {
Text.Draw(frame, Text.Props.{.text="Hello, world!", .size=32})
}
```
@@ -95,7 +96,7 @@ packages: add `https://github.com/kryonlabs/css.git`,
building blocks listed in `ziran.toml` for code that needs those primitives
without importing the widget catalog. Native and browser profiles resolve
imports the same way, so an app's Git dependencies and package-qualified
imports such as `kryon/Widgets` work in Canvas and DOM builds too.
named imports such as `kryon/text` work in Canvas builds too.
From the app directory, run:
@@ -118,13 +119,9 @@ for lock, cache, and override details.
### Foreign renderer artifacts
Builders can request Kryon's foreign libraries and standard resources through
the generic Ziran artifact API (toolchain revision 5461202417d48e2b31122354419179b262d7530c
or later):
the generic Ziran artifact API:
```sh
ziran pkg artifact kryon:renderer-raylib --platform linux-x86_64-gnu --locked
CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar \
ziran pkg artifact kryon:renderer-raylib --platform windows-x86_64-mingw --locked
ziran pkg artifact kryon:renderer-desktop --platform linux-x86_64-gnu --locked
ziran pkg artifact kryon:renderer-web --platform emscripten-wasm32-emscripten --locked
```
@@ -141,44 +138,22 @@ Ziran's ordinary compiler invocation. No generated Ziran source tree or object
list is part of this contract.
Every recipe includes `resources/kryon-font.ttf` and its Liberation license.
`renderer-raylib` also includes `lib/libraylib.a`, the four public Raylib headers
under `include/`, and the Raylib license. Linux uses SDL2/GLES2; Windows uses
RGFW/OpenGL 1.1. Both preserve JPEG, TrueType and audio support. Linux
`renderer-desktop` declares the existing SDL/Cairo/FreeType/Pango/Fontconfig/GIO
system dependencies rather than redistributing system libraries.
Linux desktop builds use SDL2, Cairo, FreeType, Pango, Fontconfig and GIO.
`renderer-web` supplies `web/ziran_web.js` from the selected Ziran toolchain,
`js_libraries`, browser link flags and `preload_files` entries (`path`, `mount`)
for the standard font at `/kryon-font.ttf`. Feed these to Emscripten's
`--js-library` and `--preload-file` arguments. Game resources remain separate.
The Raylib recipe also accepts `android-aarch64-bionic` and
`android-armv7-bionic`. Set `[tool.kryon.renderer] android_ndk` to the installed
NDK directory and `android_api` to a decimal API level (default 21, minimum 21).
Set `CC` to that ABI/API's NDK clang executable so compiler identity is keyed,
for example `aarch64-linux-android21-clang`. This foreign Raylib artifact recipe
is independent of Kryon's Android app host and retains its GLES2, image, font
and audio options.
NativeActivity glue, the application shared library, edition, packaging and
signing remain with the app packaging build. Unsupported recipe/platform pairs
fail explicitly. Other hosts and architectures are not yet provider targets.
Widget and renderer Ziran code remains ordinary `kryon/...` imports. These
artifacts do not provide a separately compiled Ziran component ABI: the current
generic artifact API stages provider files but does not define such a language
component interface. Builders must not rewrite generated C/H or reconstruct a
private module/object list to manufacture one.
Run `make renderer-artifact-test` for real outputs, hashes, dirty isolation and
a maintained Raylib renderer compiled and run on private Xvfb. Add `--cross`
to `python3 tests/renderer_artifact_test.py` for installed MinGW and Android
toolchains. After pushing, `--clean --revision COMMIT` uses normal immutable
package resolution and requires two independent consumers to receive the exact
same descriptor. A dirty canonical provider deliberately cannot prove reuse.
Define each profile under `[tool.kryon.profiles.NAME]`. It requires `backend`;
`codegen` defaults to `c99`. Supported backends are `terminal`, `desktop`,
`raylib`, `canvas`, `dom`, `pixmap`, and `android`. Set `default_profile` under `[tool.kryon]` when there
`canvas`, `pixmap`, and `android`. Set `default_profile` under `[tool.kryon]` when there
are several profiles. `--profile NAME` selects another. `run` asks for a
profile when there are several, none is specified, and it runs in a
terminal; otherwise it uses the default.
@@ -187,9 +162,7 @@ terminal; otherwise it uses the default.
| --- | --- | --- |
| `terminal` | 80 × 24 terminal cells | TTY for interactive input; redirected output renders once |
| `desktop` | SDL2 window with Cairo raster | SDL2, Cairo, and FreeType development libraries |
| `raylib` | raylib SDL2/OpenGL ES 2 window | the locked raylib source package and SDL2, DRM, EGL, GLESv2 |
| `canvas` | Canvas2D browser page | Emscripten with Asyncify; see [Canvas host](canvas.md) |
| `dom` | semantic DOM page | Emscripten with Asyncify; see [DOM host](dom.md) |
| `pixmap` | headless 960 × 600 frame printed as a PPM image | nothing; `kryon run shot > frame.ppm` |
| `android` | installable APK through a generated `droid/` Gradle project and direct NativeActivity host | a JDK, the Android SDK with NDK `28.2.13676358` and CMake `3.22.1`, the locked codec source packages, and `[tool.kryon.android] package`; see [Android host](BACKENDS.md#android-host) |
@@ -261,12 +234,11 @@ with `native_artifacts` and an explicit `native_platform`:
```toml
[tool.kryon.profiles.desktop]
backend = "desktop"
native_artifacts = "kryon:renderer-raylib"
native_artifacts = "kryon:renderer-desktop"
native_platform = "linux-x86_64-gnu"
```
This adds Raylib's foreign support, for example for `MediaAudio`, to the
existing SDL/Cairo profile. It keeps that profile's host and rendering path.
This adds the desktop codec support and resources to the SDL/Cairo profile.
Use space-separated `package:artifact` selections for several providers.
Selections come from the application's resolved package graph; no cache
paths or prebuilt archive copies belong in its manifest. The toolchain must
@@ -290,7 +262,7 @@ default_profile = "tui"
## Zx applications
Desktop, raylib, Canvas and Android profiles can package an ordinary `Frame`
Desktop, Canvas and Android profiles can package an ordinary `Frame`
application as the same portable program with its resources:
```toml
@@ -307,29 +279,14 @@ shell interprets the bundle and uses Canvas2D for rendering. It includes a
file picker for opening another downloaded ZX without recompiling its UI.
Unsupported required services are reported before replacing the running app.
`backend = "raylib"` with `codegen = "zx"` builds a generic native player
beside the bundle. `make zx-raylib` builds that player directly; pass a ZX
path to it or use `--check FILE.zx` to validate without opening a window.
Images are decoded directly from the bundle, with no resource extraction.
The native player carries its host font beside the executable. Linux uses
SDL/GLES; Windows and macOS use GLFW/OpenGL. HTTP uses libcurl; install its
development package or supply `ZX_RAYLIB_HTTP_LIBS` for your target.
Cross builds can supply
`ZX_RAYLIB_CC`, `ZX_RAYLIB_AR`, `ZX_RAYLIB_OBJCOPY`,
`ZX_RAYLIB_ARCHIVE`, `ZX_RAYLIB_DEFINES` and `ZX_RAYLIB_LIBS`.
Use a separate `ZX_RAYLIB_DIR` for each target. macOS uses the same renderer
and has platform build settings, but has not been executed in this checkout.
An Android profile with `codegen = "zx"` builds its portable guest first,
then packages `app.zx`, the VM and the raylib-free native host into the APK. Its
then packages `app.zx`, the VM and the NativeActivity host into the APK. Its
`Frame` is not compiled into native application code. The canonical scaffold
handles display density, safe-area insets, touch, hardware/soft-keyboard input
and graphics restoration without resetting bundle state. It also registers a
ZX file opener: Android document URIs are copied into private cache and
validated before replacing the running app. Invalid files retain the current
instance. Existing customized Android scaffolds must adopt the updated
Gradle/CMake and activity/manifest glue to use this profile.
`make zx-android-test` builds ARM64, ARMv7 and x86-64 shells. Runtime testing
instance. `make zx-android-test` builds ARM64, ARMv7 and x86-64 shells. Runtime testing
uses `python3 tests/zx_android_test.py --serial emulator-NNNN` and accepts
only an explicitly selected disposable emulator.
@@ -384,13 +341,13 @@ All four project templates include this profile.
After downloading that file, `ziran run app.zx` works without the app's source,
manifest, lock, or compiler-generated native code. Install the player with
`make install-user` in Kryon; this also registers the provider with Ziran.
The player needs SDL2, Cairo and FreeType. `ziran run --vm app.zx` selects
portable execution. `kryon run app.zx` forwards to the same Ziran runner.
The player needs SDL2, Cairo and FreeType. `kryon run app.zx` forwards to the
same Ziran runner.
For a custom install prefix, add its `share/ziran/hosts` directory to
`ZIRAN_HOST_PATH` or its `share` directory to `XDG_DATA_DIRS`.
`assets` is an optional project-relative directory or file, embedded under that
same path. Images retain their ordinary `ImageProps.asset_path` values. The
same path. Images retain their ordinary `Image.Props.asset_path` values. The
player extracts validated resources into a private temporary directory and
removes it when the app exits. Exports rebuild resource content on every build,
including file removals. A `pixmap` profile also accepts `codegen = "zx"` and
@@ -432,11 +389,10 @@ returns `{"status":"unavailable"}` when the harness does not grant one.
`AppSupports("kryon.input.desktop")` is true when the device's main input is
a keyboard and mouse: native desktop hosts answer yes, Android and the web
no, and a harness that runs inside another host passes the question on.
Older hosts answer no, so an app keeps its touch behaviour there.
An app that imports `kryon/app_theme` follows the host's theme:
`AppThemeColor(token, fallback)` returns the host stylesheet's colour for
`canvas`, `surface`, `border`, `text`, `accent` or `link`, and `fallback` for
a token the host lacks or on a host older than the module.
a token the host lacks.
An app with a look of its own, such as a game, imports `kryon/widget_palette`
instead: `WidgetPaletteUse(session, palette)` asks the host to draw the
widgets that follow in that palette's colours (as `SystemPalette`), until the
@@ -503,17 +459,12 @@ with `autostart` the login entry to `~/.config/autostart/example.desktop`.
Setting `autostart = false` removes an autostart entry that `ziran install`
wrote earlier. Browser profiles cannot be installed.
The raylib profile builds its static raylib dependency in Kryon's `build/`
directory. The Kryon host chooses and owns that backend. Game code belongs in
the separate Game2D package; applications using both should rely on Kryon's
selected backend and raylib revision.
The project binary is `build/<package-name>-<profile>`. Checked Ziran modules
are saved in `build/generated/<profile>/ir/` as `.zir`; generated C is in
`build/generated/<profile>/c/`. `ziran inspect FILE.zir` displays a saved
module.
Canvas and DOM projects resolve package-qualified hosts and bind the selected
Canvas projects resolve package-qualified hosts and bind the selected
source through the shared frame capability. Their generator also roots
`canvas_raster.zi` and lowers every saved module, preserving raster adapters
and browser callbacks. Native profiles select the package-qualified host
@@ -534,11 +485,9 @@ all three images match; `build/pixmap-parity/grid.png` shows them side by side.
`tools/image_tools.zi`, compiled to C, compares two PPM images, converts
them to PNG, and lays out such grids.
Kryon's `make desktop-project-test` and `make raylib-project-test` exercise the graphical hosts on private Xvfb
Kryon's `make desktop-project-test` exercises the graphical host on private Xvfb
displays, including keyboard and Unicode text input. `make canvas-project-test`
builds a real Canvas2D project and loads it in private headless Chromium.
`make dom-project-test` builds a real semantic DOM project and checks its
mounted tags and attributes in another private headless Chromium process. Do
builds a real Canvas2D project and loads it in private headless Chromium. Do
not run graphical tests on the developer's live display.
### Application-owned hosts
@@ -588,7 +537,7 @@ Custom native hosts can import `kryon/app_asset_path` and call
buffer: a resolved path borrows it; an unchanged path borrows the original text.
`ResolveAppAssetForExecutable(path, executable, output)` supplies an explicit
executable for hosts/tests. Neither changes the process working directory.
The standard Cairo and Raylib image loaders use this resolver automatically;
The standard native image loaders use this resolver automatically;
a custom asset-reader callback still has exclusive ownership of its resources.
A host embedding another UI packages that UI's referenced files under its own
View File
Whitespace-only changes.
+1 -4
View File
@@ -1,6 +1,6 @@
# Theme customization
Kryon uses one modern CUI-inspired style. Light and dark are color modes of
Kryon uses one modern style. Light and dark are color modes of
that style; applications do not need a style-pack registry or selector.
Import `kryon/Theme` for theme tokens. `InstallDefaultTheme(dark)` installs
@@ -14,6 +14,3 @@ support system, light and dark preferences. `SetReducedMotion` controls motion.
Typed style rules and optional CSS remain available for application-specific
colors and control styling, using the same components and interaction behavior.
The former style-picker gallery route remains a single-style example so
existing links continue to open.
-16
View File
@@ -1,16 +0,0 @@
# Web host status
Kryon's current web host is the Canvas2D backend in `src/backend/`.
Applications compile Ziran to C, then Emscripten links that generated C with
small browser effect libraries. The Ziran host implementation remains in
`.zi`; JavaScript supplies only browser effects that Ziran foreign imports
declare. See [BACKENDS.md](BACKENDS.md) and
[Canvas2D browser host](canvas.md).
The semantic DOM profile adds a real browser document layer over that
Canvas raster host; see [Semantic DOM browser host](dom.md). Both browser
profiles generate from the selected host plus the Canvas raster adapter and
without entry pruning. This is not a revival of the removed `.kry` compiler.
Kryon has no separate JavaScript widget runtime or source-language compiler.
The files above are the current web support documentation.
+1 -2
View File
@@ -7,8 +7,7 @@ decisions. Tests that only verify code generation do not prove behavior.
The current `make test` gate builds the core and optional packages and runs
the `tests/ziran_*` behavior suite through the relevant source, saved `.zir`,
portable `.zx`, and native targets. Package project tests verify imports and
terminal host behavior. `make desktop-project-test` and
`make raylib-project-test` verify graphical
terminal host behavior. `make desktop-project-test` verifies graphical
capture and input on private Xvfb displays.
For an affected widget, check the interaction that changed through the
+2 -7
View File
@@ -55,13 +55,8 @@ its UI scale setting, so the wheel and the Appearance slider drive one value,
and hands that setting to `ZoomDPI` each frame.
A host that draws an application unchanged applies the factor as a render
scale and divides pointer positions and the viewport by it. Kryon's raylib
runner does this for every application it runs, with no application code:
`ZoomWheel` and `ZoomKey` run before each frame, the wheel and the shortcut
keys they consume never reach the application, and `RaylibSetZoom` scales the
frame, so layout reflows to the smaller viewport as a browser page does and
text is rebaked at its scaled size to stay sharp. `KRYON_ZOOM=1.5` starts a
window at 150%; the native ZX player draws a bundle at that density too.
scale and divides pointer positions and the viewport by it. Layout reflows
to the scaled viewport; text is rasterized at the scaled size.
An application imports the module as `Zoom` (and `DPI` for the platform enum)
from the Kryon package. To opt out, or to force zoom on every platform, call
+11 -6
View File
@@ -10,7 +10,7 @@ them with Emscripten, and Ziran's Web bridge:
-sASYNCIFY -sSINGLE_FILE=1 -sEXIT_RUNTIME=1 -sENVIRONMENT=web
```
Kryon contains no JavaScript or C. The browser hosts (`page_core.zi`,
The browser hosts (`page_core.zi`,
`page_paint.zi`, `page_texture.zi`, `page_font.zi`, `page_events.zi`,
`page_files.zi`, `page_input.zi`, `page_mesh.zi`, `canvas_audio_host.zi`, `dom_host.zi`) are
written in Ziran and reach the page through `std/web.zi`; the one JavaScript
@@ -34,10 +34,9 @@ needed. Ordinary host paint and custom emitters use complete painting. Text
measurement leaves retained pixels intact. This adds no extra full-size surface.
The dedicated `canvas_raster.zi` provider
calls the Canvas modules directly, so retained widgets use the same paint
queue, font selection, and clipping path as the native host. Project builds do
not pass an entry to IR or C generation: the selected `_run` module owns
`main`, while `canvas_raster.zi` remains reachable as a second root for raster
and typeface adapters.
queue, font selection, and clipping path as the native host. Frame-profile builds retain the selected `_run` host and `canvas_raster.zi`
as generation roots for raster and typeface adapters. A program entry owns
its own `main`.
`RequestWindowClose` is currently a raw browser host capability. An application
may declare it against `host_api`; the host records the request and observes it
@@ -64,9 +63,15 @@ Only this host's event listeners and resize observer are removed on close.
A subsequent open creates new input and texture state; cached default font
memory is released before closing the canvas.
A `#canvas` that carries the `data-transparent` attribute has no background:
the host clears the window and each frame to alpha 0 instead of Kryon's frame
colour, so the page behind it shows wherever the program draws nothing, and
widgets draw over it as usual. The editor preview sets it; without it every
pixel is opaque.
Applications that handle Escape as navigation can call `CanvasSetExitKey(0)`
through `kryon/Canvas` to disable the host's default Escape-to-exit behavior.
Other keys remain available through `CanvasPressedKey`.
Ordered keys and text remain available through `CanvasInputTake(session)`.
Custom Canvas hosts can use `BeginRasterClip(bounds)` and
`EndRasterClip(saved)` through `kryon/Canvas` to intersect a rendering scope
-65
View File
@@ -1,65 +0,0 @@
# Browser document host
Select `backend = "dom"` in a Kryon profile. The host builds Ziran through
Emscripten and reconciles successful committed trees into browser elements.
Retained generation IDs preserve element identity. Unchanged text, attributes,
styles and order stay untouched; reordering uses `moveBefore` where available
and restores focus/selection when falling back to insertion. Nested absolute
positions are relative to their parents. Container labels use ARIA instead
of replacing their children with text.
Native button activation, editor focus, input, selection and browser IME
return to Kryon's shared session/widget logic. Applications still own values,
apply ordinary returned edits, and retain cursor/anchor state. Browser UTF-16
selection offsets convert to grapheme-aligned UTF-8 byte offsets. Multiple
inputs to one editor coalesce before a frame; another editor waits for the
session's current request. Read-only and disabled controls use native
properties. Password values travel through a private presentation callback,
never the semantic tree or capture snapshots; password copy/cut is blocked.
Native edit requests are bounded to 64 KiB.
The default remains an absolutely positioned, transparent semantic overlay
on Canvas2D. Canvas applications compiled through `canvas_app_run.zi` can
select the equivalent entry `dom_app_run.zi`; that host keeps the AppContext
lifecycle, storage, input and Canvas frame, then reconciles the additional
semantic elements. Consequently canvas-heavy apps normally use slightly more
memory and CPU in DOM mode, not less. For document widgets, call this before
the first frame:
```ziran
Dom :: #import "kryon/Dom";
// css is an application-owned CSS string, optionally exported by the CSS package.
Dom.UseDocumentLayout(css)
```
This hides the owned canvas and presents native elements in normal browser
flow. CSS supplies responsive widths, layout and appearance. Supported kinds
are Screen, Text, Paragraph, Page, Section, Link, Image, Button, TextField,
TextArea, Group, Column, Row, Stack and Grid. Other kinds reject the frame so
canvas-only content cannot disappear silently. Browser layout geometry is
owned by CSS; the core retained geometry remains the application's submitted
layout. Prefer native identity activation over canvas hit tests in this mode.
DOM elements carry `data-kryon-widget` names and hashed `data-kryon-class`
values for supported styled text and controls. The separate CSS package
exports `ExportCSS(source, path, environment, output)` and `StyleClass(name)`.
The exporter scopes selectors to `#kryon-dom-root`, maps widget, class and
state selectors to those attributes, and writes rules in Kryon's priority
order so the browser ranks them as native hosts do. Environment media queries
are decided for the given environment; viewport queries stay for the browser.
Check its `ok` result before attaching output. Unresolved imports and
attribute selectors fail explicitly; see the CSS package for its subset.
The DOM root and private presentation handles are removed at close. A
text/semantics-only test snapshot omits secure values. Verification runs a
new headless Chromium process with desktop variables removed:
```sh
python3 tests/dom_project_test.py
KRYON_DOM_INTERACTION=1 python3 tests/dom_project_test.py
```
The second check uses the CSS package and verifies no DOM mutations during unchanged
frames, Unicode editing, identity/focus/caret after reorder, button routing,
responsive sizing, password redaction and a native editor in the browser's
accessibility tree. Neither test uses the owner's desktop or browser profile.
+8 -6
View File
@@ -1,25 +1,27 @@
# Compact navigation
`NavigationBar` can compose a compact vertical rail or horizontal dock using
`Navigation.Draw` can compose a compact vertical rail or horizontal dock using
the same themed buttons, keyboard activation and retained pointer capture as
other Kryon controls.
```ziran
props: NavigationBarProps
```zi
Navigation :: #import "kryon/navigation";
props: Navigation.Props
props.key = KeyHash("navigation")
props.compact = true
props.vertical = true
props.bounds = Rectangle.{0.0, 0.0, 88.0, 720.0}
props.footer_count = 2
props.scroll_offset = navigation_scroll
result := NavigationBar(session, props, items[:])
result := Navigation.Draw(session, props, items[:])
navigation_scroll = result.scroll_offset
```
The last `footer_count` items stay at the bottom of a rail or the trailing
edge of a dock. Other items scroll without covering those actions. Supply
stable item keys when shortcuts can move. Items carry route IDs, labels,
`ImageProps`, optional vector `icon_shape`, selected state and disabled state;
`Image.Props`, optional vector `icon_shape`, selected state and disabled state;
the application applies `result.clicked_route` to its own routing.
Set `draggable` to receive `result.drag`, `drag_route` and `drag_bounds` for
@@ -28,6 +30,6 @@ shortcut cards. While dragging a card, supply `dragging` and `drag_position`;
`-1` outside their viewport. Footer actions are never insertion slots.
The surface resolves `NavigationBar` style rules and buttons resolve
`NavigationBarItem` rules. `class_name` and `item_class_name` let applications
`Navigation.NavigationBarItem` rules. `class_name` and `item_class_name` let applications
customize those faces with their current palette. Compact items use ordinary
button hover, focus, press, selection and accessibility behavior.
-1
View File
@@ -1 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=docs.html"><title>API docs moved</title></head><body><a href="docs.html">API docs moved</a></body></html>
+1 -1
View File
@@ -1,2 +1,2 @@
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Apps and showcase — Kryon</title><meta name="description" content="Kryon Labs applications are development surfaces for the widget, chart and data-view packages."><link rel="stylesheet" href="current.css?v=129720eec9d272d5"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=129720eec9d272d5"></script></body></html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Apps and showcase — Kryon</title><meta name="description" content="Kryon Labs applications are public, open-source Ziran and Kryon projects with links to their GitHub repositories."><link rel="stylesheet" href="current.css?v=2f7ee344c6192e9c"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=2f7ee344c6192e9c"></script></body></html>
-13
View File
@@ -1,13 +0,0 @@
# Kryon Labs mark
`mark.svg` is a clean vector reconstruction of Proposal 01, Modular K, from
the exploratory Kryon Labs logo rasters generated on 2026-09-26. The original
proposals, exact prompts, and provenance are retained in the local Kryon Labs
profile archive under `work/branding/logo-proposals/2026-09-26/`; they are not
tracked site assets. The reconstruction keeps the selected block geometry and
colors without the raster texture or wordmark baked into the proposal image.
The site uses the mark in its header and footer. `favicon.svg` adds an ivory
backplate for browser tabs; `favicon-32.png`, `favicon.ico`, and
`apple-touch-icon.png` are raster versions of it. `og.svg` is the editable social
card source for `og.png`.
-18
View File
@@ -1,18 +0,0 @@
# Kryon Labs editorial assets
Created for the approved website redesign on 2026-09-19.
- `workshop.webp`: original ink-and-watercolor hero, generated with the built-in
`image_gen` tool using the approved page mockup as a reference. Exact prompt:
`workshop-prompt.txt`. WebP export: 1536 × 1024, quality 84.
- Site-root `og.png`: current 1200 × 630 Kryon Labs social card rendered from
the site-root `og.svg`, using the new mark in `../brand/mark.svg`. The earlier
generated card prompt remains in `social-card-prompt.txt` for reference.
- Manrope and Newsreader are served locally. Their OFL license texts are included.
- Application screenshots and metadata come from the Kryon showcase registry via
the existing `scripts/update-showcase.py` build step.
Original generated images and the approved mockup are retained in
`/mnt/storage/Projects/waozi-design-proposals/2026-09-19/kryonlabs/` on the design
workstation. Image-generation originals are also retained in the tool's default
output directory. No compiler assets are loaded by the homepage.
-24
View File
@@ -1,24 +0,0 @@
# Product previews
These images show real applications and modules. App captures use synthetic
fixtures on a private display; they contain no owner account or repository data.
They describe development builds, not released downloads.
- `terminal.webp`: Terminal with sample shell output, captured on private Xvfb.
- `browser.webp`: Browser rendering a local Field notes sample page.
- `github-overview.webp` and `github-repositories.webp`: GitHub client using
fixture repositories and accounts on private Xvfb.
- `kryon-gallery.webp`: a selection of widgets from the real browser gallery.
- `plot-candles.webp`: the gallery CandleChart example (`plot/4`), with sample data.
- `data-views-table.webp`: the gallery TableView example (`data_views/2`), with sample data.
- `css-packs.webp`: the same fixture interface with the real CSS style packs.
- `game2d-controls.webp`: the Game2D control chooser, compiled and rendered in
the private browser live editor.
The gallery and editor captures use an isolated headless Chromium with inherited
display and desktop-session variables removed. WebP files are binary exports of
those captures. The original app and module implementations own their interfaces;
these are not illustrated mockups.
The SVG icons in `mingcute/` are copied from the MingCute package's upstream
assets. Their Apache-2.0 license is retained as `mingcute/LICENSE.txt`.
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=docs.html"><title>Benchmarks moved</title></head><body><a href="docs.html">Benchmarks moved</a></body></html>
-1
View File
@@ -1 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=widgets.html"><title>Components moved</title></head><body><a href="widgets.html">Components moved</a></body></html>
-1
View File
@@ -1 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=widgets.html"><title>Live editor moved</title></head><body><a href="widgets.html">Live editor moved</a></body></html>
-49
View File
@@ -1,49 +0,0 @@
# Kryon live editor
`../demo.html` offers Source, Preview, and Both views. Both is the default on
wide screens; narrow screens and `?mini` embeds start with the interactive
preview. Opening source loads the browser compiler. Edits compile after a
350 ms pause, and Ctrl/Command + Enter compiles immediately. Compilation errors
keep the last working preview. Reset restores `src/app.zi`.
The compiler runs in a worker and uses Ziran's ordinary checker and portable
bundle writer. The compiled app runs in a sandboxed iframe with a persistent
VM instance. `src/preview_host.zi` binds raw input, font measurements, and
raster effects to the existing Kryon Canvas host; widget behavior comes from
the ordinary Kryon library. Source stays in the browser. Programs must fit
Ziran's portable subset and the installed Canvas capabilities. Each VM frame
has a statement limit, and compilation and rendering have timeout recovery.
Build the normal initial preview with `build-queue -- ./build.sh`. For changes
in this checkout, set the ignored `ziran.local.toml` override `kryon` to this
repository root. The source build resolves that override with `ziran lock`
before compiling; production locks retain actual published revisions. To rebuild the editor's
compiler and Canvas host, activate Emscripten 6.0.6 and run:
```sh
python3 build_preview.py
```
The script resolves the configured Ziran and Kryon sources with `ziran pkg
path`, including the demo's ignored local overrides. Use a Ziran revision
that provides `BuildBundle` and `BundleInstanceLimitSteps`. The three generated
editor assets in `../assets/` are committed with the static site, alongside
the original `widgets.html` preview.
From the Kryon repository root, `build-queue -- make site-browser-test`
runs the Python browser suite in a private headless Chromium. It covers the
app and module catalogs, responsive navigation, themes, keyboard focus,
legacy routes, and real editor compilation, including rotated text. To retain
review images, run `build-queue -- python3 tests/site_browser_test.py
--screenshots backup/labs-site/verification` after confirming `backup/` is ignored.
From the Kryon repository root, `node tests/demo_browser.mjs` starts a local
server and private Xvfb/Chromium display. It checks real compilation, rendered
pixels, persistent button state, error recovery, source escaping, cancellation,
view switching, reset, responsive layout, and lazy loading in embeds. Its
screenshots and logs live in `build/scratch/web-preview/`.
Pass a deployed editor URL to run the same checks against a live site:
```sh
node tests/demo_browser.mjs https://kryonlabs.com/demo.html
```
+7 -3
View File
@@ -1,7 +1,11 @@
using UI :: #import "kryon/Widgets";
Scroll :: #import "kryon/scroll";
#import "kryon/geometry"
#import "kryon/input_protocol"
#import "kryon/session"
#import "kryon/tree"
#import "kryon/tree_input"
#import "kryon/tree_draw"
#import "kryon/frame_snapshot"
#import "kryon/cursor"
GuestTheme :: #import "kryon/Theme";
#import "app"
#import "preview_protocol"
@@ -46,7 +50,7 @@ Tick :: () -> s32 {
if BeginFrame(preview_session, cast(u64)1, viewport) != FrameStatus.FrameOk { return 1 }
height := viewport.height
if height < 520.0 { height = 520.0 }
scroll := Scroll(preview_session, ScrollProps.{.key = 190000001, .bounds = viewport,
scroll := Scroll.Draw(preview_session, Scroll.Props.{.key = 190000001, .bounds = viewport,
.content_height = cast(s32)height, .scroll_offset = preview_scroll})
preview_scroll = scroll.scroll_offset
if Frame(preview_session, scroll.content) != 0 { return 1 }
+3 -1
View File
@@ -1,4 +1,6 @@
using UI :: #import "kryon/Widgets";
#import "kryon/control_props"
#import "kryon/drawing_props"
#import "kryon/style_sheet"
preview_theme: s32;
preview_installed_theme: s32 = -1;
+1 -1
View File
@@ -1,2 +1,2 @@
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Docs — Kryon</title><meta name="description" content="Kryon ownership, public surface, local commands and integration boundaries."><link rel="stylesheet" href="current.css?v=129720eec9d272d5"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=129720eec9d272d5"></script></body></html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Docs — Kryon</title><meta name="description" content="Kryon ownership, public surface, local commands and integration boundaries."><link rel="stylesheet" href="current.css?v=2f7ee344c6192e9c"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=2f7ee344c6192e9c"></script></body></html>
+1 -1
View File
@@ -1,2 +1,2 @@
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Getting started — Kryon</title><meta name="description" content="Add Kryon to a Ziran project, import widgets, and run the maintained local tests."><link rel="stylesheet" href="current.css?v=129720eec9d272d5"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=129720eec9d272d5"></script></body></html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Getting started — Kryon</title><meta name="description" content="Add Kryon to a Ziran project, import widgets, and run the maintained local tests."><link rel="stylesheet" href="current.css?v=2f7ee344c6192e9c"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=2f7ee344c6192e9c"></script></body></html>
+1 -1
View File
@@ -1,2 +1,2 @@
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Kryon — Ziran UI system</title><meta name="description" content="Kryon is a reusable Ziran UI library with source-driven controls, charts, overlays and data views."><link rel="stylesheet" href="current.css?v=129720eec9d272d5"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=129720eec9d272d5"></script></body></html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Kryon — Ziran UI system</title><meta name="description" content="Kryon is a reusable Ziran UI library with source-driven controls, charts, overlays and data views."><link rel="stylesheet" href="current.css?v=2f7ee344c6192e9c"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=2f7ee344c6192e9c"></script></body></html>
-1
View File
@@ -1 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=docs.html"><title>Language docs moved</title></head><body><a href="docs.html">Language docs moved</a></body></html>
-1
View File
@@ -1 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=widgets.html"><title>Examples moved</title></head><body><a href="widgets.html">Examples moved</a></body></html>
-1
View File
@@ -1 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=renderers.html"><title>Platform matrix moved</title></head><body><a href="renderers.html">Platform matrix moved</a></body></html>
+1 -1
View File
@@ -1,2 +1,2 @@
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Modules — Kryon</title><meta name="description" content="The maintained gallery currently builds Kryon widgets, Plot charts, DataViews controls, focused inputs and overlays."><link rel="stylesheet" href="current.css?v=129720eec9d272d5"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=129720eec9d272d5"></script></body></html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Modules — Kryon</title><meta name="description" content="The maintained gallery currently builds Kryon widgets, Plot charts, DataViews controls, focused inputs and overlays."><link rel="stylesheet" href="current.css?v=2f7ee344c6192e9c"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=2f7ee344c6192e9c"></script></body></html>
+1 -1
View File
@@ -1,2 +1,2 @@
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Platforms — Kryon</title><meta name="description" content="Kryon runs through Ziran desktop and Canvas hosts; support varies by backend and target."><link rel="stylesheet" href="current.css?v=129720eec9d272d5"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=129720eec9d272d5"></script></body></html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Platforms — Kryon</title><meta name="description" content="Kryon runs through Ziran desktop and Canvas hosts; support varies by backend and target."><link rel="stylesheet" href="current.css?v=2f7ee344c6192e9c"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=2f7ee344c6192e9c"></script></body></html>
+92
View File
@@ -0,0 +1,92 @@
Geist Sans and Geist Mono Font
(C) 2023 Vercel, made in collaboration with basement.studio
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is available with a FAQ at: http://scripts.sil.org/OFL and copied below
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION AND CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
+92
View File
@@ -0,0 +1,92 @@
Copyright (c) 2016-2018 The Inter Project Authors ([email protected])
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION AND CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
[["/kryon-font.ttf", "runtime/asset-0.bin"], ["/assets/alpine-lake.webp", "runtime/asset-1.bin"], ["/assets/coastal-cliffs.webp", "runtime/asset-2.bin"], ["/assets/fonts/Geist-Medium.ttf", "runtime/asset-3.bin"], ["/assets/fonts/GeistMono-Regular.ttf", "runtime/asset-4.bin"], ["/assets/fonts/Inter-Regular.ttf", "runtime/asset-5.bin"], ["/assets/fonts/LICENSE-Geist.txt", "runtime/asset-6.bin"], ["/assets/fonts/LICENSE-Inter.txt", "runtime/asset-7.bin"], ["/assets/pfp.webp", "runtime/asset-8.bin"]]
[["/kryon-font.ttf", "runtime/asset-0.bin"], ["/assets/alpine-lake.webp", "runtime/asset-1.bin"], ["/assets/apps/browser.webp", "runtime/asset-2.bin"], ["/assets/apps/explorer.webp", "runtime/asset-3.bin"], ["/assets/apps/github.webp", "runtime/asset-4.bin"], ["/assets/apps/terminal.webp", "runtime/asset-5.bin"], ["/assets/coastal-cliffs.webp", "runtime/asset-6.bin"], ["/assets/fonts/Geist-Medium.ttf", "runtime/asset-7.bin"], ["/assets/fonts/GeistMono-Regular.ttf", "runtime/asset-8.bin"], ["/assets/fonts/Inter-Regular.ttf", "runtime/asset-9.bin"], ["/assets/fonts/LICENSE-Geist.txt", "runtime/asset-10.bin"], ["/assets/fonts/LICENSE-Inter.txt", "runtime/asset-11.bin"], ["/assets/pfp.webp", "runtime/asset-12.bin"]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
+9 -9
View File
@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"updatedAt": "2026-11-05",
"updatedAt": "2026-11-12",
"source": "https://github.com/kryonlabs/showcase/tree/master/projects",
"starPlatforms": [
"github"
@@ -52,24 +52,24 @@
"rank": 2
},
{
"slug": "shelf",
"name": "Shelf",
"summary": "File explorer for Rill and Taiji OS that also runs as a standalone desktop app.",
"slug": "explorer",
"name": "Explorer",
"summary": "Native Linux file manager with grid, list, compact and split views, image preview and full file operations.",
"author": {
"name": "KryonLabs",
"url": "https://github.com/kryonlabs"
},
"homepage": "https://github.com/kryonlabs/shelf",
"banner": "showcase/shelf-1dcbd10eaaa0.png",
"bannerAlt": "Shelf file explorer showcase banner",
"homepage": "https://github.com/kryonlabs/explorer",
"banner": "showcase/explorer-1dcbd10eaaa0.webp",
"bannerAlt": "Explorer file manager showcase banner",
"tags": [
"files",
"desktop",
"kryon",
"plan9"
"file-manager"
],
"featured": true,
"repository": "https://github.com/kryonlabs/shelf",
"repository": "https://github.com/kryonlabs/explorer",
"stars": 0,
"rank": 3
},
-1
View File
@@ -1 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=apps.html"><title>Showcase moved</title></head><body><a href="apps.html">Showcase moved</a></body></html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

+1 -1
View File
@@ -1,2 +1,2 @@
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Components — Kryon</title><meta name="description" content="Browse real light and dark Ziran component examples with source, APIs, options and status."><link rel="stylesheet" href="current.css?v=129720eec9d272d5"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=129720eec9d272d5"></script></body></html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Components — Kryon</title><meta name="description" content="Browse real light and dark Ziran component examples with source, APIs, options and status."><link rel="stylesheet" href="current.css?v=2f7ee344c6192e9c"></head><body><input id="kryon-ime" type="text" tabindex="-1" aria-hidden="true" autocomplete="off" autocapitalize="off" spellcheck="false"><div id="canvas-frame"><canvas id="canvas" tabindex="0" aria-label="Kryon interactive website"></canvas></div><pre id="result" role="status"></pre><noscript>This website runs Ziran through WebAssembly. Enable JavaScript to use the live examples.</noscript><script src="current.js?v=2f7ee344c6192e9c"></script></body></html>
+1 -1
View File
@@ -4,7 +4,7 @@ Import `kryon/Window` and call `WindowFocused()` to read whether the application
own visible window has keyboard focus. The call changes no window, focus, input
or desktop setting. Linux SDL and the desktop portable player inspect only the
window created by their host. Hidden and minimized SDL windows report false.
Raylib and browser canvas hosts use their existing window focus signals.
Browser Canvas hosts use their existing window focus signals.
An embedded pixel-surface player forwards `WindowFocusedHost` to its platform
callback. The callback must return the focus of that child application, rather
+55 -114
View File
@@ -1,108 +1,79 @@
.DEFAULT_GOAL := all
CC ?= cc
ZIRAN_DIR ?= $(if $(ZIRAN_ROOT),$(ZIRAN_ROOT),$(shell ziran pkg path ziran))
ZIRAN_BIN ?= $(abspath $(ZIRAN_DIR)/build/bin/ziran)
ZIRAN_INCLUDE ?= $(abspath $(ZIRAN_DIR)/include)
ZIRAN_BIN ?= ziran
# Resolve the maintained examples through the ordinary package graph.
KRYON_MODULE_ROOTS := $(shell python3 -c 'import tomllib; from pathlib import Path; print(" ".join("../" + root for root in tomllib.loads(Path("../ziran.toml").read_text())["package"]["module_roots"]))')
KRYON_MODULE_ARGS := --project --module-path .
KRYON_SOURCES := $(foreach root,$(KRYON_MODULE_ROOTS),$(wildcard $(root)/*.zi $(root)/*/module.zi))
KRYON_MODULE_ARGS := --project
# The demos that the desktop hosts import live in demo/, apart from the
# programs here whose names other project modules also use.
DEMO_MODULE_ARGS := --module-path demo
KRYON_SOURCES := $(shell find ../src/ui ../src/backend -type f -name '*.zi' -print)
BUILD_DIR ?= ../build/examples
NATIVE_LIB := ../build/ziran/libkryon.a
PROGRAMS := hello window
NATIVE_PROGRAMS := $(addprefix $(BUILD_DIR)/,$(PROGRAMS))
GO_PROGRAMS := $(addsuffix .go.stamp,$(addprefix $(BUILD_DIR)/matrix/,$(PROGRAMS)))
WEB_PROGRAMS := $(addsuffix .web.stamp,$(addprefix $(BUILD_DIR)/matrix/,$(PROGRAMS)))
ZX_PROGRAMS := $(addsuffix .zx,$(addprefix $(BUILD_DIR)/matrix/,$(PROGRAMS)))
.PHONY: all test desktop desktop-test desktop-image-test desktop-text-test time-picker time-picker-shots clean
all: $(BUILD_DIR)/hello.svg $(BUILD_DIR)/hello.zx
$(ZIRAN_BIN):
$(MAKE) -C $(ZIRAN_DIR) all
.PHONY: all test backend-matrix desktop desktop-image-test time-picker time-picker-shots clean
all: $(NATIVE_PROGRAMS)
$(NATIVE_LIB): ../Makefile ../src/ui/modules.txt $(KRYON_SOURCES)
$(MAKE) -C .. all
$(BUILD_DIR)/hello.zx: hello.zi $(KRYON_SOURCES) $(ZIRAN_BIN) ../ziran.toml Makefile
$(BUILD_DIR)/image.zx: demo/image_demo.zi $(KRYON_SOURCES) ../ziran.toml Makefile
mkdir -p $(BUILD_DIR)
$(ZIRAN_BIN) bundle --root . $(KRYON_MODULE_ARGS) \
--entry hello:Frame -o $@ hello.zi
$(BUILD_DIR)/hello-saved.zx: $(BUILD_DIR)/hello.zx
$(ZIRAN_BIN) ir --root . $(KRYON_MODULE_ARGS) \
-o $(BUILD_DIR)/ir hello.zi
$(ZIRAN_BIN) bundle --root $(BUILD_DIR)/ir \
--module-path $(BUILD_DIR)/ir --entry hello:Frame \
-o $@ $(BUILD_DIR)/ir/hello.zir
cmp $(BUILD_DIR)/hello.zx $@
$(BUILD_DIR)/image.zx: image_demo.zi $(KRYON_SOURCES) $(ZIRAN_BIN) ../ziran.toml Makefile
mkdir -p $(BUILD_DIR)
$(ZIRAN_BIN) bundle --root . $(KRYON_MODULE_ARGS) \
--entry image_demo:Frame -o $@ image_demo.zi
$(ZIRAN_BIN) bundle --root demo $(KRYON_MODULE_ARGS) \
--entry image_demo:Frame -o $@ demo/image_demo.zi
$(BUILD_DIR)/image-saved.zx: $(BUILD_DIR)/image.zx
$(ZIRAN_BIN) ir --root . $(KRYON_MODULE_ARGS) \
-o $(BUILD_DIR)/image-ir image_demo.zi
$(ZIRAN_BIN) ir --root demo $(KRYON_MODULE_ARGS) \
-o $(BUILD_DIR)/image-ir demo/image_demo.zi
$(ZIRAN_BIN) bundle --root $(BUILD_DIR)/image-ir \
--module-path $(BUILD_DIR)/image-ir --entry image_demo:Frame \
-o $@ $(BUILD_DIR)/image-ir/image_demo.zir
cmp $(BUILD_DIR)/image.zx $@
$(BUILD_DIR)/text.zx: text_hello.zi $(KRYON_SOURCES) $(ZIRAN_BIN) ../ziran.toml Makefile
mkdir -p $(BUILD_DIR)
$(ZIRAN_BIN) bundle --root . $(KRYON_MODULE_ARGS) \
--entry text_hello:Frame -o $@ text_hello.zi
$(BUILD_DIR)/text-saved.zx: $(BUILD_DIR)/text.zx
$(ZIRAN_BIN) ir --root . $(KRYON_MODULE_ARGS) \
-o $(BUILD_DIR)/text-ir text_hello.zi
$(ZIRAN_BIN) bundle --root $(BUILD_DIR)/text-ir \
--module-path $(BUILD_DIR)/text-ir --entry text_hello:Frame \
-o $@ $(BUILD_DIR)/text-ir/text_hello.zir
cmp $(BUILD_DIR)/text.zx $@
$(BUILD_DIR)/hello-native/hello_host.c: hello_host.zi hello.zi $(KRYON_SOURCES) $(ZIRAN_BIN) ../ziran.toml Makefile
mkdir -p $(BUILD_DIR)/hello-native
$(RM) $(BUILD_DIR)/hello-native/*.c $(BUILD_DIR)/hello-native/*.h
$(ZIRAN_BIN) build --target=c --root . $(KRYON_MODULE_ARGS) \
-o $(BUILD_DIR)/hello-native hello_host.zi
$(BUILD_DIR)/hello-host: $(BUILD_DIR)/hello-native/hello_host.c Makefile
$(CC) -std=c11 -Wall -ffunction-sections -fdata-sections -Wl,--gc-sections \
-I$(ZIRAN_INCLUDE) -I$(BUILD_DIR)/hello-native \
$(BUILD_DIR)/hello-native/*.c -lm -o $@
$(BUILD_DIR)/hello.svg: $(BUILD_DIR)/hello-host
env -u DISPLAY -u WAYLAND_DISPLAY \
$(BUILD_DIR)/hello-host > $@
test: all $(BUILD_DIR)/hello-saved.zx
python3 -c 'import xml.etree.ElementTree as ET; root=ET.parse("$(BUILD_DIR)/hello.svg").getroot(); ns="{http://www.w3.org/2000/svg}"; assert root.tag==ns+"svg"; assert [node.text for node in root.iter(ns+"text")]==["Hello, Ziran"]*3+["Clicked!"]; assert len(list(root.iter(ns+"rect")))>=4'
$(BUILD_DIR)/desktop-hello-native/desktop_hello.c: desktop_hello.zi ../src/backend/desktop_runtime.zi ../src/backend/cairo_raster.zi hello.zi $(KRYON_SOURCES) $(ZIRAN_DIR)/std/c_string.zi $(ZIRAN_BIN) Makefile
mkdir -p $(BUILD_DIR)/desktop-hello-native
$(RM) $(BUILD_DIR)/desktop-hello-native/*.c $(BUILD_DIR)/desktop-hello-native/*.h
$(ZIRAN_BIN) build --target=c --root . $(KRYON_MODULE_ARGS) \
--entry desktop_hello:main -o $(BUILD_DIR)/desktop-hello-native desktop_hello.zi
$(BUILD_DIR)/desktop-image-native/desktop_image.c: desktop_image.zi ../src/backend/desktop_runtime.zi ../src/backend/cairo_raster.zi image_demo.zi $(KRYON_SOURCES) $(ZIRAN_DIR)/std/c_string.zi $(ZIRAN_BIN) Makefile
# Kryon's ziran.toml [package] links names the desktop host's system
# libraries, so every project C build below links without caller LDLIBS.
$(BUILD_DIR)/image-desktop: desktop_image.zi ../src/backend/desktop_runtime.zi ../src/backend/cairo_raster.zi demo/image_demo.zi $(KRYON_SOURCES) ../ziran.toml Makefile
mkdir -p $(BUILD_DIR)/desktop-image-native
$(RM) $(BUILD_DIR)/desktop-image-native/*.c $(BUILD_DIR)/desktop-image-native/*.h
$(ZIRAN_BIN) build --target=c --root . $(KRYON_MODULE_ARGS) \
$(ZIRAN_BIN) build --target=c --exe --root . $(KRYON_MODULE_ARGS) $(DEMO_MODULE_ARGS) \
--entry desktop_image:main -o $(BUILD_DIR)/desktop-image-native desktop_image.zi
cp $(BUILD_DIR)/desktop-image-native/desktop_image $@
$(BUILD_DIR)/desktop-text-native/desktop_text.c: desktop_text.zi ../src/backend/desktop_runtime.zi ../src/backend/cairo_raster.zi text_hello.zi $(KRYON_SOURCES) $(ZIRAN_DIR)/std/c_string.zi $(ZIRAN_BIN) Makefile
mkdir -p $(BUILD_DIR)/desktop-text-native
$(RM) $(BUILD_DIR)/desktop-text-native/*.c $(BUILD_DIR)/desktop-text-native/*.h
$(ZIRAN_BIN) build --target=c --root . $(KRYON_MODULE_ARGS) \
--entry desktop_text:main -o $(BUILD_DIR)/desktop-text-native desktop_text.zi
$(BUILD_DIR)/desktop-time-picker-native/desktop_time_picker.c: desktop_time_picker.zi time_picker_demo.zi ../src/backend/desktop_runtime.zi ../src/backend/cairo_raster.zi $(KRYON_SOURCES) $(ZIRAN_DIR)/std/c_string.zi $(ZIRAN_BIN) Makefile
$(BUILD_DIR)/time-picker-desktop: desktop_time_picker.zi demo/time_picker_demo.zi ../src/backend/desktop_runtime.zi ../src/backend/cairo_raster.zi $(KRYON_SOURCES) ../ziran.toml Makefile
mkdir -p $(BUILD_DIR)/desktop-time-picker-native
$(RM) $(BUILD_DIR)/desktop-time-picker-native/*.c $(BUILD_DIR)/desktop-time-picker-native/*.h
$(ZIRAN_BIN) build --target=c --root . $(KRYON_MODULE_ARGS) \
$(ZIRAN_BIN) build --target=c --exe --root . $(KRYON_MODULE_ARGS) $(DEMO_MODULE_ARGS) \
--entry desktop_time_picker:main -o $(BUILD_DIR)/desktop-time-picker-native desktop_time_picker.zi
cp $(BUILD_DIR)/desktop-time-picker-native/desktop_time_picker $@
# The desktop host draws with Cairo and Pango and finds fonts with Fontconfig.
DESKTOP_LIBS = $(shell pkg-config --libs sdl2 cairo freetype2 pangocairo fontconfig glib-2.0 x11) -lm -lpthread
define PROGRAM_RULES
$(BUILD_DIR)/$(1): $(1).zi $(KRYON_SOURCES) ../ziran.toml Makefile
mkdir -p $(BUILD_DIR)/$(1)-native
$(ZIRAN_BIN) build --target=c --exe --root . $(KRYON_MODULE_ARGS) \
--entry $(1):main -o $(BUILD_DIR)/$(1)-native $(1).zi
cp $(BUILD_DIR)/$(1)-native/$(1) $$@
$(BUILD_DIR)/matrix/$(1).go.stamp: $(1).zi $(KRYON_SOURCES) ../ziran.toml Makefile
mkdir -p $(BUILD_DIR)/matrix/$(1)-go
$(ZIRAN_BIN) build --target=go --pkg main --exe --root . $(KRYON_MODULE_ARGS) \
--entry $(1):main -o $(BUILD_DIR)/matrix/$(1)-go $(1).zi
touch $$@
$(BUILD_DIR)/matrix/$(1).web.stamp: $(1).zi $(KRYON_SOURCES) ../ziran.toml Makefile
mkdir -p $(BUILD_DIR)/matrix/$(1)-web
$(ZIRAN_BIN) build --target=c --target-os web --root . $(KRYON_MODULE_ARGS) \
--entry $(1):main -o $(BUILD_DIR)/matrix/$(1)-web $(1).zi
touch $$@
$(BUILD_DIR)/matrix/$(1).zx: $(1).zi $(KRYON_SOURCES) ../ziran.toml Makefile
mkdir -p $(BUILD_DIR)/matrix
$(ZIRAN_BIN) bundle --root . $(KRYON_MODULE_ARGS) \
--entry $(1):main -o $$@ $(1).zi
endef
$(foreach program,$(PROGRAMS),$(eval $(call PROGRAM_RULES,$(program))))
.PHONY: widget-catalog widget-catalog-web
widget-catalog:
@@ -112,47 +83,17 @@ widget-catalog:
widget-catalog-web:
python3 ../scripts/build-gallery.py
$(BUILD_DIR)/hello-desktop: $(BUILD_DIR)/desktop-hello-native/desktop_hello.c Makefile
$(CC) -std=c11 -O2 -I$(ZIRAN_INCLUDE) \
-I$(BUILD_DIR)/desktop-hello-native \
$(BUILD_DIR)/desktop-hello-native/*.c \
$(DESKTOP_LIBS) -o $@
desktop: $(BUILD_DIR)/hello
$(BUILD_DIR)/image-desktop: $(BUILD_DIR)/desktop-image-native/desktop_image.c Makefile
$(CC) -std=c11 -O2 -I$(ZIRAN_INCLUDE) \
-I$(BUILD_DIR)/desktop-image-native \
$(BUILD_DIR)/desktop-image-native/*.c \
$(DESKTOP_LIBS) -o $@
backend-matrix: $(GO_PROGRAMS) $(WEB_PROGRAMS) $(ZX_PROGRAMS)
$(BUILD_DIR)/text-desktop: $(BUILD_DIR)/desktop-text-native/desktop_text.c Makefile
$(CC) -std=c11 -O2 -I$(ZIRAN_INCLUDE) \
-I$(BUILD_DIR)/desktop-text-native \
$(BUILD_DIR)/desktop-text-native/*.c \
$(DESKTOP_LIBS) -o $@
$(BUILD_DIR)/time-picker-desktop: $(BUILD_DIR)/desktop-time-picker-native/desktop_time_picker.c Makefile
$(CC) -std=c11 -O2 -I$(ZIRAN_INCLUDE) \
-I$(BUILD_DIR)/desktop-time-picker-native \
$(BUILD_DIR)/desktop-time-picker-native/*.c \
$(DESKTOP_LIBS) -o $@
desktop: $(BUILD_DIR)/hello-desktop
desktop-test: desktop
env -u DISPLAY -u WAYLAND_DISPLAY \
KRYON_CAPTURE_PATH=$(BUILD_DIR)/hello-desktop.png \
xvfb-run -a $(BUILD_DIR)/hello-desktop
test: all backend-matrix
desktop-image-test: $(BUILD_DIR)/image-saved.zx $(BUILD_DIR)/image-desktop
env -u DISPLAY -u WAYLAND_DISPLAY \
KRYON_CAPTURE_PATH=$(BUILD_DIR)/image-desktop.png \
xvfb-run -a $(BUILD_DIR)/image-desktop
desktop-text-test: $(BUILD_DIR)/text-saved.zx $(BUILD_DIR)/text-desktop
env -u DISPLAY -u WAYLAND_DISPLAY \
KRYON_CAPTURE_PATH=$(BUILD_DIR)/text-desktop.png \
xvfb-run -a $(BUILD_DIR)/text-desktop
# The TimePicker example. `make -C examples time-picker` builds it; run
# ../build/examples/time-picker-desktop from examples/ to open it.
time-picker: $(BUILD_DIR)/time-picker-desktop
+28 -41
View File
@@ -24,7 +24,7 @@ make -C examples widget-catalog # desktop
make -C examples widget-catalog-web # Canvas/Wasm
make gallery-zx # one complete portable ZX per example
make site-gallery # stage the gallery for the existing site
make site # rebuild the gallery, editor and initial demo
make site # package the website, gallery and editor
```
Run `./build/gallery-desktop` from `examples/gallery/`. The web output is
@@ -44,18 +44,25 @@ The desktop host supports `KRYON_CATALOG_SCENE` and `KRYON_CAPTURE_PATH` for
repeatable captures. Scrub the inherited display and session environment and
use a private `xvfb-run -a` display for all captures and browser checks.
## Small host probes
## Hello world
The files below exercise custom host contracts and native/portable parity.
Their small probe bundles use those test hosts. Use the gallery exports above
for complete applications that open in the generic ZX players.
`hello.zi` is the complete example: one program with an explicit `main`, one
desktop window, and one text label that says `Hello, world!`. It uses named,
package-qualified imports so the application boundary stays visible:
`hello.zi` is a small Ziran application that imports Kryon's ordinary
`Button` and pointer modules. It builds a retained tree, handles a press and
release, and changes the button label after the click. `hello_host.zi` supplies
four raw pointer samples, font measurements, and SVG drawing effects. The
application and host are both Ziran source. No window or display server is
opened.
```zi
App :: #import "kryon/app";
Text :: #import "kryon/text";
main :: () -> s32 {
window := App.Window.{ .title = "Hello", .width = 320, .height = 160 }
return App.Run(window, Draw)
}
Draw :: (frame: App.Frame) {
Text.Draw(frame, Text.Props.{ .text = "Hello, world!", .size = 32 })
}
```
From the Kryon repository root, with the `ziran` command installed:
@@ -64,40 +71,20 @@ make -C examples
make -C examples test
```
The first command builds `build/examples/hello.zx`, generates and links
a native program from the two `.zi` sources, and writes
`build/examples/hello.svg`. Open the SVG in an image viewer to see the
idle, pressed, released, and clicked frames side by side. The test also bundles
the saved `.zir`, verifies that both `.zx` files match, and checks the native
host's four-frame click result and SVG content. The portable bundle is built
and compared here; its execution is covered by the separate portable runtime
tests.
Both commands build the native executables at `build/examples/hello` and
`build/examples/window`. Run either from `examples/` to open it. `window.zi`
is the smallest empty-window program. Neither example contains an image,
button, pointer, capture, or test-driver code. Button behavior remains covered
by the dedicated button examples and widget regression tests. The `test`
target also compiles both programs for Go, C/Web, and portable ZX.
This example shows the intended application boundary: Ziran compiles only the
modules the application imports; Kryon supplies widget decisions; a separate
Ziran host supplies raw input, font, and drawing effects. Applications with a
window use one of the hosts in [BACKENDS.md](../docs/BACKENDS.md) instead.
An optional Ziran desktop host links the application with SDL2 and Cairo
through declared foreign calls. Build it with `make -C examples desktop`.
Run `build/examples/hello-desktop` from `examples/` to interact with its
button. Its repeatable four-frame check runs on a private display with
`make -C examples desktop-test` and writes
`build/examples/hello-desktop.png` without contacting the current
desktop display. `make -C examples desktop-image-test` renders the canonical
`Image(ImageProps)` with a path-backed PNG and red tint, then writes
`make -C examples desktop-image-test` renders the canonical
`Image.Draw(Image.Props)` with a path-backed PNG and red tint, then writes
`build/examples/image-desktop.png`. The host imports Ziran's generic
`c_string` module for safe C string arguments. It handles shapes, text, and
path-backed PNG images. Texture handles and other image formats remain open.
path-backed PNG images. See [image host support](../docs/BACKENDS.md#webp-images) for image formats.
`make -C examples desktop-text-test` renders the plain `Text(TextProps)`
example under a private display and saves
`build/examples/text-desktop.png`. It also checks that source and saved
`.zir` produce the same portable `text.zx`. Run
`../build/examples/text-desktop` from `examples/` to open the interactive
window, or open `examples/text_hello.zi` in an editor to see its Ziran source.
`make -C examples time-picker` builds `time_picker_demo.zi`, Kryon's
`make -C examples time-picker` builds `demo/time_picker_demo.zi`, Kryon's
`TimePicker` without a time, with one, disabled and in a small form, with a
Light and Dark switch. Run `../build/examples/time-picker-desktop` from
`examples/` to try it with the mouse, touch and keyboard.
+11 -6
View File
@@ -2,7 +2,12 @@
#import "kryon/session"
#import "kryon/frame_snapshot"
#import "kryon/style_sheet"
using UI :: #import "kryon/Widgets";
Box :: #import "kryon/box";
Button :: #import "kryon/button";
Modal :: #import "kryon/modal";
Text :: #import "kryon/text";
#import "kryon/control_props"
#import "kryon/drawing_props"
#import "kryon/system_theme"
#import "std/number_text"
@@ -41,18 +46,18 @@ b: Rectangle;
Frame :: (session: Session, viewport: Rectangle) -> s32 {
example_input := WidgetInput(session)
SetGalleryViewport(viewport, true, example_input.now, example_input.reduced_motion)
Box(session, BoxProps.{.key = 9000, .bounds = viewport, .fill = StyleTokenColor("canvas")})
Text(session, TextProps.{.key = 9001, .bounds = .{viewport.x + 24.0, viewport.y + 12.0, viewport.width - 48.0, 36.0}, .text = "ActionModal", .font = 23})
Box.Draw(session, Box.Props.{.key = 9000, .bounds = viewport, .fill = StyleTokenColor("canvas")})
Text.Draw(session, Text.Props.{.key = 9001, .bounds = .{viewport.x + 24.0, viewport.y + 12.0, viewport.width - 48.0, 36.0}, .text = "ActionModal", .size = 23})
b = Rectangle.{viewport.x + 24.0, viewport.y + 64.0, viewport.width - 48.0, 44.0}
disabled := example_input.disabled
actions: [2]ActionModalAction
actions: [2]Modal.ActionModalAction
actions[0].label = "Cancel"; actions[1].label = "Save"; actions[1].tone = ButtonTone.ButtonToneAccent; actions[1].disabled = disabled
if !dismissed {
answer := ActionModal(session, ActionModalProps.{.title = "Save changes?", .message = "Keep your latest ideas for next time.", .max_width = 420}, actions[:])
answer := Modal.ActionModal(session, Modal.ActionModalProps.{.title = "Save changes?", .message = "Keep your latest ideas for next time.", .max_width = 420}, actions[:])
if answer.action != 0 { dismissed = true; clicks += 1 }
} else {
if Button(session, ButtonProps.{.bounds = b, .label = "Open dialog again"}) == 1 { dismissed = false }
if Button.Draw(session, Button.Props.{.bounds = b, .label = "Open dialog again"}) == 1 { dismissed = false }
}
return 0
}
+54 -63
View File
@@ -20,12 +20,13 @@
"url": "https://github.com/libsdl-org/SDL.git"
},
{
"commit": "123a1b9fe5ed2043a4eb3d3c007e9bd4cebfb95d",
"dependencies": {},
"id": "p365ce414e38bff9a",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
"commit": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"dependencies": {"image_codec": "p69c0e968ae5735d9", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "p2af20e0c835b1c63",
"name": "webp",
"ref": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
@@ -37,13 +38,13 @@
"url": "https://github.com/webmproject/libwebp.git"
},
{
"commit": "af027a528c6e42b44b68fdaa90b13a7c1136d161",
"dependencies": {"audio": "pd258d453b63edc1f", "avif": "p872d871f84f2284f", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b", "webp": "pbc4a303a61449a44"},
"dependency_refs": {"audio": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b", "avif": "f84c162594e518cb306bfd0ce41783ad55b6c730", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "02145a00a1f0df2a111da04a75f3fef260883897"},
"id": "p3cf597cf815203c0",
"name": "kryon",
"commit": "66a400980d84de58b43d8cff9753c1837cb27067",
"dependencies": {"kryon": "p83b7422cf506dc6a"},
"dependency_refs": {"kryon": "master"},
"id": "p3f7c2d81ecbcab4f",
"name": "DataViews",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
"url": "https://github.com/kryonlabs/data-views.git"
},
{
"commit": "1aadfad932c98c069a1204261b1856f81f3bc199",
@@ -54,15 +55,32 @@
"source": true,
"url": "https://github.com/AOMediaCodec/libavif.git"
},
{
"commit": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "p59deb49c7f103127",
"name": "audio",
"ref": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"url": "https://github.com/ziranlang/audio.git"
},
{
"commit": "bd278217e2bac754d868b3d6502eac4257658d4b",
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa"},
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa"},
"dependency_refs": {"dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937"},
"id": "p5d7d12505a42f7b3",
"name": "av1",
"ref": "bd278217e2bac754d868b3d6502eac4257658d4b",
"url": "https://github.com/ziranlang/av1.git"
},
{
"commit": "360553150917f352e49e1beb78917370792ccaef",
"dependencies": {},
"id": "p69c0e968ae5735d9",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
},
{
"commit": "b141d9c45db236335351c8a4b2a14b3ade27c937",
"dependencies": {},
@@ -73,22 +91,22 @@
"url": "https://aomedia.googlesource.com/aom"
},
{
"commit": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"dependency_refs": {"av1": "bd278217e2bac754d868b3d6502eac4257658d4b", "dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"},
"id": "p872d871f84f2284f",
"name": "avif",
"ref": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"url": "https://github.com/ziranlang/avif.git"
"commit": "03016057afa1c695f6e24f32e5be5df761475220",
"dependencies": {"audio": "p59deb49c7f103127", "avif": "pb203529d803e73a4", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "sdl3": "p16cd0434af3dff7b", "webp": "p2af20e0c835b1c63"},
"dependency_refs": {"audio": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2", "avif": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "ec6ed304767e10c125ab2820f3b01d6fd773e147"},
"id": "p83b7422cf506dc6a",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "3f888653b6b97010163d824c4cc72476be3214f3",
"dependencies": {"kryon": "p3cf597cf815203c0"},
"dependency_refs": {"kryon": "master"},
"id": "pab5377a2950368a2",
"name": "plot",
"ref": "master",
"url": "https://github.com/kryonlabs/plot.git"
"commit": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"dependency_refs": {"av1": "bd278217e2bac754d868b3d6502eac4257658d4b", "dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"},
"id": "pb203529d803e73a4",
"name": "avif",
"ref": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"url": "https://github.com/ziranlang/avif.git"
},
{
"commit": "54706fc6bc0cdecab7e9593974a4039cc038fca7",
@@ -100,40 +118,13 @@
"url": "https://github.com/videolan/dav1d.git"
},
{
"commit": "570ada03428260435541e7474d4a36afcefccfd6",
"dependencies": {"image_codec": "p365ce414e38bff9a", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "pbc4a303a61449a44",
"name": "webp",
"ref": "02145a00a1f0df2a111da04a75f3fef260883897",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "942fea7809063407e2b4fa9611a2247ab6b3b894",
"dependencies": {"kryon": "p3cf597cf815203c0"},
"dependency_refs": {"kryon": "master"},
"id": "pc4c837bf2ac33dfb",
"name": "DataViews",
"commit": "67a7131b9e6fb5a3a09d6e5191044c4c97196aa3",
"dependencies": {"kryon": "p83b7422cf506dc6a"},
"dependency_refs": {"kryon": "3f72441949d4e16094834fa9220e5d7fa77a0ac0"},
"id": "pd07b633ca4461fd8",
"name": "plot",
"ref": "master",
"url": "https://github.com/kryonlabs/data-views.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
"id": "pcc7aa76725f2fb2f",
"name": "raylib",
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "pd258d453b63edc1f",
"name": "audio",
"ref": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"url": "https://github.com/ziranlang/audio.git"
"url": "https://github.com/kryonlabs/plot.git"
},
{
"commit": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6",
@@ -146,13 +137,13 @@
}
],
"root": {
"dependencies": {"data_views": "pc4c837bf2ac33dfb", "kryon": "p3cf597cf815203c0", "plot": "pab5377a2950368a2"},
"dependencies": {"data_views": "p3f7c2d81ecbcab4f", "kryon": "p83b7422cf506dc6a", "plot": "pd07b633ca4461fd8"},
"dependency_refs": {"data_views": "master", "kryon": "master", "plot": "master"},
"name": "actionmodal"
},
"toolchain": {
"commit": "d4ef3bb7dd15b5fe715cbdbdd34df8fa6592e3e4",
"ref": "1d616e3a1761dd4e4a1c5a960c165d30ba16da29",
"commit": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"ref": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"url": "https://github.com/ziranlang/ziran.git"
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ tool = "kryon"
[toolchain]
git = "https://github.com/ziranlang/ziran.git"
ref = "1d616e3a1761dd4e4a1c5a960c165d30ba16da29"
ref = "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863"
[tool.kryon]
default_profile = "desktop"
+9 -5
View File
@@ -1,12 +1,16 @@
using UI :: #import "kryon/Widgets";
Alert :: #import "kryon/alert";
Button :: #import "kryon/button";
Text :: #import "kryon/text";
#import "kryon/geometry"
#import "kryon/session"
state: AlertState;
state: Alert.AlertState;
#program_export
Frame :: (session: Session, viewport: Rectangle) -> s32 {
Text(session, TextProps.{.disabled = example_disabled, .key = 1, .bounds = .{viewport.x + 20.0, viewport.y + 16.0, viewport.width - 40.0, 40.0}, .text = "Alert", .font = 28})
Text.Draw(session, Text.Props.{.disabled = example_disabled, .key = 1, .bounds = .{viewport.x + 20.0, viewport.y + 16.0, viewport.width - 40.0, 40.0}, .text = "Alert", .size = 28})
bounds := Rectangle.{viewport.x + 20.0, viewport.y + 76.0, viewport.width - 40.0, 180.0}
Alert(session, AlertProps.{.disabled = example_disabled, .key = 10, .bounds = bounds, .title = "Changes saved", .description = "Your settings are up to date.", .dismissible = true}, *state)
if Button(session, ButtonProps.{.disabled = example_disabled, .key = 11, .bounds = .{bounds.x, bounds.y + 200.0, 160.0, 40.0}, .label = "Show alert"}) != 0 { state.dismissed = false }
Alert.Draw(session, Alert.Props.{.disabled = example_disabled, .key = 10, .bounds = bounds, .title = "Changes saved", .description = "Your settings are up to date.", .dismissible = true}, *state)
if Button.Draw(session, Button.Props.{.disabled = example_disabled, .key = 11, .bounds = .{bounds.x, bounds.y + 200.0, 160.0, 40.0}, .label = "Show alert"}) != 0 { state.dismissed = false }
return 0
}
+41 -50
View File
@@ -20,12 +20,13 @@
"url": "https://github.com/libsdl-org/SDL.git"
},
{
"commit": "123a1b9fe5ed2043a4eb3d3c007e9bd4cebfb95d",
"dependencies": {},
"id": "p365ce414e38bff9a",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
"commit": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"dependencies": {"image_codec": "p69c0e968ae5735d9", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "p2af20e0c835b1c63",
"name": "webp",
"ref": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
@@ -36,15 +37,6 @@
"source": true,
"url": "https://github.com/webmproject/libwebp.git"
},
{
"commit": "af027a528c6e42b44b68fdaa90b13a7c1136d161",
"dependencies": {"audio": "pd258d453b63edc1f", "avif": "p872d871f84f2284f", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b", "webp": "pbc4a303a61449a44"},
"dependency_refs": {"audio": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b", "avif": "f84c162594e518cb306bfd0ce41783ad55b6c730", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "02145a00a1f0df2a111da04a75f3fef260883897"},
"id": "p3cf597cf815203c0",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "1aadfad932c98c069a1204261b1856f81f3bc199",
"dependencies": {},
@@ -54,15 +46,32 @@
"source": true,
"url": "https://github.com/AOMediaCodec/libavif.git"
},
{
"commit": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "p59deb49c7f103127",
"name": "audio",
"ref": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"url": "https://github.com/ziranlang/audio.git"
},
{
"commit": "bd278217e2bac754d868b3d6502eac4257658d4b",
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa"},
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa"},
"dependency_refs": {"dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937"},
"id": "p5d7d12505a42f7b3",
"name": "av1",
"ref": "bd278217e2bac754d868b3d6502eac4257658d4b",
"url": "https://github.com/ziranlang/av1.git"
},
{
"commit": "360553150917f352e49e1beb78917370792ccaef",
"dependencies": {},
"id": "p69c0e968ae5735d9",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
},
{
"commit": "b141d9c45db236335351c8a4b2a14b3ade27c937",
"dependencies": {},
@@ -73,12 +82,21 @@
"url": "https://aomedia.googlesource.com/aom"
},
{
"commit": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"commit": "03016057afa1c695f6e24f32e5be5df761475220",
"dependencies": {"audio": "p59deb49c7f103127", "avif": "pb203529d803e73a4", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "sdl3": "p16cd0434af3dff7b", "webp": "p2af20e0c835b1c63"},
"dependency_refs": {"audio": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2", "avif": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "ec6ed304767e10c125ab2820f3b01d6fd773e147"},
"id": "p83b7422cf506dc6a",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"dependency_refs": {"av1": "bd278217e2bac754d868b3d6502eac4257658d4b", "dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"},
"id": "p872d871f84f2284f",
"id": "pb203529d803e73a4",
"name": "avif",
"ref": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"ref": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"url": "https://github.com/ziranlang/avif.git"
},
{
@@ -90,33 +108,6 @@
"source": true,
"url": "https://github.com/videolan/dav1d.git"
},
{
"commit": "570ada03428260435541e7474d4a36afcefccfd6",
"dependencies": {"image_codec": "p365ce414e38bff9a", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "pbc4a303a61449a44",
"name": "webp",
"ref": "02145a00a1f0df2a111da04a75f3fef260883897",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
"id": "pcc7aa76725f2fb2f",
"name": "raylib",
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "pd258d453b63edc1f",
"name": "audio",
"ref": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"url": "https://github.com/ziranlang/audio.git"
},
{
"commit": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6",
"dependencies": {},
@@ -128,13 +119,13 @@
}
],
"root": {
"dependencies": {"kryon": "p3cf597cf815203c0"},
"dependencies": {"kryon": "p83b7422cf506dc6a"},
"dependency_refs": {"kryon": "master"},
"name": "alert"
},
"toolchain": {
"commit": "d4ef3bb7dd15b5fe715cbdbdd34df8fa6592e3e4",
"ref": "1d616e3a1761dd4e4a1c5a960c165d30ba16da29",
"commit": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"ref": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"url": "https://github.com/ziranlang/ziran.git"
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ tool = "kryon"
[toolchain]
git = "https://github.com/ziranlang/ziran.git"
ref = "1d616e3a1761dd4e4a1c5a960c165d30ba16da29"
ref = "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863"
[tool.kryon]
default_profile = "desktop"
+8 -5
View File
@@ -1,14 +1,17 @@
using UI :: #import "kryon/Widgets";
Avatar :: #import "kryon/avatar";
Text :: #import "kryon/text";
#import "kryon/geometry"
#import "kryon/session"
#program_export
Frame :: (session: Session, viewport: Rectangle) -> s32 {
Text(session, TextProps.{.disabled = example_disabled, .key = 1, .bounds = .{viewport.x + 20.0, viewport.y + 16.0, viewport.width - 40.0, 40.0}, .text = "Avatar", .font = 28})
Text.Draw(session, Text.Props.{.disabled = example_disabled, .key = 1, .bounds = .{viewport.x + 20.0, viewport.y + 16.0, viewport.width - 40.0, 40.0}, .text = "Avatar", .size = 28})
bounds := Rectangle.{viewport.x + 20.0, viewport.y + 76.0, viewport.width - 40.0, 180.0}
Avatar(session, AvatarProps.{.disabled = example_disabled, .key = 10, .bounds = .{bounds.x, bounds.y, 72.0, 72.0}, .name = "Ada Lovelace", .size = 72.0})
Avatar(session, AvatarProps.{.disabled = example_disabled, .key = 11, .bounds = .{bounds.x + 90.0, bounds.y, 72.0, 72.0}, .name = "Grace Hopper", .size = 72.0, .square = true})
Avatar.Draw(session, Avatar.Props.{.disabled = example_disabled, .key = 10, .bounds = .{bounds.x, bounds.y, 72.0, 72.0}, .name = "Ada Lovelace", .size = 72.0})
Avatar.Draw(session, Avatar.Props.{.disabled = example_disabled, .key = 11, .bounds = .{bounds.x + 90.0, bounds.y, 72.0, 72.0}, .name = "Grace Hopper", .size = 72.0, .square = true})
names := string.["Ada Lovelace", "Grace Hopper", "Katherine Johnson", "Alan Turing"]
AvatarGroup(session, AvatarGroupProps.{.key = 12, .bounds = .{bounds.x, bounds.y + 100.0, bounds.width, 56.0}, .size = 48.0, .max_visible = 3}, names[:])
Avatar.AvatarGroup(session, Avatar.AvatarGroupProps.{.key = 12, .bounds = .{bounds.x, bounds.y + 100.0, bounds.width, 56.0}, .size = 48.0, .max_visible = 3}, names[:])
return 0
}
+41 -50
View File
@@ -20,12 +20,13 @@
"url": "https://github.com/libsdl-org/SDL.git"
},
{
"commit": "123a1b9fe5ed2043a4eb3d3c007e9bd4cebfb95d",
"dependencies": {},
"id": "p365ce414e38bff9a",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
"commit": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"dependencies": {"image_codec": "p69c0e968ae5735d9", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "p2af20e0c835b1c63",
"name": "webp",
"ref": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
@@ -36,15 +37,6 @@
"source": true,
"url": "https://github.com/webmproject/libwebp.git"
},
{
"commit": "af027a528c6e42b44b68fdaa90b13a7c1136d161",
"dependencies": {"audio": "pd258d453b63edc1f", "avif": "p872d871f84f2284f", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b", "webp": "pbc4a303a61449a44"},
"dependency_refs": {"audio": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b", "avif": "f84c162594e518cb306bfd0ce41783ad55b6c730", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "02145a00a1f0df2a111da04a75f3fef260883897"},
"id": "p3cf597cf815203c0",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "1aadfad932c98c069a1204261b1856f81f3bc199",
"dependencies": {},
@@ -54,15 +46,32 @@
"source": true,
"url": "https://github.com/AOMediaCodec/libavif.git"
},
{
"commit": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "p59deb49c7f103127",
"name": "audio",
"ref": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"url": "https://github.com/ziranlang/audio.git"
},
{
"commit": "bd278217e2bac754d868b3d6502eac4257658d4b",
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa"},
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa"},
"dependency_refs": {"dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937"},
"id": "p5d7d12505a42f7b3",
"name": "av1",
"ref": "bd278217e2bac754d868b3d6502eac4257658d4b",
"url": "https://github.com/ziranlang/av1.git"
},
{
"commit": "360553150917f352e49e1beb78917370792ccaef",
"dependencies": {},
"id": "p69c0e968ae5735d9",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
},
{
"commit": "b141d9c45db236335351c8a4b2a14b3ade27c937",
"dependencies": {},
@@ -73,12 +82,21 @@
"url": "https://aomedia.googlesource.com/aom"
},
{
"commit": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"commit": "03016057afa1c695f6e24f32e5be5df761475220",
"dependencies": {"audio": "p59deb49c7f103127", "avif": "pb203529d803e73a4", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "sdl3": "p16cd0434af3dff7b", "webp": "p2af20e0c835b1c63"},
"dependency_refs": {"audio": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2", "avif": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "ec6ed304767e10c125ab2820f3b01d6fd773e147"},
"id": "p83b7422cf506dc6a",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"dependency_refs": {"av1": "bd278217e2bac754d868b3d6502eac4257658d4b", "dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"},
"id": "p872d871f84f2284f",
"id": "pb203529d803e73a4",
"name": "avif",
"ref": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"ref": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"url": "https://github.com/ziranlang/avif.git"
},
{
@@ -90,33 +108,6 @@
"source": true,
"url": "https://github.com/videolan/dav1d.git"
},
{
"commit": "570ada03428260435541e7474d4a36afcefccfd6",
"dependencies": {"image_codec": "p365ce414e38bff9a", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "pbc4a303a61449a44",
"name": "webp",
"ref": "02145a00a1f0df2a111da04a75f3fef260883897",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
"id": "pcc7aa76725f2fb2f",
"name": "raylib",
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "pd258d453b63edc1f",
"name": "audio",
"ref": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"url": "https://github.com/ziranlang/audio.git"
},
{
"commit": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6",
"dependencies": {},
@@ -128,13 +119,13 @@
}
],
"root": {
"dependencies": {"kryon": "p3cf597cf815203c0"},
"dependencies": {"kryon": "p83b7422cf506dc6a"},
"dependency_refs": {"kryon": "master"},
"name": "avatar"
},
"toolchain": {
"commit": "d4ef3bb7dd15b5fe715cbdbdd34df8fa6592e3e4",
"ref": "1d616e3a1761dd4e4a1c5a960c165d30ba16da29",
"commit": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"ref": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"url": "https://github.com/ziranlang/ziran.git"
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ tool = "kryon"
[toolchain]
git = "https://github.com/ziranlang/ziran.git"
ref = "1d616e3a1761dd4e4a1c5a960c165d30ba16da29"
ref = "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863"
[tool.kryon]
default_profile = "desktop"
+6 -3
View File
@@ -1,12 +1,15 @@
using UI :: #import "kryon/Widgets";
Badge :: #import "kryon/badge";
Text :: #import "kryon/text";
#import "kryon/geometry"
#import "kryon/session"
#program_export
Frame :: (session: Session, viewport: Rectangle) -> s32 {
Text(session, TextProps.{.disabled = example_disabled, .key = 1, .bounds = .{viewport.x + 20.0, viewport.y + 16.0, viewport.width - 40.0, 40.0}, .text = "Badge", .font = 28})
Text.Draw(session, Text.Props.{.disabled = example_disabled, .key = 1, .bounds = .{viewport.x + 20.0, viewport.y + 16.0, viewport.width - 40.0, 40.0}, .text = "Badge", .size = 28})
bounds := Rectangle.{viewport.x + 20.0, viewport.y + 76.0, viewport.width - 40.0, 180.0}
for i: cast(s32)0..4 {
Badge(session, BadgeProps.{.disabled = example_disabled, .key = cast(u64)(10 + i), .bounds = .{bounds.x, bounds.y + cast(float32)i * 48.0, 140.0, 36.0}, .text = "Ready", .tone = cast(BadgeTone)i, .dot = true, .solid = i % 2 == 0})
Badge.Draw(session, Badge.Props.{.disabled = example_disabled, .key = cast(u64)(10 + i), .bounds = .{bounds.x, bounds.y + cast(float32)i * 48.0, 140.0, 36.0}, .text = "Ready", .tone = cast(Badge.BadgeTone)i, .dot = true, .solid = i % 2 == 0})
}
return 0
}
+41 -50
View File
@@ -20,12 +20,13 @@
"url": "https://github.com/libsdl-org/SDL.git"
},
{
"commit": "123a1b9fe5ed2043a4eb3d3c007e9bd4cebfb95d",
"dependencies": {},
"id": "p365ce414e38bff9a",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
"commit": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"dependencies": {"image_codec": "p69c0e968ae5735d9", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "p2af20e0c835b1c63",
"name": "webp",
"ref": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
@@ -36,15 +37,6 @@
"source": true,
"url": "https://github.com/webmproject/libwebp.git"
},
{
"commit": "af027a528c6e42b44b68fdaa90b13a7c1136d161",
"dependencies": {"audio": "pd258d453b63edc1f", "avif": "p872d871f84f2284f", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b", "webp": "pbc4a303a61449a44"},
"dependency_refs": {"audio": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b", "avif": "f84c162594e518cb306bfd0ce41783ad55b6c730", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "02145a00a1f0df2a111da04a75f3fef260883897"},
"id": "p3cf597cf815203c0",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "1aadfad932c98c069a1204261b1856f81f3bc199",
"dependencies": {},
@@ -54,15 +46,32 @@
"source": true,
"url": "https://github.com/AOMediaCodec/libavif.git"
},
{
"commit": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "p59deb49c7f103127",
"name": "audio",
"ref": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"url": "https://github.com/ziranlang/audio.git"
},
{
"commit": "bd278217e2bac754d868b3d6502eac4257658d4b",
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa"},
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa"},
"dependency_refs": {"dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937"},
"id": "p5d7d12505a42f7b3",
"name": "av1",
"ref": "bd278217e2bac754d868b3d6502eac4257658d4b",
"url": "https://github.com/ziranlang/av1.git"
},
{
"commit": "360553150917f352e49e1beb78917370792ccaef",
"dependencies": {},
"id": "p69c0e968ae5735d9",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
},
{
"commit": "b141d9c45db236335351c8a4b2a14b3ade27c937",
"dependencies": {},
@@ -73,12 +82,21 @@
"url": "https://aomedia.googlesource.com/aom"
},
{
"commit": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"commit": "03016057afa1c695f6e24f32e5be5df761475220",
"dependencies": {"audio": "p59deb49c7f103127", "avif": "pb203529d803e73a4", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "sdl3": "p16cd0434af3dff7b", "webp": "p2af20e0c835b1c63"},
"dependency_refs": {"audio": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2", "avif": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "ec6ed304767e10c125ab2820f3b01d6fd773e147"},
"id": "p83b7422cf506dc6a",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"dependency_refs": {"av1": "bd278217e2bac754d868b3d6502eac4257658d4b", "dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"},
"id": "p872d871f84f2284f",
"id": "pb203529d803e73a4",
"name": "avif",
"ref": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"ref": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"url": "https://github.com/ziranlang/avif.git"
},
{
@@ -90,33 +108,6 @@
"source": true,
"url": "https://github.com/videolan/dav1d.git"
},
{
"commit": "570ada03428260435541e7474d4a36afcefccfd6",
"dependencies": {"image_codec": "p365ce414e38bff9a", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "pbc4a303a61449a44",
"name": "webp",
"ref": "02145a00a1f0df2a111da04a75f3fef260883897",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
"id": "pcc7aa76725f2fb2f",
"name": "raylib",
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "pd258d453b63edc1f",
"name": "audio",
"ref": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"url": "https://github.com/ziranlang/audio.git"
},
{
"commit": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6",
"dependencies": {},
@@ -128,13 +119,13 @@
}
],
"root": {
"dependencies": {"kryon": "p3cf597cf815203c0"},
"dependencies": {"kryon": "p83b7422cf506dc6a"},
"dependency_refs": {"kryon": "master"},
"name": "badge"
},
"toolchain": {
"commit": "d4ef3bb7dd15b5fe715cbdbdd34df8fa6592e3e4",
"ref": "1d616e3a1761dd4e4a1c5a960c165d30ba16da29",
"commit": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"ref": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"url": "https://github.com/ziranlang/ziran.git"
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ tool = "kryon"
[toolchain]
git = "https://github.com/ziranlang/ziran.git"
ref = "1d616e3a1761dd4e4a1c5a960c165d30ba16da29"
ref = "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863"
[tool.kryon]
default_profile = "desktop"
+6 -3
View File
@@ -2,7 +2,10 @@
#import "kryon/session"
#import "kryon/frame_snapshot"
#import "kryon/style_sheet"
using UI :: #import "kryon/Widgets";
Box :: #import "kryon/box";
Text :: #import "kryon/text";
#import "kryon/control_props"
#import "kryon/drawing_props"
Plot :: #import "plot/PlotWidget";
Charts :: #import "plot/Plot";
Theme :: #import "kryon/theme";
@@ -68,8 +71,8 @@ Prepare :: (session: Session, scene: s32) {
Frame :: (session: Session, viewport: Rectangle) -> s32 {
example_input := WidgetInput(session)
SetGalleryViewport(viewport, true, example_input.now, example_input.reduced_motion)
Box(session, BoxProps.{.key = 9000, .bounds = viewport, .fill = StyleTokenColor("canvas")})
Text(session, TextProps.{.key = 9001, .bounds = .{viewport.x + 24.0, viewport.y + 12.0, viewport.width - 48.0, 36.0}, .text = "BandChart", .font = 23})
Box.Draw(session, Box.Props.{.key = 9000, .bounds = viewport, .fill = StyleTokenColor("canvas")})
Text.Draw(session, Text.Props.{.key = 9001, .bounds = .{viewport.x + 24.0, viewport.y + 12.0, viewport.width - 48.0, 36.0}, .text = "BandChart", .size = 23})
disabled := example_input.disabled
scene: s32 = 5
InstallStyles(example_input.theme == 2)
+54 -63
View File
@@ -20,12 +20,13 @@
"url": "https://github.com/libsdl-org/SDL.git"
},
{
"commit": "123a1b9fe5ed2043a4eb3d3c007e9bd4cebfb95d",
"dependencies": {},
"id": "p365ce414e38bff9a",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
"commit": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"dependencies": {"image_codec": "p69c0e968ae5735d9", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "p2af20e0c835b1c63",
"name": "webp",
"ref": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
@@ -37,13 +38,13 @@
"url": "https://github.com/webmproject/libwebp.git"
},
{
"commit": "af027a528c6e42b44b68fdaa90b13a7c1136d161",
"dependencies": {"audio": "pd258d453b63edc1f", "avif": "p872d871f84f2284f", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b", "webp": "pbc4a303a61449a44"},
"dependency_refs": {"audio": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b", "avif": "f84c162594e518cb306bfd0ce41783ad55b6c730", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "02145a00a1f0df2a111da04a75f3fef260883897"},
"id": "p3cf597cf815203c0",
"name": "kryon",
"commit": "66a400980d84de58b43d8cff9753c1837cb27067",
"dependencies": {"kryon": "p83b7422cf506dc6a"},
"dependency_refs": {"kryon": "master"},
"id": "p3f7c2d81ecbcab4f",
"name": "DataViews",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
"url": "https://github.com/kryonlabs/data-views.git"
},
{
"commit": "1aadfad932c98c069a1204261b1856f81f3bc199",
@@ -54,15 +55,32 @@
"source": true,
"url": "https://github.com/AOMediaCodec/libavif.git"
},
{
"commit": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "p59deb49c7f103127",
"name": "audio",
"ref": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"url": "https://github.com/ziranlang/audio.git"
},
{
"commit": "bd278217e2bac754d868b3d6502eac4257658d4b",
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa"},
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa"},
"dependency_refs": {"dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937"},
"id": "p5d7d12505a42f7b3",
"name": "av1",
"ref": "bd278217e2bac754d868b3d6502eac4257658d4b",
"url": "https://github.com/ziranlang/av1.git"
},
{
"commit": "360553150917f352e49e1beb78917370792ccaef",
"dependencies": {},
"id": "p69c0e968ae5735d9",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
},
{
"commit": "b141d9c45db236335351c8a4b2a14b3ade27c937",
"dependencies": {},
@@ -73,22 +91,22 @@
"url": "https://aomedia.googlesource.com/aom"
},
{
"commit": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"dependency_refs": {"av1": "bd278217e2bac754d868b3d6502eac4257658d4b", "dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"},
"id": "p872d871f84f2284f",
"name": "avif",
"ref": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"url": "https://github.com/ziranlang/avif.git"
"commit": "03016057afa1c695f6e24f32e5be5df761475220",
"dependencies": {"audio": "p59deb49c7f103127", "avif": "pb203529d803e73a4", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "sdl3": "p16cd0434af3dff7b", "webp": "p2af20e0c835b1c63"},
"dependency_refs": {"audio": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2", "avif": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "ec6ed304767e10c125ab2820f3b01d6fd773e147"},
"id": "p83b7422cf506dc6a",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "3f888653b6b97010163d824c4cc72476be3214f3",
"dependencies": {"kryon": "p3cf597cf815203c0"},
"dependency_refs": {"kryon": "master"},
"id": "pab5377a2950368a2",
"name": "plot",
"ref": "master",
"url": "https://github.com/kryonlabs/plot.git"
"commit": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"dependency_refs": {"av1": "bd278217e2bac754d868b3d6502eac4257658d4b", "dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"},
"id": "pb203529d803e73a4",
"name": "avif",
"ref": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"url": "https://github.com/ziranlang/avif.git"
},
{
"commit": "54706fc6bc0cdecab7e9593974a4039cc038fca7",
@@ -100,40 +118,13 @@
"url": "https://github.com/videolan/dav1d.git"
},
{
"commit": "570ada03428260435541e7474d4a36afcefccfd6",
"dependencies": {"image_codec": "p365ce414e38bff9a", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "pbc4a303a61449a44",
"name": "webp",
"ref": "02145a00a1f0df2a111da04a75f3fef260883897",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "942fea7809063407e2b4fa9611a2247ab6b3b894",
"dependencies": {"kryon": "p3cf597cf815203c0"},
"dependency_refs": {"kryon": "master"},
"id": "pc4c837bf2ac33dfb",
"name": "DataViews",
"commit": "67a7131b9e6fb5a3a09d6e5191044c4c97196aa3",
"dependencies": {"kryon": "p83b7422cf506dc6a"},
"dependency_refs": {"kryon": "3f72441949d4e16094834fa9220e5d7fa77a0ac0"},
"id": "pd07b633ca4461fd8",
"name": "plot",
"ref": "master",
"url": "https://github.com/kryonlabs/data-views.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
"id": "pcc7aa76725f2fb2f",
"name": "raylib",
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "pd258d453b63edc1f",
"name": "audio",
"ref": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"url": "https://github.com/ziranlang/audio.git"
"url": "https://github.com/kryonlabs/plot.git"
},
{
"commit": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6",
@@ -146,13 +137,13 @@
}
],
"root": {
"dependencies": {"data_views": "pc4c837bf2ac33dfb", "kryon": "p3cf597cf815203c0", "plot": "pab5377a2950368a2"},
"dependencies": {"data_views": "p3f7c2d81ecbcab4f", "kryon": "p83b7422cf506dc6a", "plot": "pd07b633ca4461fd8"},
"dependency_refs": {"data_views": "master", "kryon": "master", "plot": "master"},
"name": "bandchart"
},
"toolchain": {
"commit": "d4ef3bb7dd15b5fe715cbdbdd34df8fa6592e3e4",
"ref": "1d616e3a1761dd4e4a1c5a960c165d30ba16da29",
"commit": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"ref": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"url": "https://github.com/ziranlang/ziran.git"
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ tool = "kryon"
[toolchain]
git = "https://github.com/ziranlang/ziran.git"
ref = "1d616e3a1761dd4e4a1c5a960c165d30ba16da29"
ref = "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863"
[tool.kryon]
default_profile = "desktop"
+12 -8
View File
@@ -1,22 +1,26 @@
using UI :: #import "kryon/Widgets";
Banner :: #import "kryon/banner";
Button :: #import "kryon/button";
Text :: #import "kryon/text";
#import "kryon/geometry"
#import "kryon/session"
#import "kryon/frame_snapshot"
DemoTheme :: #import "kryon/Theme";
state: BannerState;
state: Banner.BannerState;
initialized: bool;
requested: bool;
#program_export
Frame :: (session: Session, viewport: Rectangle) -> s32 {
Text(session, TextProps.{.disabled = example_disabled, .key = 1, .bounds = .{viewport.x + 20.0, viewport.y + 16.0, viewport.width - 40.0, 40.0}, .text = "Banner", .font = 28})
Text.Draw(session, Text.Props.{.disabled = example_disabled, .key = 1, .bounds = .{viewport.x + 20.0, viewport.y + 16.0, viewport.width - 40.0, 40.0}, .text = "Banner", .size = 28})
bounds := Rectangle.{viewport.x + 20.0, viewport.y + 76.0, viewport.width - 40.0, 180.0}
input := CaptureFrameInput(session)
now := cast(float64)input.elapsed_ms / 1000.0
if !initialized { state = BannerStateFor(true); initialized = true }
BannerAdvance(*state, cast(float32)input.delta_ms / 1000.0, (example_reduced_motion || DemoTheme.CurrentTheme().motion.reduced_motion))
result := Banner(session, BannerProps.{.disabled = example_disabled, .key = 10, .bounds = bounds, .text = "A new version is available.", .action = "Update", .dismissible = true}, *state)
if !initialized { state = Banner.BannerStateFor(true); initialized = true }
Banner.BannerAdvance(*state, cast(float32)input.delta_ms / 1000.0, (example_reduced_motion || DemoTheme.CurrentTheme().motion.reduced_motion))
result := Banner.Draw(session, Banner.Props.{.disabled = example_disabled, .key = 10, .bounds = bounds, .text = "A new version is available.", .action = "Update", .dismissible = true}, *state)
if result.action { requested = true; state.open = false }
if requested { Text(session, TextProps.{.disabled = example_disabled, .key = 12, .bounds = bounds, .text = "Update requested"}) }
if Button(session, ButtonProps.{.disabled = example_disabled, .key = 11, .bounds = .{bounds.x, bounds.y + 200.0, 160.0, 40.0}, .label = "Show banner"}) != 0 { state.open = true; requested = false }
if requested { Text.Draw(session, Text.Props.{.disabled = example_disabled, .key = 12, .bounds = bounds, .text = "Update requested"}) }
if Button.Draw(session, Button.Props.{.disabled = example_disabled, .key = 11, .bounds = .{bounds.x, bounds.y + 200.0, 160.0, 40.0}, .label = "Show banner"}) != 0 { state.open = true; requested = false }
return 0
}
+41 -50
View File
@@ -20,12 +20,13 @@
"url": "https://github.com/libsdl-org/SDL.git"
},
{
"commit": "123a1b9fe5ed2043a4eb3d3c007e9bd4cebfb95d",
"dependencies": {},
"id": "p365ce414e38bff9a",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
"commit": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"dependencies": {"image_codec": "p69c0e968ae5735d9", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "p2af20e0c835b1c63",
"name": "webp",
"ref": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
@@ -36,15 +37,6 @@
"source": true,
"url": "https://github.com/webmproject/libwebp.git"
},
{
"commit": "af027a528c6e42b44b68fdaa90b13a7c1136d161",
"dependencies": {"audio": "pd258d453b63edc1f", "avif": "p872d871f84f2284f", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b", "webp": "pbc4a303a61449a44"},
"dependency_refs": {"audio": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b", "avif": "f84c162594e518cb306bfd0ce41783ad55b6c730", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "02145a00a1f0df2a111da04a75f3fef260883897"},
"id": "p3cf597cf815203c0",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "1aadfad932c98c069a1204261b1856f81f3bc199",
"dependencies": {},
@@ -54,15 +46,32 @@
"source": true,
"url": "https://github.com/AOMediaCodec/libavif.git"
},
{
"commit": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "p59deb49c7f103127",
"name": "audio",
"ref": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2",
"url": "https://github.com/ziranlang/audio.git"
},
{
"commit": "bd278217e2bac754d868b3d6502eac4257658d4b",
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa"},
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa"},
"dependency_refs": {"dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937"},
"id": "p5d7d12505a42f7b3",
"name": "av1",
"ref": "bd278217e2bac754d868b3d6502eac4257658d4b",
"url": "https://github.com/ziranlang/av1.git"
},
{
"commit": "360553150917f352e49e1beb78917370792ccaef",
"dependencies": {},
"id": "p69c0e968ae5735d9",
"name": "image-codec",
"ref": "360553150917f352e49e1beb78917370792ccaef",
"url": "https://github.com/ziranlang/image-codec.git"
},
{
"commit": "b141d9c45db236335351c8a4b2a14b3ade27c937",
"dependencies": {},
@@ -73,12 +82,21 @@
"url": "https://aomedia.googlesource.com/aom"
},
{
"commit": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p365ce414e38bff9a", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"commit": "03016057afa1c695f6e24f32e5be5df761475220",
"dependencies": {"audio": "p59deb49c7f103127", "avif": "pb203529d803e73a4", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "sdl3": "p16cd0434af3dff7b", "webp": "p2af20e0c835b1c63"},
"dependency_refs": {"audio": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2", "avif": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "ec6ed304767e10c125ab2820f3b01d6fd773e147"},
"id": "p83b7422cf506dc6a",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"},
"dependency_refs": {"av1": "bd278217e2bac754d868b3d6502eac4257658d4b", "dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"},
"id": "p872d871f84f2284f",
"id": "pb203529d803e73a4",
"name": "avif",
"ref": "f84c162594e518cb306bfd0ce41783ad55b6c730",
"ref": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30",
"url": "https://github.com/ziranlang/avif.git"
},
{
@@ -90,33 +108,6 @@
"source": true,
"url": "https://github.com/videolan/dav1d.git"
},
{
"commit": "570ada03428260435541e7474d4a36afcefccfd6",
"dependencies": {"image_codec": "p365ce414e38bff9a", "libwebp": "p3b3c785a0e17e605"},
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
"id": "pbc4a303a61449a44",
"name": "webp",
"ref": "02145a00a1f0df2a111da04a75f3fef260883897",
"url": "https://github.com/ziranlang/webp.git"
},
{
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"dependencies": {},
"id": "pcc7aa76725f2fb2f",
"name": "raylib",
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"},
"dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"},
"id": "pd258d453b63edc1f",
"name": "audio",
"ref": "f5eed1e6c817997d51508f9c3c7b948a0bb4ad0b",
"url": "https://github.com/ziranlang/audio.git"
},
{
"commit": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6",
"dependencies": {},
@@ -128,13 +119,13 @@
}
],
"root": {
"dependencies": {"kryon": "p3cf597cf815203c0"},
"dependencies": {"kryon": "p83b7422cf506dc6a"},
"dependency_refs": {"kryon": "master"},
"name": "banner"
},
"toolchain": {
"commit": "d4ef3bb7dd15b5fe715cbdbdd34df8fa6592e3e4",
"ref": "1d616e3a1761dd4e4a1c5a960c165d30ba16da29",
"commit": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"ref": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863",
"url": "https://github.com/ziranlang/ziran.git"
}
}
Loaded 100 of 1372 files, more files were not shown because too many files have changed in this diff. Show more