Skip to content

feat: the controller test shows Guide, HID usages and every battery source - #227

Merged
lippdev merged 5 commits into
mainfrom
feat/controller-test-diagnostics
Nov 18, 2026
Merged

lippdev merged 5 commits into
mainfrom
feat/controller-test-diagnostics

Conversation

@lippdev

@lippdev lippdev commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Third of three PRs for generic controllers in 1.7.1-beta.4. Stacked on #226 (which is on #225): merge #225, then #226, then this, retargeting each to main in turn.

What

PLEXX-DE's controller diagnostics (#217) couldn't say whether the Luna's centre button reaches Windows at all: the test read XInput with XInputGetState, which never has Guide, and skipped the HID side of pads XInput covers. Now Test controller (and Copy diagnostics) shows, for anyone:

  • Guide on XInput: the XInput line reads XInputGetStateEx (new ControllerHoldWatcher.ReadButtonsWithGuide), as the shortcuts do, and marks (Guide).
  • HID usages, live: while the test is open, HidHomeButtonReader.AcquireDiagnostics also reads the collections of those pads that have no standard centre button (closed again when the test closes). Each collection gets a line: HID <vid:pid> <top-level usage>: botão central = … | sem botão central padrão; lido | não lido | o Windows não deixa ler · apertado: Button 13, Consumer 0x223 (AC Home). If the Luna's button uses a non-standard usage, it shows here.
  • Battery per source: the device list ends with Bateria <source>: <name> (<vid:pid>) <n>%, one line per source, ← mostrada on the one in the corner. The test refreshes the battery once when it opens.

Diagnostics text is internal and in Portuguese like the rest of the test, so no catalog changes. Changelogs (both) and docs/TESTING.md updated.

Testing

  • dotnet test: 715 passing. Debug build OK.
  • On the owner's PC: to check the (Guide) mark with an Xbox pad. The HID lines need a pad that isn't Xbox or PlayStation: PLEXX-DE on the beta.

🤖 Generated with Claude Code

lippdev and others added 2 commits November 18, 2026 14:02
…ource

- The XInput line reads XInputGetStateEx, like the shortcuts, so the
  Guide button shows when it arrives (XInputGetState never has it).
- While the test is open, every HID collection of the pads that aren't
  Xbox or PlayStation is read, and each one lists its centre-button
  usage and the usages pressed right now, by name.
- The device list ends with what each battery source said and which
  reading is shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ One lifecycle race can leave diagnostic-only HID reads running after the test closes.

Approach: sound — the existing shared HID reader is extended with opt-in diagnostics, and battery sources are surfaced from the same refresh used for the combined snapshot.

Reviewed changes I reviewed the controller diagnostics, their HID and battery reader lifecycles, and the associated documentation.

  • Guide diagnostics: XInput diagnostics use XInputGetStateEx so the Guide button is visible.
  • Live HID usages: the controller test reads supported controller collections and reports declared home usages and currently pressed usages.
  • Battery sources: diagnostics list readings from each provider and mark the reading included in the combined snapshot.
  • Manual testing and release notes: the Portuguese checklist and both changelogs describe the new diagnostics.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6-luna | 𝕏

…tics

# Conflicts:
#	CHANGELOG.en-US.md
#	CHANGELOG.md
@lippdev
lippdev changed the base branch from feat/hid-home-button to main November 18, 2026 17:09
A scan could read the diagnostics flag, the test close, and the scan
still open a collection without a centre button. Registering the reader
now rechecks the flag under the same lock ReleaseDiagnostics takes, and
each scan closes any test-only reader left once the test is closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes I reviewed the lifecycle fix and release-note updates added since the prior Pullfrog review.

  • HID diagnostics lifecycle: Rechecked diagnostic state under the shared lock before registering readers and cancelled leftover test-only readers in subsequent scans.
  • Release notes: Added the controller diagnostics entry to the English and Portuguese changelogs.

Pullfrog  | View workflow run | Using gpt-6-luna | 𝕏

ConsoleTourTests and LocalizationTests both change LocalizationService's
language; in parallel one could switch it in the middle of the other
(CI failed once with Portuguese where English was expected).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes I reviewed the test-serialization changes since the prior Pullfrog review.

  • Shared app-language test state: Added the same xUnit collection to both test classes that mutate the static app language, preventing those tests from running in parallel.

Pullfrog  | View workflow run | Using gpt-6-luna | 𝕏

@lippdev
lippdev merged commit f6bb5ab into main Nov 18, 2026
5 checks passed
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