Repository navigation
Sync upstream Viva main through 59a696ec - #53
Merged
Merged
Conversation
Keep a Button a Button when it is given Children, so its identity, focus, disabled state, hit options and keyboard behavior survive caller content; give the engine the recipe defaults the painter used to compute (explicit FontSize and Weight, Pad per side, recipe order, content clipping, inherited content color, baseline through the content) so the default label and Children agree. Install a control's painter and measurer as the page declares it instead of installing every control from ui's init: a page links only the controls it uses. A direct host of package base calls ui.InstallPainters, and a control declared without an installation now stops with a diagnostic naming it rather than laying out or painting as nothing. Release hello sizes fall from the parent commit: darwin/arm64 4,325,346 to 4,176,498, linux/amd64 5,583,077 to 5,386,469, windows/amd64 5,262,336 to 5,073,920, removing the 16,528-byte step the Button migration added. See ../motty for the companion CI revision pin.
The X11 backend only spoke IBus, so a desktop whose input method is Fcitx 4 (Kylin with Sogou, for instance) got keys but never marked text or a commit: the engine was never asked. Add internal/fcitx, a pure-Go client for Fcitx 4's own session-bus interface, and a daemon seam in the Linux backend so IBus and Fcitx 4 share the field state machine. The backend follows XMODIFIERS when the session names a framework, then falls back to IBus and Fcitx 4, so a Fcitx 4 desktop is not captured by an IBus daemon the desktop still runs. Keys carry the raw X keycode, symbol, state and event time; the IBus adapter converts to IBus's keycode base and release mask. Fcitx 4 has no native preedit modes, so its contexts keep the field's input through legacy marked text. Motty needs no code change: it builds against this checkout through go.mod and its terminals and text fields use the same native text input. Refs: t8y2/motty#1165
…in dev ADR 0089 stages 2 and 3. The default look of Badge, Toggle, the Tabs strip, the Select trigger, Input and Textarea, and the box and caption of Checkbox and Switch now come from their recipes and the element's own attributes, so Pad, FontSize, Weight, Color, Radius, Background, Height and Children mean the same thing on them as on any element. A control keeps its own graphic (the check, the thumb, the chevron) and keeps its hit, focus and disabled state on its root; a Select, Checkbox and Switch still declare their hit under their own identity. A dev build (-tags dev or vivadev) now reports a generic attribute an element cannot use, instead of ignoring it: Children on a control without a content slot, Gap or Items on an element that lays out nothing, a state look with no identity, Pad on an Image, Scroll* off a scroll area, Hit(ID) on a control that declares its own hit, and the attributes the self-painted widgets never read. Release builds carry neither the rules nor their messages; a CI job proves that. VIVA_ATTR_CHECK=warn reports without stopping, for sweeping an existing page. Fixes found along the way: Frame.Select copied its node and lost the themed flag, a disabled Splitter could still be dragged, a Checkbox or Switch under a disabled ancestor dimmed but still took clicks, and Image.Radius did nothing. Behavior changes: Switch Width/Height now size the track, and a larger Input FontSize grows the field instead of clipping its text. Size: hello grows 16.5 KiB on darwin, 20 KiB on linux and 15.5 KiB on windows against the commit before this one; it is still 130 KiB below the size before the Button migration. A steady button page still allocates nothing per frame and a Node is still 360 bytes, but the heap in use after warming that page measured 96 KiB higher (1,384 to 1,480 KiB). The Button page benchmark is within the noise of a loaded machine (best of 15: 179 us before, 166 us after); a quiet-machine comparison is still owed. Companion commit in Motty drops the Select Hit(ID) calls this makes an error; the Motty change does not alter any paint record.
…lement Four attributes that used to be silently ignored now reach what they name: - Tabs: Pad applies to all four sides instead of only the top, so PadX, PadY and uneven sides inset the triggers and the strip's own thickness; a strip without a height is exactly its triggers plus PadY, so PadY(0) no longer falls back to the theme's 36. - Table: the element's FontSize and Color style the header and the cells, replacing the spec's size and the theme's foreground; FitHeadings then fits at the element's size. Weight stays with the table's recipe. - Checkbox: an explicit Size sizes the box, not only its element; a non-square box draws its mark for the shorter side. - Switch: FillWidth, FillHeight and percent sizes size the track from the layout, keeping the caption's room out of it, and the pill radius follows the height. A pixel size still sizes it directly. The dev attribute rules are relaxed for the attributes that now work. The component defaults are untouched, so nothing changes for callers that set none of these.
# Conflicts: # internal/platform/linux/wide_label_linux_test.go
An Image's Radius now cuts its picture's corners and its Opacity fades it, in every renderer: the CPU rasterizer, Metal, Vulkan, WebGL, the Web Canvas2D fallback and D3D11. Radius and Fade are draw-time values on the image primitive, so an animated opacity does not rebuild a texture; a zero value takes the old square, opaque path byte for byte. The shaders reuse the rounded-box distance field the rectangle shaders already use. On the Web Canvas2D fallback the picture is clipped to a rounded path and drawn with a scaled globalAlpha. A Progress given a Label is a progress bar to assistive technology: a read-only range from 0 to 100 at the fraction (no number while indeterminate), never a keyboard stop or a press target. Frame.Progress takes the bar's identity and the page's ui.Progress names it automatically. The role and its read-only range pattern are mapped on Darwin, Windows, AT-SPI and ARIA. A bar with no Label declares no node, so it cannot take the pointer from the row holding it. The dev attribute rules let these through: Image Radius and Opacity, Progress Label, and the attributes the previous batch made real. Verified: the full affected suite and the dev build on Linux and macOS; the Vulkan and D3D11 paths with offscreen pixel tests on the private Linux machine and Windows VM; Darwin with Metal offscreen tests; the Web package under Node. Size: hello darwin 4,209,874 (+176), linux 5,484,773 (+16,384), windows 5,125,632 (+12,288), from the new shader bytecode.
1lck
marked this pull request as ready for review
November 21, 2026 05:51
19 of 22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Sync upstream
faaa437d..59a696ecinto the fork before the next Lithe desktop release. The 13 commits cover engine-backed controls and their styling, live window icons, List row margins, Windows resize pacing, Linux IME and X11 behavior, long-label rendering, shaped-text highlighting, image rendering, and accessible progress bars.The Linux wide-label test was an add/add conflict. The resolved file matches upstream, including the Vulkan sampling fix. The rest of the wide-label patch also matches upstream, including the implementation from vivaui#375.
Include the native Dock icon test correction from vivaui#377. The old test failed on this HDR Mac because AppKit's device color profile changes sampled RGB values. The test verifies both icon changes by their dominant channels and checks logical dimensions and alpha. GitHub’s macOS runner snapshots the 18-pixel fixture at 9 pixels, so the size assertion now uses the NSImage size in points.
Include the Windows shader ABI test correction in vivaui#378. The upstream renderer and shaders already agree on the 80-byte buffer after image shaping was added. The test now verifies the matching size and field offsets.
Verification
GOOS=windows GOARCH=amd64 go build ./...and the same build withGOARCH=arm64passed on the sync branch.GOTOOLCHAIN=go1.26.10 go vet ./...and the Darwin/headless vet passed.