[#20] Added Space and navigation key hints to checkbox widgets.#23
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds themed left/right arrow helpers and renders a key-binding hint beneath multi-select options, with Unicode and ASCII fallback coverage. ChangesMulti-select hint rendering
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MultiSelectWidget
participant ThemeInterface
participant DefaultTheme
MultiSelectWidget->>ThemeInterface: request key-binding glyphs
ThemeInterface->>DefaultTheme: resolve arrowLeft() and arrowRight()
DefaultTheme-->>MultiSelectWidget: return Unicode or ASCII glyphs
MultiSelectWidget-->>MultiSelectWidget: append themed hint footer to view
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.2.2)Composer install failed: the lock file is not up to date with the latest changes in composer.json. Run Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
=======================================
Coverage 98.87% 98.88%
=======================================
Files 56 56
Lines 1337 1349 +12
=======================================
+ Hits 1322 1334 +12
Misses 15 15 ☔ View full report in Codecov by Harness. |
Closes #20
Summary
Checkbox-style widgets gave no on-screen indication that Space toggles the highlighted option, so that binding was only discoverable through documentation or trial and error.
MultiSelectWidgetnow renders its own themed key-hint line beneath the option list and reportsrendersHint(): TRUEso the editor chrome no longer draws its generic footer hint on top of it.MultiSearchWidgetinherits the same behavior since it extendsMultiSelectWidget. Rendering the left/right glyphs used by the new hint required extending the theme contract witharrowLeft()/arrowRight().Changes
MultiSelectWidget::hint(), appended to the option list inview(), renderingspace select · ↑/↓ move · ←/→ none/all · ↵ accept · esc cancelthrough the theme'sfooter()/dot()helpers.MultiSelectWidget::rendersHint()to returnTRUEsoDefaultTheme::renderEditor()skips its generic hint footer for this widget (and forMultiSearchWidget, which extends it).arrowLeft()/arrowRight()toThemeInterface, mirroring the existingarrowUp()/arrowDown()contract.arrowLeft()/arrowRight()inDefaultTheme, returning←/→in Unicode mode and</>in ASCII mode.MultiSelectWidgetTest,MultiSearchWidgetTest, andThemeRenderTestcovering the new hint line, its ASCII degradation, and therendersHint()override.Before / After
Before - generic footer only, Space's role is invisible:
After - self-rendered hint, Space leads since it is the non-obvious action:
Summary by CodeRabbit
New Features
Bug Fixes