Repository navigation
fix(plugin-ui): 修正网页浮层、后端错误传递与工具窗口图标 - #2383
Merged
Merged
Conversation
xiaoyumuxi
marked this pull request as ready for review
November 24, 2026 08:42
6 tasks done
12 tasks done
This was referenced Nov 24, 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
背景 / Why
插件网页打开时,正文层的原生 WebView 可能遮住悬停、补全和导航弹层;后端函数错误经过网页桥接后丢失业务错误码,页面只能收到笼统的 invalidRequest。工具窗口同时忽略了合法的包内图标声明,始终显示通用图标。
改动 / Changes
LayerPaneChrome,复用框架原生视图遮罩、命中路由和已有菜单/对话框层级。FunctionError提供结构化转换,网页桥接通过errors.As保留code、message、pluginErrorCode;嵌入该错误的事件失败也可转换,不解释插件业务码。path、darkPath、mode,插件重载时在后台复用pluginicons读取 SVG,绘制时按当前主题取缓存。plugin_icon降级记录与通用图标,未扩展当前绘制器不支持的 PNG。不在本 PR 范围内 / Out of scope
#2371 的公共 API 已由 #2372 和 Core #194 实现,本 PR 只修正上述通用适配器行为,不新增宿主方法、权限或协议版本。具体插件业务在独立仓库维护,宿主无具体插件依赖。真实原生 WebView 遮挡、指针和焦点效果交由用户验收;PNG 和其他既有未实现能力不在本次扩展范围内。
类型专属:fix
复现与根因
pluginErrorCode的函数失败,网页收到的却是plugin.web.invalidRequest;声明包内 SVG 的窗口仍显示通用图标。预期分别为弹层覆盖正文、错误字段完整、使用声明图标。0faecba49(Epic(0.7.0): 基于 Viva 框架的跨平台方案的迁移(#1794) #1799)迁移时仅按声明顺序绘制浮层,层级仍为 0;网页回复只识别pluginweb.Failure;工具窗口只解码icon.host。已通过 blame/log 定位。检查项
pluginsemantics_hover_test.go的失败为 hover layer 0 不高于 editor layer 0;page_test.go的失败为业务错误码丢失。.agents/notes/implemented/bug-fix/2026-11-24-web-content-overlays-and-function-failures.md记录约束与取舍。范围检查 / Scope checks
功能矩阵 / Feature matrix
.artifacts/生成视图。插件归属 / Plugin ownership
UI 验证 / UI evidence
TestVisualPointerHover已生成浅/深色、中文/英文的悬停与导航共 8 张无头截图;1000×640,图标接线不在这次历史截图范围内。统一日志系统 / Structured logging
backgroundFailedIn(..., "plugin_icon", ...)的目录记录与已有缓存去重。界面文案 / i18n
N/A:未新增宿主用户文案;错误消息保留 Core/插件已有返回内容,不新增共享词条。
逻辑归属 / Logic placement
性能与内存 / Performance and memory
设置 / Settings
N/A:未新增或修改设置。
插件契约 / Plugin contract
N/A:保留既有错误字段并接线既有 UI 图标声明,不新增或修改宿主方法/通知,不改契约、权限、API 等级、SDK 或 Core 固定修订。无需新增 API 表项。
发行包与资源 / Bundle and resources
无用代码与重构 / Dead code and refactoring
验证 / Verification
以下均为用户要求停止验证之前的历史结果;最后图标接线及提交收尾没有重新运行检查。
scripts/desktop/desktop-go.sh test -race -json -count=1 -p=1 -parallel=1 -timeout=45s ./internal/pluginwebscripts/desktop/desktop-go.sh test -race -json -count=1 -p=1 -parallel=1 -timeout=180s ./internal/workbench -run 'TestPointerHover|TestSemantic|TestPluginToolWindows|TestDiagnostic|TestSignatureHelp|TestInlayHint'scripts/desktop/desktop-go.sh test -json -tags vivahead,lithevisual -count=1 -p=1 -parallel=1 -timeout=180s ./internal/workbench -run '^TestVisualPointerHover$'未能执行的检查和原因: 用户明确要求“你不用进行验证,直接写代码即可,实际验证我自己来”。因此本 PR 保持 Draft,不执行最终测试、静态/文档/矩阵/i18n/只读门禁、不构建打包、不启动应用;Windows 本轮不验收。已有用户应用未操作。本 PR 不能视为最终验证已通过。
提交前确认 / Final checks
origin/main,目标为main。.artifacts/、dist、凭据和无关未跟踪目录。