Skip to content

Allow display mode "None" on basic 7-segment wheels - #97

Merged
kelchm merged 6 commits into
mainfrom
feat/display-mode-none-basic-wheels
Aug 8, 2026
Merged

kelchm merged 6 commits into
mainfrom
feat/display-mode-none-basic-wheels

Conversation

@kelchm

@kelchm kelchm commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

A user asked whether FanaBridge can leave the wheel display alone so another application (e.g. the vendor software) can drive it, while FanaBridge keeps the LEDs. On ITM wheels that already works (Legacy Display Mode "None" + the ITM checkbox), but basic 7-segment wheels had no off switch: the "None" option was hidden in the UI and the drive path had no gate, so FanaBridge rewrote the display on every gear/speed change.

This offers "None" on basic wheels and makes it mean what it should everywhere: with mode "None", FanaBridge never writes a display report — except a single blank when switching into "None", retried until the wheel accepts it.

Changes

  • UI: the "None" option in the display-mode dropdown is now offered on basic 7-segment wheels too (previously ITM-only).
  • Drive path: the ITM legacy page's "None" gate (blank-once latch + retry) is factored into a shared UpdateSegmentDisplay used by both the ITM and basic branches.
  • Cleanup paths stay silent in "None": the disconnect teardown (StopDrivingHardware), device End(), and the driver itself (belt-and-braces guard so "None" can never fall through to the unknown-mode → Gear default) all skip their exit blank when the display isn't ours.
  • Shutdown ownership: DisplayEncoder tracks whether FanaBridge owns the current display content (HasWritten, released by the accepted handoff blank). Plugin finalize only blanks the display when the content is actually ours — previously it blanked unconditionally at exit, which would stomp another application's content even in "None".

Testing

  • New device-instance tests on CSLSWGT3 (basic display, no LEDs): silence while a game runs in "None", the one-shot transition blank and its retry-until-accepted, End() staying silent in "None" (and still blanking in active modes), and ownership release after the handoff blank.
  • Driver/encoder tests for the "None" guard and the HasWritten latch/release.
  • Full suite: 691 passed.

An independent model review flagged the shutdown-blank ownership gap (fixed here); it also noted the reconnect re-blank one-shot, which is kept deliberately — the ITM legacy page relies on it after reconnects, and on basic wheels a rim swap power-cycles the display anyway.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 21 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d0d40f25-b5eb-4767-bb0b-35a9350861d5

📥 Commits

Reviewing files that changed from the base of the PR and between 4080fc5 and 47aaeeb.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs
  • tests/FanaBridge.Tests/FanatecWheelDeviceInstanceTests.cs
📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added a visible “None” display mode for disabling drive display output.
    • Display output now safely tracks ownership and releases it when disabled or cleared.
  • Bug Fixes
    • Prevented display writes when output is disabled.
    • Improved blanking and cleanup behavior during mode changes, shutdown, and disconnects.
    • Avoided clearing displays that were not written by the application.
  • Documentation
    • Clarified display mode behavior and supported display types.
  • Tests
    • Added coverage for disabled output, retries, ownership release, cleanup, and active display modes.

Walkthrough

Display output now tracks successful ownership. ModeNone suppresses updates, blanks the display once with retry support, and releases ownership after success. Device and plugin cleanup avoid writes when FanaBridge does not own the display. Tests cover active, disabled, rejected-write, handoff, and teardown paths.

Changes

Display ownership and disabled-mode handling

Layer / File(s) Summary
Encoder ownership contract
src/FanaBridge.Core/Protocol/DisplayEncoder.cs, src/FanaBridge/Adapters/DisplaySettings.cs, src/FanaBridge/Adapters/FanatecDisplayDriver.cs
DisplayEncoder tracks successful writes and supports synchronized release. ModeNone disables display updates and blanking.
Device display lifecycle
src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs, src/FanaBridge/FanatecPlugin.cs, src/FanaBridge/UI/ScreenSettingsPanel.xaml
Display updates use a shared helper. Disabled-mode blanking retries rejected writes and releases ownership after success. Cleanup clears only displays owned by FanaBridge. The UI keeps None visible.
Display behavior validation
tests/FanaBridge.Tests/FanatecDisplayDriverTests.cs, tests/FanaBridge.Tests/FanatecWheelDeviceInstanceTests.cs
Tests cover ownership latching, disabled-mode suppression, blanking retries, active modes, handoff, and teardown behavior.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant FanatecWheelDeviceInstance
  participant DisplayEncoder
  participant WheelbaseTransport
  FanatecWheelDeviceInstance->>DisplayEncoder: SetDisplay for active mode
  DisplayEncoder->>WheelbaseTransport: SendCol01(frame)
  WheelbaseTransport-->>DisplayEncoder: accepted or rejected
  FanatecWheelDeviceInstance->>DisplayEncoder: SetDisplay(blank frame) for ModeNone
  DisplayEncoder->>WheelbaseTransport: Retry blank frame until accepted
  FanatecWheelDeviceInstance->>DisplayEncoder: Release after successful handoff
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.39% 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
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.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling display mode "None" on basic 7-segment wheels.
Description check ✅ Passed The description directly explains the new display mode, ownership handling, cleanup behavior, and tests.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

Base automatically changed from refactor/device-settings-lifecycle to main August 8, 2026 15:02
"None" previously existed only for the legacy page on ITM wheels. Offering
it on basic 7-segment wheels lets another application own the wheel display
while FanaBridge keeps driving the LEDs.

With mode "None" FanaBridge never writes a display report, except a single
blank when switching into "None" (retried until the wheel accepts it). The
blank also releases display ownership, so the disconnect, End, and plugin
shutdown cleanups no longer blank content that is no longer ours.
@kelchm
kelchm force-pushed the feat/display-mode-none-basic-wheels branch from ad405bd to 4080fc5 Compare August 8, 2026 15:12
@kelchm
kelchm marked this pull request as ready for review August 8, 2026 15:13
Copilot AI balanced review requested due to automatic review settings August 8, 2026 15:13

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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: 1

🤖 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 `@src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs`:
- Around line 495-501: Update the display-test cleanup flow around
_displayManager.Clear() to store its result in _legacyBlanked, and call
plugin.Display?.Release() only when the clear is accepted; preserve ownership
when clearing fails so UpdateSegmentDisplay() can retry the blank. Add a
regression test covering switching DisplayMode to None during an active display
test.
🪄 Autofix

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: CHILL

Plan: Pro Plus

Run ID: a6d7dc73-1569-48dd-bcdc-39deecc96762

📥 Commits

Reviewing files that changed from the base of the PR and between 6cb4810 and 4080fc5.

📒 Files selected for processing (9)
  • src/FanaBridge.Core/Protocol/DisplayEncoder.cs
  • src/FanaBridge/Adapters/DisplaySettings.cs
  • src/FanaBridge/Adapters/FanatecDisplayDriver.cs
  • src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs
  • src/FanaBridge/FanatecPlugin.cs
  • src/FanaBridge/UI/ScreenSettingsPanel.xaml
  • src/FanaBridge/UI/ScreenSettingsPanel.xaml.cs
  • tests/FanaBridge.Tests/FanatecDisplayDriverTests.cs
  • tests/FanaBridge.Tests/FanatecWheelDeviceInstanceTests.cs
💤 Files with no reviewable changes (1)
  • src/FanaBridge/UI/ScreenSettingsPanel.xaml.cs

Comment thread src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs
The display-test handback and the blank-once path both ran in the frame the
test was released, so mode "None" sent two blanks instead of one. The handback
also released display ownership before its clear was accepted, dropping it
while our own test residue was still on screen.

The handback now leaves mode "None" alone: the blank-once path already clears
the residue, latches only on an accepted write, and releases ownership there.
Copilot AI review requested due to automatic review settings August 8, 2026 15:32

This comment was marked as off-topic.

Copilot AI review requested due to automatic review settings August 8, 2026 15:43

This comment was marked as off-topic.

Copilot AI review requested due to automatic review settings August 8, 2026 15:44

This comment was marked as off-topic.

Copilot AI review requested due to automatic review settings August 8, 2026 15:45

This comment was marked as off-topic.

Copilot AI review requested due to automatic review settings August 8, 2026 15:51

This comment was marked as off-topic.

@kelchm
kelchm merged commit 1b6fbae into main Aug 8, 2026
2 checks passed
@kelchm
kelchm deleted the feat/display-mode-none-basic-wheels branch August 8, 2026 15:54
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.

2 participants