Repository navigation
fix(viva): 固定版本升到同步上游后的 fork main 3c6c4608,跟随 TitlebarInsets 与 PopoverWith 的新写法 - #2336
Merged
Merged
Conversation
上游删除 app.TitlebarInsets,改为按窗口、按帧的 c.TitlebarInsets 和 canvas.TitlebarInsets:全屏和系统标题栏的窗口返回 0。7 处调用点跟着改, 并删掉标题栏和项目渐变里手工把 leading 清零的 macOS 全屏分支。 ui.PopoverWith 的 open 参数移到 spec 前面,17 处调用点跟着交换。
xiaoyumuxi
marked this pull request as ready for review
November 23, 2026 07:00
8 of 11 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.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
发布桌面端之前的 Viva 上游同步,按
release-lithe的「Sync Viva before a desktop release」和.agents/notes/implemented/process/2026-11-11-viva-fork-maintenance-and-commit-pin.md的「发版前同步上游」做。背景 / Why
desktop/go.mod的固定版本停在ecc66fc(2026-11-21)。盘点时四项检查有三项有差距:上游vivaui/vivamain 有 64 个提交 fork 没有;forkmain(103c1952)比固定版本领先 54 个提交;固定版本不是 forkmain的头。fork 没有待合入的 PR。改动 / Changes
desktop/go.mod的replace从v0.6.7-0.20261121064427-ecc66fc55042升到v0.6.7-0.20261123062230-3c6c46081fe6,即 forkmain的新头。go.sum同步。app.TitlebarInsets被上游删除75a50706把标题栏内缩改为按窗口、按帧回答:ui.C.TitlebarInsets()和gfx.Canvas.TitlebarInsets()。旧 API 按平台返回常量,全屏和用系统标题栏的窗口也会白留出按钮的位置。7 处调用点改用新 API:settingswindow/window_view.go、logwindow/window.go、workbench/standalone.go、workbench/welcome_view.go(两处)、workbench/chrome_view.go、workbench/project_gradient.go(它拿到的是*gfx.Canvas,用canvas.TitlebarInsets())。chrome_view.go的titleBar和project_gradient.go的paintProjectGradient里都有if a.fullscreen && runtime.GOOS == "darwin" { leading = 0 }:macOS 全屏时手工把前导内缩清零。新 API 自己就在全屏时返回 0,两段连同runtime导入一起删除。ui.PopoverWith换了参数顺序open *bool移到spec PopoverSpec前面。17 处调用点交换参数,没有别的改动。不在本 PR 范围内 / Out of scope
类型专属:fix
复现与根因
git log --oneline main..upstream/main列出 64 个提交,git rev-list --count ecc66fc..lithe/main是 54。期望发版前固定版本是同步过上游的 forkmain头。没有用户可观察的缺陷,是流程要求。检查项
rg TitlebarInsets desktop/与rg PopoverWith desktop/的结果全部改过TitlebarInsets的新语义对三个平台一致TitlebarInsets现在按窗口回答,不要再在应用层按runtime.GOOS和全屏状态二次修正同步报告 / Sync report
基线
Lithe-IDEA/Lithe-vivamain103c19523c6c4608(fork PR #57,merge commit)vivaui/vivamain 到68be843c,64 个提交v0.6.7-0.20261121064427-ecc66fc55042v0.6.7-0.20261123062230-3c6c46081fe6从固定版本看,这次一共带入 113 个非 merge 提交:上游的 64 个,加上
ecc66fc之后进 forkmain的我们自己的提交(markdown 字符引用解码、面板滚轮回归对齐当前 page API)。上游带来的、会影响 Lithe 的变化
app.TitlebarInsets(75a50706),改为ui.C.TitlebarInsets()/gfx.Canvas.TitlebarInsets(),全屏和系统标题栏的窗口返回 0。本 PR 已迁移,并删掉对应的绕过。ui.PopoverWith的open参数移到spec前面。 本 PR 已交换 17 处调用点。base.Hide/base.Show(05804abe)和按窗口或容器宽度响应的base.From(a96c6733),Lithe 暂时没有用上。Config.CaptureMenuKeys(0f959e5c):菜单捕获按键时保留 IME 组字,Lithe 没有设置它,行为不变。我们每一个补丁的结果
fork
main上没有待合入的 PR,所有补丁都已经在main上,这次 merge 全部保留,没有被上游取代、需要 revert 的。a105ef83 fix(markdown): decode inline character references是从上游9707cce3cherry-pick 的,上游以148d6dcb合入;这次 merge 自动合并,没有冲突。每一处冲突
两处,都是上游和我们改到同一段代码,但解决的是不同问题,所以两边保留。
app/painter.gocaptureMenuKeys,我们这侧有 fork 独有的onFocusLostonFocusLost(Lithe 的workbench在用Config.OnFocusLost)。结构体与focusLostHandler、focusLost的改动自动合并base/scroll.goScrollState加手指过界回弹的pull/touching/pullAt,并在wheelArea末尾加「手指滚不动时交给最内层还能滚的区域」的兜底;我们这侧有 fork 独有的barStyle和panel限制(滚轮不穿透 Popover、Dialog、模态 Drawer)panel限制和within判断——否则手指在浮层上滚到底会带动底下的页面,正是 fork #40 要修的问题。ScrollPhaseEnd的提前返回补上manual返回值删掉的绕过代码
workbench/chrome_view.go的titleBarif a.fullscreen && runtime.GOOS == "darwin" { leading = 0 }c.TitlebarInsets()自己在全屏返回 0workbench/project_gradient.go的paintProjectGradientcanvas.TitlebarInsets()还留着的绕过代码
#1821 的第 1–5 项,上游都还没有覆盖,在新固定版本的源码里逐项核对过:
Disabled不生效、只读输入框手画base/box.go的Disabled文档仍然只列 Button、Checkbox、Switch、Tabsbase/list.go注册p.wheelXRoute = (*Page).ListWheelX,base/tree.go没有ListWheelX仍然只要DeltaX != 0就横向滚;DeltaY != 0时only为 false,但仍然movedHandlers仍没有 chord 钩子,只有菜单的runShortcut第 6、7 项早已完成(分别在 #1799 和 #1963)。
范围检查 / Scope checks
功能矩阵 / Feature matrix
N/A:没有用户可观察能力的增减。
TitlebarInsets的新语义让全屏窗口的标题栏内缩从「应用手工清零」变成「框架返回 0」,用户看到的结果不变。已运行./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD,结果通过。插件归属 / Plugin ownership
develop-lithe第三节「插件归属与宿主零依赖」的自查命令,结果为空UI 验证 / UI evidence
没有新界面。标题栏、弹出层的几何由现有无头测试覆盖(
workbench、settingswindow、logwindow的-tags vivahead测试全部通过)。macOS 全屏和 Windows 真机没有手工验收。统一日志系统 / Structured logging
N/A:没有改日志。
界面文案 / i18n
N/A:没有改文案。
逻辑归属 / Logic placement
N/A:跟随上游 API,没有新增业务逻辑。删掉的两段是应用层对框架缺口的修正,正好回到框架。
性能与内存 / Performance and memory
没有改编辑器模块,没有跑编辑器基线。上游带来一批渲染和文本的性能改动(按行增量布局、Vulkan 设备共用、标签图像内存分块),本 PR 不声称测过它们的效果。
设置 / Settings
N/A:没有改设置。
插件契约 / Plugin contract
PINNED_CORE_REVISION:没有改 Core 固定版本发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh,结果通过无用代码与重构 / Dead code and refactoring
runtime、app导入已一并删除验证 / Verification
go build ./...GOOS=windows GOARCH=amd64 go build ./...、GOOS=windows GOARCH=arm64 go build ./...、GOOS=linux GOARCH=amd64 go build ./...go test ./base/ ./app/ ./ui/ ./components/ ./markdown/ ./gfx/go test ./...cmd/viva的 dmg 与签名测试在本机失败(built for macOS 13.0 but [mac] min_system says 12.0),在上游origin/main上直接跑同一个测试也是同样的失败,是本机 Xcode SDK 的部署目标造成的./scripts/desktop/desktop-go.sh vet -tags vivahead ./...GOFLAGS=-tags=vivahead ./scripts/desktop/desktop-go.sh test ./...internal/ai的TestProviderDiscoveryUsesRealCoreParser./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD./scripts/desktop/verify/verify-runtime-bundle-immutability.shTestProviderDiscoveryUsesRealCoreParser的失败与本 PR 无关:ai.Environment()读登录 shell 的环境变量,开发机的 shell 里有ANTHROPIC_*变量,于是多发现一个 claude provider(providers = 1 codex, 1 claude; want one Codex provider)。internal/ai自 #1889 起没有改动,本 PR 也不碰它。未能执行的检查和原因: 没有在 Windows 或 Linux 上本地运行桌面端测试,也没有做 macOS 全屏的手工验收。Viva 的三平台交叉编译通过,其余由 CI 覆盖。
提交前确认 / Final checks
main创建;目标分支为main