Add selectable output profiles#477
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Review limit reached
Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main.zig (1)
1268-1285: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate output-profile-selection logic vs.
Supervisor.applyUserOutputProfile.This block reimplements the same "look up
output_profile→ callselectOutputProfile→ log info/warn" sequence asSupervisor.applyUserOutputProfileinsrc/supervisor.zig(lines 2381-2389). Both were introduced in this PR. Consider extracting a single shared helper (e.g. inconfig/user_config.zigorconfig/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.zigandsupervisor.zigcallconfig.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
📒 Files selected for processing (16)
devices/flydigi/vader5.tomldocs/src/device-config.mddocs/src/devices/flydigi-flydigi-vader-5-pro.mddocs/src/diagnostic-logging.mddocs/src/getting-started.mddocs/src/immutable-install.mddocs/src/mapping-guide.mddocs/src/troubleshooting.mdsrc/cli/install/mappings.zigsrc/cli/install/tests.zigsrc/config/device.zigsrc/config/user_config.zigsrc/main.zigsrc/supervisor.zigsrc/test/validate_e2e_test.zigsrc/tools/docgen.zig
Summary
output_profileselectiondualsense-edgeprofile while keeping Xbox Elite 2 defaultoutput_profileacross config rewrites and document where users set itRefs #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.tomlmdbook build docsgit diff --checkNote: a full unfiltered
zig build test -Dtarget=x86_64-linux-muslrun 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
Bug Fixes