Skip to content

fix: controller navigation hardening (ported from PR #17) - #47

Merged
lippdev merged 1 commit into
mainfrom
fix/controller-nav-hardening
Sep 24, 2026
Merged

lippdev merged 1 commit into
mainfrom
fix/controller-nav-hardening

Conversation

@lippdev

@lippdev lippdev commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Ports the parts of @nextestudios' #17 that our rewrite lacked, on top of the current ControllerInput / GamepadNavigator:

  • Polling no longer dies. A pad disconnecting mid-read threw inside Poll, and we stopped the timer for good. That matches the "controller stops working" reports. Now the sample is skipped (logged once).
  • Foreground gating by HWND inside the poll loop (IsActive), instead of trusting WinUI Activated events. Console screen, session menu and the desktop window all pass their handle.
  • Navigation rules: first press only reveals the focus ring; tab-order fallback for Up/Down when the spatial search finds nothing (scrolled lists); D-pad diagonals count as vertical; A handles ComboBox → open, ComboBoxItem → pick, SelectorItem, ToggleSwitch, and falls back to Command for SettingsCard; B closes an open ComboBox.
  • Desktop interface navigable end to end from MainWindow: Start toggles Settings, B leaves Settings, Y jumps to the console interface, tour A next / B skip. The ad-hoc "A switches to console" listener in HomeView is gone; the chip now says "A navigates, Y opens console mode".

Test plan

  • dotnet test: 76 passed; build OK
  • Desktop interface launches cleanly, no controller errors in the log
  • With a controller: docs/TESTING.md → "Navegação por controle" (3 new items: desktop interface, disconnect/reconnect, first-press ring)

🤖 Generated with Claude Code

- ControllerInput no longer stops polling for good when a pad
  disconnects mid-read; it skips the sample. IsActive gates reads by
  window (GetForegroundWindow == hwnd) instead of WinUI activation
  events. D-pad diagonals count as vertical.
- GamepadNavigator: first press only reveals the focus ring; tab-order
  fallback when the XY search finds nothing in a scrolled list; A on
  ComboBox/ComboBoxItem/SelectorItem/ToggleSwitch and a Command
  fallback for SettingsCard; B closes an open ComboBox; Intercept hook.
- Desktop interface driven by the pad from MainWindow: Start toggles
  Settings, B leaves Settings, Y jumps to the console interface, tour
  A next / B skip. HomeView's ad-hoc listener is gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@lippdev
lippdev merged commit ef89e61 into main Sep 24, 2026
@lippdev
lippdev deleted the fix/controller-nav-hardening branch September 24, 2026 15:38
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.

1 participant