[Feature] 整理共享布局的 Part/Key 身份归属以通过 Viva dev 检查
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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,确认没有重复建议。
- Ngôn ngữ chính
- TypeScript
- Star
- 1.8k
- Fork
- 151
- Merge trung bình
- 3 giờ 48 phút
- Pull request đã merge (30 ngày)
- 571
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của 1lck/Lithe-IDEA
-
review: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
1lck/Lithe-IDEA#2432 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
review: medium
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
1lck/Lithe-IDEA#2431 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor review: high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
1lck/Lithe-IDEA#2376 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
1lck/Lithe-IDEA#2365 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
review: medium
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
1lck/Lithe-IDEA#2434 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của 1lck/Lithe-IDEA
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
posit-dev/positron-sas-extension#196 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug composer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
inmanta/web-console#8037 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: AlFajer Palestine FHDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: v5 dist/types/components.d.ts imports @stencil/core/runtime instead of ./stencil-public-runtimeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày