You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tk crash_symbolize: crash reports with their functions named. It names the program's frames of a crash report from the build's linker map (Windows) or its executable (Linux). A program's build tool links with toolbox.CRASH_LINKER_FLAGS and calls toolbox.crash_publish_symbols after each link to keep the map named by its build.
gt:log: a program's log.tk_log.install gives a context.logger that writes core:log's lines to <program>.log in the program's state folder, off the thread that logs and in the order the threads logged them, rotated past a size with older files kept. Its last lines go into a crash report through tk_log.tail.
gt:crash: crash reports. One call at the start (crash.install) and a program that crashes on Windows or Linux writes a report as it dies: the faulting thread's stack and every other thread's, the modules, the last lines of the log and the settings that differ from their default, in a versioned text that crash.report_parse reads. crash.begin_session and crash.end_session find a session that was killed without a report, and crash.last_report tells the next start that the program crashed, so it can offer to open or copy the report. Nothing is sent anywhere.
The menu of a text area: a right press in a ui.text_edit opens the same menu as a ui.line_edit's (Undo, Redo, Cut, Copy, Paste, Delete, Select all, their keys and icons, a search); menu = false leaves it to the program. ui.field_menu takes a ui.Edit_Target: a Text_Field or a Text_Area.
Export of the preferences: config.export_json, config.export_toml and config.export_ini write the user's changes, or every value with all = true, as a flat JSON object, TOML tables per group, or INI sections per group. config.export_own writes our own format, which config.load_file reads back; it replaces config.serialize_user. Floats are written in the fewest digits that read back as the same value.
Advanced preferences: Def.advanced marks a technical setting. A settings page shows it folded under an "Advanced" part of its group, and a search finds it as any other. Def.hidden stays for the program's state, which is no setting.
ui.modal_sized fits its content: a preferred height of 0 makes the dialog as tall as what is in it (a region that scrolls counted whole), between its least size and the window. A program no longer adds up its header and its buttons to size it.
ui.label_tip: a label whose whole text shows in a tooltip when its box cuts it and the pointer rests on it.
ui.field_wipe: empties a text field and leaves nothing of a secret in memory: its buffer and every step of its undo and redo history are zeroed.
ui.prompt: a dialog that asks for an answer typed in: a title, a sentence, one field (secret or not), Cancel and OK. The field has the keyboard as it opens; Enter answers, Escape gives up. Its words are Prompt_Labels.
ui.spinner, ui.dot: the busy arc, turning, which asks for frames only while it is shown; and a filled disc of an intent's hue (a recording, a state).
ui.well, ui.hint_action: a sunken box carved in the surface (the theme's well), and words that say an act and do it, weak like a hint, lit under the pointer, coloured by an intent.
Box_Flag.Held, Box_Flag.Lit, ui.box_hot, ui.box_held: a box drawn pressed in (a toggled button) or as under the pointer (a button whose menu is open), in every finish.
ui.button_icon: a face (raised, ghost, toggled), quiet (a secondary act), lit, wrap (its words on more lines), left (its content at its left), icon_color, a free height and a tip; drawn by the theme's finish (bevelled in the machined one, pressed in when toggled).
ui.number: one widget for a number one sets, of any integer or float type: − and + (held, they repeat), a field where its exact value is typed (applied at Enter or when the keyboard goes, Escape gives it back), Up / Down and Page Up / Page Down with Shift, Ctrl and Alt multipliers, the wheel, optional bounds (a slider with slider = true), a step, a format, a unit, disabled and a tooltip; a screen reader sees a spin button.
ui.Feel: the interface's delays, repeats and steps in one struct the State holds, read with ui.feel and set with ui.set_feel, so a settings page can offer each: the tooltip delay, the submenu's hover delay, the menu item's height, the palette's fade, the list's type-ahead, the undo steps and their merge, a held button's repeat, the Shift, Ctrl, Alt and Page steps, the zoom step, and the wheel's lines, a held key's repeat and a fling's end where the system says nothing (platform.set_input_defaults). Defaults: ui.FEEL_DEFAULT, today's values; docs/feel.md lists each.
Preference groups from the name: the segments of a preference's name but the last are its groups (appearance.text.gamma is in appearance, then appearance.text). config.path_of(name) gives them, config.title_register(prefs, path, title, order) gives a group its heading and its place, config.group_title reads it (else it is made from the last segment), and config.groups_of(prefs, parent) lists the groups in a group in their order (docs/config.md).
ui.open, ui.file_dialog: a file, a folder or a web address opened with the system's program, and the system's file dialogs, with no wait on the interface's thread (they run on the chores; a dialog's result comes back at a next build).
base.blocking: in a debug build (TOOLKIT_BLOCKING_CHECK), a procedure of the toolkit that waits on the system (a file read or written, a dialog, a URL or a file opened, a notification, the clipboard read at once, the preferences saved, a theme icon) called on a thread that builds an interface is said on the standard error, once per call site of the program, and counted (base.blocking_count): what can freeze a window is found before a person meets it.
gt:tasks, ui.task, ui.chores: work off the interface's thread and its result back on it. tasks.Pool (its order or the newest first, urgent work, timed work, more threads while some hang, a pool of no thread a test drives by its own clock) and tasks.Job (asks that merge); ui.task(s, work, done, data, lost) runs work on the program's chores and done at the next build, and never touches a State destroyed meanwhile (docs/tasks.md).
toolbox.odin_check, toolbox.check_env: odin check of a package for another system, Windows from Linux too (an Odin root whose wgpu has an empty Windows library). tk ci on Linux checks every package of src/ for Windows, and run_tests -check:windows_amd64 checks every test package and program with its own defines: Windows code that does not compile fails the Linux job.
toolbox.Logo.files: write_logo also writes the logo at a size anywhere, such as the site's logo.
toolbox.check_scopes: finds each if !ui.row(...) in a program's sources: a scope opened under a negation ends at once. The scopes are read from the ui package, so a new scope is checked at once.
toolbox.build_c_lib: a static C library that a program builds itself, built again only when its sources or flags change. toolbox.stamp_holds and toolbox.write_stamp are the stamps of every build made once.
toolbox.third_party_notices: writes or checks a program's THIRD-PARTY-NOTICES: the licences of the toolkit, its fonts and icons, Odin's core library, wgpu-native, and the Rust crates that the toolkit's native libraries link.
toolbox.sway_start: a sway desktop nobody sees, for a tool's live tests and pictures on Linux. It has its own runtime directory and sockets, no session bus, and, when asked, its own configuration, data, state and cache folders. Its programs and sway stop with all they started, also when a signal ends the tool (toolbox.guard_groups). tk desktop_tests wayland runs in it.
Standard commands of a project's tool: changelog.command (new, check, preview), site.command (build, check, card), release.commands (package, notes, ship), toolbox.logo_command and toolbox.notices_command each add a whole command to a tool with one line.
toolbox.Project: what a program's project is to its tool, in one place. odin_command, build_native_text, build_launcher, check_launcher, check_windows, check_darwin and project_version build, check and read the program from it.
toolbox.tool_main: a project's tool is a list of toolbox.Commands. It says the help, refuses an unknown command or a line a command does not take with exit code 2, joins the -name:value flags that PowerShell splits, and works from the project's root, found by its mark. tk and every program's tool use the same dispatcher.
Changed
Every tooltip waits the same delay: Feel.tooltip_delay_ms (500 ms by default), the settings page's and the setup dialog's included (they waited 400 ms).
A line edit keeps as many undo steps as a text area: 200 (Feel.undo_steps; it kept 100), and both merge typing by the same rule (Feel.undo_merge_ms).
A slider's keys take Shift: Shift with an arrow key or Page Up / Page Down moves Feel.step_shift times as far (ten by default), as its wheel already did.
One dialog header, with its close button: ui.dialog_header(id, title, opts) -> bool takes a ui.Dialog_Header (its icon, close) and a block for its own controls; with close, a close button (Lucide's X) sits in the dialog's corner at the same margin from its top and right edges, its corners concentric with the dialog's, and the header's controls stay clear of it. ui.dialog_header_begin and ui.dialog_header_end are its if form; ui.modal_corner builds a program's own look of the control in the header's block. The confirmation, the shortcuts sheet and the Setup dialog have it (the sheet's Close button at its foot is gone).
A scroll bar's arrow repeats as any held button: held, it steps again after Feel.repeat_delay_ms and then every Feel.repeat_interval_ms (420 and 55 ms by default; it was 250 and 50 ms of its own), as a stepper's buttons do.
A preference's title is its last segment: config.title_of no longer repeats the groups, which a settings page shows as headings (network.http.max_connections reads "Max connections" under "HTTP"). config.matches(prefs, def, query) now takes the registry and finds a preference by the titles of its groups too.
A button says its intent, not a tag: intent = .Primary / .Danger / ... and face = .Ghost replace pushing accent_button, danger_button, warn_button or ghost_button around a button. The tags stay the theme's names of those colours, derived from the intent (intent_tag).
ui.button and ui.icon_button take an intent (their colour), a face (Button_Face: raised, ghost, toggled), disabled, lit (drawn as under the pointer while its menu is open) and a tip (a tooltip, read as their description); ui.icon_button also an icon_font and a name for a screen reader (else its tip). A toggled button is held down and read as pressed.
ui.range_slider works from the keyboard and the wheel: each thumb is a Tab stop and a slider for a screen reader; the active thumb (the one a press took, or Tab reached) moves by the arrows, Home / End and Page Up / Page Down, and with the wheel. It takes a step and a format of each value (it was always "%.0f-%.0f").
gt:lucide names every icon of the font (1876, were about 150 added by hand): lucide.odin is generated from lucide.ttf by tk gen_lucide, each name the font's own. Two constants take the font's name: TRIANGLE_ALERT is ALERT_TRIANGLE, SEND_HORIZONTAL is SEND_HORIZONAL.
tk release and release.ship take patch, minor, major or a version, and the number is the next after the last tag on origin. They publish from any clean checkout (a branch, a worktree, a detached HEAD), push master and the tag at once (atomic), and start again with the next number when origin moved meanwhile: a tag never goes out without its commit. release.publish, release.version_next: the step they share.
site.Check_Options.generate gets user: the pages that a site check makes can depend on the project's own data.
changelog.Options.user: Options.version and Options.set_version get it as their last argument, so a project's tool can pass its project to them.
release.Config holds a toolbox.Project: its name, repository, changelog, version line and program are the project's (Config{project = p, ...}). version_of and version_set are now toolbox.version_of and toolbox.version_set.
Removed
ui.modal_header, ui.modal_header_begin, ui.modal_header_end: the header of a dialog with a control in its corner is ui.dialog_header with close.
The constants ui.Feel replaces, and ui.set_menu_item_height: PANE_TOOLTIP_DELAY_S, TABLE_TIP_DELAY_S, MENU_HOVER_MS, MENU_ITEM_EM, PALETTE_FADE_MS, LIST_TYPEAHEAD_MS, FIELD_UNDO_STEPS, FIELD_UNDO_MERGE_MS, TEXT_UNDO_MAX, NUM_STEP_PAGE, NUM_STEP_CTRL, NUM_STEP_SHIFT, NUM_STEP_ALT, ZOOM_STEP, and in platformWHEEL_LINES_DEFAULT, TOUCH_FLING_STOP_SPEED, KEY_REPEAT_DEFAULT_RATE, KEY_REPEAT_DEFAULT_DELAY_MS; set the field of ui.Feel instead (menu_item_em for the menu's item height). ui.hovered_for(sig) takes no delay: every tooltip waits Feel.tooltip_delay_ms. platform.touch_fling takes no stop speed: it is the thread's input_defaults().fling_stop_speed.
Def.category, the category argument of config.register and config.category_title: a preference's name is the one source of its group. Use config.path_of and config.group_title; a title registered with config.title_register replaces a category with words of its own.
ui.stepper, ui.slider_field, ui.Slider_Field, ui.slider_field_destroy: ui.number does what both did, and more (ui.number(id, &v, lo = 0, hi = 99); with slider = true for a slider beside the field). The number being typed is kept by the interface: a program keeps no field for it.
ui.Worker (worker_start, worker_ask, worker_take, worker_busy, worker_lock, worker_published, worker_stop): a tasks.Job on ui.chores() does it, its result posted with ui.post.
Fixed
A dialog opens without a jump: its first frame shown has it at its size and place (it is laid out once unseen), its scrim and its panel fade in together, and the focus ring behind it goes as it appears.
ui.button and ui.icon_button keep the text alignment they are given: a next or a style with text_align is honoured; only a button nothing aligns is centred.
A menu is as wide as its widest row: a label next to a long shortcut ("Show as QR code", Ctrl+Shift+Q) is no longer cut. The width a caller gives (ctx_menu, menu_nested, a drop-down's list) is a minimum, a wider text_pad widens the menu, and only a menu wider than the window cuts a label, whose row then shows it whole as a tooltip; a line the command palette cuts does the same.
Security
A text field forgets a secret for good: a step of the undo and redo history that is dropped (the oldest, a redo replaced by an edit, a step undone) is zeroed before its memory is freed.