[Feature] 清理插件视图渲染器中从未读取的 ui.C 字段
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 84/100
Research direction
Open desktop/internal/pluginview/render.go, find the renderer struct with the c ui.C field and the constructor that assigns it in Draw. Confirm no reads of r.c exist inside the desktop/internal/pluginview/ package, then delete the field and its assignment, leaving the per-frame c parameter passing untouched. Done looks like the package builds and its targeted tests plus Viva vet report no kept-context diagnostic for that field; leave the Host.Info func(c ui.C, text string) callback alone.
Written by the indexing model from the issue text.
Description
Problem to solve / 要解决的问题
desktop/internal/pluginview/render.go 的 renderer.c ui.C 字段在 Draw 构造 renderer 时赋值,但没有读取方。绘制函数已经逐层传递当前帧的 c 参数。它让 Viva vet 产生 kept-context 诊断,也让维护者误以为渲染器需要保存当前绘制上下文。
判定依据:在基线 c086a0b1b2cb1ce231ee34e94f023a7078f5ab05 与当前工作区检查 renderer 的定义、构造以及整个 desktop/internal/pluginview/ 包的接收者方法,只有字段声明和构造赋值。全仓库检索 r.c 与 renderer{ 没有此字段的读取,也没有通过反射或字符串访问该字段的路径;字段和类型都未导出。
这是已有的无用字段,不是跨帧保存上下文已经造成运行崩溃的证据。每帧都会新建 renderer。
Proposed solution / 建议方案
移除 renderer.c 及构造中的赋值,保留现有按参数传递 ui.C 的方式。运行插件视图包的定向测试及 Viva vet,确认这一条诊断消失。
风险较低,但不要把同一文件的 Host.Info func(c ui.C, text string) 回调类型也当成保存了当前帧的上下文;它不持有某个 ui.C 实例,应单独识别扫描误报。
Target platform / 目标平台
Cross-platform / 跨平台
Area / 模块
UI / 界面
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
保留字段并忽略 vet 警告,会继续保留无用引用和误导。给 renderer 添加跨帧上下文语义没有需求,且违反 ui.C 的帧生命周期约束。不在这次 Key/Part 兼容修复中混入已有字段清理。
Additional context / 补充信息
在审计 #2285 后的 Viva API 迁移时发现。此为源码清理建议,目标是 macOS/Windows 共用的 Go Viva 渲染器;不依赖真实插件、系统配置或用户项目,不需要采集操作系统、硬件和个人日志,也没有声明目标平台的原生运行验收已完成。
当前 Viva 固定版本为 github.com/Lithe-IDEA/viva v0.6.8-0.20261123134538-bb85256c8ffa。本建议只涉及宿主内部渲染器,不改变插件契约。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 151
- Avg merge
- 4h 4m
- Merged PRs (30d)
- 558
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 1lck/Lithe-IDEA
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
1lck/Lithe-IDEA#2376 ·
Maintainers usually reply within 1 day
-
bug issue-form:bug review: no-score
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
1lck/Lithe-IDEA#2373 · 1 comment ·
Maintainers usually reply within 1 day
-
review: high
Difficulty 4/5 3-5 days Newbie friendliness 28/100
1lck/Lithe-IDEA#2381 ·
Maintainers usually reply within 1 day
-
review: high
Difficulty 3/5 1-2 days Newbie friendliness 35/100
1lck/Lithe-IDEA#2380 ·
Maintainers usually reply within 1 day
-
review: high
Difficulty 3/5 1-2 days Newbie friendliness 50/100
1lck/Lithe-IDEA#2379 ·
Maintainers usually reply within 1 day
Similar issues
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
drydocs/meridian#1503 · 1 comment ·
Maintainers usually reply within 2 days
-
bug extension mcp
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primer/primitives#1426 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
danielmiessler/LifeOS#2941 ·
Maintainers usually reply within 4 days
-
Sign-in-only setup dialog describes API-key verificationPossibly taken @roboclaw-bot claimed this today. Openclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 1/5 Under an hour Newbie friendliness 78/100
openclaw/openclaw#204323 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day