Repository navigation
fix(desktop): 同步 Viva 上游 ac665a8f,固定 fork 448b0553 - #2421
Merged
Merged
Conversation
- replace 升到 fork main 448b0553(fork #62 merge 了上游 ac665a8f 的 107 个提交),包含 #61 的 Box.OverflowTooltip,main 恢复编译。 - 跟随上游 d9886845:ModalWith/PopoverWith/TextFieldID 合并进单一函数, 105 处调用点机械迁移。 - 插件设置和来源设置的只读框改用 Box.ReadOnly,删掉手画的 readOnlyField/readOnlyList(#1821 第 2 项)。 - 通知测试适配上游紧凑通知:先悬停展开通知堆再点。 - pluginview: 新版 viva vet 的 kept-context 报告,Info 回调加 ignore, 删掉从未读取的 renderer.c。 Refs #1821
插件设置的只读项改用 Box.ReadOnly,通知改为上游的折叠卡片堆;验证状态保持 pending。
1 task done
xiaoyumuxi
marked this pull request as ready for review
November 25, 2026 22:04
This was referenced Nov 25, 2026
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.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
Viva 上游同步,按
.agents/notes/implemented/process/2026-11-11-viva-fork-maintenance-and-commit-pin.md的「发版前同步上游」做:先把上游 merge 进 forkmain,再升级 Lithe 的固定版本、跟随上游 API、删掉上游已经覆盖的绕过代码。背景 / Why
desktop/go.mod的固定版本停在 fork36cbd3ab(2026-11-25)。上游vivaui/vivamain 有 107 个提交 fork 没有(含v0.6.8)。585e1e119)用了Box.OverflowTooltip,它来自 fork fix(settings): refresh locale when language changes #61,在36cbd3ab之后才进 forkmain,固定版本没跟着升。本 PR 的固定版本包含 fix(settings): refresh locale when language changes #61,main 的编译随之恢复。改动 / Changes
replace从v0.6.8-0.20261125075943-36cbd3ab6859升到v0.6.9-0.20261125212154-448b0553faf8(forkmain新头);require从v0.6.8-0.20261123124712-471ea7ab5f81升到上游ac665a8f对应的v0.6.9-0.20261125164855-ac665a8f86e4。go.sum同步。d9886845)ui.ModalWith→ui.Modal(62 处)、ui.PopoverWith→ui.Popover(17 处)、ui.TextFieldID(c, id, …)→ui.TextField(c, …, ui.WithID(id))(17 处)、原来不带规格的ui.Modal补ui.ModalSpec{}(8 处)、不带规格的ui.Popover补ui.PopoverSpec{}(1 处)。Box.ReadOnly(#1821 第 2 项)ReadOnly:输入框可以获得焦点、可以选中复制,但不接受编辑。删掉settingswindow/plugin_settings_view.go里手画的readOnlyField、readOnlyList和随之无用的strings导入;插件设置页、来源设置页的禁用文本框、列表框改为同一个TextField/TextArea加.ReadOnly(disabled),禁用的选择框显示为只读文本框。245768e2)workbench/notifications_test.go的TestFailureNoticeOpensTheLogsOfTheActionThatFailed原来直接点折叠时的坐标,展开后按钮移走,点空了(toast opened the logs of [], want action-N,每次必现)。测试改为像用户一样先把指针移到通知堆上、等它展开再点。产品代码不变。viva vet的两处报告(pluginview/render.go)kept-context规则把签名里含ui.C的函数字段也当作保留上下文:Info func(c ui.C, text string)是每帧用当次c调用的回调,和 Viva 的PageConfig.View一样,加行尾// viva:ignore kept-context并写明原因;renderer.c字段从没被读过,连同赋值删除。两处都来自270e71287,main 上已有,换到新版viva vet才报出来。CI 不跑viva vet。declarative-plugin-settings、workbench-notifications的 notes 各补一段 2026-11-26 的行为变化和对应测试、截图,验证状态保持pending。不在本 PR 范围内 / Out of scope
类型专属:fix
复现与根因
585e1e119)的logwindow、settingswindow、workbench有 8 处调用Box.OverflowTooltip,在模块缓存里核对过旧固定版本36cbd3ab没有这个方法(新固定版本有),所以 main 编译不过;期望 main 能编译。另外,在 fork 的克隆里git log --oneline main..upstream/main列出 107 个提交,期望发版前固定版本是同步过上游的 forkmain头。main,但desktop/go.mod的固定版本没有升到包含它的 commit。检查项
rg 'ui\.(ModalWith|PopoverWith|TextFieldID|TextAreaID|RadioID|SelectID|ColorPickerID)\(' desktop/结果为空;rg 'readOnlyField|readOnlyList' desktop/结果为空render.go的两处是新版viva vet报出来的,删掉的是无用字段replace」,本次是没执行到位,不新增规则同步报告 / Sync report
基线
Lithe-IDEA/Lithe-vivamain98e5d08b448b0553(fork PR #62,merge commit)vivaui/vivamain 到ac665a8f,107 个提交(含v0.6.8)v0.6.8-0.20261125075943-36cbd3ab6859v0.6.9-0.20261125212154-448b0553faf8从旧固定版本看,这次一共带入 108 个非 merge 提交:上游的 107 个,加上
36cbd3ab之后进 forkmain的我们自己的2a19490f(#61,省略文字悬停显示全文,上游 vivaui/viva#454 仍在评审)。上游带来的、会影响 Lithe 的变化
d9886845):本 PR 已迁移 105 处调用点。245768e2):通知改为折叠卡片堆、悬停展开,新增Toaster.Timeout、Toaster.Limit、ToastConfig、ShowConfig,Toaster.Next不再导出(Lithe 没用)。Lithe 的通知外观随之变化,见下方截图;本 PR 只改了一个测试。Box.ReadOnly:本 PR 用它替换手画的只读框。TreeItem.Loading的加载转圈、主题色Warning、输入框MaxLength/ShowCount、Box.Loading、BeginPose/EndPose,以及一批新的ui/*组件。viva vet的kept-context规则变严:签名里含ui.C或Box的函数类型也算保留上下文(本 PR 处理了render.go的两处)。我们每一个补丁的结果
fork 上已合入
main的补丁这次 merge 全部保留,没有被上游取代、需要 revert 的。待合入的 #60 不在本次 merge 里(见「不在本 PR 范围内」)。每一处冲突
5 个文件。每一处都是上游和 fork 为不同目的改到同一段代码,两边保留,没有丢掉上游的改动。
gfx/presence.goPresence.apply拆成presenceTransform.apply,和新的BeginPose/EndPose共用(19ad31a5、eba61a6c)presenceTransform.apply,presence 和 pose 都覆盖gfx/pose.go(没有文本冲突)BeginPose记录自己的图元从哪里开始hoverHints: len(canvas.hoverHints);不记的话EndPose会把 pose 之前画的悬停提示也一起移走。提示和命中区一样跟着 pose 移动components/tree.go、cmd/viva/templates/tree.go.txt5d0ec187)tree.paintDisclosure画应用设置的箭头(#10)paintDisclosure;模板与组件逐字节一致ui/tree_paint.goitem.Loading有转圈相位(5d0ec187)TreeState.Disclosure(#44)cmd/viva/initfiles/AGENTS.md.txtWarningTooltip删掉的绕过代码
settingswindow/plugin_settings_view.go的readOnlyField、readOnlyList(#1821 第 2 项)Row/Column加边框手画文字,再用HitWith声明成只读文本框给辅助技术TextField/TextArea的.ReadOnly(true)还留着的绕过代码
#1821 剩下各项在新固定版本的源码里逐项核对过:
Disabled不生效Disabled对输入框生效。Lithe 的调用点本来就写的.Disabled(…),不用改。Issue 里要的测试没补base/list.go注册wheelXRoute,base/tree.go仍然没有;workbench/filetree_view.go的wheel保留ListWheelX仍然只要DeltaX != 0就横向滚Handlers仍没有 chord 钩子;Lithe 的splitterKey还负责记住尺寸,保留范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/<id>.json:declarative-plugin-settings和workbench-notifications的 notes 各补一段 2026-11-26 的行为变化(只读框、紧凑通知)和对应的自动化与截图;两端实现状态不变,验证状态保持pending./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(223 项通过)和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD(通过).artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节「插件归属与宿主零依赖」的自查命令,结果为空UI 验证 / UI evidence
workbench、settingswindow、pluginview、logwindow的-tags vivahead测试全部通过;只读框由TestPluginSettingsFormEditsOnlyOnExplicitSaveAndPreservesConflictDraft(原生输入被拒绝)和TestNativeSettingsFormShowsReadOnlyListsInFull覆盖。下面两张截图在 macOS arm64 上用无头测试的视觉输出(LITHE_VISUAL_OUTPUT_DIR)生成,浅色主题、英文ReadOnly的样式。深色主题、中文、macOS 原生窗口和 Windows 真机都没有验收紧凑通知(欢迎页上的「Could not read settings」,折叠状态):
只读的来源设置(来源不可编辑时:
Target是只读文本框,显示继承值;Referenced files是只读的多行框,三项都在):统一日志系统 / Structured logging
N/A:没有改日志。
界面文案 / i18n
N/A:没有新增或修改文案。仍运行了
node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,都通过。逻辑归属 / Logic placement
N/A:跟随上游 API,没有新增业务逻辑。删掉的只读框是应用层对框架缺口的补救,现在由框架提供。
性能与内存 / Performance and memory
没有改编辑器模块,没有跑编辑器基线。上游带来的渲染改动本 PR 不声称测过效果。
设置 / Settings
插件契约 / Plugin contract
PINNED_CORE_REVISION:没有改 Core 固定版本发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh,结果通过无用代码与重构 / Dead code and refactoring
readOnlyField、readOnlyList、strings导入;renderer.c字段(新版viva vet报出的无用字段)验证 / Verification
gofmt、go vet ./...、go 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 ./...cmd/viva、ui/inputnumber、internal/componentdemo、internal/gallery外全部通过;这四个用GOTOOLCHAIN=go1.26.0(上游 CI 的版本)都通过,在未改动的上游ac665a8f上用 go1.27.4 也同样失败(cmd/viva是 dmg 与签名夹具和本机 SDK 不匹配,另三个是 go1.27.4 下ui/inputnumber热绘制多一次分配)go test -tags dev ./base ./ui/... ./gfx ./componentsui/breadcrumb的TestDisabledPlaceTakesNoPress外全部通过;它在未改动的上游上同样失败./scripts/desktop/desktop-go.sh build ./..../scripts/desktop/desktop-go.sh vet -tags vivahead ./...gofmt -l desktop./scripts/desktop/desktop-go.sh --exec go run github.com/vivaui/viva/cmd/viva vet ./...(在模块内运行,走replace)render.go两处后无报告GOFLAGS=-tags=vivahead ./scripts/desktop/desktop-go.sh test ./...GOFLAGS=-tags=vivahead ./scripts/desktop/desktop-go.sh test ./internal/workbench/ ./internal/settingswindow/ ./internal/pluginview/ ./internal/logwindow/workbench337 秒)./.agents/skills/write-stable-tests/scripts/test-stability-macos.sh --package ./internal/workbench -- --filter 'TestFailureNoticeOpensTheLogsOfTheActionThatFailed'GOFLAGS=-tags=vivahead ./scripts/desktop/desktop-go.sh test -race -count=1 -run 'Notice|Toast|Notification' ./internal/workbench/GOFLAGS=-tags=vivahead ./scripts/desktop/desktop-go.sh test -race -count=1 ./internal/settingswindow/ ./internal/pluginview/./.agents/skills/write-stable-tests/scripts/verify-test-stability.shsettle,没有真实时间等待node scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --check./scripts/desktop/verify/verify-runtime-bundle-immutability.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh、./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD./scripts/agent-notes/verify-agent-notes.sh未能执行的检查和原因: 没有在 Windows 或 Linux 上本地运行桌面端测试(Viva 三平台交叉编译通过,其余交给 CI);
workbench只对通知测试跑了竞态检测,没有跑整个包;没有做 macOS 原生窗口和 Windows 真机的通知、只读框验收。图标生成检查没跑:本次没有改 SVG,交给 CI。提交前确认 / Final checks
main(585e1e119)创建;目标分支为main