Repository navigation
Releases: vivaui/viva
Release list
Viva v0.2.1
v0.2.1 是 v0.2.0 之后的 patch 版本:公开 API 只有新增,没有删除或改签名,升级不需要改调用点。本版新增滚轮步进、无文字粘贴事件、macOS 系统编辑键、块元素字符的单元格绘制、系统文件图标与 Dock 角标,并修掉一批 Windows 静默退出、Linux 拖动与连字、近共线三角形的根因。macOS 是参考平台。
v0.2.1 is a patch release after v0.2.0: the public API only gains members, with no removal or signature change, so upgrading needs no call-site edits. It adds wheel stepping, a paste event for a clipboard without text, macOS system editing keys, cell-drawn Block Elements, system file icons and a Dock badge, and fixes root causes behind silent Windows exits, Linux drag and ligature handling, and near-collinear triangles. macOS is the reference platform.
拿到它 · Getting it
这个 tag 是 Go module 标签:go get github.com/vivaui/viva@v0.2.1,需要 Go 1.26 或更新。系统依赖与 v0.2.0 相同:macOS 要 Xcode 命令行工具(cgo 调用 Cocoa 与 Metal),Linux 要 X11 与系统的 XCB、Vulkan、Pango,Windows 要系统的 Direct3D 11 与 DirectWrite;Viva 在运行时加载这些系统库,不捆绑其中任何一份。每个 Release 附带 viva 命令的预编译压缩包与 SHA256SUMS,以及 Homebrew 与 Scoop 清单:macOS、Linux 用 brew install vivaui/tap/viva,Windows 先 scoop bucket add vivaui https://github.com/vivaui/homebrew-tap 再 scoop install viva。压缩包没有代码签名或公证,浏览器下载的 macOS 版会被 Gatekeeper 拦下,用 brew、curl 或 go install 则不受影响。
This tag is a Go module tag: go get github.com/vivaui/viva@v0.2.1 needs Go 1.26 or newer. The system requirements are the same as v0.2.0: the Xcode command-line tools on macOS (cgo reaches Cocoa and Metal), X11 with the system XCB, Vulkan and Pango on Linux, and the system Direct3D 11 and DirectWrite on Windows. Viva loads those system libraries at runtime and bundles none of them. Every Release carries prebuilt archives of the viva command with SHA256SUMS, plus Homebrew and Scoop manifests: brew install vivaui/tap/viva on macOS and Linux, and on Windows scoop bucket add vivaui https://github.com/vivaui/homebrew-tap followed by scoop install viva. The archives are not code-signed or notarized: a browser download on macOS is stopped by Gatekeeper, while brew, curl and go install are not affected.
go get github.com/vivaui/viva@v0.2.1有什么 · What is in it
-
新增
ui.ScrollEvent.StepX与StepY:按行滚动的内容(列表、终端)每个经典滚轮事件至少移动一个单位,触摸板的精确增量原样通过;macOS 把慢速滚轮刻度报成不足一行的像素,应用不再需要各自兜底 -
文本粘贴新增
app.TextPasteNoText:剪贴板里只有图片时,粘贴不再消失在原生文本系统里,字段可以据此用ClipboardImagePNG读到图片;Linux 文本字段补上了此前缺失的 Control+C/X/V,浏览器从 paste 事件发出同一事件 -
macOS 文本字段补齐系统编辑键:Option+方向键/删除键、Command+方向键/删除键、Control+K、Home、End 这些 AppKit 选择器映射到既有的文本命令,新增
app.TextDeleteToLineStart、app.TextDeleteToLineEnd与text.Editor.DeleteToLineBoundary;无头驱动用同一套按键定义 -
macOS 把 Control+Tab 与 Control+Shift+Tab 交给应用:AppKit 默认把它留给窗口的视图切换,视图现在在
performKeyEquivalent:里先认领,组词期间不认领;不保证配对的 keyUp 一定送达 -
修复 Windows 上让程序静默退出的几处根因:UI Automation 的 fragment root 使用自己的接口表(此前无障碍客户端在场时一次双击就能写坏堆并崩溃,Windows 11 build 26200 上复现 4/4 次,改动后 0/8 次);UIA 回调拒绝调用方传入的不可写指针并返回
E_POINTER;EnableCrashDumps改到真正导出WerRegisterAppLocalDump的 kernelbase 里查找,此前每次查找都失败、程序从不留下原生转储 -
Windows 终端的预编辑按终端自己的单元格网格绘制:用
MonoFace与 0.6 字号的单元格步进,宽字符占两格,插入符、组词下划线与候选窗位置都按格测量;终端自己画光标时不再叠加一个系统插入符,也不再为它的闪烁启动定时器 -
修复近乎共线的网格三角形在平移后画出远端亮斑的问题:D3D11 与 Vulkan 后端与 macOS 对齐,把覆盖度限制在三角形自身范围、丢弃越界与非有限样本,细长图形只在自身位置绘制
-
Linux 拖动时排队的主键移动事件合并到最新位置,与原生平台的行为一致;
app.Config.OnPointer的文档说明拖动中的 move 可能被合并,处理函数应跟随坐标而不是数调用次数 -
修复 Linux 固定字宽文本在拟合连字时重复 reshape 布局:绘制改用已经测量过的布局,缩放矩阵不再泄漏到后续 run
-
新增
ui.Canvas.BlockRectangles、ui.IsBlockElement与ui.ReplaceBlockElements:U+2580–U+259F 的块元素字符按设备像素对齐画成矩形,相邻同色单元格合并,字体不再绘制这些字符,终端像素画与方块条不再露出缝隙 -
新增
app.FileIcon与flex.Frame.Image:按系统文件管理器的方式取本地文件或目录的图标(macOS 通过NSWorkspace,其他平台返回ErrUnsupported),并把这张位图不产生每帧分配地排进布局 -
新增
app.Application.SetDockBadge:macOS Dock 图标上的角标文字,空串移除;Windows 与 Linux 没有等价物,调用不做事;无头驱动新增dockbadge命令,不开窗口也能检查 -
组件新增:
Button.WithIcon加前置矢量图标,图标尺寸下文字转为无障碍名称与提示;Checkbox.HitBounds让外层标签或整张卡片成为同一个勾选目标;面积图的时间轴标签被限制在容器内;TabOption.IconOnly的标签同时作为提示;SelectSizeXSmall让触发器比控件矮八像素、值降一档字号,弹层选项仍是正文字号;MessageScrollerGeometry.OffsetForThumb把滑块位置反算成内容偏移,轨道上没有可移动空间时不移动列表 (contributed by @Ezreal-byte) (PR #66) -
Windows 安装器在完成页提供“创建桌面快捷方式”,静默安装(/S)不创建;卸载只删除安装器自己创建过的那一个 (contributed by @Ezreal-byte) (PR #74)
-
同一次组件改动的收尾修复:图标按钮在窄尺寸下不再把图标挤出边界,聚焦的面积图会播报最新数据点,复选框外层目标的文档补齐
-
官网新增
/showcase页面,展示用 Viva 构建的应用;viva add分发的组件模板与components/的本版改动同步 -
ui.ScrollEvent.StepXandStepYare new: content that scrolls in steps, such as a list or a terminal, moves at least one unit per classic wheel event, while a precise touchpad delta passes through unchanged; macOS reports a slow wheel notch as a fraction of a line, so applications no longer need their own floor -
Text input gains
app.TextPasteNoText: a paste whose clipboard holds only a picture no longer disappears inside the native text system, and the field can read the picture withClipboardImagePNG; Linux text fields now own Control+C/X/V, which they lacked, and the browser emits the same event from the paste event -
macOS text fields gain the system editing keys: Option+arrows/delete, Command+arrows/delete, Control+K, Home and End map from their AppKit selectors to the existing text commands, with new
app.TextDeleteToLineStart,app.TextDeleteToLineEndandtext.Editor.DeleteToLineBoundary; the headless driver uses the same key definitions -
macOS delivers Control+Tab and Control+Shift+Tab to the application: AppKit keeps them for the window's view switching, so the view now claims them in
performKeyEquivalent:first and leaves them alone during input-method composition; a matching keyUp is not promised -
Root causes of silent Windows exits are fixed: the UI Automation fragment root has its own interface table (an accessibility client plus one double click used to corrupt the heap and crash; 4 of 4 times on Windows 11 build 26200 before, 0 of 8 after); a UIA callback rejects an unwritable out pointer from its caller with
E_POINTER; andEnableCrashDumpslooks forWerRegisterAppLocalDumpin kernelbase, which really exports it, instead of wer.dll, where the lookup always failed and no native dump was ever written -
A Windows terminal's preedit is drawn on the terminal's own cell grid:
MonoFaceat a 0.6-of-the-font-size cell pitch, wide characters on two cells, and the caret, composition underline and candidate window measured in cells; a terminal that draws its own cursor no longer gets a system caret over it, and no blink timer starts for a caret that must not appear -
Fixed near-collinear mesh triangles painting a remote bright patch after a translation: the D3D11 and Vulkan backends now match macOS, bounding coverage to the triangle, discarding out-of-range and non-finite samples, so a sliver draws only where it is
-
Linux coalesces queued primary drag motions to the latest position, as native platforms do; the
app.Config.OnPointerdocumentation says a drag's moves may be coalesced, so a handler follows the coordinates rather than counting calls -
Fixed Linux fixed-pitch text reshaping its layout again while drawing fitted ligatures: drawing shows the layout already measured, so the scaled matrix no longer leaks into later runs
-
ui.Canvas.BlockRectangles,ui.IsBlockElementandui.ReplaceBlockElementsare new: U+2580–U+259F Block Elements become rectangles snapped to device pixels, adjacent cells of one character and color merge, and the font no longer draws them, so terminal pixel art and block bars show no seams -
app.FileIconandflex.Frame.Imageare new: the icon the system's file manager shows for a local file or folder (throughNSWorkspaceon macOS,ErrUnsupportedelsewhere), placed in a layout without allocating per frame -
app.Application.SetDockBadgeis new: text in the badge macOS draws on the Dock tile, an empty string removing it; Windows and Linux have no equivalent and the call does nothing, and the headless driver has a newdockbadgecommand so it can be checked without a window -
New in components:
Button.WithIconadds a leading vector icon, with the label becoming the accessible name and hint at an icon size;Checkbox.HitBoundsmakes an enclosing label or card one checkable target; time labels on an area chart stay inside the container;TabOption.IconOnlykeeps its label as the hint;SelectSizeXSmallmakes the trigger eight pixels shorter than a control with the value one type step down while the popup keeps body size;MessageScrollerGeometry.OffsetForThumbmaps a thumb back to a content offset and moves nothing when the track has no travel (contributed by @Ezreal-byte) (PR #66) -
The Windows installer offers "Create a desktop shortcut" on its finish page, a silent install (/S) creates none, and uninstall removes only the one the installer made (contributed by @Ezreal-byte) (PR #74)
-
Follow-up fixes to the same component change: a narrow icon button no longer pushes its icon outside its bounds, a focused area chart announces its latest point, and the enclosing checkbox target is documented
-
The website gains a
/showcasepage for applications built with Viva, and the component templatesviva adddistributes match this version's changes undercomponents/
注意 · Caveats
v0.2.1 是 patch 版本:没有删除任何公开 API,也没有改变任何签名,上面列出的新增项都是可选的,升级不需要改调用点。按 1.0 之前的版本语义,新增公开 API 通常会进 minor;这次按 patch 发布,是因为它没有破坏性变更。
有两处行为值得知道:
app.Config.OnPointer现在写明:一次拖动中的 move 可能被合并到最新位置(本版在 Linux 上就是这样),处理函数必须跟随坐标,而不是假定每个 move 一次回调- 无文字粘贴事件只发给文本字段;终端不会收到它,
TextEvent.Apply也会忽略它,按终端语义处理粘贴的代码不需要改
viva dev 的重载协议版本仍是 20,分发的组件模板与 components/ 同源,Go 1.26 的要求没有变。
v0.2.1 is a patch release: no public API is removed and no signature changes, every addition listed above is optional, and upgrading needs no call-site edits. By pre-1.0 version semantics new public API usually lands in a minor release; this one ships as a patch because it has no breaking change.
Two behaviors are worth knowing:
app.Config.OnPointernow states that a d...
Viva v0.2.0
v0.2.0 是一个允许破坏公开 API 的 minor 版本:ui.MonoFace 的底层类型加宽为 uint16,MonoFamilyCount 改名为 MonoFaceCount,MaxMonoFamilies 由 MaxMonoFaces 取代,迁移方式见文末。这一版新增固定字宽字体的回退族、按 DPI 生效的窗口最小内容尺寸、Windows 崩溃转储与故障上报、可搜索可创建的单选下拉,以及面积图填充样式与图标标签页。macOS 是参考平台;本版在 macOS 真机、Linux 容器与 Windows 虚拟机上跑过同一套窗口生命周期 conformance,但没有真机 Windows/Linux GPU 数据。
v0.2.0 is a minor release that may break the public API: the underlying type of ui.MonoFace widens to uint16, MonoFamilyCount becomes MonoFaceCount, and MaxMonoFamilies becomes MaxMonoFaces; migration is at the end. It adds fallback families for fixed-pitch text, a minimum content size that respects display DPI, Windows crash dumps and fault reporting, a searchable creatable single select, and area fill styles and icon tabs. macOS is the reference platform; the same window-lifecycle conformance ran on a real Mac, a Linux container and a Windows VM in this release, but there is no real-GPU data for Windows or Linux.
拿到它 · Getting it
这个 tag 是 Go module 标签:go get github.com/vivaui/viva@v0.2.0,需要 Go 1.26 或更新。系统依赖与 v0.1.0 相同:macOS 要 Xcode 命令行工具(cgo 调用 Cocoa 与 Metal),Linux 要 X11 与系统的 XCB、Vulkan、Pango,Windows 要系统的 Direct3D 11 与 DirectWrite;Viva 在运行时加载这些系统库,不捆绑其中任何一份。每个 Release 从 v0.1.3 起附带 viva 命令的预编译压缩包与 SHA256SUMS,以及 Homebrew 与 Scoop 清单:macOS、Linux 用 brew install vivaui/tap/viva,Windows 先 scoop bucket add vivaui https://github.com/vivaui/homebrew-tap 再 scoop install viva。压缩包没有代码签名或公证,浏览器下载的 macOS 版会被 Gatekeeper 拦下,用 brew、curl 或 go install 则不受影响。
This tag is a Go module tag: go get github.com/vivaui/viva@v0.2.0 needs Go 1.26 or newer. The system requirements are the same as v0.1.0: the Xcode command-line tools on macOS (cgo reaches Cocoa and Metal), X11 with the system XCB, Vulkan and Pango on Linux, and the system Direct3D 11 and DirectWrite on Windows. Viva loads those system libraries at runtime and bundles none of them. Every Release since v0.1.3 carries prebuilt archives of the viva command with SHA256SUMS, plus Homebrew and Scoop manifests: brew install vivaui/tap/viva on macOS and Linux, and on Windows scoop bucket add vivaui https://github.com/vivaui/homebrew-tap followed by scoop install viva. The archives are not code-signed or notarized: a browser download on macOS is stopped by Gatekeeper, while brew, curl and go install are not affected.
go get github.com/vivaui/viva@v0.2.0有什么 · What is in it
-
ui.MonoStack让一个固定字宽字体带上按顺序尝试的回退族:主字体没有的字形由回退族补上,平台自身的回退排在最后,单元格始终是主字体的;macOS 设置字体的 cascade list,Windows 建IDWriteFontFallback,Linux 与 Web 把族名接在 Pango 与 CSS 列表之后。配套的新 API 有MonoFallbacks、MonoIsClassic、MaxMonoFaces(最多 4096 个 face)与MaxMonoFallbacks(8 个) -
app.Config新增MinWidth、MinHeight:按逻辑像素限制用户拖动窗口的下限,与显示器 DPI 无关,为零表示该方向不限;原生适配器会把限制压到当前屏幕工作区以内,初始尺寸小于下限时会被放大 (contributed by @Ezreal-byte) (PR #54) -
Windows 新增
app.EnableCrashDumps:在 Windows 11 22H2 及以上把 LocalAppData 目录注册给 Windows 错误报告,让在 Go 运行时接手之前就结束进程的故障(显卡驱动崩溃、fast-fail)留下转储,其他平台返回ErrUnsupported;VIVA_ACCESSIBILITY=0可以不给 Windows 窗口建 UI Automation 树,VIVA_SOFTWARE_RENDERING=1改用 WARP 绘制,便于把静默退出定位到驱动或无障碍客户端 -
新增
app.SetFaultHandler,收到后端在系统回调边界(窗口过程、UI Automation、拖放、状态图标、字体枚举、AppKit 回调)捕获的每个 panic 的堆栈;新增app.ShowFatalError,在程序无法启动时弹出原生错误框。同时修了几处 Windows 静默退出的根因:arm64 上 UI Automation 不可用不再导致建窗失败;输入法上下文或组词串丢失不再关闭窗口;窗口销毁即使中途 panic 也会归还窗口计数;状态图标窗口改为隐藏的顶层窗口,Explorer 重启后能收到TaskbarCreated;最小化的窗口不再把自己报告在 (-32000,-32000) -
新增
SingleSelect:PaintSingleSelect与SingleSelectState把一个选中值、原生搜索编辑器与过滤后的弹层组合在一起,支持可选地创建新条目、清空、键盘导航与输入法安全的确认 (contributed by @Ezreal-byte) (PR #56) -
AreaChart的每个系列可以带ChartSeries.AreaStyle(ChartAreaStyle:颜色、透明度、ChartAreaGradient渐变),不设时保持原来的填充;ChartAreaDefaultOpacity让只改颜色时沿用默认透明度。Tabs的TabOption支持Icon与IconOnly,图标与文字作为一个整体居中,IconOnly仍以Label作为无障碍名称。同一改动还让图表在容器内移动后坐标轴与绘图区仍对齐,并把固定值域里落在可视窗口外的点裁剪掉 (contributed by @Ezreal-byte) (PR #65) -
viva sign可以给在别处构建好的 Windows 程序原地签名,证书或自定义签名命令的选项与viva package相同;没有配置签名选项时保持原样 -
Markdown 组件的行内代码、围栏代码与固定网格绘制改为按片段测量一次,行内代码的内边距不再让点击与光标落在错位的位置 (contributed by @Lan-zk) (PR #60)
-
带说明文字的菜单项改用两行高度:标题保持系统行高,说明隔一行小间距跟随,指示器、图标与尾部内容对准标题行,不再悬浮在两行之间 (contributed by @Lan-zk) (PR #61)
-
修复 macOS 上近乎共线的矢量三角形在平移后产生远端亮斑的问题:Metal 着色器把覆盖度限制在有限范围,细长图形只在自身位置绘制 (contributed by @Lan-zk) (PR #63)
-
修复分数缩放下复选框的对勾偏离中心的问题 (contributed by @Ezreal-byte) (PR #57)
-
修复 Windows 上一次空格按下打出两个空格的问题:不带修饰键的空格交给
WM_CHAR,按下与松开共用同一身份,Ctrl+Space 与 Alt+Space 仍作为组合键 -
官网为每个页面输出 canonical、绝对的 hreflang 与 x-default、Open Graph 与 schema.org 图,构建时生成 sitemap.xml、robots.txt 与 llms.txt;
go get指令不再被 Cloudflare 的邮件混淆改写成github.com/vivaui/[email protected];新增building-with-viva编码助手技能页,并在/skills/building-with-viva/SKILL.md提供与仓库同源的下载 -
新增中文 README,两份 README 使用新的品牌锁定图,并链接 linux.do 社区
-
ui.MonoStackgives a fixed-pitch face an ordered list of fallback families: glyphs the primary font lacks come from the fallbacks, the platform's own choice comes last, and the cell always belongs to the primary; macOS sets the font's cascade list, Windows builds anIDWriteFontFallback, and Linux and the web append the families to the Pango and CSS lists. New alongside it:MonoFallbacks,MonoIsClassic,MaxMonoFaces(up to 4096 faces) andMaxMonoFallbacks(8) -
app.ConfiggainsMinWidthandMinHeight: logical-pixel limits on user resizing, independent of display DPI, zero leaving that axis unrestricted; native adapters cap the limits to the current screen's work area, and an initial size below the minimum is enlarged (contributed by @Ezreal-byte) (PR #54) -
Windows gains
app.EnableCrashDumps: on Windows 11 22H2 and newer it registers a LocalAppData folder with Windows Error Reporting, so a fault that ends the process before the Go runtime runs (a graphics driver crash, a fast-fail) leaves a dump; other platforms returnErrUnsupported.VIVA_ACCESSIBILITY=0leaves a Windows window without a UI Automation tree andVIVA_SOFTWARE_RENDERING=1draws on WARP, so a silent exit can be narrowed to the driver or an automation client -
app.SetFaultHandlerreceives the stack of every panic the backends recover at an OS callback boundary (window procedure, UI Automation, drag and drop, status icon, font enumeration, AppKit callbacks);app.ShowFatalErrorshows a native message box when the program cannot start. Several root causes of silent Windows exits are fixed too: UI Automation being unavailable on arm64 no longer fails window creation; a lost IME context or composition string no longer closes the window; window teardown always releases the window count, even if a step panics; the status icon window is a hidden top-level window, so it receivesTaskbarCreatedafter Explorer restarts; and a minimized window no longer reports (-32000,-32000) as its frame -
SingleSelectis new:PaintSingleSelectandSingleSelectStatecombine one selected value, a native search editor and a filtered popup, with optional item creation, clearing, keyboard navigation and IME-safe confirmation (contributed by @Ezreal-byte) (PR #56) -
Each
AreaChartseries may carryChartSeries.AreaStyle(ChartAreaStyle: color, opacity and aChartAreaGradient); unset keeps the previous fill, andChartAreaDefaultOpacitykeeps the default alpha when only the color changes.TabOptiongainsIconandIconOnly: the icon and label center as one group, andIconOnlystill usesLabelas the accessible name. The same change keeps a chart's axes and plot aligned after the chart moves within its container, and clips points outside the visible window in a fixed domain (contributed by @Ezreal-byte) (PR #65) -
viva signsigns a Windows program built elsewhere in place, with the same certificate and custom-command options asviva package; with no signing options it leaves the program as it is -
The Markdown component measures inline code, fenced code and fixed-grid drawing once per piece, and inline-code padding no longer puts clicks and the caret off by its inset (contributed by @Lan-zk) (PR #60)
-
Menu rows with a description take a two-line height: the title keeps the system line height, the description follows one small gap below it, and the indicator, icon and trailing content anchor to the title line instead of floating between the two (contributed by @Lan-zk) (PR #61)
-
Fixed near-collinear vector triangles producing a remote bright patch after a translation on macOS: the Metal shader clamps coverage to a finite range, so a sliver draws only where it is (contributed by @Lan-zk) (PR #63)
-
Fixed the checkbox check drifting from the center at fractional scales (contributed by @Ezreal-byte) (PR #57)
-
Fixed one space press typing two spaces on Windows: a plain space is left to
WM_CHAR, press and release share one identity, and Ctrl+Space and Alt+Space remain chords -
The website emits a canonical link, absolute hreflang with x-default, Open Graph and a schema.org graph on every page, and writes sitemap.xml, robots.txt and llms.txt at build time; the
go getcommand is no longer rewritten togithub.com/vivaui/[email protected]by Cloudflare's email obfuscation; and abuilding-with-vivacoding-agent skill page now serves the same file from the repository at/skills/building-with-viva/SKILL.md -
A Chinese README is new, both READMEs use the new brand lockup, and both link the linux.do community
注意 · Caveats
0.2.0 是 1.0 之前允许破坏公开 API 的 minor ...
Viva v0.1.3
新功能
viva命令新增doctor:检查 Go 工具链、平台库(macOS 的 Xcode 命令行工具、Linux 的 XCB 与 Vulkan)、打包工具、viva.toml,以及命令与项目所用 Viva 版本是否一致,每个问题附带修复命令;新增viva versionviva build、dev、init在机器上没有 Go 1.26 或更新版本时,会把官方工具链下载一次到用户缓存,并用 go.dev 公布的 SHA-256 校验,只供 viva 自己的命令使用;VIVA_GO_DOWNLOAD=0可关闭,VIVA_GO_MIRROR可换下载源viva init在go.mod里写入tool指令,go tool viva运行的就是项目锁定的版本;viva add在命令与项目版本不一致时给出提示- 新增面积图与柱状图
PaintAreaChart、PaintBarChart,由类型化切片绘制坐标轴、网格、图例、系列、悬停标记与提示,曲线支持线性、自然、单调和阶梯,面积可堆叠或归一化;ChartDownsample用最大三角三桶(LTTB)为长序列降采样,viva add可直接取到 - 新增
ui.PathBuilder,复用命令缓冲,每帧由数据生成路径时不再分配;PathStyle.FillGradient用线性渐变填充路径;earcut对超过 80 个点的环使用 z 序哈希,一万个点的细带三角剖分从 147 ms 降到 6.7 ms - 新增可拖动排序的
ReorderList(ReorderListState、ReorderMove):状态只拥有指针几何,不拥有应用数据,拖动中按 Esc 取消,行保持稳定的 ID,滚动由调用方负责,可用RevealScroll把目标槽位滚入视野 Table新增可排序表头(TableHeader、TableSortState、SortableHeader、FitSortableTableHeadings),排序方向由调用方持有Select的选项支持图标、图片与文字前缀(Icon、IconImage、IconText),图片保持宽高比且不产生分配,图片无效时回退到文字Textarea新增InsetTop,在编辑器上方为调用方自己的控件预留空间,文字与原生光标都在其下方
改进
- 菜单用键盘导航时会把待聚焦的条目先滚入视野,再移动焦点
- 官网新增全站搜索(Cmd/Ctrl+K),重做了首页;性能文档把验收预算与长期目标分开列出
- 发布流程会为每个版本构建
viva命令的预编译压缩包,附带SHA256SUMS,并同步 Homebrew 与 Scoop 清单;压缩包按字节可复现
修复
- 修复 macOS 上遇到亚像素尺寸的标签或被裁剪为空的图片时窗口被关闭的问题:现在丢弃这类绘制,并在亚像素文本边界上停用文字输入
安装
- 从这个版本起,Release 附带预编译的
viva命令(darwin、linux、windows,amd64 与 arm64),并提供 Homebrew 与 Scoop 包:- macOS、Linux:
brew install vivaui/tap/viva - Windows:
scoop bucket add vivaui https://github.com/vivaui/homebrew-tap,再scoop install viva - 也可下载对应压缩包,用
SHA256SUMS校验后把viva放进PATH;压缩包没有做代码签名或公证,浏览器下载的 macOS 版会被 Gatekeeper 拦下,用 brew、curl 或go install则不受影响
- macOS、Linux:
- 没有安装 Go 也可以使用
viva:它会按需下载工具链,并在 macOS 与 Linux 上用viva doctor提示缺少的系统库 - 库本身仍是 Go module 标签:
go get github.com/vivaui/viva@v0.1.3;需要 Go 1.26 或更新,系统依赖与 v0.1.0 相同,升级前看一眼本说明
New
viva doctorchecks the Go toolchain, the platform libraries (Xcode command-line tools on macOS, XCB and Vulkan on Linux), the packaging tools,viva.toml, and whether the command matches the Viva version a project builds against, with the fixing command for each problem;viva versionis newviva build,devandinitdownload the official Go toolchain once into the user cache when Go 1.26 or newer is missing, verified against go.dev's SHA-256 and used only by viva's own commands;VIVA_GO_DOWNLOAD=0turns it off andVIVA_GO_MIRRORchanges the sourceviva initwrites atooldirective togo.mod, sogo tool vivaruns the version the project pins;viva addsays so when the command and the project disagreePaintAreaChartandPaintBarChartdraw axes, grid, legend, series, hover mark and tooltip from typed slices; curves are linear, natural, monotone or step, areas can be stacked or normalized, andChartDownsamplereduces long series with largest-triangle-three-buckets;viva addinstalls themui.PathBuilderreuses its command buffer so a path derived from data every frame allocates nothing;PathStyle.FillGradientfills a path with a linear gradient; earcut uses a z-order hash for rings above 80 points, taking a 10k-point thin band from 147 ms to 6.7 ms- A draggable
ReorderList(ReorderListState,ReorderMove): the state owns pointer geometry, never the application's data; Esc cancels a drag, rows keep stable IDs, scrolling stays with the caller, andRevealScrollbrings a target slot into view Tablegains sortable headers (TableHeader,TableSortState,SortableHeader,FitSortableTableHeadings); the caller owns the sort directionSelectoptions take an icon, image or text prefix (Icon,IconImage,IconText); images keep their aspect ratio without allocating and fall back to text when invalidTextareagainsInsetTop, which reserves room above the editor for the caller's own controls; text and the native caret stay below them
Improved
- Keyboard navigation in a menu reveals the pending item before moving focus to it
- The website has site-wide search (Cmd/Ctrl+K) and a rebuilt landing page; the performance guide separates the acceptance budget from the long-term goal
- Every release now builds prebuilt archives of the
vivacommand withSHA256SUMSand updates the Homebrew and Scoop manifests; the archives are byte-for-byte reproducible
Fixed
- Fixed macOS closing the window on a subpixel-sized label or an image clipped to nothing: such drawing is now dropped, and text input is disabled on subpixel text bounds
Install
- From this version the Release carries prebuilt
vivacommands (darwin, linux, windows on amd64 and arm64) and Homebrew and Scoop packages:- macOS, Linux:
brew install vivaui/tap/viva - Windows:
scoop bucket add vivaui https://github.com/vivaui/homebrew-tap, thenscoop install viva - Or download the archive for your platform, check it against
SHA256SUMS, and putvivaon yourPATH. The archives are not code-signed or notarized: a browser download on macOS is stopped by Gatekeeper, while brew, curl andgo installare not affected
- macOS, Linux:
- You do not need Go installed to use
viva: it fetches a toolchain on demand, andviva doctornames the system libraries still missing on macOS and Linux - The library is still a Go module tag:
go get github.com/vivaui/viva@v0.1.3; it needs Go 1.26 or newer, with the same system requirements as v0.1.0. Read these notes before upgrading
Viva v0.1.2
新功能
- 新增可复用的
ColorPicker,提供 HSV 面板、原生 HEX 输入、可选透明度、方形或圆形触发器以及清空/取消/确定,方向键与捕获拖动按逻辑坐标工作,是否写入业务表单由应用决定 (contributed by @Ezreal-byte) (PR #40) - 新增可搜索、可创建条目的
MultiSelect,已选项显示为可删除标签并在空间不足时折叠成数量,查询框接原生text.Editor并保留输入法与选区行为 (contributed by @Ezreal-byte) (PR #41) - 新增
CodeEditor、ImageView与ColorSwatch组件,viva add可以直接取到,仍以源码复制进项目 - 新增
app.OpenContentWindow,给文档查看器、检查器和可分离工具面板一个由框架托管投递的窗口,后台 goroutine 用有界Post排队 UI 更新,窗口关闭后的更新被丢弃 - 新增
app.Application.OnQuitRequest,让 macOS 菜单与 Dock 的 Quit 先等应用确认未保存内容 MarkdownView支持渲染文本的选区与偏移映射(MarkdownSelection、TextLen、SelectedText、ui.TextPlacement),不使用选区时只多维护一份纯文本- 新增
ui.Canvas.FillLinearGradient,复用现有带顶点颜色的三角形通道绘制渐变,不增加纹理、着色器或依赖 ui.HitOptions、components.InputSnapshot与app.TextInputContext新增NavigationKeys,让下拉筛选框与命令面板接管方向键和翻页键而不必伪造TextBounds(contributed by @onenewcode) (PR #42)components.PopoverOptions新增AnchorDismiss与ConsumeOutsidePress,让按锚点关闭不再重开、暂存式选择器不把外部点击传给外层对话框- 下拉菜单与上下文菜单的条目支持第二行说明
改进
- Windows 合并同一窗口的后台重绘请求,静止页面不再因为多次
Invalidate反复提交
修复
- 修复最大化与还原后
OnMaximize/Maximized报告的几何不同步、X11 自绘边框边距不随状态重算的问题 - 修复 Windows 标题栏窗口丢失原生边框缩放光标、无法从边框拖动缩放的问题
- 修复 macOS 从 Dock 重开隐藏窗口时没有取消最小化、窗口留在 Dock 里的问题
- 修复菜单刚好放得下时误出滚动条、以及分数坐标下溢出计算失真导致菜单提前滚动的问题
- 修复
MultiSelect关闭弹层后键盘焦点丢失、SetValidateCreate改动后仍按旧规则判定创建条目、无头快照丢失原生编辑器文字的问题 MultiSelect只在声明TextBounds时接管原生编辑器,自己绘制查询框的面板不再画两遍
安装
- 这个 tag 是 Go module 标签,不带预编译的二进制:
go get github.com/vivaui/viva@v0.1.2,或go install github.com/vivaui/viva/cmd/viva@v0.1.2;需要 Go 1.26 或更新,系统依赖与 v0.1.0 相同,升级前看一眼本说明
Viva v0.1.1
新功能
- 无头驱动新增
Session.Record与record DIR MS [FPS],按固定采样率推进虚拟时钟,把像素变化的帧写成 PNG 并附 manifest,静止应用只录一帧,帧时长之和精确等于录制区间,编码器不进仓库 text新增SingleLine、WordRange与Editor.MoveWord、DeleteWord、MoveLineBoundary,Windows 文本框的编辑快捷键建在这些原语上
改进
- 绘制声明与上一帧相同时,重绘跳过命中镜像同步(输入路由、语义树、无障碍树、文本输入状态),密集页面不再每帧重复这部分工作
- 淡入淡出的圆角边框复用三角化结果,缓存有界(8 项、4096 个三角形),命中时只重设颜色、图层与裁剪
- bidi 判定直接在 rune 上进行,不再为判定把整行转成字符串,ASCII 字形分类内联,箭头键移动不再分配
- 渲染节点不再各自保存一份几何,扁平矩形成为唯一副本,删除、追加与任意插入都不再分配输出数组
- Windows 打包把证书与密码写进按私有 DACL 创建的临时目录,ZIP 归档按
CFBundleExecutable保留可执行位 (contributed by @Ezreal-byte) (PR #6)
修复
- 修复 Windows 普通文本框不响应剪贴板快捷键、全选、Home/End、按词与按文档移动、按词删除的问题,这些组合键现在先于
OnShortcut生效,终端与 Placed 编辑器保持原有顺序 (contributed by @Ezreal-byte) (PR #1) - 修复 Windows 光标移动、布局或样式更新取消输入法组词、候选窗被关掉、下一次按键覆盖旧 preedit 的问题,只在目标、编辑模式或文本状态真正改变时才取消 (contributed by @Ezreal-byte) (PR #10)
- 修复 Windows 原始终端 Enter、Tab、Backspace、Escape 与 Ctrl 组合键的控制台记录缺字符、ConPTY 读取端丢 Enter 的问题,按下时用当前键盘布局补齐字符,AltGr 字符只记录一次且松开 Ctrl 不改变已记录的字符 (contributed by @Ezreal-byte) (PR #16)
- 修复 Windows 终端带末尾空格的定宽 run 把可见前缀拉伸到空白单元、列距按补白宽度计算的问题,计宽改用
WidthTrailing(contributed by @Ezreal-byte) (PR #15) - 修复 Windows 托盘同时设置
Menu与OnClick时主键与键盘激活被系统菜单拦截、应用回调从不执行的问题,右键与菜单键仍打开系统菜单 (contributed by @Ezreal-byte) (PR #19) - 修复 Windows 最大化按钮按住后松开被系统误判为离开而取消点击的问题,Windows 11 snap layouts 仍可用 (contributed by @lizzzzz777) (PR #11)
- 修复证书只导入 scratch keychain 时
viva package报 "no identity found"、无法签名的问题,构建期间把 keychain 加入codesign搜索列表并在结束后还原 (contributed by @Ezreal-byte) (PR #6) - 修复 macOS 从 Dock 重开隐藏窗口后
app.Window的隐藏状态不同步、close-to-hide 只能用一次的问题 (contributed by @onenewcode) (PR #17) - 修复 D3D11、Vulkan 与 Metal 上矢量图标轮廓外侧半个像素的抗锯齿被裁掉的问题,不同 DPI 下轮廓完整,Metal 库部署目标固定为 macOS 12 (contributed by @Ezreal-byte) (PR #8)
安装
- 这个 tag 仍是 Go module 标签,不带预编译的二进制:
go get github.com/vivaui/viva@v0.1.1,或go install github.com/vivaui/viva/cmd/viva@v0.1.1;需要 Go 1.26 或更新,系统依赖与 v0.1.0 相同
Viva v0.1.0
首个带标签的版本。macOS 是参考平台:窗口、Metal、文本与中文输入法都在真机上验证过。
Windows 与 Linux 后端可用,但只在虚拟机上验证过行为,没有真机 GPU 的数据。
First tagged release. macOS is the reference platform: window, Metal, text and
Chinese input are verified on real hardware. The Windows and Linux backends work,
but they have only been verified in virtual machines; there is no real-GPU data.
拿到它 · Getting it
这个 tag 是 Go module 标签,不带预编译的二进制;各平台的安装包由 viva package
在你自己的机器上生成。
This tag is a Go module tag with no prebuilt binaries; each platform's installer
is built by viva package on your own machine.
go install github.com/vivaui/viva/cmd/viva@v0.1.0
viva init hello && cd hello && viva dev .需要 Go 1.26 或更新。macOS 需要 Xcode 命令行工具(cgo 调用 Cocoa 与 Metal),
Linux 需要 X11 与系统的 XCB、Vulkan、Pango,Windows 需要系统的 Direct3D 11 与
DirectWrite。Viva 在运行时加载系统库,不捆绑其中任何一份。
Requires Go 1.26 or newer. On macOS the Xcode command-line tools (cgo reaches
Cocoa and Metal); on Linux X11 with the system XCB, Vulkan and Pango; on Windows
the system Direct3D 11 and DirectWrite. Viva loads system libraries at runtime and
bundles none of them.
有什么 · What is in it
-
原生窗口与事件循环:Cocoa/Metal、Win32/Direct3D 11、XCB/Vulkan。没有 WebView,
没有捆绑的浏览器引擎或渲染运行时。 -
保留式场景图与声明式布局,事件驱动的渲染:空闲的窗口不绘制、不提交。
-
文本由各平台自己的引擎整形、绘制并放置光标(CoreText、DirectWrite、Pango),
所以自动宽度的控件在不同平台差一个字体宽度;不随字体变化的布局自己声明尺寸。 -
源码分发的组件:
viva add把组件文件复制进你的项目,每个视觉决定都在源码里。 -
无头驱动:不开窗口就能驱动应用、跑测试(macOS 上截图需要
-tags vivahead)。 -
viva build用-trimpath和剥离的链接构建并报告体积;viva package产出
.app/.dmg/.zip、NSIS 安装包和.deb/.tar.gz,归档文件在测试里逐字节复现。
签名与公证是可选项,默认不签:macOS 会拦下载的 bundle,Windows SmartScreen 会警告
安装包,Linux 包不签名。 -
Native windows and event loop: Cocoa/Metal, Win32/Direct3D 11, XCB/Vulkan. No
WebView, no bundled browser engine, no bundled rendering runtime. -
A retained scene with declarative layout and event-driven rendering: an idle
window neither paints nor submits. -
Text is shaped, drawn and given a caret by each platform's own engine
(CoreText, DirectWrite, Pango), so a control sized to its label differs by one
font's width between platforms; a layout that must not move declares its sizes. -
Source-owned components:
viva addcopies component files into your project, and
every visual decision is in that source. -
A headless driver: run an application and its tests without a window (screenshots
on macOS need-tags vivahead). -
viva buildbuilds with-trimpathand a stripped link and reports the size;
viva packagewrites.app/.dmg/.zip, an NSIS installer, and
.deb/.tar.gz, and the archives are reproduced byte for byte in the tests.
Signing and notarization are opt-in and off by default: macOS blocks a downloaded
unsigned bundle, SmartScreen warns about the installer, and Linux packages are
not signed.
证据在哪 · Where the evidence is
每个速度、体积或内存数字都写在
docs/benchmarks
的报告里,连同机器、系统、构建模式和取数方法;没有这些上下文的数字不写。平台行为由
cmd/viva-conformance 在 macOS、Windows 虚拟机与 Linux 测试机上跑过,
docs/conformance.md
同时列出只能人工检查的场景,以及三平台之间已知的行为差异。
Every speed, size or memory number is in a report under
docs/benchmarks with
its machine, OS, build mode and method; numbers without that context are not
published. Platform behaviour runs through cmd/viva-conformance on macOS, on a
Windows virtual machine and on a Linux test machine, and
docs/conformance.md
also lists what is only checked by hand and where the three platforms differ.
未验证 · Not verified
-
Windows:平台测试与 conformance 跑在 Windows 11 虚拟机(WARP,软件 Direct3D 11)
上,不是真机 GPU;启动、RSS、GPU 提交和文本栅格质量没有数据。输入法走 IMM32,
TSF 未实现。 -
Linux:验证在 Debian KDE/X11(lavapipe,软件 Vulkan)上;原生 Wayland(现在走
XWayland)、XIM、平滑滚动、HiDPI 与多显示器摆放未验证。 -
虚拟机里的 Direct3D 11 与软件 Vulkan 只证明行为,不是 GPU 性能的证据。
-
Web 预览是 Canvas2D,WebGPU 后端未开始;文档站需要本地构建(
website/)。 -
Windows: the platform tests and the conformance scenarios run on a Windows 11
virtual machine (WARP, Direct3D 11 in software), not on a real GPU; startup,
RSS, GPU submissions and text raster quality have no data. Input goes through
IMM32; TSF is not implemented. -
Linux: verified on Debian KDE/X11 with lavapipe (Vulkan in software); native
Wayland (XWayland today), XIM, smooth scrolling, HiDPI and multi-monitor
placement are not verified. -
Direct3D 11 in a virtual machine and Vulkan in software are evidence of
behaviour, not of GPU performance. -
The web preview is Canvas2D and the WebGPU backend has not started; the
documentation site is built locally fromwebsite/.
注意 · Caveats
API 仍是 1.0 之前,小版本之间可能变化。
The API is pre-1.0 and can change between minor releases.