Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Warnings and the devtools

At the end of this chapter, you can see what your app is doing.

Turn it on

kui_native::app("Todo").devtools(true).run(Todo::default())

Or set KUI_DEVTOOLS=1 and run any app. A panel opens beside the app, docked to the right. Ctrl+Shift+D moves it (left, right, bottom, its own window, off); Ctrl+Shift+I moves the keyboard into it and back.

Three tabs

facts — what the runtime believes right now: the theme and where it came from, the window and its size, the focused node, the modifier keys, the node count, and a latency graph.

events — every event handed to your on_event, as it arrives: the frame number, the node it came from, and the payload as data. Click a row to unfold the payload. This is the tab to keep open while you learn. When a button does nothing, look here first: either the click arrived and your handler ignored it, or it never arrived and the button is not where you think it is.

tree — the last frame’s nodes, foldable, with a filter. Click a node to see its box, its layout, its paint, its handlers and its state. The picker (Ctrl+Shift+P, or the crosshair button) selects a node by pointing at it.

Warnings

A mistake that fails silently in most UI libraries comes back as data in kui: a warning with a stable code, the node it is about, and a sentence that says what to do. They show in the events tab, and a test reads them with d.warnings().

The ones you will meet first:

codewhat happenedwhat to do
control-without-namea button, editor or checkbox with no text inside it and no labelgive it .label("..")
duplicate-keytwo nodes in one frame share a keykey rows by id, not by text that repeats
transition-auto-keya node with a transition sits among siblings that change count, under a position keygive it with_keyed or with_indexed
modal-behind-contenta modal float declared before the content that paints over itdeclare the modal last
grow-weight-ignoredSizing::Grow(2.0) on the only grow childit has nothing to split against; use grow_width()
item-outside-containera radio with no radio_group above itwrap the items
exit-budgetone frame removed more than 4096 nodes declaring exitthat removal did not animate; remove a parent instead of its children

The full list is the Warnings table in docs/props.md. Each (code, node) pair is reported once, so a warning in a view that runs every frame does not flood the log.

Where this is decided

  • The panel is drawn by the core, not by the window runner, so a Node, Lua or C app gets the same one, and KUI_DEVTOOLS=1 works for all of them.
  • Your app can add a tab of its own: features/devtools_tab.rs.