controller: implement default player color reset in PadResetLightBar #2060
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2060
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2060/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@luanantony on GitHub · 2026-11-01 23:18 UTC · original
luanantony:pr/pad-reset-lightbar→main· +134 −69 · 2 files · 1 commits · closed without mergingSummary
This PR implements proper player-slot default color restoration in \PadResetLightBar\ when custom light bar color is cleared.
Changes
Testing
@coderabbitai[bot] on GitHub · 2026-11-01 23:24 UTC · original
Findings
0d554c5f-83a1-4557-a09a-b802cd1a7b12Reviewing files that changed from the base of the PR and between
893b035526and93a6794ea4.src/libs/controller.cpptests/ControllerSettingsTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Walkthrough
PadResetLightBarnow locks the router, validates the handle, and applies a default light-bar color for players 1–4. It returnsPAD_ERROR_INVALID_HANDLEif player resolution fails. New tests check light-bar parameter and handle errors, custom colors, and the default color restored by reset. Other controller changes reformat declarations and expressions without changing their reported behavior.Suggested reviewers:
pipe530Change: Bug fix
Merge Risk:
Low · up to
93a67A reassigned controller can lose its reset light-bar color. This is a bounded visual issue to address or accept before merging.
Pre-merge checks:
4 ·
1
Full details: Title check
Explanation
The title names the main change: PadResetLightBar now restores a player-specific default light bar color. The raw summary confirms this change in src/libs/controller.cpp, where the reset sets blue, red, green, or pink for players 1-4. The title is specific and matches the changeset, so the check passes. Minor note: the description says the change is in src/libs/libPad.cpp and libPad.h, but the summary only lists controller.cpp, a file-path mismatch that does not affect the title assessment.
Full details: Description check
Explanation
The description states that PadResetLightBar now restores player-slot default RGB colors, which matches the changeset. It also describes the added unit tests in tests/ControllerSettingsTests.cpp, which appear in the summary. The description is related to the changeset, so the check passes. It does name src/libs/libPad.cpp and libPad.h, while the summary lists src/libs/controller.cpp, so the file references should be checked for accuracy. It also says Magenta for Player 4, while the summary says pink, a naming difference only.
Full details: Docstring Coverage
Explanation
Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 9 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
@coderabbitai[bot] on GitHub · 2026-11-01 23:24 UTC · original · reviewed
Actionable comments posted: 1
0d554c5f-83a1-4557-a09a-b802cd1a7b12Reviewing files that changed from the base of the PR and between
893b035526and93a6794ea4.src/libs/controller.cpptests/ControllerSettingsTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
@ -1444,0 +1462,4 @@if (player_idx >= 0 && player_idx < Config::MAX_PLAYERS) {player->SetLightBar(default_colors[player_idx][0], default_colors[player_idx][1],default_colors[player_idx][2]);@coderabbitai[bot] on GitHub · 2026-11-01 23:24 UTC · original
Retain the default color across device reassignment.
SetLightBaronly updates the current host pad. If the keyboard player changes twice after a reset,RefreshPlayersstops the pad andSetDevicesdoes not restore its default color. The light bar remains off until another reset. Retain the default state and apply it when a pad is assigned. (raw.githubusercontent.com)Pull request closed