[Feature] 整理共享布局的 Part/Key 身份归属以通过 Viva dev 检查
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
Research direction
Start in desktop/internal/settingswindow/window_view.go (the breadcrumb function, where k.Part("sep") is passed to ui.Text) and in desktop/internal/workbench/chrome_view.go (stripe and stripeZone, where ui.Column receives a Key on a Spacer). Run TestGeneralAppearanceAppliesBeforeCloseAndRestore and TestThisWindowOpensTheProjectInAProjectTab with -tags dev to reproduce the identity panics. Done means both tests pass under -tags dev with the dev identity check still enabled, and real controls keep their identity.
Written by the indexing model from the issue text.
Description
Problem to solve / 要解决的问题
当前 Viva dev 属性检查会拒绝没有身份的布局元素接收 Part/Key,宿主仍有既有布局调用不符合这个规则,导致受影响的无头开发测试在首次绘制时 panic,阻断功能验证。
可复核的两个位置:
desktop/internal/settingswindow/window_view.go的breadcrumb(面包屑绘制)将k.Part("sep")交给纯ui.Text,触发Part "sep" was given to a Text, which has no identity。desktop/internal/workbench/chrome_view.go的stripe/stripeZone复用上下文声明纯布局,在现有TestThisWindowOpensTheProjectInAProjectTab首帧触发Key 3 was given to a Spacer, which has no identity;调用栈经过stripeZone的ui.Column。
这些调用在源码基线 d8f55a50cc624ec4f928f7b6f5bbe731f147e351 已存在,文件关联新增控件之前即可触发。它们不是无用函数,需按 Viva 的身份契约整理布局调用,不能关闭开发检查掩盖。
Proposed solution / 建议方案
检查上述上下文的 Part/Key 归属,让身份只传给有身份的容器或控件;纯文本和占位布局使用不携带未消费命名的上下文。按相同模式检索设置和工作台,集中调整同因调用,并复用现有无头场景在 -tags dev 下验证。风险是错误地改变控件身份会丢失焦点、勾选、拖拽或滚动状态,需保留真实控件的稳定身份。
Target platform / 目标平台
Cross-platform / 跨平台
Area / 模块
UI / 界面
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
普通构建的受影响场景可通过,但不能代替 dev 属性检查。不采用关闭检查、扩大豁免或修改 Viva 来容忍宿主未消费身份的做法;本功能改动只修新增控件,既有布局适配独立处理。
Additional context / 补充信息
2026-11-23 在 macOS arm64 的源码构建中复现,使用宿主固定的 Viva v0.6.7-0.20261123062230-3c6c46081fe6。这是共享 Go 界面的适配建议,Windows 是否同样触发尚未原生运行;跨平台是建议修复范围,不代表已在 Windows 复现。
复现命令:
scripts/desktop/desktop-go.sh test -tags dev ./internal/settingswindow -run '^TestGeneralAppearanceAppliesBeforeCloseAndRestore$' -count=1 -timeout=30s
scripts/desktop/desktop-go.sh test -tags dev ./internal/workbench -run '^TestThisWindowOpensTheProjectInAProjectTab$' -count=1 -timeout=30s
已搜索 unusedName、has no identity、stripeZone 和 breadcrumb。已关闭的 #2285 涉及 Segmented.Label、Textarea.Mono、Row.Hover 与退出收尾,不包含本次纯布局 Part/Key 的触发点。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 151
- Avg merge
- 3h 48m
- Merged PRs (30d)
- 571
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
-
review: medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
1lck/Lithe-IDEA#2432 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 1/5 Under an hour Newbie friendliness 82/100
1lck/Lithe-IDEA#2431 ·
Maintainers usually reply within 1 day
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
1lck/Lithe-IDEA#2376 ·
Maintainers usually reply within 1 day
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Difficulty 1/5 Under an hour Newbie friendliness 84/100
1lck/Lithe-IDEA#2365 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 3/5 1-2 days Newbie friendliness 57/100
1lck/Lithe-IDEA#2434 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
rel: fix
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Deltares/fews-web-oc#2400 ·
Maintainers usually reply within 1 day
-
Command bar: Tab-to-search on claude.ai falls back to Google site: search instead of opening a prompt on ClaudePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ardia-browser/ardia#4426 ·
Maintainers usually reply within 1 day
-
Bug report: isValidISODateDashOnly accepts text before or after the date-timePossibly taken @bardrop claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
pnp/cli-microsoft365#7713 ·
Maintainers usually reply within 1 day
-
Diagram: Journey Type: Bug / Error
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
mermaid-js/mermaid-v13#1293 ·
Maintainers usually reply within 1 day