Skip to content

fix(ui): 修复下拉框中隐藏的占位项显示为空白行 [Claude-Opus-5.5] - #41

Merged
Chiloven945 merged 1 commit into
PCL-Community:devfrom
zhuzhi-09:fix/36-combobox-hidden-items
Nov 15, 2026
Merged

Chiloven945 merged 1 commit into
PCL-Community:devfrom
zhuzhi-09:fix/36-combobox-hidden-items

Conversation

@zhuzhi-09

@zhuzhi-09 zhuzhi-09 commented Nov 15, 2026 •

Copy link
Copy Markdown

变更说明 / Summary

部分下拉框在 XAML 中用 IsVisible="False" 的选项占位,使选项序号与枚举值对应,例如“启动器可见性”中已废弃的 1 号选项(LauncherVisibility.ObsoleteCaseDoNotUse)、主页预设中已移除的 EchoCave。

默认的 VirtualizingStackPanel 生成容器时会把 IsVisible 重新设为 true,导致占位项仍然显示,在“启动器可见性”中表现为一行空白。

MyComboBox 在未绑定 ItemsSource 且未指定 ItemsPanel 时改用 StackPanel,使内联声明的隐藏项保持隐藏。绑定 ItemsSource 的下拉框(如字体列表 FontSelector)仍使用虚拟化面板,不受影响。占位项本身保留,选项序号与枚举值的对应关系不变。

关联 Issue / Related Issue

Closes #36

验证方式 / Verification

构建

  • .NET SDK 11.0.100-rc.3.26522.148,dotnet publish PCL.Launcher/PCL.Launcher.csproj -c Debug -r win-x64 --no-self-contained -p:Platform=x64,编译通过

运行测试(Windows 11 x64)

  • 用 UI Automation 展开“设置 → 启动 → 启动器可见性”下拉框并读取列表项:
    • 修复前:6 项,第 2 项名称为空、高 23px 且在屏幕上可见(即空白行)
    • 修复后:5 项,连续排列,每项高 25px
  • “进程优先级”等其它内联下拉框展开正常
  • 对比截图见下方
i36_compare

未覆盖

  • macOS / Linux 未测试
  • 主页预设下拉框(EchoCave 占位项)逻辑相同,但未实际展开验证

AI 使用情况 / Generative Artificial Intelligence Usage

  • 使用情况 / Usage:实质性使用 / Substantial
  • 使用工具及模型 / Tools and models:Claude Code(Claude Opus 5.5)
  • 使用目的 / Purpose:定位原因、编写修复、编译测试、撰写提交信息与 PR 描述
  • 涉及范围 / Scope:PCL.Launcher/UI/Controls/Inputs/MyComboBox.cs
  • 人工审查与验证 / Human review and verification:本人核对了修复前后的截图

提交前检查 / Checklist

  • 我已阅读并遵守 技术规范 和 生成式人工智能使用方针。/ I have read and followed the Technical Guidelines and the Generative Artificial Intelligence Usage Policy.
  • 我能解释本次修改的全部内容,包括关键逻辑、异常处理和已知限制。/ I can explain all changes, including key logic, error handling, and known limitations.
  • 我确认未伪造日志、测试结果、基准数据或其他证据。/ I confirm that no logs, test results, benchmarks, or other evidence have been fabricated.
  • 本次提交不包含与修改无关的文件变更,也未提交临时文件或构建产物。/ The PR contains no unrelated changes, temporary files, or build artifacts.
  • 所有提交均已签名,且提交信息符合提交信息规范。/ All commits are signed and follow the commit message convention.
  • 我确认 PR 描述由本人撰写,未直接提交未经核实的 AI 生成内容。/ I confirm that I wrote this PR description myself and have not submitted unverified AI-generated content.
    此PR由claude编写,本人已阅读并确认。

@Chiloven945 Chiloven945 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除注释

部分下拉框在 XAML 中用 IsVisible="False" 的选项占位,使选项序号与枚举值
对应(如启动器可见性中已废弃的 1 号选项、主页预设中已移除的 EchoCave)。
默认的 VirtualizingStackPanel 生成容器时会把 IsVisible 重新设为 true,
导致这些占位项仍然显示在下拉列表中。

MyComboBox 在未绑定 ItemsSource 且未指定 ItemsPanel 时改用 StackPanel,
使内联声明的隐藏项保持隐藏;绑定 ItemsSource 的下拉框(如字体列表)
仍使用虚拟化面板。

Closes PCL-Community#36
@zhuzhi-09
zhuzhi-09 force-pushed the fix/36-combobox-hidden-items branch from a6cf1dc to 2a95ecc Compare November 15, 2026 19:29
@zhuzhi-09

Copy link
Copy Markdown
Author

改动部分注释已移除

@Chiloven945
Chiloven945 merged commit 8ad6282 into PCL-Community:dev Nov 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C#]: 启动器可见性下拉框展开出现空白

2 participants