Repository navigation
fix(ui): 修正數值輸入截字與控制項生命週期 - #96
Merged
Merged
Conversation
依原生偏好高度與數值範圍配置編輯區,修正 Latest 大字型與多 DPI 截字,並在重新啟用視窗後同步焦點提示。 統一對話框關閉與直接 Dispose 的事件清理,阻止處置後重新綁定控制器及取消註冊。 新增版面、事件解除與資源回收回歸測試,強化 Blink 截圖的前景驗證與游標相位隔離,並同步無障礙規範。 驗證:Release MSBuild 零警告、零錯誤;格式與分析器資訊層級檢查通過。 非 UI 459 項、淺色 UI 91 項、深色與高對比各 80 項通過;三主題 100%、125%、150% 截圖驗證完成。
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A UI theory lacks the required opt-in guard, while MainForm disposal bypasses closing cleanup, risking unintended UI execution, retained static subscriptions, and an unstopped AnnouncementService.
2 open issues
What changed in this PR
此 PR 改善 InputBox 數值對話框在大字型與多 DPI 下的顯示,並補強對話框及回饋按鈕的資源清理,保留既有 Latest 原生外觀。
Changes:
- 依原生偏好高度與數值範圍調整編輯區尺寸,重新啟用後同步焦點配色及預設動作提示。
- 統一關閉與直接處置的清理流程,阻止已處置控制項重新綁定外部資源。
- 新增尺寸、焦點及生命週期回歸測試,強化 Blink 截圖驗證並同步文件。
本次僅核對程式碼與測試設計,未執行建置或測試。
| File | Description |
|---|---|
tests/InputBox.Tests/README.md |
更新測試涵蓋範圍與總數。 |
tests/InputBox.Tests/NumericInputLayoutTests.cs |
新增大字型尺寸、尺寸穩定性與焦點還原測試。 |
tests/InputBox.Tests/GamepadMessageBoxTests.cs |
新增直接處置後解除事件及拒絕重新綁定測試。 |
tests/InputBox.Tests/FeedbackButtonLifetimeTests.cs |
驗證長存活權杖不會保留已處置按鈕。 |
tests/InputBox.Tests/BlinkFrameRenderingTests.cs |
加入前景驗證、游標相位隔離與截圖保存。 |
src/InputBox/Core/Controls/NumericInputDialog.Layout.cs |
重新啟用後同步焦點外觀並重繪確認按鈕。 |
src/InputBox/Core/Controls/NumericInputDialog.Gamepad.cs |
阻止處置後重新綁定控制器。 |
src/InputBox/Core/Controls/NumericInputDialog.cs |
清除控制器參考,更新尺寸處理註解。 |
src/InputBox/Core/Controls/NumericInputDialog.AccessibleNumericUpDown.cs |
依字型、DPI、樣式與數值範圍同步尺寸。 |
src/InputBox/Core/Controls/GamepadMessageBox.cs |
共用關閉與處置清理,解除外部訂閱。 |
src/InputBox/Core/Controls/FeedbackButton.cs |
為回饋設定與互動入口加入處置狀態檢查。 |
docs/engineering/a11y-safety.md |
補充數值框尺寸、焦點還原及生命週期規範。 |
Review effort: Balanced
數值字型 Theory 沿用既有 UI opt-in 條件,避免一般測試建立原生視窗。 移除兩處不必要的 MainForm,直接使用數值對話框既有字型快取,避免未經關閉流程留下全域訂閱與公告服務。 驗證:Release 建置零警告、零錯誤;格式與分析器資訊層級檢查通過;未 opt-in 的四項 UI 案例均正確略過。
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.

數值輸入 Dialog 在 Latest、大字型與多 DPI 下未同步編輯區高度,導致文字截斷。本次依原生 PreferredHeight 與可輸入數值範圍配置大小,保留 Latest 外觀,並在視窗重新啟用後同步焦點與預設動作提示。
同時統一正常關閉與直接 Dispose 的資源清理,解除控制器及系統事件訂閱,阻止已處置控制項重新綁定控制器或取消註冊。新增尺寸、焦點、事件解除及 GC 回歸測試,並強化 Blink 截圖的前景視窗驗證與游標相位隔離。
驗證結果:
本輪以既有 GPG 金鑰簽章,dev 基於最新 main,未新增 merge commit。未變更核心輸入、輸出、剪貼簿或控制器映射行為。