Keyboard Arrow Navigation - #180
Conversation
Summary — Keyboard Arrow NavigationProblem
SolutionUse AWT New Files (5)
Modified Files (5)
Focusable ElementsBottom nav bar, desktop sidebar, tablet top pills, poster cards, profile avatar cards, add profile button, and settings items. |
| Column( | ||
| modifier = Modifier | ||
| .posterCardClickable(onClick = onClick, onLongClick = onLongClick) | ||
| .nuvioFocusBorder(cardShape) |
There was a problem hiding this comment.
This part isn't working for the poster cards for me because .posterCardClickable is swallowing the events it needs. If you put .nuvioFocusBorder first ahead of .posterCardClickable you get the desired functionality.
There was a problem hiding this comment.
Thanks for catching that! Fixed in the latest push.
What changed:
- Moved .nuvioFocusBorder() from the inner Box to the Column modifier on SeasonPosterButton, placed before .posterCardClickable so the focus ring receives keyboard events before the click handler swallows them.
- The episode card already had the correct order (.nuvioFocusBorder before .posterCardClickable), so no change needed there.
All other components (StreamCard, StreamsScreen filter chips, DetailActionButtons, DetailCastSection avatars) were already correct.
|
@DustinBryant Good catch! I've pushed a fix — moved .nuvioFocusBorder(cardShape) before .posterCardClickable(...) so the focus ring can receive keyboard events before the clickable modifier intercepts them. The change is on the keyboard-nav branch now. |
- Merged upstream NuvioMedia/NuvioDesktop Dev (58+ commits) - Reverted custom player modifications, adopted upstream Linux player - Deleted obsolete files (LinuxDesktopIntegration, old player hosts, etc.) - Rewrote PR NuvioMedia#180 keyboard navigation for current codebase: - PlatformKeyboardNavigation: AWT KeyEventDispatcher for arrow keys - NuvioFocusable: Modifier.nuvioFocusBorder() for visual focus rings - Applied focus borders to NavigationBar, ShelfComponents, ProfileSelection, Settings - No-op implementations for Android/iOS
|
Good direction, but the global KeyEventDispatcher currently consumes every arrow key press across the app, even when focus movement isn't handled. This can interfere with text fields, sliders, scrolling and other components that need their own arrow-key behavior. Please only consume the event when appropriate, and make the focus/navigation behavior desktop-only rather than changing shared mobile focus behavior. Also please rebase onto current Dev and update the PR description/testing, since this is a behavior/UI feature rather than maintenance. |
Add keyboard arrow navigation support for desktop using AWT KeyEventDispatcher, with visual focus rings (border) on all focusable UI elements. New files: - PlatformKeyboardNavigation.kt (expect/actual) - PlatformKeyboardNavigation.desktop.kt (AWT KeyEventDispatcher) - PlatformKeyboardNavigation.android.kt / .ios.kt (no-op) - NuvioFocusable.kt (Modifier.nuvioFocusBorder) Modified files: - App.kt: Register PlatformKeyboardNavigation in AppEnvironment - NavigationBar.kt: Focus border on all NavItem variants - ShelfComponents.kt: Focus border on NuvioPosterCard - ProfileSelectionScreen.kt: Focus border on ProfileAvatarCard and AddProfileCard - SettingsComponents.kt: Focus border on SettingsSidebarItem, SettingsNavigationRow, SettingsSwitchRow
c4c49ed to
d71703c
Compare
|
Thanks for the review feedback - all three points have been addressed in the latest push:
Other changes in this push:
Build verified successfully. Ready for another review. |
…nents - PlatformKeyboardNavigation: skip consuming arrows when focused on JTextField, JTextArea, JSpinner, JSlider, JScrollPane, Scrollable - NuvioFocusable: guard .focusable() with isDesktop (desktop-only) - DetailActionButtons: nuvioFocusBorder on Play and More buttons - DetailSeriesContent: nuvioFocusBorder on season chips, season posters, episode horizontal cards, episode list cards - DetailCastSection: nuvioFocusBorder on cast avatar circles - StreamCard: nuvioFocusBorder on stream link cards - StreamsScreen: nuvioFocusBorder on provider filter chips
…Button The focus ring was on the inner Box but posterCardClickable on the Column was swallowing keyboard events. Move nuvioFocusBorder to the Column modifier chain ahead of posterCardClickable so focus works correctly.
Summary
PR type
Why
Desktop scope
Issue or approval
UI / behavior impact
Policy check
CONTRIBUTING.md.Scope boundaries
Testing
Screenshots / Video
Breaking changes
Linked issues