Repository navigation
merge: sync upstream main (ac665a8f) into fork - #62
Merged
Merged
Conversation
TextareaLayout.Fit wrapped the whole text again whenever it changed, on the paint thread, measuring every row with the platform text engine. On Windows a TextArea with 20000 lines spent about four seconds of DirectWrite shaping per change, so typing in a long text or a log growing at its end froze the window. A paragraph wraps on its own, so Fit now finds the paragraphs between the shared prefix and suffix of the old and new text, wraps only those again, keeps the rows before them and moves the rows after them by the length the edit changed. Other fonts, a size or a width still wrap everything; the font generation is now part of that check. Appending a line to 20000 lines goes from 26 ms to 71 us with reference metrics, with no allocation; on a Windows 10 machine typing 24 keys into 20000 lines took 1.0 s of CPU instead of 3.7 s.
A TextArea with a long text still shaped every row once when it opened: 20000 lines took five seconds on Windows before the window appeared. The rows are now estimated with the reference metrics, which shape nothing (the new gfx.WrapRowEstimate), and TextareaLayout.Show wraps the rows the box shows with the canvas, keeping the text at the top of the box in place as estimated rows become exact and keeping a caret that moved in view. RowCount and ContentHeight stay exact; AutoGrow uses ContentHeightUpTo, which wraps only up to the rows the box can grow to. A string bound to a field and changed by the program was set whole: the editor rebuilt every rune and the user's selection jumped to the end, so a growing log could not be selected. Field.follow now replaces only the runes between the start and end the texts share, mapping the selection through the edit; a caret at the end keeps following appended text. A field being composed or restricted is still set whole. Editor.ReplaceRangesWith found the byte and line of each edit by walking every rune before it; it now asks the rune store's index, so a replacement at the end of a long text costs the edit. On a Windows 10 machine 20000 lines open in 0.16 s instead of 5.1 s and 50000 in 0.24 s instead of 12.7 s; appending to a bound log of 20000 lines costs 0.22 ms in the field instead of 6.3 ms, and ReplaceRanges at the end of it 0.46 us instead of 5.7 ms.
benchmarks/size.sh failed whenever hello passed a hard-coded byte limit, and CI ran it with continue-on-error, so every run showed a red job that meant nothing. A binary's size is a number to watch across changes, not something one fixed limit tells right from wrong. The script now builds the same release binaries and reports their sizes, to the log and to the job summary on GitHub Actions; the job fails only when a build fails.
Three tests make real disk images with hdiutil. On the shared macOS runners the disk image service failed them in about one run in five whatever the change was (busy, not mountable, permission denied, no such file, or hanging for minutes), after four rounds of retries, so unrelated commits went red and a release tag could be held by it. They now run only with VIVA_DISK_IMAGE_TESTS set, in a disk-image job that the changes job starts when tools/dmg, tools/appbundle, cmd/viva/package*, the module or the workflow changes, and for every tag. The darwin job skips them; the logic around hdiutil stays tested on every change against a stand-in. The size job is now part of "ci passed" too, as it fails only when a release build fails.
A timer that must advance application state while its window cannot paint (hidden, minimized, or covered) previously had to pair time.AfterFunc with Application.Post in every calling application. PostAfter is that pair as one loop primitive: the delay is owned by the window loop, stop cancels it, and no goroutine is started. Motty's background keepalive and reconnect timers are the first caller (t8y2/motty#1454).
libibus names the address file after the Wayland socket when WAYLAND_DISPLAY is set, even for an X11 client on XWayland, and honours IBUS_ADDRESS_FILE. Looking only at DISPLAY missed the file on GNOME Wayland, so no input method connected. Refs: t8y2/motty#1472
paintSelect left the presence that components.BeginSelect opens, so the next EndPresence of an enclosing dialog, drawer or popover closed the select's in its place and animated everything painted after it. Call Select.End, which also paints the scrollbar of a popup that did not fit. Companion to the Motty select jitter report (#1460).
Add gfx.RadiusOutset so focus rings, cards and tab strips that stand a few pixels outside a control follow a zero radius instead of adding a fixed offset to it. Lets an app offer square corners by zeroing the radius tokens. Companion to the Motty corner style setting.
A release that ships patches from several earlier versions gets larger patches the further back it reaches. viva feed can now leave out a patch bigger than a fraction of its full archive, so the feed never offers a delta that saves too little to be worth applying. Paired with the Motty release script change that publishes patches from recent versions.
Motion gains a closed-form spring that keeps its velocity when the target changes on the way, including when it takes over a timed curve. Companion commit in motty adopts it for the library row chevron.
Canvas.BeginPose/EndPose place a group of primitives with an animated offset, scale and fade on top of the spring motion, and BeginGlide slides an element from where the last frame painted it to where the layout now puts it. Box.Glide exposes it to the element tree. Companion commit in motty glides window-bar tabs when their neighbours close, open or reorder.
GlideFrom names the point an element was last seen at, so a tab dropped by the pointer slides from there to its slot. Companion commit in motty.
A press on a gliding tab landed where the layout will put it rather than where it is drawn. Hit bounds now take the pose, as the paint does.
ListState.Glide slides keyed rows when rows are added, removed or moved, measuring the list's scroll so scrolling is not a move. Companion commit in motty keys host rows by host ID and turns it on for the host list.
A Tree row declares its hit inside the row, so the row element had no ID to be followed by and never glided. The list now gives it the row's identity.
Box.Presence draws a removed element's last frame fading and moving out, as an overlay does, so a closed item or a deleted list row no longer vanishes. Rows of a List follow their key. Reuses the canvas presence snapshots.
VelocityTracker measures a drag's speed, Project says where a throw would come to rest, Nearest picks a snap point, RubberBand holds a value pulled past its range, and Canvas.Throw gives the release speed to the next spring.
Pose gains Rotate. A turned group's rectangles become vector shapes in paint order, labels are drawn into a warped quad, shadows and images follow without turning, and clips and hits take the turned box. A posed element's text now follows its scale.
Moves, scales, turns and fades an element about its centre with a spring or a curve, painting only, with its hits following. Completes the element-level motion set: Glide, Presence and Pose.
Companion to the Motty release publish step, which spent most of its announce time cutting 18 patches one after another. Each patch reads its own archives and writes its own file, so they run on GOMAXPROCS workers while the feed entries are still added in argument order.
…the menu Companion to the Motty commit that lets broadcast input pick several tabs from one menu; a reusable menu needs a checkbox row that stays open.
FilePromise and StartFilePromiseDrag describe files the application produces when the target asks: macOS writes them through NSFilePromiseProvider, Windows serves FileGroupDescriptorW and one FileContents stream per file, and the X11 shell stages them and offers the paths with XDND. StartFileDrag no longer reports the effect, because the Windows drag blocks until the drop while macOS and Linux return once the drag is running. base.DragState.OnMove lets a page-driven drag continue past the window. Companion: t8y2/motty's file-panel drag-out (Refs t8y2/motty#1517).
A window that composites over the desktop asked for it through a clear color alpha just under one, relying on the zero color meaning unspecified and on the drawable rounding the alpha away. Name the request instead: Transparent keeps a zero ClearColor fully transparent where the platform composites (macOS), and is ignored elsewhere, which Supports reports. Companion to the Motty terminal transparency setting (t8y2/motty#1601), which needs a typed window option rather than a clear-color side effect.
A Transparent window takes the DirectComposition renderer that materials already use, and turns on DWM blur-behind with an empty region so the swap chain's alpha reaches the desktop instead of an opaque sheet. CapabilityTransparentWindow is now reported on Windows as well as macOS. Checked on a Windows VM with a custom-titlebar window: an unpainted area and a half-alpha band show the desktop through; the opaque band stays opaque.
Opt-in page package: a popover over the pressed button with a question, a line of detail and two answers, reporting Confirmed or Cancelled in the paint that delivers the press, with a destructive form for removing something. Escape and a press outside close it without answering. It is for a cheap local question; an irreversible one stays in ui.AlertDialog.
Box.Status gives a Progress the theme's success, warning or danger color for its fill in place of the primary one, in the same ui.Status vocabulary an alert, a tag and a field use.
Box.Loading puts the loading indicator in the place of a button's icon, or before its label when it has none, keeps the button's look, and delivers no press while it is on so the work cannot start twice. The recipe takes the indicator as a painter the page supplies, so installing the button does not pull in the spinner's file.
Opt-in page package: a horizontal rule with a label in the middle or near an end, as the "or" between two ways to sign in. A plain rule stays ui.Divider.
…ography) Opt-in page package: a text shown in Rows lines ending in an ellipsis, with a button that shows the rest when the text needs more lines at the width it has, and a button that puts the whole text on the clipboard. Whether it is cut comes from the width the previous paint laid the paragraph out at, so an idle text asks for no frame. ui.SetClipboardText is added for a button that copies a value.
Box.Marks puts a dot on the track at each ui.SliderMark's value, light over the filled part and dark over the rest, and the mark's word under it. A horizontal slider with a labelled mark is taller by the room the words take; the pointer still maps over the track alone. The installable slider template is regenerated.
… it on Linux OnTransparentChange tells the application, once the window exists, whether the desktop shows through it, so a window that could not be composited paints as opaque instead of leaving a translucent fill over black. macOS reports a clear alpha below one, Windows reports the DirectComposition renderer, and the X11 shell reports its ARGB frame window, which exists for a WindowCustomTitlebar window where a compositing manager owns the screen. CapabilityTransparentWindow is now reported on Linux except in the GTK shell. Adds cmd/transparent-demo to look at the window by hand on each platform. Verified on the Linux test environment (GNOME on X, composited): the half-alpha band and the unpainted area show the desktop and the callback reports true; VIVA_LINUX_FRAME=off gives an opaque window and reports false.
Loading now takes a Switch as well as a Button: the spinner turns on the thumb, the switch keeps its look, and a press neither reports nor flips the bound value while it is on. components.SwitchResult reports where the thumb was painted.
Box.Circle draws a Progress as a ring that fills clockwise from twelve o'clock with round ends, 64 across unless sized, keeps the status color and the accessible progress bar of the bar, and does not stretch in a Column; an Indeterminate ring is a turning arc that holds still under reduced motion. gfx.PathBuilder gains Arc, circle arcs as cubic curves, which the ring is drawn with.
ui.SelectGroups puts a heading row in a Select's list before the first option of each group. A heading is not an option: no focus, click or type-ahead, and Picked, DisabledOptions, Icons and Part keep the choices' own indexes. The select works in rows internally and maps back at the boundary; the grouping is applied where the select is made, before Picked reads the click. The installable select template is regenerated.
Box.Segments(n) draws a Progress bar as n separate segments with a gap between them and the first ones filled for the fraction, for work that comes in stages; it keeps the status color and the accessible progress bar.
Required, MinLength, MaxLength, Min, Max, Pattern, Email and URL rules with caller-supplied messages, Check for the first failure and Apply to set a FormFieldState's Error and Invalid. Rules are plain functions, so an application's own rule has the same shape.
Box.DropFiles with a FileDropState declares an area that takes files dragged onto it (Over for the highlight, Dropped for the files and paths), and ui.Configure now gives the window's OnFileDrop to the area under the files before the application's own handler. ui.OpenFiles wraps the system picker for a page and wakes the window when a browser answers late; FileRef.Path and ui.FilePath give a file's path where the platform has one.
A drop area with the system picker button and one row per file with its status, progress, retry and remove. The page owns the transfer and tells the control each item's Status and Progress; the control reports Added, Rejected, Removed and Retried, checking Accept, Limit and single-file batches. The component catalog tests now run under a driver so pressing every control never opens a native dialog.
…e dirs by identity The website needs a Chinese sidebar name for every catalog page; the browser vet cannot build tests that import headless; and the Windows folder-picker test compared an 8.3 short temp path with the shell's long one as text instead of as the same folder.
anchor is an in-page table of contents with a rail marking the section in view; the page owns the scrolling and tells the control which section is active. comment lays out an avatar, author and time, text, the page's own action buttons and nested replies, keeping no state of its own.
A dialog over a picture with zoom out, zoom in, fit and actual-size buttons, wheel and +/-/0 keys, and drag to pan, closed like any Modal. The thumbnail stays the page's own control and calls Open.
Typing @ and letters at the start of a word lists the matching options under the field; Up, Down, Enter, Tab and Escape drive it from the keyboard, and pressing an option chooses it without taking the keyboard from the field. The chosen option is written in place of the typed word.
A note beside one control at a time with Previous, Next, Finish and Skip, and the rest of the window dimmed around the control. The page names each step's control with Target as it declares it; only Finish counts as finishing, and a step whose control is absent is shown as a plain note.
TreeNode.Loading replaces the chevron with the spinner and takes no press on it, so an application that loads children on Toggled marks the row until they arrive and a second press cannot start a second fetch.
# Conflicts: # cmd/viva/initfiles/AGENTS.md.txt # cmd/viva/templates/tree.go.txt # components/tree.go # gfx/presence.go # ui/tree_paint.go
17 of 21 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 this changes
Merges
upstream/main(ac665a8f:fix(cmd/viva): regenerate the tree installer template, 107 upstream commits includingv0.6.8) intosync/upstream-ac665a8f(based on forkmain98e5d08b), keeping merge-commit history (git merge-base --is-ancestor upstream/main HEAD).Conflicts (5 files). Each one is an upstream change and a fork-only change touching the same lines for different reasons, so both sides are kept; nothing from upstream is dropped.
gfx/presence.goPresence.applysplit intopresenceTransform.apply, shared with the newBeginPose/EndPose(19ad31a5,eba61a6c)presenceTransform.apply, so it covers presences and poses alikegfx/pose.go(no textual conflict)BeginPoserecords where its primitives starthoverHints: len(canvas.hoverHints); without itEndPosewould move every hint painted before the pose. Hints follow the pose like hits do (EndPosemoves hits withtransform.rect)components/tree.go,cmd/viva/templates/tree.go.txt5d0ec187)tree.paintDisclosuredraws app-set arrows (#10)paintDisclosure; the template stays byte-identical to the componentui/tree_paint.goitem.Loadinggets a spinner phase (5d0ec187)TreeState.Disclosure(#44)cmd/viva/initfiles/AGENTS.md.txtWarningtheme colorTooltiptheme colorWhy
Lithe-IDEA pins this fork. Upstream had 107 commits the fork did not have, and Lithe's
mainalready usesBox.OverflowTooltipfrom #61, which the current pin (36cbd3ab) predates.How it was verified
On
652ee6eb(macOS arm64):test -z "$(gofmt -l $(git ls-files '*.go'))"go vet ./...andgo vet -tags dev ./...go build ./...;GOOS=windows GOARCH=amd64 go build ./...,GOOS=windows GOARCH=arm64 go build ./...,GOOS=linux GOARCH=amd64 go build ./...go test ./...: every package passes exceptcmd/viva(dmg/signing fixtures vs the local macOS 27 SDK),ui/inputnumber,internal/componentdemo,internal/gallery(all three:ui/inputnumberallocates once per warm paint under go1.27.4). All four pass withGOTOOLCHAIN=go1.26.0(thego.modversion upstream CI uses), and the same failures reproduce on pristineupstream/mainunder go1.27.4.go test -tags dev ./base ./ui/... ./gfx ./components: all pass exceptui/breadcrumbTestDisabledPlaceTakesNoPress(Key 1 was given to a Text), which fails identically on pristineupstream/main.git merge-base --is-ancestor upstream/main HEADWhere the boundary sits
Pure upstream sync into
Lithe-IDEA/Lithe-vivamain; use Create a merge commit (do not squash) so the common upstream history is preserved. Fork patches still not upstream after this merge: #61 (upstream vivaui#454, open) plus the earlier fork-only patches; open fork PR #60 is not part of this merge.Cost
None beyond upstream changes.