Enhance controller UI tests and improve gamepad feedback features#16
Merged
Conversation
新增控制器設定子選單與校準視覺化對話框的 UI smoke test。 同步放寬選單標籤比對規則,支援附帶狀態文字的顯示。 更新測試 README 與案例總數。
- 新增 Back+A 復原、Back+Y 全選與 R3 重讀輸入內容 - 調整控制器震動曲線、識別脈衝與相關回歸測試 - 修正說明文案多語系同步與 RS 選取捲動視覺異常
- 放寬 TypingPulse 的插入判定,改善部分輸入法詞語確認情境。 - 在片語插入前抑制下一次回饋,避免短片語誤觸震動。 - 更新 README 與註解,明確說明觸控式鍵盤搭配微軟注音等 IME 的限制。
改以內容感知尺寸與工作區上限控制自訂對話框高度。 - NumericInputDialog 改為依內容偏好高度計算 - HelpDialog 保留 OSK 感知上限,避免手持裝置遮擋 - 維持小螢幕可視範圍與桌面可讀性平衡
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands InputBox’s controller-driven UX by adding new stick-click events and controller shortcuts (Undo / Select All / accessibility re-read), refining haptic feedback (new TypingPulse + retuned vibration profiles + improved intensity scaling), improving small-screen dialog sizing, and updating UI automation/tests and localized strings to match the new behaviors.
Changes:
- Added L3/R3 click events across gamepad backends and wired them into the main form (incl. R3 accessibility re-read, Back+Confirm Undo, Back+Menu Select All).
- Introduced a new TypingPulse vibration profile, retuned vibration patterns, and updated intensity scaling to a gamma-corrected curve.
- Updated Help/Numeric dialog sizing logic, localization resources, and expanded controller-related UI smoke tests.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/InputBox.Tests/VibrationPatternsTests.cs | Updated vibration expectations and intensity-scaling assertions; extended stubs for new stick-click events. |
| tests/InputBox.Tests/README.md | Updated test inventory counts/descriptions to reflect new UI smoke coverage. |
| tests/InputBox.Tests/PhraseManagerDialogGamepadTests.cs | Updated IGamepadController test stub to include new stick-click events. |
| tests/InputBox.Tests/MainFormUiSmokeTests.cs | Added smoke tests for Settings > Gamepad menu and calibration visualizer; improved menu-label matching. |
| tests/InputBox.Tests/GamepadMessageBoxTests.cs | Updated IGamepadController test stub to include new stick-click events. |
| tests/InputBox.Tests/GamepadEventBinderTests.cs | Extended binding map and stub to cover stick-click events. |
| src/InputBox/Resources/Strings.resx | Added new A11y strings and help rows for Undo/Select All shortcuts (English). |
| src/InputBox/Resources/Strings.zh-Hant.resx | Added new A11y strings and help rows (Traditional Chinese). |
| src/InputBox/Resources/Strings.zh-Hans.resx | Added new A11y strings and help rows (Simplified Chinese). |
| src/InputBox/Resources/Strings.ko.resx | Added new A11y strings and help rows (Korean). |
| src/InputBox/Resources/Strings.ja.resx | Added new A11y strings and help rows (Japanese). |
| src/InputBox/Resources/Strings.fr.resx | Added new A11y strings and help rows (French). |
| src/InputBox/Resources/Strings.de.resx | Added new A11y strings and help rows (German). |
| src/InputBox/Resources/Strings.Designer.cs | Regenerated strongly-typed resource accessors for the new strings. |
| src/InputBox/MainForm.Gamepad.cs | Implemented Undo stack + controller shortcuts; added TypingPulse trigger logic; added caret scrolling during selection expansion. |
| src/InputBox/MainForm.Events.cs | Ensured hotkey-capture visuals are restored correctly when TBInput regains focus; pushed Undo snapshots before programmatic clears/sets. |
| src/InputBox/MainForm.ContextMenu.cs | Passed vibration-feedback suppression into phrase insertion; pushed Undo snapshot before certain programmatic clears. |
| src/InputBox/Core/Services/PhraseInsertionHandler.cs | Added optional delegate to suppress next text-length feedback before phrase insert (to avoid TypingPulse). |
| src/InputBox/Core/Services/FeedbackService.cs | Treated controller identification vibrations as Critical priority. |
| src/InputBox/Core/Input/IGamepadController.cs | Added LSClickPressed / RSClickPressed events to the controller interface. |
| src/InputBox/Core/Input/XInputGamepadController.cs | Implemented detection/clearing for L3/R3 click events. |
| src/InputBox/Core/Input/GameInputGamepadController.cs | Implemented detection/clearing for L3/R3 click events. |
| src/InputBox/Core/Input/GamepadEventBinder.cs | Extended binding map and event hookups for stick-click events. |
| src/InputBox/Core/Input/GamepadFaceButtonProfile.cs | Updated help-row replacement logic to cover new Back+Confirm / Back+Menu shortcuts. |
| src/InputBox/Core/Feedback/VibrationProfile.cs | Implemented gamma-corrected intensity scaling in ApplyIntensityMultiplier. |
| src/InputBox/Core/Feedback/VibrationPatterns.cs | Retuned vibration profiles and introduced TypingPulse. |
| src/InputBox/Core/Controls/NumericInputDialog.cs | Refined min-size sizing logic to clamp to work-area fit. |
| src/InputBox/Core/Controls/HelpDialog.cs | Refined min-size sizing logic with an OSK-aware max-height cap. |
| README.md | Documented new controller shortcuts and typing haptic behavior. |
Files not reviewed (1)
- src/InputBox/Resources/Strings.Designer.cs: Language not supported
修正復原流程中的回饋行為與測試命名一致性。 - 在程式復原與原生 Undo 前先抑制下一次文字上限回饋 - 對齊震動樣式測試名稱與註解描述 - 整理 PR review 後的暫存修補提交
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.
This pull request introduces several new controller input features, improves accessibility, and significantly refines the haptic feedback (vibration) experience. The main changes include new controller shortcuts for undo, select all, and accessibility actions, the addition of a dedicated typing pulse vibration, and a comprehensive retuning of all vibration profiles for a more nuanced tactile experience. The vibration intensity scaling logic has also been improved for better sensitivity at lower settings.
Controller Input Enhancements:
README.md.LSClickPressed,RSClickPressed) inGameInputGamepadController, with corresponding event detection and event clearing logic. Updated the binding map inGamepadEventBinderto support these events. [1] [2] [3] [4] [5]Haptic Feedback Improvements:
TypingPulsefor gentle tactile feedback on single character inserts (typing), with logic to avoid triggering on paste or near the character limit.VibrationPatterns.csfor improved strength, duration, and feel—providing clearer, more expressive feedback across all actions.VibrationProfile.ApplyIntensityMultiplierto use a gamma correction curve (gamma=0.55), making low intensity settings more perceptible and avoiding the problem of weak vibrations being physically imperceptible.Documentation:
These changes collectively provide a more responsive, accessible, and user-friendly input experience, especially for users relying on tactile and accessibility features.
This pull request introduces several feature enhancements and improvements to the user experience, especially for dialog sizing and haptic feedback. It adds new controller shortcuts, refines dialog size calculations to better handle various screen and OSK scenarios, and significantly updates the vibration feedback profiles for a more nuanced and responsive tactile experience.
Feature Additions and User Experience Improvements:
README.mddocumentation. [1] [2]Dialog Sizing Enhancements:
HelpDialog.csandNumericInputDialog.csto use more adaptive calculations. Dialogs now consider both a percentage of the work area and absolute boundaries, improving usability on devices with on-screen keyboards and varying screen sizes. [1] [2]Haptic Feedback and Vibration Profile Updates:
VibrationPatterns.csfor all key actions, increasing the strength, duration, and nuance of feedback for cursor movement, page switching, selection, boundary collisions, privacy mode, and more. Introduced a newTypingPulseprofile for character insertion.VibrationProfile.csto use a power curve (gamma correction), ensuring haptic feedback remains perceptible even at low global intensity settings.This pull request introduces several improvements and refinements to the input dialog system, focusing on better usability for small screens, enhanced vibration feedback, and updated documentation for new features. The most significant changes are grouped below:
1. Dialog Size Calculation and Responsiveness
HelpDialog.csandNumericInputDialog.csto better handle small screens and on-screen keyboard (OSK) scenarios. Dialogs now use a more adaptive height cap (up to 65% of the work area or available height, whichever is smaller) and improved minimum/maximum size clamping, ensuring dialogs are always visible and usable on devices like handhelds. (src/InputBox/Core/Controls/HelpDialog.cs[1]src/InputBox/Core/Controls/NumericInputDialog.cs[2]2. Vibration Feedback Enhancements
VibrationPatterns.csfor cursor movement, paging, selection, text limits, system actions, and more, providing clearer, more distinct, and context-appropriate tactile feedback. Many strengths, durations, and envelope parameters were updated for a richer and more nuanced experience. (src/InputBox/Core/Feedback/VibrationPatterns.cssrc/InputBox/Core/Feedback/VibrationPatterns.csL112-R479)TypingPulsevibration profile for subtle tactile feedback on character insertion, enhancing the typing experience without interfering with batch operations or IME input. (src/InputBox/Core/Feedback/VibrationPatterns.cssrc/InputBox/Core/Feedback/VibrationPatterns.csL112-R479)ApplyIntensityMultipliermethod inVibrationProfile.csto use a gamma-corrected curve (gamma = 0.55) for scaling vibration intensity, ensuring low settings remain perceptible and preventing motor dead zones at low values. (src/InputBox/Core/Feedback/VibrationProfile.cssrc/InputBox/Core/Feedback/VibrationProfile.csL24-R40)3. Documentation Updates
README.mdto document new controller shortcuts for undo, select-all, and accessibility features, as well as the new typing tactile feedback. (README.mdREADME.mdR145-R148)These changes collectively improve the usability, accessibility, and tactile experience of the input dialog system, especially on compact devices and for users relying on controller input.