Skip to content

feat: v1.0 — Config UI app, live tuning, throttle/brake curves, haptics, CI#1

Merged
rolling-codes merged 6 commits into
masterfrom
feat/v1.0
Jun 21, 2026
Merged

feat: v1.0 — Config UI app, live tuning, throttle/brake curves, haptics, CI#1
rolling-codes merged 6 commits into
masterfrom
feat/v1.0

Conversation

@rolling-codes

Copy link
Copy Markdown
Owner

Summary

  • MyGamepadFX Config app (MyGamepadFX_Config/) — new CSP Lua in-game overlay with 20 live parameter sliders (steering, speed scaling, self-steer, slip limit, throttle/brake curves, haptics, debug mode). Writes live_cfg.ini into the script folder; assist.lua polls and applies it within 0.5 seconds while driving, no restart required.
  • Throttle & brake curves — trigger inputs now run through configurable deadzone + gamma, matching the steering pipeline. Four new config.lua keys: GAS_DEADZONE, GAS_GAMMA, BRAKE_DEADZONE, BRAKE_GAMMA.
  • Haptic feedback — optional trigger rumble on front wheel slip via ac.setTriggerRumble. Disabled by default (HAPTICS_ENABLED = false); requires CSP v0.2.0+ and a controller with trigger motors.
  • Startup diagnostics — one-time axis log on game start, frame-drop warning, nil-car/nil-gamepad guards with logOnce (no per-frame log spam).
  • CIquality.yml workflow: Lua syntax check (luac5.2 -p), luacheck lint, structure/manifest/config-key validation, automatic PR comment with per-check results table.

Breaking changes

config.lua has 9 new required keys (GAS_*, BRAKE_*, HAPTICS_*, DEBUG_MODE). Users with customized configs must copy their values into the new template — the old file will cause a Lua error on load.

Test plan

  • CI passes: Lua Syntax ✅, Luacheck ✅, Structure ✅
  • PR comment appears with quality check table after workflow run
  • Deploy MyGamepadFX/ to AC; verify startup diagnostic fires ([MyGamepadFX] === Startup Diagnostic ===) in CM log
  • Open MyGamepadFX Config app in-game; move a slider; confirm change applies within ~0.5s while driving
  • Run TESTING.md Sections 2–4 (core pipeline, diagnostics, error conditions) before merge
  • Confirm old config.lua upgrade path: missing keys produce a clear Lua error, not silent wrong behavior

…ng, diagnostics

- MyGamepadFX/config.lua: 9 new parameters (GAS_*, BRAKE_*, HAPTICS_*, DEBUG_MODE)
- MyGamepadFX/lib.lua: add logOnce helper
- MyGamepadFX/debug.lua: add carSteer and dt_ms overlay fields
- MyGamepadFX/assist.lua: full pipeline rewrite — diagnostics, error guards,
  throttle/brake curves, haptic trigger rumble, frame-drop warning,
  live_cfg.ini polling (0.5s) for Config UI app
- MyGamepadFX_Config/: new CSP Lua app — 20-parameter slider UI,
  writes live_cfg.ini to script folder, changes apply within 0.5s
- .luacheckrc: luacheck config for CSP LuaJIT environment
@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 →

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rolling-codes, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 1 second. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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 credits.

🚦 How do rate limits work?

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

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a1984dd4-821e-4faf-a423-f5509b0a80f4

📥 Commits

Reviewing files that changed from the base of the PR and between 175709b and 40d109b.

📒 Files selected for processing (10)
  • .github/workflows/quality.yml
  • .luacheckrc
  • CLAUDE.md
  • INSTALLATION.md
  • INTEGRATION.md
  • README.md
  • RESEARCH_FINDINGS.md
  • TESTING.md
  • Troubleshooting.md
  • VALIDATION.md
📝 Walkthrough

Walkthrough

Adds a live config tuning system: a new MyGamepadFX_Config app UI writes parameters to live_cfg.ini, which assist.lua polls every 0.5 s via applyLiveCfg(). New CFG constants cover gas/brake deadzone+gamma curves and haptic feedback. The assist update loop gains dt validation, one-time logging, startup axis diagnostics, haptic rumble from front-slip, and gas/brake processing. A .luacheckrc for LuaJIT 5.2 and debug overlay formatting improvements are also included.

Changes

Live Config Tuning & Config UI

Layer / File(s) Summary
New CFG constants and logOnce utility
MyGamepadFX/config.lua, MyGamepadFX/lib.lua
Adds GAS_*, BRAKE_*, HAPTICS_*, and DEBUG_MODE constants to CFG, and a M.logOnce(key, message) helper that deduplicates log calls using a local _logged table.
assist.lua live-config state and applyLiveCfg
MyGamepadFX/assist.lua
Adds module-level state (steerOut, frameCount, firstFrameDiagnostics), defines LIVE_CFG_PATH and a polling timer, and implements applyLiveCfg() which loads live_cfg.ini and overwrites CFG fields at runtime.
assist.lua update/reset refactor with haptics and gas/brake
MyGamepadFX/assist.lua
Refactors script.update(dt) with dt validation, logOnce-guarded missing car/gamepad handling, one-time startup axis diagnostics, haptic rumble scaled from avgFrontSlip, deadzone+gamma processing for gas and brake outputs, and extends script.reset() to clear live-tuning state.
Config UI app: persistence, sliders, and manifest
MyGamepadFX_Config/app.lua, MyGamepadFX_Config/manifest.ini
Adds the full MyGamepadFX_Config app: default cfg table, saveLiveCfg() writing all fields under [PARAMS] via pcall, loadSaved() restoring them on startup, sliderRow() binding sliders to cfg keys, and windowMain(dt) rendering all parameter controls with throttled (~10 Hz) saves. The manifest defines the app entry point and window size.
Debug overlay formatting and Luacheck config
MyGamepadFX/debug.lua, .luacheckrc
Reformats D.draw(values) telemetry lines with string.format precision and adds carSteer/dt(ms) outputs. Adds .luacheckrc for LuaJIT 5.2 with CSP globals and suppressed warning codes 212 and 143.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant windowMain
  participant saveLiveCfg
  participant live_cfg.ini
  participant applyLiveCfg
  participant CFG

  User->>windowMain: adjusts slider/checkbox
  windowMain->>windowMain: sets dirty=true, updates cfg[key]
  Note over windowMain: throttled: saveTimer <= 0
  windowMain->>saveLiveCfg: write on timer
  saveLiveCfg->>live_cfg.ini: INIConfig.set(PARAMS, ...).save()

  Note over applyLiveCfg: assist.lua polls every 0.5s
  applyLiveCfg->>live_cfg.ini: INIConfig.load(LIVE_CFG_PATH)
  live_cfg.ini-->>applyLiveCfg: all PARAMS values
  applyLiveCfg->>CFG: overwrites GAS_*, BRAKE_*, HAPTICS_*, STEER_* etc.
  CFG-->>applyLiveCfg: updated live in-session
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 A slider moves, the INI bends,
The car feels rumble, the config blends.
Every half-second the values flow,
From UI knobs to physics below.
One logOnce whispers, never twice —
The rabbit tunes his gamepad nice! 🎮

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main v1.0 feature additions: Config UI app, live tuning, throttle/brake curves, haptics, and CI integration.
Description check ✅ Passed The description is directly related to the changeset, providing detailed context about the Config app, throttle/brake curves, haptic feedback, startup diagnostics, and CI workflow.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/v1.0

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 and usage tips.

@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.

Actionable comments posted: 2

🤖 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.

Inline comments:
In @.luacheckrc:
- Around line 11-14: The global ignore configuration for warning code 143
(undefined-field) is too broad and will allow typos on CSP globals to slip past
CI. Instead of ignoring this warning project-wide, remove "143" from the ignore
table and use a narrower scoping mechanism such as an inline comment or per-file
configuration to suppress the warning only where math.clamp is accessed,
ensuring that undefined-field checks remain active elsewhere in the codebase.

In `@MyGamepadFX_Config/app.lua`:
- Around line 157-159: Add validation logic in the configuration save/apply
handler to enforce that HAPTICS_SLIP_MAX must be greater than
HAPTICS_SLIP_START. When the user attempts to save the configuration with these
sliders (the 'Slip start' and 'Slip max' sliderRow elements bound to
HAPTICS_SLIP_START and HAPTICS_SLIP_MAX), check that HAPTICS_SLIP_MAX is
strictly greater than HAPTICS_SLIP_START. If the condition is violated, either
prevent the save operation, show an error message to the user, or automatically
correct the invalid value to maintain a valid range for the haptics intensity
calculations downstream in assist.lua.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c5d31726-af93-48f7-9924-7ec4cd4172c2

📥 Commits

Reviewing files that changed from the base of the PR and between 1ccddbc and 175709b.

📒 Files selected for processing (7)
  • .luacheckrc
  • MyGamepadFX/assist.lua
  • MyGamepadFX/config.lua
  • MyGamepadFX/debug.lua
  • MyGamepadFX/lib.lua
  • MyGamepadFX_Config/app.lua
  • MyGamepadFX_Config/manifest.ini
📜 Review details
🧰 Additional context used
🪛 Luacheck (1.2.0)
MyGamepadFX_Config/app.lua

[warning] 106-106: setting non-standard global variable 'windowMain'

(W111)

🔇 Additional comments (5)
MyGamepadFX/debug.lua (1)

8-23: LGTM!

MyGamepadFX/config.lua (1)

24-37: LGTM!

MyGamepadFX/lib.lua (1)

5-13: LGTM!

MyGamepadFX/assist.lua (1)

9-141: LGTM!

MyGamepadFX_Config/manifest.ini (1)

1-12: LGTM!

Comment thread .luacheckrc
Comment on lines +11 to +14
ignore = {
"212", -- unused argument: dt is required by CSP entry point signatures
"143", -- accessing undefined field: math.clamp is a CSP extension to math
}

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 | 🔵 Trivial | ⚡ Quick win

Narrow the undefined-field suppression.

Ignoring luacheck warning 143 project-wide disables undefined-field checks everywhere, so typos on CSP globals will now slip past CI. If only math.clamp needs an exception, scope it more narrowly instead of silencing the warning globally.

🤖 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 @.luacheckrc around lines 11 - 14, The global ignore configuration for
warning code 143 (undefined-field) is too broad and will allow typos on CSP
globals to slip past CI. Instead of ignoring this warning project-wide, remove
"143" from the ignore table and use a narrower scoping mechanism such as an
inline comment or per-file configuration to suppress the warning only where
math.clamp is accessed, ensuring that undefined-field checks remain active
elsewhere in the codebase.

Comment on lines +157 to +159
sliderRow('Slip start', 'HAPTICS_SLIP_START', 0.0, 1.0, '%.2f')
sliderRow('Slip max', 'HAPTICS_SLIP_MAX', 0.0, 2.0, '%.2f')
sliderRow('Strength', 'HAPTICS_STRENGTH', 0.0, 1.0, '%.2f')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Enforce HAPTICS_SLIP_MAX > HAPTICS_SLIP_START before saving.

These sliders currently allow invalid ordering, which can propagate to assist.lua and break haptics intensity math (zero/negative range divisor).

Suggested fix
     if cfg.HAPTICS_ENABLED then
         sliderRow('Slip start',  'HAPTICS_SLIP_START', 0.0, 1.0, '%.2f')
         sliderRow('Slip max',    'HAPTICS_SLIP_MAX',   0.0, 2.0, '%.2f')
+        if cfg.HAPTICS_SLIP_MAX <= cfg.HAPTICS_SLIP_START then
+            cfg.HAPTICS_SLIP_MAX = cfg.HAPTICS_SLIP_START + 0.01
+            dirty = true
+        end
         sliderRow('Strength',    'HAPTICS_STRENGTH',   0.0, 1.0, '%.2f')
     end
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
sliderRow('Slip start', 'HAPTICS_SLIP_START', 0.0, 1.0, '%.2f')
sliderRow('Slip max', 'HAPTICS_SLIP_MAX', 0.0, 2.0, '%.2f')
sliderRow('Strength', 'HAPTICS_STRENGTH', 0.0, 1.0, '%.2f')
sliderRow('Slip start', 'HAPTICS_SLIP_START', 0.0, 1.0, '%.2f')
sliderRow('Slip max', 'HAPTICS_SLIP_MAX', 0.0, 2.0, '%.2f')
if cfg.HAPTICS_SLIP_MAX <= cfg.HAPTICS_SLIP_START then
cfg.HAPTICS_SLIP_MAX = cfg.HAPTICS_SLIP_START + 0.01
dirty = true
end
sliderRow('Strength', 'HAPTICS_STRENGTH', 0.0, 1.0, '%.2f')
🤖 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 `@MyGamepadFX_Config/app.lua` around lines 157 - 159, Add validation logic in
the configuration save/apply handler to enforce that HAPTICS_SLIP_MAX must be
greater than HAPTICS_SLIP_START. When the user attempts to save the
configuration with these sliders (the 'Slip start' and 'Slip max' sliderRow
elements bound to HAPTICS_SLIP_START and HAPTICS_SLIP_MAX), check that
HAPTICS_SLIP_MAX is strictly greater than HAPTICS_SLIP_START. If the condition
is violated, either prevent the save operation, show an error message to the
user, or automatically correct the invalid value to maintain a valid range for
the haptics intensity calculations downstream in assist.lua.

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

Quality Check ✅ Passed

Check Result
Lua Syntax ✅ success
Luacheck ✅ success
Structure ✅ success

@rolling-codes
rolling-codes merged commit 2dc35f7 into master Jun 21, 2026
4 of 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