Skip to content

fix(channels): sync Channel::mSettings from ChannelOptions (meta #2580 A3) - #2582

Merged
zackees merged 1 commit into
masterfrom
fix/2580-msettings-sync
May 30, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2580-msettings-sync

Conversation

@zackees

@zackees zackees commented May 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Channel::showPixels() builds ReorderingPixelIteratorAny from mSettings.rgbw()/rgbww(), but neither the constructor nor applyConfig() ever assigned mSettings from the incoming ChannelOptions. Any channel configured via ChannelOptions::mWhiteCfg therefore silently encoded as plain RGB.

This PR assigns mSettings = options; (and mSettings = config.options; in applyConfig) before the existing applyWhiteCfg(*this, ...) calls so the variant survives to showPixels().

Addresses meta-issue #2580 finding A3 (originally CodeRabbit on #2560 — #2560 (comment)).

Test plan

  • bash lint
  • CI green

Summary by CodeRabbit

  • Bug Fixes
    • Fixed white-channel color settings not persisting correctly during pixel display operations.

Review Change Stack

…plyConfig

Channel::showPixels() builds ReorderingPixelIteratorAny from
mSettings.rgbw()/rgbww(), but the constructor and applyConfig() never
assigned mSettings from the incoming ChannelOptions. As a result any
channel configured via ChannelOptions::mWhiteCfg silently encoded as
plain RGB. Assign mSettings = options/config.options before calling
applyWhiteCfg so the variant survives to showPixels().

Addresses CodeRabbit finding A3 from meta #2580 (originally from #2560).
@zackees
zackees merged commit 4a5df46 into master May 30, 2026
6 of 7 checks passed
@coderabbitai

coderabbitai Bot commented May 30, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d45f0aee-c03a-4a15-9161-f3a29256aeb6

📥 Commits

Reviewing files that changed from the base of the PR and between 7df5ac9 and e3108b4.

📒 Files selected for processing (1)
  • src/fl/channels/channel.cpp.hpp

📝 Walkthrough

Walkthrough

The PR adds explicit synchronization of the mSettings member variable in Channel constructors and the applyConfig() method. This ensures that the white-channel configuration variant (RGB-only, RGBW, or RGBWW) persists from initialization through to pixel rendering in showPixels().

Changes

Settings Synchronization in Channel

Layer / File(s) Summary
Settings synchronization in Channel initialization and configuration
src/fl/channels/channel.cpp.hpp
Both Channel constructors and applyConfig() now assign mSettings from ChannelOptions or config.options at initialization or reconfiguration time. This idempotent assignment preserves the mWhiteCfg variant (and future configuration fields) so the white-channel configuration survives into showPixels().

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A channel's white config must flow,
Through init and setup's grand show,
With mSettings assigned with care,
The variant persists with flair,
So pixels light up—on we go! 🐰✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2580-msettings-sync

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.

@zackees
zackees deleted the fix/2580-msettings-sync branch May 30, 2026 15:25
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