Skip to content

Fix blending style options list filter for iOS#5513

Open
DedeHai wants to merge 2 commits intowled:mainfrom
DedeHai:fix_blendOptions_iOS
Open

Fix blending style options list filter for iOS#5513
DedeHai wants to merge 2 commits intowled:mainfrom
DedeHai:fix_blendOptions_iOS

Conversation

@DedeHai
Copy link
Copy Markdown
Collaborator

@DedeHai DedeHai commented Apr 18, 2026

fixes #5498

tested and it fixes the issue on safari.

Summary by CodeRabbit

  • Bug Fixes

    • Improved blending style handling between matrix and non-matrix modes so invalid or missing selections are reliably reset to a valid default.
  • Refactor

    • Reworked option update logic to rebuild and filter blending choices more cleanly, improving reliability and maintainability.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 54337f21-a91e-45fd-88e5-ea0500672a79

📥 Commits

Reviewing files that changed from the base of the PR and between e641fcf and 9d4b3e2.

📒 Files selected for processing (1)
  • wled00/data/index.js

Walkthrough

Refactors blending-option handling in wled00/data/index.js: introduces a module-level cache for blend options, rebuilds the #bs options list with replaceChildren() based on matrix mode (keeps or filters 2D options), and adds defensive fallback when a previously selected blend is missing.

Changes

Cohort / File(s) Summary
Blending-style option handling
wled00/data/index.js
Added bsOpts module-level cache; parseInfo() now recreates the #bs option list via replaceChildren() and filters out option[data-type="2D"] when not in matrix mode (isM false); removed per-option style.display toggling. readState() now uses a safer `bsSel = s.bs

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—fixing the blending style options list filter specifically for iOS.
Linked Issues check ✅ Passed The code changes properly address issue #5498 by filtering 2D-only transition options when not in matrix mode, fixing the iOS/Safari visibility issue.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the blending options filter for iOS; no unrelated modifications detected.

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


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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@wled00/data/index.js`:
- Around line 665-668: The fallback that sets bsSel.value = 0 should be applied
after state values are restored, because parseInfo() rebuilds options before
readState() assigns s.bs and a restored s.bs might be filtered-out causing an
empty value; locate the code manipulating the bs select (gId('bs') / bsSel,
bsOpts, and the parseInfo()/readState() sequence) and move the fallback logic
(the "if (!bsSel.value) bsSel.value = 0" line) to run after readState() (or
directly after the code that applies s.bs), and remove the unused bsCur variable
or use it appropriately so no unused locals remain.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 743d7a75-9946-455f-8045-27d6ad4e70a3

📥 Commits

Reviewing files that changed from the base of the PR and between 910caae and e641fcf.

📒 Files selected for processing (1)
  • wled00/data/index.js

Comment thread wled00/data/index.js Outdated
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.

Safari/webkit browsers show 2D transitions for 1D segments ( correctly hidden on PC)

1 participant