Repository navigation
zgx 0.1.9
A release of fixes before work pauses, from bugs Zeron's apps found and from the remaining bugs on Linux, Windows and macOS; the few additions are what those fixes needed (a host-loaded locale catalog, opt-in partial hot reloads, the window's size in plugins). Rust and Luau code builds as before, but for a struct literal of zgx's trace::Frame (it has new fields), below with what to change. Every published 0.1.8 crate builds against this release. Forks published with it: zgx-cosmic-text 0.19.9 (glyphs drawn through Core Text where only hvgl has their shapes) and zgx-alacritty-terminal 0.26.1 (a Windows program's last output read after it exits). Behaviours change too, each below with what to check.
Changed: what to check in an existing app
trace::Framehas new fields,eventsandlayout(zgx): the input events a traced frame took, and what layout measured afresh in it (zgx inspect frames). AFramewritten out field by field stops compiling. Migrate: end it with..Default::default().- A picture that can't be shown is told, never a script error (zgx-script): a
ui.image,ui.svgorbg_imagewhose file is gone or isn't a picture draws nothing, shows the image'sfallback(now for local files too, not only remote ones) and is told to its newon_error(why), else warned of once, with the script line naming it. It was a script error, which in a gallery stopped every window's reloads, though a file can go at any time.on_load({ w, h })tells a picture's size once known (a file's from its header, before it draws; a remote one's as it arrives), andui.image_size(src)reads it from the header alone, nothing decoded, so a design system can hold a picture's place at its final size. - A style re-run with the same result no longer resets paint set elsewhere (zgx): as with an element only changed props touch, an unrelated state change that re-runs a node's reactive style (or a script's style function) to the same result writes nothing, so paint an
anime.animate, a script or a direct scene write set on the node (its effects, transform, clip) stays until the style's own value for that property changes; then the style's new value wins. Before, such a re-run restored the node's own paint, undoing what was set since (as a style changing only a box's size already did not). - WebView2's browser keys are off (zgx-desktop's
webview2): Ctrl+F, F3, Ctrl+P, Ctrl+R, F5, zoom, Alt+arrows and F12 in a page reach the page, then the app's bindings when the page leaves them alone, as on macOS and Linux, instead of WebView2's find bar, print preview, reload and DevTools. Editing keys stay the page's. Find withWebView::find; DevTools withWebView::open_devtools.
Added
- A screen reader moving to a node in a scroll view scrolls it in (zgx-desktop, zgx): nodes in a scroll view offer AccessKit's
ScrollIntoView(macOSAXScrollToVisible, UIA's and AT-SPI's scroll-into-view), and the tree with the node's new place goes out at once, not paced as geometry is.Ui::scroll_into_view(node)does the same for an app. - A shortcut recorder takes every key (zgx, zgx-script, zgx-desktop):
capture_keys = trueon a node (View::capture_keys,InputDispatcher::set_capture_keys) sends every key to what is focused while focus is in it: no key binding takes one, and on macOS the menu bar's key equivalents (⌘Q, ⌘C, the app's commands) don't fire, the key going to zgx's view. A settings page records ⌘J as ⌘J instead of running its command. As focus leaves, shortcuts work again; a host asks withInputDispatcher::captures_keys, andbinds_keyanswers no meanwhile. - A command's shortcut can follow a state (zgx-script):
ui.command { key = state }orkey = function() … endpublishes the commands again whenever what it reads changes, so a shortcuts setting rebinds a command at once, menus included, with no reload. While a key follows a state, a key an earlier command already holds stays with it and the later command is published without it, reported inScriptHost::dropped_shortcuts(itspluginempty for the app's own), so a rebinding never gives the menu bar a key twice.ui.shortcut_owner(keys)names the command holding a key now. - Drop shadows (zgx, zgx-gpu, zgx-script):
Styled::drop_shadow(x, y, blur, color)(Scene::set_drop_shadow,DropShadow), Luaudrop_shadowwritten asshadowis: a shadow of what a node and its subtree paint, following their alpha rather than the box (CSS'sfilter: drop-shadow): an icon's, a cut-out's, a rounded card's. The node paints as a cached layer; its shadow is a second slot of the effect atlas, blurred by the same passes asfilter_blurand tinted there, then composited under the layer: a shadow moved or faded composites again without repainting the layer, and one blurred anew re-runs the passes only. Nodes without one cost nothing. Not drawn by the Direct3D 11 proof, as no layer effect is. - Focus moving into a list scrolls it there, clear of what floats over it (zgx, zgx-script): Tab, Shift+Tab or
el:focus()onto a control in aui.list's row (a transcript's tool row built beyond the rows in view) scrolls the list to it, the offset state following, as a plain scroll view already did.scroll_padding(ui.scroll,ui.list,View::scroll_padding; a number or{ top, bottom, left, right }) keeps that much clear inside its edges, so a focused row doesn't land under a composer or a title bar.el:focus({ scroll = false })(NodeHandle::focus_with,InputDispatcher::focus_in_place) leaves the views where they are. - A GIF in
ui.imageplays (zgx, zgx-gpu): an image view whose source gives an animation's still (ImageData::animated, which zgx-gpu now decodes a GIF to) plays its frames asanimated_imagedoes, paused off screen, hidden or with the window unseen, its last frame kept once a finite one ends. The playback is set up the first time a source gives one, so a view of still pictures costs nothing more; a reactivesrcthat changes to another GIF plays that one, and to a still stops. A GIF whose frames pass 4 MiB decoded streams them (Animation::streamed, zgx-gpu'sGIF_KEPT): its file and a frame or two held, however long, all of it given back as it goes; a smaller one keeps its frames and costs nothing to play. Under the system's reduced motion an animation (animated_image's too) shows its first frame, still. - A modifier pressed alone is heard:
Ui::modifiers()andui.modifiers(zgx, zgx-desktop, zgx-script): the modifier keys held now, as a state that changes as one goes down or up, a modifier alone included (Command held to show ⌘1–9 hints, which no key event reports). Luau readsui.modifiers.shift,control,altandmeta, each tracked. All are up as the window loses focus, so a ⌘-Tab away leaves none held. The state is made the first time something asks for it; until then the host writes nothing. ScriptHost::i18n(dir, source)loads a catalog with no script (zgx-script): a host loads the locale files in a folder of its choosing before any script runs, andui.tandui.localework in the app's scripts and its plugins' with noui.i18ncall. A hot-reloading host now watches every catalog's locale files, so an edit to one shows in place without reloading the scripts, wherever the folder is. A host that preloaded its catalog through a one-line plugin no longer needs that plugin, which made every hot reload a full one.zgx inspect framesmeasures an interaction as a whole (zgx-script, zgx-desktop):until(a mark or a frame) ends the frames read, assincestarts them, andsummaryanswers what they cost together: their count and pacing, the work's median, p90, p95, p99 and most, the input events they took and the work per event (a drag's moves), and each phase's spread. Each frame says the input events it took (events). A tapereplayplays can move the pointer too (ms pointer x y down|moved|up, from the target's centre), so a scripted drag lands a move a frame through the window's own input path, and its answer gives the same percentiles. The CLI reads a command's own fields given askey=valuewords (frames n=300,mark name=drag) and refuses a number field given anything else, where it fell back to the default.zgx inspect framessays where layout's time went (zgx, zgx-script): each traced frame counts the nodes layout measured afresh (not taken from a measurement kept from before) and their time, and names the costliest by their own time, their children's apart, as the script made them (layout: 14 measured afresh, 5120 µs; costliest: @88 #chat (column screens/chat.luau:41) …;layoutin its JSON). An interaction'ssummaryadds them up by node. While nothing traces, a fresh measure pays one relaxed load for it.scroll_paddingfollows a state (zgx, zgx-script):scroll_paddingonui.listandui.scrolltakes a state or a function as well as a number or{ top, bottom, left, right }, read again as what it reads changes (View::scroll_padding_with), so a composer growing to more lines keeps a focused row clear of it, rather than the height it had as the list was made.- A long reply landing whole is parsed over frames (zgx-script):
ui.markdown(text, { key, lazy = true })(orlazy = bytes; 4 KB by default) answers a long text arriving at once (not by appends) with one entry a block at once, those not parsed yet{ t = "pending", hint, lines, from, to }, and parses them over the next frames, the end first, a block asked for withfirstbefore the others. Blocks keep their index and, parsed, their table; a computed around the call runs again as they come. The frame showing a 25 KB, 385-block reply parses it in 0.25 ms instead of 0.94 ms. Streaming appends and short texts are as before. Rust hosts callIncremental::set_text_lazyandparse_pending. - Nine-slice images (zgx, zgx-gpu, zgx-script):
Styled::image_slice(slice, widths)(Scene::set_image_slice,ImageSlice), Luauslice = { top, right, bottom, left }: an image drawn in nine pieces (a nine-patch, CSS'sborder-imagewithfill). Its corners keep their size, its edges stretch along their side and its middle both ways, so one small image frames a button or a bubble at any size. Drawn as nine quads of the image's texture, each sampled half a texel inside its cut so pieces don't bleed into each other; widths past the box shrink together, as CSS's do. Images without a slice check one empty map. - A plugin reads the window's size (zgx-script):
ui.window.sizeis readable in a plugin's VM, read-only and with no grant, so a picture it opens fitted to the window (a lightbox) opens at the window's size, not 1 by 1. The rest ofui.window(zoom, visibility, the title bar's area and controls) stays the app's. ZGX_RELOAD=partial: a hot reload runs again only what a save changed (zgx-script, opt-in while it is proven on real apps): while a host watches its files, a save keeps the app's VM and runs again the modules it changed, what requires them, and the app's script; the other modules keep the values they returned and what their top levels made, and what a module running again made at its top level goes first (#1369). Everything loads again, as before, when keeping couldn't be right: plugins are loaded, a module running again sets a global or starts a task, animation,on_openhandler, actions or router at its top level, a module kept declares a command, window, contribution, override oron_mountthere, every module changed (a template swapped whole), or the last reload failed partway. A failed partial reload leaves the last load running as it was.zgx inspect reloadssays which path each reload took and why; without the variable every reload loads everything and says what it would have kept. It lists the reloads a host asks for (ScriptHost::reload) too, a watched file whose bytes a reload already read no longer reloads the scripts again, and a global zgx makes on first read (anime) no longer counts as the module setting it.- Spans take context menus (zgx, zgx-script):
ui.span { context_menu = … }(TextSpan::context_menu) gives a run a menu of its own, on a link in place of Open Link and Copy Link; a secondary click inside the text selected shows the selection's menu (Copy, Select All), over a plain link's too, and Shift+F10 or the Menu key opens a focused link's. Aui.richparagraph'scontext_menuis told the run it was asked on (e.span:{ index, href, text };View::context_menu_with_spanandContextMenuSpanin Rust), and asked first on its links. A span'son_clickreturningtruekeeps itshreffrom opening (TextSpan::on_click_handled).zgx testgainsapp:right_click(target, { x, y }?)andapp:opened(). - Specular and index of refraction in 3D scenes (zgx-3d):
World::set_specular(id, Some(Specular::new(1.).color(tint).ior(1.7)))sets how much a dielectric mesh reflects, tinted how: as much facing it as its index of refraction says (water a little, diamond a lot), that and its grazing reflection scaled by its factor. glTF models bringKHR_materials_specular's factor and colour (not yet its textures) andKHR_materials_ior's index for any material, not glass's alone. A mesh reflecting otherwise than any does draws with a pipeline of its own; a world with none binds nothing new. - A web page's downloads are the app's to save (zgx
WebView::set_download_handler,DownloadRequest,DownloadResponder,DownloadStatus; Luauui.webview { on_download = function(d) … end }withd.url,d.name,d.mime,d:save_to(file),d:ask()andd:cancel()): each download a page starts (adownloadlink, an attachment, a response it can't show) reaches the app, which saves it at a file the person chose, as through its save dialog, or not, and hears its progress and its end, on macOS (WKDownload), Windows (WebView2, its download bar hidden) and Linux (WebKitDownload). With no handler nothing is saved, as before: a page never saves into the person's folders without the app deciding. WebView::find(zgx, withFindOptionsandFindResult, andWebView::clear_find): find text in a web page as a browser's find bar does, on macOS, Windows and Linux. The next match (or the previous) is selected and scrolled to, wrapping past the end, and the reply says whether there is one and, on Windows and Linux, how many. Asking again with the same text steps to the next match.- Drops into web pages on Linux (zgx-desktop,
webkitgtk): a page's own HTML drags now drop within it (itsdragstartdata, any types), zgx's dragged text drops on it, and files from other apps drop asFiles with their bytes, each as the page'sdragenter,dragover,dragleaveanddropwhere the pointer is. Before, a page's own drag left it for zgx's, and nothing dropped on a page reached it.
Performance
- 3D frames find their pipelines by a variant's bits (zgx-3d): what sets a mesh's pipeline apart is one 16-bit number, built, compared and hashed as one, where it was eleven flags; which of light passing through, a coat or a specular a mesh has is kept as one byte as they change; and a pipeline's shader is written from an index of the shader's code made once, instead of every byte of it read again.
3d-mixedfalls 1.5% (148 K instructions a frame, 0.66 M of setup),3d-textureda little. - A reflow with a screen reader running sends only the nodes near the window (zgx-desktop): a node more than a window away, still on the side of it it was last sent on and otherwise unchanged, keeps the box it was sent with until it comes near; above stays above and below below, so a reader's order and the way it scrolls are the box's. Resizing a 3,000-row list with an assistive client attached: 3,032 → 178 nodes an update, AccessKit and its adapter 3.7 → 0.25 ms, zgx's projection 4.5 → 3.3 ms.
- Accessibility updates hash with FxHash (zgx-desktop): the projection's maps, keyed by node ids zgx hands out, hashed with SipHash, ~17% of each update. Resizing a 3,000-row list with an assistive client attached: 6.4 → 4.2 ms an update in zgx's projection (median of three runs each). Nothing changes with no assistive technology running.
- A reflow with a screen reader running shapes only the text near the window (zgx-desktop): each accessibility update shaped every label's text again for its text runs, on screen or not: resizing a 3,000-row list with an assistive client attached cost ~30 ms an update in zgx's projection. Text more than a screen away keeps its runs, shaped again as it comes near; text first seen there gets runs of its whole text placed by estimate, so a reader still gets every character (
AXStringForRange) and a box near where it is. ~30 ms → 6.6 ms an update on that list; nothing changes with no assistive technology running. - A custom fill never freezes the frame that first draws it: a
bg_shader's pipeline compiles on a thread of its own, from the momentui.shaderdeclares it. A window's frame that draws it before it's ready shows the box's colour and draws again once it is, instead of waiting. The first frame drawing Zeron's status ring took 117–151 ms on an M-series Mac (the frame waited for the compile); it takes 0.5 ms, and the ring follows about 150 ms later. Offscreen renderers (snapshots, tests) still wait, so their pixels stay deterministic. - The system font cache is checked as the app first goes idle, with no thread (zgx-gpu): the check that a cached font file hasn't changed in place ran on a thread of its own two seconds after launch, and a process that has ever had a second thread locks glibc's allocator on every allocation. It now runs on the renderer's first trim (as the host's frames stop, no wake of its own), or after 600 frames for an app that never goes idle. On Linux, the headless lab stream no longer pays the locked allocator (about 12 M instructions).
- A change a row or column's child keeps to itself lays out that child alone (zgx): a text changing inside a child its row or column asked one size of (a fixed-width list's rows, a document's blocks) used to lay out the whole row or column and every ancestor; the child is now laid out again on its own and, if it answers as it did, its siblings stay as they are. A streaming Markdown append with 256 paragraphs above it costs 30% fewer instructions (7% with one), and
update_bench's rows updated in place 21% fewer. A change that does move its siblings lays out as before. - A Luau app's modules compile on a worker while its window is made (zgx-script, zgx-run):
zgx-runcallszgx_script::compile_ahead(script, packages)before the app's window, the GPU and AppKit are set up. A worker compiles the script and what it reaches byrequirewith a string literal (.luaurcaliases and lent packages resolved asrequiredoes; no tests, type files or unused modules; files up to 1 MB). The first load'srequires then find their bytecode compiled, rather than compiling each on the main thread. It is compiled in memory from the text and used only for the very bytesrequirereads; no bytecode is written to or read from a file, and nothing waits for the worker. What the load didn't use is let go as it ends. An app hosting its ownScriptHostcallscompile_aheaditself, first thing inmain. A 170-module app (466 KB): main-thread compile 7.3 → 0.5 ms, its build 15.7 → 7.9 ms (macOS, medians of 12), peak memory no higher. Hosts that don't call it pay one atomic load perrequire. - A Markdown view's appends look at its blocks without allocating (zgx-script): each update of
ui.markdown_viewmade a string of every block's kind to find where it is kept; it now reads the kind as it lies and keys each block by plain numbers. An append into a reply with 256 paragraphs above it costs 19% fewer instructions (8% with a 6 KB paragraph streaming), and its keys hold no part of the blocks. - Only the observed nodes that moved are told so (zgx): each frame that moved anything gathered every observed node's bounds and visibility (a link's or an icon's in each paragraph) into a list to publish; it now compares each with what was last told and gathers those that changed. An append into a reply with 256 paragraphs costs 7% fewer instructions.
- A repaint draws what its clips show, not every node (zgx): the paint walk passes by children whose ink falls wholly outside the clip they're drawn in (a scroll view's rows out of view), on a full repaint as on a damaged one. Resizing a 3,000-row file list visits 144 nodes a frame instead of 4,715, and its paint phase falls 36% (7.43M to 4.72M instructions).
- A streamed paragraph is prepared from the words of the one it grew from (zgx-gpu): each append to a paragraph prepared from its words (#1292) found, looked up and packed every word again. A paragraph that starts with a recent one's text, in the same runs, now keeps that one's words and packed advances up to its last word after a space following a letter or digit. Only the text after it is read, its words looked up, shaped and packed. One word appended to a streaming Markdown reply's 6 KiB paragraph costs 415 K instructions instead of 1.44 M, and 194 K instead of 342 K at 96 bytes. Memory is unchanged, and the peak is lower.
- A wrapping text keeps its lines while a window is dragged a few points (zgx, zgx-gpu): a resize measured every wrapping text again at the new width, breaking its lines anew, though most rows had no break move. Text measured from its words now also reports the widths it holds for. From its widest line's width to where the next word would join a line, its lines break the same, and layout serves any width between from the size it has, without asking. A host's measurer gives them with
Scene::set_font_text_reach_measurer, whichTextServicesand the renderer install. On a 3,000-row file list dragged 3 points a frame (reflow_bench), layout costs 33.0 M instructions a frame instead of 69.0 M, and text 0.13 ms instead of 1.90 ms. - A style re-run with the same result writes no paint (zgx): a reactive style that sets no paint and ran again to the same styles (a box whose colour a moved selection reads, but which did not change colour) re-laid and re-wrote its unchanged effects, transform, clip and mask each time; after one such run it writes nothing, as a box changing only its size already did, and leaves what else set them since.
update_benchfunction-prop, where 198 of 200 boxes keep their colour each update, falls 13.6% of its updates (26.8 M instructions in 200).
Fixed
- A clickable chip span is one pill, not underlined unless asked (zgx, zgx-script):
- Underline: a span with
on_clickwas underlined even withunderline = false, since false was taken as not given.underline = falsenow leaves a link not underlined at rest (TextSpan::no_underline), though a hover's underline still shows. It wins over an underline's style, colour or thickness too. - One wash: a span with an icon and a background was washed in three pieces: the icon's room, its text and the padding after it. Their backgrounds now join into one rounded wash per line. Spans side by side keep their own.
- Underline: a span with
- Chinese text on macOS 26 draws in PingFang (zgx-gpu, zgx-cosmic-text): glyphs whose shapes are only in Apple's
hvgltable, as macOS 26's PingFang keeps them, are drawn through Core Text into the glyph atlas, at the weight and subpixel position they were shaped at, so Chinese draws in the system's own Chinese face (and at Regular for regular text) rather than falling back to Heiti. - A scroll view stretched past its edge always springs back (zgx, macOS trackpads): every stretched view springs back as a gesture ends, not only the last one a gesture took, so a list released past its end while another view takes the next gesture no longer stays shifted with empty space below it; a view whose content fits shows no stretch and lets go of any as the gesture ends.
zgx inspect nodegives a scroll view's offset within its range and any stretch (scroll), andUi::scroll_reportthe same. - A fade over stacked pictures holds textures the size of its bands, and none at rest (zgx-gpu): where
fade_edgescrosses stacked items, the renderer draws them unfaded into a band texture and fades it once. One texture covered every band, so a clip faded at its top and bottom took one the size of the whole clip (Zeron's wallpaper, a plugin's layered scene: a 1888×1600 texture, 11.5 MiB, reported as a layer on a node that isn't one), and the pool of band textures was never let go. Bands apart now each take a texture of their own size (1.9 MiB there), and the textures go as the window goes idle (GpuRenderer::trim). - A flex item its content held wide shrinks again when that content gets smaller (zgx): in a row or column too small for its children, an item held at its content's least size (CSS's
min-width: auto) now shrinks as soon as that size drops: when a child starts clipping, leaves the flow (absolute) or gets narrower. Before, the item kept its old width until something else laid out its parent. - An inset title bar keeps its strip when going into full screen fails (zgx-desktop, macOS): the inset title bar's toolbar is hidden as a window goes into full screen, and a transition that failed after it began (AppKit tells only the window's delegate) left it hidden on a window that wasn't in full screen, its traffic lights no longer centred. Two seconds after a window begins going into full screen, one that isn't gets its toolbar back.
- An inset title bar leaves no bar over the content in full screen (zgx-desktop, macOS): AppKit moves a window's toolbar into a window of its own above it in full screen, which the title bar's transparency doesn't reach, so
Titlebar::Inset's empty toolbar showed as an opaque 40-point bar over the content's top. It is now hidden as the window goes into full screen (the green button orset_fullscreen) and shown again once it is out, where it centres the traffic lights. - An app's shader can't take its process down on Windows (zgx-gpu): FXC, which compiles shaders for Direct3D 12 when the app ships no DXC, has overflowed every stack on some shaders, ending the process from any thread. zgx's own shaders are compiled under a gate; a shader fill or layer shader an app writes is now compiled by FXC in a process of its own (the app's executable, started again as a compiler) and handed to Direct3D 12 as bytecode, kept on disk so it compiles so once a machine. One FXC can't survive draws nothing, and the app goes on. Where the executable can't be started again, isn't zgx's (zgx in a DLL), or wgpu offers no passthrough shaders, it compiles in the process as before;
ZGX_FXC_IN_CHILD=0keeps it there. - A GIF in
ui.imageshows (zgx-gpu): its first frame, through thegifcrate, where it was a runtime error ("The image format Gif is not supported"): a picture's file decoded through theimagecrate, which reads PNG and JPEG alone. Any.gifsomeone attached in Zeron. - A
ui.imagewith afallbackkeeps itsfit(zgx-script): its picture shows inside a switch (the picture or its fallback), and the image's styles went on the switch, sofit,object_positionandimage_renderingreached no picture: it drew asfill(a 4:1 picture covering a 56 by 40 box drew 56 by 40, not 160 by 40). The picture takes them itself now. - A cached layer draws again once a picture in it has decoded (zgx-gpu): a layer (a layer shader's, an isolated group's) drawn while a picture in it was still decoding was kept as it was drawn, without the picture, until something inside changed style: Zeron's wallpaper under an effect (scanlines, dither) came up blank as its picture changed, until a zoom drew it again. A layer drawn without something on its way (a picture decoding, a shader fill compiling) is drawn again rather than reused.
math.hugeas a list's offset is its end (zgx, zgx-script): every kind ofui.list(fixed or measured rows, positional or keyed) now takes an offset past its end as the end, and-math.hugeor NaN as the top, asui.scrolldoes. Before, a list took any non-finite offset as its top. Setting a bound number to NaN no longer hangs the app: the state and the widget passed it back and forth for ever, since NaN never equals itself.- Tab and Shift+Tab go on through a list's rows, built or not (zgx): Tab only knew the rows a
ui.listhad built, so past them it left the list (or wrapped round to the composer) halfway down a transcript. Now, at the last built row that way, the next row is scrolled to, built, and its first control (its last, with Shift+Tab) focused with the same key, rows with nothing to focus passed over, as a page's Tab goes on down a list it holds whole. A list whose rows are one Tab stop (keyboard = true) is left by Tab as before. - Look Up in a text area shown a line at a time:
EditorHandle::look_upasked for the baseline of a text the editor doesn't lay out (its lines are nodes of their own), and returned false. It now takes it from the line node holding the selection's start, astext_areatakes its pieces. - A picture in Markdown that isn't alone in its paragraph is still a picture (zgx-script):
ui.markdownmade a picture a block only when nothing came before it in its paragraph. Words before it ("Here it is:" then the picture), or another picture on the line before, turned it into its alt text and lost its source. A picture on a line of its own now splits its paragraph there into the words before, theimgblock and the words after, and leaves no empty paragraph behind. A picture among words is a run withimg, its source, beside its alt text. - A context menu keeps the selection it opened on drawn: right-clicking inside an editor's selection opened the menu, which took the focus, and the highlight went (only the window going to the back kept it). While a context menu opened on the editor (its own, or the app's on it or a view holding it) shows, the selection stays drawn in the colour of a selection in the back, as AppKit's does, and is drawn as before once the menu closes.
- A modal opening closes the popups open outside it (zgx, all platforms): a dropdown, menu or submenu left open stayed drawn over a
modal(ui.modal) opened after it, and, where it overflowed the window, in a popup window above everything in the window (a ⌘K palette under an open dropdown). A modal opening now closes every anchored popup open outside it, in the window or in a window of its own, as AppKit closes menus and popovers when a sheet opens. Popups opened from inside the modal stay, and alayer(an overlay, not a dialog) closes nothing. - Nothing a scroll leaves behind stays on screen: scroll content that repaints rather than copies when it moves (a layer of its own, such as a faded or isolated view) repaints what goes or is laid out again in it after the move, where it was drawn before the move. A node removed in such a frame (a reply's hover lane under a still pointer, in a measured list flung past it) was damaged only where the content had moved it, and its pixels stayed where they were drawn until something painted there again.
Ui::modifiersfollows the modifier keys while a web page or terminal has focus (zgx-desktop, macOS): AppKit sendsflagsChanged:to the key window's first responder, so while a page or a terminal held the keyboard winit heard no modifier change, andui.modifiersstayed as it was (Command held for shortcut hints never showed, or a key stayed held after it was released). A local event monitor, installed with the native views, now passes each change zgx's view doesn't hear toUi::modifiers.image_rendering = "pixelated"draws an image view's picture pixelated (zgx): the setting landed on the image view's box, while its picture is a node inside it, which the renderer asked. Everyui.imagedrew smooth (Zeron's lightbox at 300%: a 1 px checker ramped 46 → 202 → 46).image_renderingis now inherited, as CSS'simage-renderingis: a node's own setting, else the nearest one around it.i18n-pluralasks each locale for CLDR's plural cases in every build (zgx-script): without thei18nfeature (thezgxcommand, test hosts) the lint asked every locale for English'sone, so a Chinese, Japanese, Korean, Thai or Vietnamese plural withotheralone, which is complete, was reported (50 times in one catalog). It now reads ICU4X's categories for each catalog's locale whatever the features.- A debug build's lint findings never cover the interface (zgx-script): they showed as the "Script error" card, a modal that took the pointer and hid what lay under it. They now count in a strip in the window's lower corner, never as an error nor over a modal, and a test host (
testing::TestApp, orScriptHost::lint_strip(false)) shows none. - A web view's diagnostics report a popup window's backdrop (zgx-desktop, macOS):
NativeDiagnostics::backdropslists AppKit's material behind each translucent popup shown in a window of its own (a menu past its window's edge) as anNSVisualEffectViewat the popup's box, soweb_view --fixture's menu backdrop check passes again; it now runs on every macOS CI job. - A tooltip's glass fades with its card (zgx-desktop, macOS): since a node tooltip's translucent card gets AppKit's material under it, the material stayed at full strength while the card faded out (100 ms) and showed at once while it faded in: an empty frosted pane the card's size lingered as a hover card went. The material now takes the panel's opacity through what holds it (the tooltip's fade), and goes as it reaches 0.
- A node tooltip's card is its popup's panel (zgx-desktop, macOS): a popup window took the panel to be what its root holds, which for a node tooltip is its clear layer. A card with its own shadow then got the window server's shadow too, outlining the whole reach of the card's (a dark rim round empty space below it), and a translucent card got no material behind it. Through boxes that paint nothing and hold one thing, the card is now the panel: its own shadow alone, and AppKit's material under its translucent fill, cut to its corners, as a menu's.
- Popup windows open at their trigger in a zoomed window (zgx-desktop, macOS, Windows, Wayland): in a window zoomed off 100% (
Ui::set_zoom), a menu or popover shown in a window of its own opened away from its anchor and 1/zoom too large, as its frame was built from the scene's points with no zoom. On macOS and Wayland its window's frame, size, material and arrow, its renderer's scale and the input coming back from it now go through the window's zoom; on Windows the screens it may open on do too (its frame and input already did; on X11 everything already did). A zoom an app sets before its window exists now reaches that window's popups as well. ui.prefers's states type-check when read (zgx-script): they were typedReadable<boolean>, whosegettakesself: neverso that any state fits a bound property, which madeui.prefers.reduced_motion:get()an error in a strict script. They are nowReadOnlyState<boolean>(getandpeek), asui.modifiersis.- A plugin replaces the root of a presence's content (zgx-script):
ui.contribute { target, replace }did nothing, without an error, when its target was the root aui.presencebuilder returns, at one level or nested; a child inside the branch was replaced. The root is now replaced where the branch builds it, each entry as it enters, leaving with it, asbeforeandafterthere already were. - A reload with a modal open keeps where closing it gives focus back (zgx, zgx-script): reloading a script while a modal or command palette is open, then closing it (Escape), now gives focus back to what had it before the modal opened, found again in what the reload built, the same way the focused node itself is found (its list row, else its role and name, else its place). Before, focus went nowhere: the modal's scope remembered the node the reload replaced.
- A reload keeps focus where it was (zgx, zgx-script): reloading a script built the interface again, and focus fell to its first Tab stop, so a focused
ui.listrow, or any control but the first, lost the keyboard on every save. What was focused is now found again once the new interface settles: in a list's row, the same row by its index (scrolled to if the list hasn't built it) and the same place in it, so one of many alike buttons (a "Delete" per row) keeps the right one; elsewhere the one node of its role and accessible name if it is the only one, else the node at its place. Rust views get it withcompose::switch_keeping_focus. - A remote picture that fails is asked for again by itself (zgx-script): after a failed fetch (a dropped connection, a busy server's 5xx), a
ui.imageshowing it fetches it again once the backoff passes (5 s, doubling up to 5 minutes), for as long as a node shows it. The backoff only held back a fetch something asked for again, and nothing did: the picture stayed blank, or on itsfallback, for the life of the node. - A span's padding that changes measures its paragraph again: an inline chip whose padding followed a state kept the width it was first measured at (a padding change was taken for a colour change), so its line wrapped or left a gap.
- A list in a box easing shut lays out (zgx): a
ui.list(or scroll view) of a set height in a column, in a box that clips while its height eases (a fold), never settled once its rows held a percentage height (h_full): the column's floor counted the list as nothing, so it squeezed the list, which built no rows, and the next pass all of them. A list's or scroll view's set height now counts toward its column's min-content height, as CSS counts a scroll container's: the column keeps the list's height and the box clips it, with or without percentages inside. What moves: a list or scroll view with its own height, in a column with no height of its own that is shrunk and holds percentage heights, used to be squeezed below its height and now keeps it, clipped by what clips above it (as it already did without percentages inside). - A terminal moved to another window keeps naming what runs in it (zgx-terminal): when an engine-drawn terminal's session showed in another window (a tab dragged out, a view mounted elsewhere), its output followed it to that window's tasks, but a check of the process in front already due, and the app resolver's polling, stayed with the first window's. Once that window closed they ended with it, their pending flags left set, and the terminal never named its process or status again. They now move with the session.
- Terminals opened at once all start on macOS (zgx-terminal): macOS's
openptyisn't safe to call from two threads at once while ptys are in use, and an engine-drawn terminal could fail to start ("Terminal · couldn't start: Unknown error: -6"), about once in 4,000 concurrent opens. Ptys are now opened one at a time.zgx-alacritty-terminalis 0.26.1. - A terminal program's first clipboard request is answered (zgx-terminal): an engine-drawn terminal was given the app's platform (its clipboard) only after its session had started and been read once, so on a busy machine a program that copied to the clipboard or asked to read it (OSC 52) as it started could have its copy dropped or its question answered empty. The platform is now the terminal's before its session starts.
- A test's timers keep its time (zgx-script): under
zgx testandTestApp,ui.afterandui.everyfire as frames advance the test's time (1/60 s each), in order and each at its own time, never on the wall clock between two steps. A deferredui.afterin an app no longer lands mid-test on a slow machine. A wait (TestApp::wait_until) delivers a frame when one is asked for, else moves the test's time on by the time that passes.ui.after(0, fn)runsfnbefore the next frame is drawn, as it does in a window: in a test, before the frame that made it ends, or as the next one starts. - A token radius or border takes its single corners or sides, as a number does (zgx, zgx-script):
rounded = "$app.r", rounded_tl = 0, rounded_tr = 0painted all four corners at the token's radius, andborder = "$w", border_sides = { … }every side at its width: the token resolved after the refinements and wrote over them. The token now rounds only the corners no single corner sets (and follows theme changes there),rounded_cornersandborder_edgesreplace a token radius or width as they replace a number, and padding and margin, which already did, are pinned by tests. - A layout that never settles fails a test, without a panic (zgx-script):
zgx testandTestApppanicked when layout didn't settle in 64 passes (a list squeezed in a box easing shut, say), taking the whole run down. They now contain it as a window does: the last layout is kept, and the error naming what still moved is the app's (app:error(),TestApp::error, the inspector), so the test fails on it and the rest of the run goes on. - A runaway script is stopped on time in a backgrounded app (zgx-script): the watchdog that stops a script past its time budget woke from its timed wait as the system's coalesced timers allowed, and in a process macOS had put in the background (App Nap, a busy CI runner) that came 117 to 197 ms late, the script running on meanwhile. Its waits now end on a strict dispatch timer, which is not coalesced (within 2 ms there), and its thread runs at the interactive QoS; on Linux it takes no timer slack, on Windows the highest thread priority.
- A Windows program's last output shows after it exits (zgx-terminal): ConPTY renders what a program last wrote after the program has gone, and an engine-drawn terminal stopped reading at the exit, so a program's last lines were often lost: ping's statistics after Ctrl+C, a build's final error. The terminal now closes the pseudoconsole and reads its output to the end (five seconds at most) before reporting the exit.
zgx-alacritty-terminalis 0.26.1. The output pipe now ends as the pseudoconsole closes (zgx no longer keeps its own copies of the console's ends of the pipes), so an exit is reported as soon as the last output is read.
Crates: zgx, zgx-components, zgx-gpu, zgx-3d, zgx-desktop, zgx-terminal, zgx-script, zgx-run and zgx-ghostty-sys 0.1.9.