Repository navigation
docs(plugins): 补回 #104 更新记录;补充画布图片、文字基线、渐变角度与分组坐标的说明 - #105
Merged
Merged
Conversation
- 能力表脚注 ¹ 删掉插件视图和设置区域关键词;ui.md、settings.md 的桌面端状态改为已呈现,并去掉已过时的“不读包内翻译”。 - 契约:画布图片从插件包只读读取,单个文件 256 KiB、最多 1024 × 1024 像素,读不到时不画并记一次日志;image 行补上 opacity。 - 契约:文字 y 是基线、align 放行首/中/尾;渐变 angle 同 CSS(默认 180);分组的 children、w、h、radius 用分组自己的坐标;捏合缩放只在宿主上报时可用。 - view-results fixture 的文字基线移到卡片中间。
xiaoyumuxi
added a commit
to 1lck/Lithe-IDEA
that referenced
this pull request
Nov 18, 2026
#104 已 squash 合入 Core main,固定版本从分支提交 f7b2e48 换成 main 545ca11。main 上 #104 之下还有 #103(设置导航删除 limit 与溢出行), 桌面端从未发送 limit、也不读溢出行,不受影响。f7b2e48 与 545ca11 的 Rust 代码相同,只差文档和 view-results fixture 的文字坐标,桌面测试 不检查该坐标;文档补充在 Lithe-IDEA/Lithe-core-rust#105。
33 of 41 tasks
xiaoyumuxi
marked this pull request as ready for review
November 19, 2026 02:47
xiaoyumuxi
added a commit
to 1lck/Lithe-IDEA
that referenced
this pull request
Nov 19, 2026
* feat(desktop): 用 Viva 原生绘制插件视图:宿主控件、树、画布与设置区域(#2181) 插件后端的视图函数返回 UI 树和画布场景 JSON,桌面端用 Viva 原生绘制, 不嵌网页。工具窗口里的插件视图和设置页里的 settingRegions 共用同一个渲染器。 - 新增 internal/pluginview:节点、宿主控件、树、画布(矩形、路径、文字、 图片、分组、渐变、缩放平移)、颜色令牌、宿主图标、包内 PNG 加载和视图会话。 - 新增 internal/core/plugin_view.go 与 pluginservice/hostview.go,接 Core 的视图函数与事件;删除旧的 plugin_native 路径。 - 设置窗口呈现插件设置区域(关键词进入搜索),工具窗口呈现插件视图; 视图失败走 app.notification.operation_failed 并写日志。 - 修复会话竞态、工具窗口图标、viewSettings 日志、嵌套树高度和 visual_capture_test 旧签名。 - Viva 尚不支持的画布能力(自定义虚线、路径多色标渐变、整层透明度、 圆角裁剪、捏合缩放)按契约降级,在 #2182 跟进。 - PINNED_CORE_REVISION 固定到 Core #104 的 f7b2e48;Agent Note 移到 implemented,旧的声明式原生 UI Note 归档,更新功能矩阵、API 计划和 i18n。 * test(desktop): 插件设置区域视觉测试改用固定偏好目录,补插件视图截图 * build(desktop): Core 固定版本换成 main 545ca11(#104 已合入) #104 已 squash 合入 Core main,固定版本从分支提交 f7b2e48 换成 main 545ca11。main 上 #104 之下还有 #103(设置导航删除 limit 与溢出行), 桌面端从未发送 limit、也不读溢出行,不受影响。f7b2e48 与 545ca11 的 Rust 代码相同,只差文档和 view-results fixture 的文字坐标,桌面测试 不检查该坐标;文档补充在 Lithe-IDEA/Lithe-core-rust#105。
This was referenced Nov 19, 2026
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 19, 2026
会报告宽度的宿主在每个视图事件里带 width(排版视图节点用的宽度,也是顶层画布的宽度),量到宽度之后才发 open;画布的 on 可以写 resize,宽度停止变化 400 ms 后宿主发 resize 和新的 width。契约 README 同时写明缩放为 1 时怎样放 viewBox:不写 pan 时显示整个 viewBox、从左上角开始,写了 pan 时宽度占满视图。 Core 画布校验接受 on: ["viewport", "resize"],schema 同步;Rust、Java、Node 三个 SDK 支持 width 和 resize 并补 README;settings.md 中英说明区域画布按 width 排版和旧宿主下的固定宽度;更新记录登记本次补充,并把 #105 的条目移到时间线。取代 #107。
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
类型
docs:契约 README 的说明补充、一处 fixture 坐标修正,以及更新记录。不新增版本号、宿主方法、通知或 SDK 版本,行为不变。
改动
更新记录(
shared/plugins/reference/protocol-changelog.md)schemaVersion”那一行的“见待合入”改为链接 feat(plugins): 插件视图(界面树与画布节点)取代原生 UI 文档,新增设置区域与三个 SDK 的 view() #104。契约 README(
shared/plugins/contract/v1/README.md)桌面端实现插件视图时,发现有几处契约没有写清楚,宿主只能自己猜。这次补上:
opacity。y;align把行首(默认)、中点或行尾放在x。linear-gradient一致,按顺时针从向上算起,0 向上、90 向右,默认 180 向下。渐变线穿过形状中心(路径用bounds,没有时用点的包围盒),长度刚好让角度指向的两个角分别落在第一个和最后一个色标上。x、y放置原点,scale缩放内部;children、w、h、radius都在分组自己的坐标里。fixture
fixtures/ui/view-results.json:按上面的基线语义,把文字 “core” 的y移到卡片中间(25),不再贴着卡片顶边。参考文档
reference/capabilities-and-versions.md:中英两处都删掉脚注 ¹ 里“插件视图尚未在桌面端绘制”那一条。reference/domains/ui.md:中英两处的桌面端一行改为呈现文本、网页和插件视图工具窗口,插件视图用 Viva 原生绘制宿主控件、树和画布。reference/domains/settings.md:中英两处的桌面端一行改为已呈现设置区域settingRegions(搜索关键词和插件视图),并按界面语言显示包内翻译l10n/。验证
node shared/plugins/scripts/verify-docs.mjscargo test -p lithe-plugin-ui(fixture 改动之后)cargo test -p lithe-core plugin_view合入顺序
可以独立合入。桌面端 PR 1lck/Lithe-IDEA#2183 固定在 #104 的合入提交
545ca11,不依赖本 PR:桌面测试只读取view-results.json,不检查文字坐标。