Skip to content

merge: sync upstream main (df223f97) into fork - #82

Merged
1lck merged 16 commits into
mainfrom
sync/upstream-df223f97
Nov 30, 2026
Merged

1lck merged 16 commits into
mainfrom
sync/upstream-df223f97

Conversation

@1lck

@1lck 1lck commented Nov 30, 2026

Copy link
Copy Markdown

Sync vivaui/viva main (up to df223f9, 15 upstream commits) into Lithe-IDEA/Lithe-viva main using merge commit.\n\nLocal checks:\n- GOOS=windows GOARCH=amd64 go build ./...\n- GOOS=windows GOARCH=arm64 go build ./...\n- go vet ./...\n- go test ./... (all packages pass except cmd/viva min_system=12.0 vs Go toolchain 13.0 mismatch, reproduced identically on unmodified upstream/main df223f9)

t8y2 and others added 16 commits November 29, 2026 17:51
HideWindow put SW_HIDE in STARTUPINFO, which Windows applies to the
first ShowWindow of a GUI program, so an editor opened through OpenWith
started with its main window hidden and looked hung. CREATE_NO_WINDOW
alone keeps a console program from opening a console. Verified on a
Windows 11 VM: a GUI program started the old way showed no visible
top-level window, started this way it showed one.

Companion: t8y2/motty#1809, which drops its app-local launcher and goes
back to app.OpenWith; the launch behavior is a framework concern.
decimals formatted the step with strconv.FormatFloat on every paint, which
allocates once per frame under Go 1.27. Step now records its decimal places
when it is set, so the warm paint does no formatting at all.

Closes vivaui#506
CodeMergeSnapshot gains caller-owned Conflicts with a Resolved flag. The
view marks unresolved conflicts in the result, Unresolved counts them and
NextConflict finds the next or previous one, mirroring CodeDiff's
NextHunk. CodeDiff gains RowOfOffset and RowOffset so navigation can start
from the result caret and place it at a conflict. Detecting conflicts and
what accepting a side writes stay with the application.

Closes vivaui#132
Box.Sticky keeps an element in its container's flow and, once the nearest
enclosing Scroll has scrolled its place away, holds it at the top of the
viewport, no further than the end of its container, so the next group's
header pushes it off: CSS position: sticky with top: 0. The whole subtree
moves after layout and before popups are placed, so paint, hits, focus
ring and popup anchors follow it.

The element paints in its place in the tree, so Tab, reading and
accessibility order are unchanged; while it is held, what its container
paints after it is clipped below it, so the group neither shows nor takes
a press behind it.

Desktop checklist: keyboard - Tab order unchanged, tested while held;
pointer - presses on the held header reach it, not the row under it;
focus - the ring moves with the header; focusing a row under a held
header does not yet scroll it clear of the header; text, density,
window - not affected; accessibility - roles and order unchanged, bounds
follow the header. Headless only; no real window verified.

Closes vivaui#250
ShowCount was documented for TextField and TextArea, but TextArea dropped
it: the option compiled and showed nothing. TextareaSnapshot gains Count,
painted at the end of a row of its own under the rows, in the style of a
TextField's count addon; the rows, the native text bounds and the
measured height keep clear of it through BottomInset. The words come from
the same cached Field count, so a warm repaint still allocates nothing.

A multi-line count follows Arco's TextArea showWordLimit; shadcn's
textarea has no count.
A fixed-pitch run without TextRun.Ligatures is laid out by DirectWrite
as one line whose advances are spaced onto the cells, but DirectWrite
still applied the font's default liga, clig and calt features. Maple
Mono's calt joins ]# (and ->, !=) into one glyph, so with Motty's font
ligatures switch off the terminal still drew them joined. ClearType
rows of a regular or bold face go through GDI, which shapes nothing,
so this showed on the grayscale path: a window over a translucent
backdrop, the Windows 11 default.

Such runs now carry an IDWriteTypography that turns off liga, clig,
calt and kern, set before the metrics are read, as the other backends
already draw them glyph by glyph. A generated test font with a calt
]# ligature guards both the grayscale and the ClearType path.

Refs: t8y2/motty#1820. The companion Motty commit pins CI to this one;
the fix is Viva's because the TextRun contract is the renderer's.
A window that hides on close (an application living in the status area)
comes back through Window.Show, from the application's own menu or from a
macOS Dock reopen that Viva routes there. The application had no way to
see the second path, so it could not put back what the window should hold
before it was shown again. OnShow runs inside Show when the window was
hidden, before it is back on screen; raising a visible window or
restoring a minimized one does not call it.

Motty: the companion commit opens a terminal in a terminal-only window
that was hidden after its last tab closed. Window show/hide is a
framework lifecycle event, so the hook belongs here rather than in a
Motty-local reopen handler duplicating Viva's default routing.
Selecting by words or lines read the whole text on every pointer move:
the byte offset was counted into a rune index, WordRange and LineRange
walked it back to the rune, and the result was walked again into bytes.
On a 7 KB text dragged to its end that took 25 us a move.

WordSpan and LineSpan take and return byte offsets and read only the word
or line and what borders it. WordRange and LineRange are now built on them,
and the text selection uses them directly, so a move costs the same on a
short text and a long one (about 70 ns for a word at the end of a 7 KB text).
They are checked against the rune ranges on every rune of mixed, CJK,
emoji and invalid UTF-8 text, by a fuzz test, and benchmarked on a long text.
…t+press

After a double or triple press, a Shift press extended the selection by
character from the picked word's start. Browsers and the platform text
controls keep the picked word or line whole and extend by the same unit,
on either side of it; TextSelection and TextSelectionArea now do too.
A single press selection, or one that picked nothing, still extends by
character from where the last press began.
…r the rows below

A list or tree whose rows glide places a row that comes in at once, where the
layout puts it, while the rows below it are still sliding down from where
they were. Opening a group therefore painted its rows on top of the rows of
the group below until those arrived.

The rows that came in are now held to the room that has opened: each shows
down to the top of the highest row below it that is still shown above its
place, which grows to the full row as those rows arrive, so a group opens like
a folder. Rows that were already there keep all of themselves, and a list at
rest, without a clock or under reduced motion is not held to anything.

Canvas.GlideShown reports where the canvas shows a glided element, so the page
can measure the room on what the eye sees. The repaint allocates nothing and
BenchmarkTreeGlide is unchanged.

Companion commit in motty: a headless end-to-end script that opens a host group
over another and checks no row is covered during the slide. The boundary is
Viva's because any application's tree or list with Glide has the same gap.
Add app.StartElevated and app.Elevated, CapabilityElevatedLaunch and
ErrElevationDeclined. StartElevated asks the consent prompt of User
Account Control (ShellExecuteEx with the runas verb) for a separate copy
of the program with administrator rights, and never raises the running
process: an ordinary-rights process cannot type into an elevated one,
which is the boundary an application offering an administrator's
terminal needs. A refused prompt is ErrElevationDeclined.

The headless Driver records the requests (ElevatedStarts) and answers a
queued result (SetElevatedStartResult), with elevatedstarts and
elevatedresult control commands, so a test neither shows a prompt nor
starts a second program.

Why this belongs in Viva: any application that wants to open an
elevated window needs the same call and the same rule about what the
request carries. Motty is the first user; see its companion commit
"feat(terminal): open local terminals as administrator" (Refs t8y2/motty#1058).

Benchmarks do not apply: it is a one-off launch, not a hot path. Windows
is the only platform with a consent prompt; the others return
ErrUnsupported and Elevated reports false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants