Skip to content

Add selectable output profiles#477

Merged
BANANASJIM merged 2 commits into
mainfrom
feat/output-profile-selection
Jul 9, 2026
Merged

Add selectable output profiles#477
BANANASJIM merged 2 commits into
mainfrom
feat/output-profile-selection

Conversation

@BANANASJIM

@BANANASJIM BANANASJIM commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • add device output profiles and user config output_profile selection
  • add an opt-in Vader 5 dualsense-edge profile while keeping Xbox Elite 2 default
  • preserve output_profile across config rewrites and document where users set it

Refs #471

Tests

  • /home/jim_z/.local/bin/zig build test -Dtarget=x86_64-linux-musl -Dtest-filter=\"output profile\" --summary all
  • /home/jim_z/.local/bin/zig build test -Dtarget=x86_64-linux-musl -Dtest-filter=\"output_profile\" --summary all
  • /home/jim_z/.local/bin/zig build test -Dtarget=x86_64-linux-musl -Dtest-filter=\"vader5\" --summary all
  • /home/jim_z/.local/bin/zig build test -Dtarget=x86_64-linux-musl -Dtest-filter=\"writeBinding\" --summary all
  • /home/jim_z/.local/bin/zig build test -Dtarget=x86_64-linux-musl -Dtest-filter=\"docgen\" --summary all
  • /home/jim_z/.local/bin/zig build test -Dtarget=x86_64-linux-musl -Dtest-filter=\"E2E validate\" --summary all
  • ./zig-out/bin/padctl --validate devices/flydigi/vader5.toml
  • mdbook build docs
  • git diff --check

Note: a full unfiltered zig build test -Dtarget=x86_64-linux-musl run produced no new output for several minutes after the bazzite fixture logs, so I interrupted it and used the focused coverage above.

Summary by CodeRabbit

  • New Features

    • Added support for selecting per-device output profiles, letting users switch a device’s virtual identity/layout without changing the mapping itself.
    • Device documentation now includes an “Output Profiles” section where available profiles and their details are listed.
  • Bug Fixes

    • Preserved configured output profiles when updating or rewriting device settings.
    • Improved profile application so the selected output profile is applied before cached device configs are used.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@BANANASJIM, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c3f6d3a-0f22-470a-a010-2aba5cfa6d83

📥 Commits

Reviewing files that changed from the base of the PR and between ebdf7b6 and 624a2ea.

📒 Files selected for processing (2)
  • src/main.zig
  • src/tools/docgen.zig
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/output-profile-selection

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

Comment @coderabbitai help to get the list of available commands.

@BANANASJIM BANANASJIM merged commit 7876b0b into main Jul 9, 2026
37 of 38 checks passed
@BANANASJIM BANANASJIM deleted the feat/output-profile-selection branch July 9, 2026 05:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/main.zig (1)

1268-1285: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate output-profile-selection logic vs. Supervisor.applyUserOutputProfile.

This block reimplements the same "look up output_profile → call selectOutputProfile → log info/warn" sequence as Supervisor.applyUserOutputProfile in src/supervisor.zig (lines 2381-2389). Both were introduced in this PR. Consider extracting a single shared helper (e.g. in config/user_config.zig or config/device.zig) that both the daemon-startup path here and the supervisor cold-scan path call, so the two copies can't drift.

♻️ Suggested shared helper
// e.g. in config/device.zig, alongside selectOutputProfile
pub fn applyUserOutputProfile(
    cfg: *DeviceConfig,
    user_cfg: *const user_config.ParseResult,
) void {
    const profile_name = user_config.findOutputProfile(user_cfg, cfg.device.name) orelse return;
    if (selectOutputProfile(cfg, profile_name)) {
        std.log.info("output profile: device \"{s}\" profile \"{s}\"", .{ cfg.device.name, profile_name });
    } else {
        std.log.warn("output profile \"{s}\" for device \"{s}\" not found; using default output", .{ profile_name, cfg.device.name });
    }
}

Then both main.zig and supervisor.zig call config.device.applyUserOutputProfile(&device_cfg.value, ucpr).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main.zig` around lines 1268 - 1285, The output-profile selection logic is
duplicated in main startup and Supervisor.applyUserOutputProfile, so extract it
into one shared helper and call that from both places. Move the
“findOutputProfile → selectOutputProfile → info/warn logging” sequence into a
reusable function in a common config module such as config/device.zig or
config/user_config.zig, and have both the code in main.zig and the method in
supervisor.zig use that helper to keep behavior consistent and prevent drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/main.zig`:
- Around line 1268-1285: The output-profile selection logic is duplicated in
main startup and Supervisor.applyUserOutputProfile, so extract it into one
shared helper and call that from both places. Move the “findOutputProfile →
selectOutputProfile → info/warn logging” sequence into a reusable function in a
common config module such as config/device.zig or config/user_config.zig, and
have both the code in main.zig and the method in supervisor.zig use that helper
to keep behavior consistent and prevent drift.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: baa1babc-85b0-4c73-bb93-de54c2d643bf

📥 Commits

Reviewing files that changed from the base of the PR and between 7822bb1 and ebdf7b6.

📒 Files selected for processing (16)
  • devices/flydigi/vader5.toml
  • docs/src/device-config.md
  • docs/src/devices/flydigi-flydigi-vader-5-pro.md
  • docs/src/diagnostic-logging.md
  • docs/src/getting-started.md
  • docs/src/immutable-install.md
  • docs/src/mapping-guide.md
  • docs/src/troubleshooting.md
  • src/cli/install/mappings.zig
  • src/cli/install/tests.zig
  • src/config/device.zig
  • src/config/user_config.zig
  • src/main.zig
  • src/supervisor.zig
  • src/test/validate_e2e_test.zig
  • src/tools/docgen.zig

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